Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Coloring for symmetric banded matrices

未关闭
#302 0 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

@amontoison 已经在做这个了。

开始于 2026年1月30日。

评估

这个 Issue 还没有评估数据。

描述

feature

The code is quite short but it took me a long a time to understand how we can do the decompression directly from the peridic coloring.
We only need to solve bidiagonal systems for the decompression of each 2-colored tree.
It also allows to not require a buffer like in the acyclic coloring.

using BandedMatrices

T = Float64
n = 10
kd = 3
k = 2 * kd + 1

A = brand(T,n,n,kd,kd)
A = A + A'

color = Int[mod(j,kd+1)+1 for j=1:n]

B = zeros(T, n, kd+1)
for j = 1:n
    cj = color[j]
    B[:,cj] .+= A[:,j]
end

C = copy(A)
fill!(C, 0)

for i = 1:n
    ci = color[i]
    C[i,i] = B[i, ci]
end

for j = 1:kd
    for i = j+1:kd+1
        posi = i
        posj = j
        c = color[posi]
        C[posi,posj] = B[posj,c]
        C[posj,posi] = C[posi,posj]
        flag = true
        while flag
            if posi > posj
                posi, posj = posj, posi
            end
            if posi + kd + 1 <= n
                c = color[posi + kd + 1]
                C[posi+kd+1,posj] = B[posj,c] - C[posj,posi]
                C[posj,posi+kd+1] = C[posi+kd+1,posj]
                posi = posi + kd + 1
            else
                flag = false
            end
        end
    end
end
主要语言
Julia
星标
46
派生
14
平均合并
6 小时 30 分钟
30 天内合并 PR
2

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

JuliaDiff/SparseMatrixColorings.jl 的其他 Issue

查看 JuliaDiff/SparseMatrixColorings.jl 的全部 Issue

相似的 Issue

更多 Julia Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。