SLISC 的 band 矩阵类

                     

贡献者: addis

  • 本文处于草稿阶段。
预备知识 数据结构:带对角矩阵,SLISC 的密矩阵类

   SLISC 把 BLAS 中的带对角矩阵封装成了 Cband 类(列主序。行主序暂时没有实现)。其中矩阵元储存于 m_a 中,m_N0 是行数,m_a.n1() 是列数。m_Nup, m_Nlow 分别是对角线上方和下方非零副对角线的条数,m_a 的第 m_idiag 行则是对角线所在的行。

class CbandDoub
{
public:
    Long m_N0;
    Long m_Nup;
    Long m_Nlow;
    Long m_idiag;
    CmatDoub m_a;

    CbandDoub();
    CbandDoub(Long_I N0, Long_I N1, Long_I Nup, Long_I Nlow,
              Long_I lda = -1, Long_I idiag = -1);
    Doub * p();
    const Doub * p() const;
    Doub operator()(Long_I i, Long_I j) const;
    Doub &ref(Long_I i, Long_I j);
    Long n0() const;
    Long n1() const;
    Long size() const;
    Long nup() const;
    Long nlow() const;
    Long lda() const;
    Long idiag() const;
    CmatDoub &cmat();
    const CmatDoub &cmat() const;
    DcmatDoub band();
    DcmatDoub_c band() const;
    DvecDoub diag();
    DvecDoub_c diag() const;
    void resize(Long_I lda, Long_I N1);
    void resize(Long_I N0, Long_I N1, Long_I Nup,
                Long_I Nlow, Long_I lda = -1, Long_I idiag = -1);
    void reshape(Long_I N0, Long_I Nup, Long_I Nlow, Long_I idiag = -1);
    void shift(Long_I idiag);
};


致读者: 小时百科一直以来坚持所有内容免费,这导致我们处于严重的亏损状态。 长此以往很可能会最终导致我们不得不选择大量广告以及内容付费等。 因此,我们请求广大读者热心打赏 ,使网站得以健康发展。 如果看到这条信息的每位读者能慷慨打赏 10 元,我们一个星期内就能脱离亏损, 并保证在接下来的一整年里向所有读者继续免费提供优质内容。 但遗憾的是只有不到 1% 的读者愿意捐款, 他们的付出帮助了 99% 的读者免费获取知识, 我们在此表示感谢。

                     

友情链接: 超理论坛 | ©小时科技 保留一切权利