libmesh解析
本工作只是尝试解析原libmesh的代码,供学习使用
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 
Public 成员函数 | 静态 Public 成员函数 | Protected 类型 | Protected 成员函数 | Protected 属性 | 静态 Protected 属性 | Private 成员函数 | Private 属性 | 友元 | 所有成员列表
libMesh::LaspackMatrix< T > 模板类 参考final

LaspackMatrix类封装了Laspack库中的QMatrix对象。 目前,Laspack仅支持实数数据类型,因此这个类是对 SparseMatrix<T> 的全特化,其中 T = Real。 所有重写的虚拟函数在 sparse_matrix.h 中有文档说明。 更多...

#include <laspack_matrix.h>

类 libMesh::LaspackMatrix< T > 继承关系图:
[图例]

Public 成员函数

 LaspackMatrix (const Parallel::Communicator &comm)
 构造函数;将矩阵初始化为空,没有任何结构,即矩阵无法使用。因此,此构造函数仅适用于类的成员矩阵。 所有其他矩阵应在所有必要信息都可用的数据流的某一点创建。 更多...
 
 LaspackMatrix (LaspackMatrix &&)=delete
 此类手动管理C风格的结构(QMatrix),因此我们不希望生成任何自动复制/移动函数, 且不能默认析构函数。 更多...
 
 LaspackMatrix (const LaspackMatrix &)=delete
 
LaspackMatrixoperator= (const LaspackMatrix &)=delete
 
LaspackMatrixoperator= (LaspackMatrix &&)=delete
 
virtual ~LaspackMatrix ()
 
virtual bool need_full_sparsity_pattern () const override
 LaspackMatrix 需要完整的稀疏性模式。 更多...
 
virtual void update_sparsity_pattern (const SparsityPattern::Graph &) override
 更新矩阵的稀疏性模式。这将告诉底层矩阵存储方案如何映射 $ (i,j) $ 元素。 更多...
 
virtual void init (const numeric_index_type m, const numeric_index_type n, const numeric_index_type m_l, const numeric_index_type n_l, const numeric_index_type nnz=30, const numeric_index_type noz=10, const numeric_index_type blocksize=1) override
 初始化LaspackMatrix对象的属性,包括矩阵的行数、列数、非零元素的预估数量等。这些参数将影响矩阵的内存分配和性能。 更多...
 
virtual void init (ParallelType=PARALLEL) override
 初始化LaspackMatrix对象,指定并行类型(默认为PARALLEL)。 这个函数用于指定矩阵的并行计算方式。 更多...
 
virtual void clear () override
 清空LaspackMatrix对象,释放分配的内存和资源。 这个函数用于清除矩阵的数据和状态。 更多...
 
virtual void zero () override
 将LaspackMatrix对象的所有元素置零。 这个函数用于将矩阵中的所有元素设置为零。 更多...
 
virtual std::unique_ptr
< SparseMatrix< T > > 
zero_clone () const override
 创建一个与LaspackMatrix对象具有相同属性但所有元素为零的新矩阵。 这个函数用于创建一个与原矩阵具有相同大小和属性的全零矩阵。 更多...
 
virtual std::unique_ptr
< SparseMatrix< T > > 
clone () const override
 克隆LaspackMatrix对象,创建一个具有相同属性和数据的新矩阵。 这个函数用于创建一个与原矩阵具有相同大小、属性和数据的新矩阵。 更多...
 
virtual void close () override
 关闭LaspackMatrix对象,标记矩阵已经完成构建,不再修改其结构。 这个函数用于标记矩阵的状态为已完成构建,之后不再修改其结构。 更多...
 
virtual numeric_index_type m () const override
 返回LaspackMatrix对象的行数。 这个函数用于获取矩阵的行数。 更多...
 
virtual numeric_index_type n () const override
 返回LaspackMatrix对象的列数。 这个函数用于获取矩阵的列数。 更多...
 
virtual numeric_index_type row_start () const override
 返回LaspackMatrix对象的行起始位置。 这个函数用于获取矩阵的行起始位置,通常用于稀疏矩阵的索引操作。 更多...
 
virtual numeric_index_type row_stop () const override
 返回LaspackMatrix对象的行结束位置。 这个函数用于获取矩阵的行结束位置,通常用于稀疏矩阵的索引操作。 更多...
 
virtual void set (const numeric_index_type i, const numeric_index_type j, const T value) override
 设置LaspackMatrix对象的指定位置 $ (i, j) $ 处的值为 value。 更多...
 
virtual void add (const numeric_index_type i, const numeric_index_type j, const T value) override
 $ (i, j) $ 处的值增加 value。 更多...
 
virtual void add_matrix (const DenseMatrix< T > &dm, const std::vector< numeric_index_type > &rows, const std::vector< numeric_index_type > &cols) override
 将一个DenseMatrix对象的元素加到LaspackMatrix对象的指定行和列。 更多...
 
virtual void add_matrix (const DenseMatrix< T > &dm, const std::vector< numeric_index_type > &dof_indices) override
 将一个DenseMatrix对象的元素加到LaspackMatrix对象的指定自由度索引。 更多...
 
virtual void add (const T a, const SparseMatrix< T > &X) override
 计算矩阵 $ A $$ a \cdot X $,其中 $ a $ 是标量, $ X $ 是矩阵。 计算结果存储在LaspackMatrix对象中。 更多...
 
virtual T operator() (const numeric_index_type i, const numeric_index_type j) const override
 获取LaspackMatrix对象的指定位置 $ (i, j) $ 处的值。 这个函数用于获取矩阵的特定元素的值。 更多...
 
virtual Real l1_norm () const override
 返回矩阵的 $ L^1 $ 范数。当前未实现。 更多...
 
virtual Real linfty_norm () const override
 返回矩阵的 $ L^\infty $ 范数。当前未实现。 更多...
 
virtual bool closed () const override
 检查LaspackMatrix对象是否已关闭。 这个函数用于检查矩阵是否已经完成构建并关闭,不再修改其结构。 更多...
 
virtual void print_personal (std::ostream &os=libMesh::out) const override
 打印LaspackMatrix对象的信息到指定的输出流(默认为libMesh::out)。 这个函数用于将矩阵的信息输出到指定的输出流中。 更多...
 
virtual void get_diagonal (NumericVector< T > &dest) const override
 获取矩阵的对角线元素,并存储到指定的NumericVector对象中。 这个函数用于获取矩阵的对角线元素。 更多...
 
virtual void get_transpose (SparseMatrix< T > &dest) const override
 获取矩阵的转置,并存储到指定的SparseMatrix对象中。 这个函数用于获取矩阵的转置矩阵。 更多...
 
virtual bool initialized () const
 
void attach_dof_map (const DofMap &dof_map)
 设置要使用的 DofMap 的指针。如果不使用单独的稀疏性模式, 则使用来自 DofMap 的模式。 更多...
 
void attach_sparsity_pattern (const SparsityPattern::Build &sp)
 设置要使用的稀疏性模式的指针。在矩阵需要比系统中的大(或更小以提高效率)的模式, 或者在 DofMap 未计算系统稀疏性模式的情况下使用。 更多...
 
virtual void zero_rows (std::vector< numeric_index_type > &rows, T diag_value=0.0)
 将所有行条目设置为 0,然后将 diag_value 放在对角线条目。 更多...
 
virtual void flush ()
 对于 PETSc 矩阵,此函数类似于 close,但不收缩内存。 当我们希望在 ADD_VALUES 和 INSERT_VALUES 之间切换时,这很有用。 在使用矩阵之前应该调用 close。 更多...
 
virtual numeric_index_type local_m () const
 获取此进程拥有的行数。 更多...
 
virtual void add_block_matrix (const DenseMatrix< T > &dm, const std::vector< numeric_index_type > &brows, const std::vector< numeric_index_type > &bcols)
 将完整矩阵 dm 添加到 SparseMatrix。这对于在装配时添加元素矩阵很有用。 矩阵被假定为块矩阵,brow、bcol 对应于*块*行和列索引。 更多...
 
virtual void add_block_matrix (const DenseMatrix< T > &dm, const std::vector< numeric_index_type > &dof_indices)
 add_block_matrix() 相同,但假定行和列映射相同。 因此矩阵 dm 必须是方阵。 更多...
 
virtual void matrix_matrix_mult (SparseMatrix< T > &, SparseMatrix< T > &, bool)
 计算 Y = A*X,其中 X 为矩阵。 更多...
 
virtual void add_sparse_matrix (const SparseMatrix< T > &, const std::map< numeric_index_type, numeric_index_type > &, const std::map< numeric_index_type, numeric_index_type > &, const T)
 scalar* spm 添加到此矩阵的行和列中: A(rows[i], cols[j]) += scalar * spm(i,j) 更多...
 
void print (std::ostream &os=libMesh::out, const bool sparse=false) const
 将矩阵的内容以统一的样式打印到屏幕上,而不考虑正在使用的矩阵/求解器包。 更多...
 
template<>
void print (std::ostream &os, const bool sparse) const
 
virtual void print_matlab (const std::string &="") const
 以 Matlab 的稀疏矩阵格式打印矩阵的内容。可选择将矩阵打印到名为 name 的文件中。 如果未指定 name ,则将其转储到屏幕上。 更多...
 
virtual void create_submatrix (SparseMatrix< T > &submatrix, const std::vector< numeric_index_type > &rows, const std::vector< numeric_index_type > &cols) const
 此函数创建一个名为 "submatrix" 的矩阵,其定义由 "rows" 和 "cols" 条目中的行和列索引给定。 目前,此操作仅对 PetscMatrix 类型定义。 注意:rowscols 向量需要排序; 如果 rowscols 向量未排序,则使用下面的 nosort 版本; rowscols 仅包含由此处理器拥有的索引。 更多...
 
virtual void create_submatrix_nosort (SparseMatrix< T > &, const std::vector< numeric_index_type > &, const std::vector< numeric_index_type > &) const
 与上述函数类似,此函数创建由 rowscols 向量中的索引定义的 submatrix。 注意:rowscols 可以是无序的; 如果索引已排序,则对于效率更高的操作,请使用上面的函数; rowscols 可以包含由其他处理器拥有的索引。 更多...
 
virtual void reinit_submatrix (SparseMatrix< T > &submatrix, const std::vector< numeric_index_type > &rows, const std::vector< numeric_index_type > &cols) const
 此函数与上述函数类似,但允许您重用 "submatrix" 的现有稀疏性模式,而不是再次分配它。 如果经常提取相同大小的子矩阵,这应该更有效。 更多...
 
void vector_mult (NumericVector< T > &dest, const NumericVector< T > &arg) const
 将矩阵乘以 NumericVector arg 并将结果存储在 NumericVector dest 中。 更多...
 
void vector_mult_add (NumericVector< T > &dest, const NumericVector< T > &arg) const
 将矩阵乘以 NumericVector arg ,并将结果添加到 NumericVector dest 中。 更多...
 
virtual void get_row (numeric_index_type, std::vector< numeric_index_type > &, std::vector< T > &) const
 从矩阵获取一行。 更多...
 

静态 Public 成员函数

static std::unique_ptr
< SparseMatrix< T > > 
build (const Parallel::Communicator &comm, const SolverPackage solver_package=libMesh::default_solver_package(), const MatrixBuildType matrix_build_type=MatrixBuildType::AUTOMATIC)
 使用由 solver_package 指定的线性求解器包构建一个 SparseMatrix<T>。 更多...
 
static std::string get_info ()
 Gets a string containing the reference information. 更多...
 
static void print_info (std::ostream &out_stream=libMesh::out)
 Prints the reference information, by default to libMesh::out. 更多...
 
static unsigned int n_objects ()
 Prints the number of outstanding (created, but not yet destroyed) objects. 更多...
 
static void enable_print_counter_info ()
 Methods to enable/disable the reference counter output from print_info() 更多...
 
static void disable_print_counter_info ()
 

Protected 类型

typedef std::map< std::string,
std::pair< unsigned int,
unsigned int > > 
Counts
 Data structure to log the information. 更多...
 

Protected 成员函数

virtual void _get_submatrix (SparseMatrix< T > &, const std::vector< numeric_index_type > &, const std::vector< numeric_index_type > &, const bool) const
 创建子矩阵和 reinit_submatrix 例程的受保护实现。 更多...
 
void increment_constructor_count (const std::string &name) noexcept
 Increments the construction counter. 更多...
 
void increment_destructor_count (const std::string &name) noexcept
 Increments the destruction counter. 更多...
 

Protected 属性

DofMap const * _dof_map
 与此对象关联的 DofMap 对象。可以查询其在处理器上的自由度计数。 更多...
 
SparsityPattern::Build const * _sp
 与此对象关联的 sparsity pattern。在需要时, 应查询其入口计数(或使用 need_full_sparsity_pattern,模式)。 更多...
 
bool _is_initialized
 标志,指示矩阵是否已初始化。 更多...
 

静态 Protected 属性

static Counts _counts
 Actually holds the data. 更多...
 
static Threads::atomic
< unsigned int > 
_n_objects
 The number of objects. 更多...
 
static Threads::spin_mutex _mutex
 Mutual exclusion object to enable thread-safe reference counting. 更多...
 
static bool _enable_print_counter = true
 Flag to control whether reference count information is printed when print_info is called. 更多...
 

Private 成员函数

numeric_index_type pos (const numeric_index_type i, const numeric_index_type j) const
 

Private 属性

QMatrix _QMat
 Laspack稀疏矩阵指针。 更多...
 
std::vector< numeric_index_type_csr
 压缩行索引。 更多...
 
std::vector< std::vector
< numeric_index_type >
::const_iterator > 
_row_start
 压缩行索引数据结构中每行的起始位置。 更多...
 
bool _closed
 指示矩阵是否已关闭的标志。 更多...
 

友元

class LaspackVector< T >
 使其他Laspack数据类型成为友元类。 更多...
 
class LaspackLinearSolver< T >
 

详细描述

template<typename T>
class libMesh::LaspackMatrix< T >

LaspackMatrix类封装了Laspack库中的QMatrix对象。 目前,Laspack仅支持实数数据类型,因此这个类是对 SparseMatrix<T> 的全特化,其中 T = Real。 所有重写的虚拟函数在 sparse_matrix.h 中有文档说明。

作者
Benjamin S. Kirk
日期
2003

<T>的特化版本,其中T为Real类型。该类提供了与SparseMatrix相关的功能,并使用Laspack库进行实际计算。

在文件 laspack_matrix.h56 行定义.

成员类型定义说明

typedef std::map<std::string, std::pair<unsigned int, unsigned int> > libMesh::ReferenceCounter::Counts
protectedinherited

Data structure to log the information.

The log is identified by the class name.

在文件 reference_counter.h119 行定义.

构造及析构函数说明

template<typename T >
libMesh::LaspackMatrix< T >::LaspackMatrix ( const Parallel::Communicator &  comm)

构造函数;将矩阵初始化为空,没有任何结构,即矩阵无法使用。因此,此构造函数仅适用于类的成员矩阵。 所有其他矩阵应在所有必要信息都可用的数据流的某一点创建。

在使用之前,必须使用 init(...) 初始化矩阵。

参数
comm通信器,用于并行计算。

在文件 laspack_matrix.C237 行定义.

237  :
238  SparseMatrix<T>(comm),
239  _closed (false)
240 {
241 }
bool _closed
指示矩阵是否已关闭的标志。
template<typename T >
libMesh::LaspackMatrix< T >::LaspackMatrix ( LaspackMatrix< T > &&  )
delete

此类手动管理C风格的结构(QMatrix),因此我们不希望生成任何自动复制/移动函数, 且不能默认析构函数。

template<typename T >
libMesh::LaspackMatrix< T >::LaspackMatrix ( const LaspackMatrix< T > &  )
delete
template<typename T >
libMesh::LaspackMatrix< T >::~LaspackMatrix ( )
virtual

在文件 laspack_matrix.C246 行定义.

247 {
248  this->clear ();
249 }
virtual void clear() override
清空LaspackMatrix对象,释放分配的内存和资源。 这个函数用于清除矩阵的数据和状态。

成员函数说明

template<typename T>
virtual void libMesh::SparseMatrix< T >::_get_submatrix ( SparseMatrix< T > &  ,
const std::vector< numeric_index_type > &  ,
const std::vector< numeric_index_type > &  ,
const bool   
) const
inlineprotectedvirtualinherited

创建子矩阵和 reinit_submatrix 例程的受保护实现。

注解
派生类必须在此函数中覆盖,以使其正常工作!

libMesh::PetscMatrix< T > 重载.

在文件 sparse_matrix.h483 行定义.

参考自 libMesh::SparseMatrix< T >::create_submatrix() , 以及 libMesh::SparseMatrix< T >::reinit_submatrix().

487  {
488  libmesh_not_implemented();
489  }
template<typename T >
void libMesh::LaspackMatrix< T >::add ( const numeric_index_type  i,
const numeric_index_type  j,
const T  value 
)
overridevirtual

$ (i, j) $ 处的值增加 value。

参数
i指定元素的行索引。
j指定元素的列索引。
value要增加的值。

实现了 libMesh::SparseMatrix< T >.

在文件 laspack_matrix.C388 行定义.

参考 libMesh::initialized().

391 {
392  libmesh_assert (this->initialized());
393  libmesh_assert_less (i, this->m());
394  libmesh_assert_less (j, this->n());
395 
396  const numeric_index_type position = this->pos(i,j);
397 
398  // Sanity check
399  libmesh_assert_equal_to (*(_row_start[i]+position), j);
400 
401  Q_AddVal (&_QMat, i+1, position, value);
402 }
QMatrix _QMat
Laspack稀疏矩阵指针。
virtual bool initialized() const
dof_id_type numeric_index_type
Definition: id_types.h:99
std::vector< std::vector< numeric_index_type >::const_iterator > _row_start
压缩行索引数据结构中每行的起始位置。
virtual numeric_index_type m() const override
返回LaspackMatrix对象的行数。 这个函数用于获取矩阵的行数。
virtual numeric_index_type n() const override
返回LaspackMatrix对象的列数。 这个函数用于获取矩阵的列数。
numeric_index_type pos(const numeric_index_type i, const numeric_index_type j) const
template<typename T >
void libMesh::LaspackMatrix< T >::add ( const T  a,
const SparseMatrix< T > &  X 
)
overridevirtual

计算矩阵 $ A $$ a \cdot X $,其中 $ a $ 是标量, $ X $ 是矩阵。 计算结果存储在LaspackMatrix对象中。

参数
a标量值。
X要与矩阵相乘的SparseMatrix对象。

实现了 libMesh::SparseMatrix< T >.

在文件 laspack_matrix.C416 行定义.

参考 libMesh::initialized(), libMesh::SparseMatrix< T >::m() , 以及 libMesh::SparseMatrix< T >::n().

417 {
418  libmesh_assert (this->initialized());
419  libmesh_assert_equal_to (this->m(), X_in.m());
420  libmesh_assert_equal_to (this->n(), X_in.n());
421 
422  const LaspackMatrix<T> * X =
423  cast_ptr<const LaspackMatrix<T> *> (&X_in);
424 
425  _LPNumber a = static_cast<_LPNumber> (a_in);
426 
427  libmesh_assert(X);
428 
429  // loops taken from LaspackMatrix<T>::zero ()
430 
431  const numeric_index_type n_rows = this->m();
432 
433  for (numeric_index_type row=0; row<n_rows; row++)
434  {
435  auto r_start = _row_start[row];
436 
437  const numeric_index_type len = (_row_start[row+1] - _row_start[row]);
438 
439  // Make sure we agree on the row length
440  libmesh_assert_equal_to (len, Q_GetLen(&_QMat, row+1));
441  // compare matrix sparsity structures
442  libmesh_assert_equal_to (len, Q_GetLen(&(X->_QMat), row+1));
443 
444 
445  for (numeric_index_type l=0; l<len; l++)
446  {
447  const numeric_index_type j = *(r_start + l);
448 
449  // Make sure the data structures are working
450  libmesh_assert_equal_to ((j+1), Q_GetPos (&_QMat, row+1, l));
451 
452  const _LPNumber value = a * Q_GetEl(const_cast<QMatrix*>(&(X->_QMat)), row+1, j+1);
453  Q_AddVal (&_QMat, row+1, l, value);
454  }
455  }
456 }
QMatrix _QMat
Laspack稀疏矩阵指针。
virtual bool initialized() const
dof_id_type numeric_index_type
Definition: id_types.h:99
std::vector< std::vector< numeric_index_type >::const_iterator > _row_start
压缩行索引数据结构中每行的起始位置。
virtual numeric_index_type m() const override
返回LaspackMatrix对象的行数。 这个函数用于获取矩阵的行数。
virtual numeric_index_type n() const override
返回LaspackMatrix对象的列数。 这个函数用于获取矩阵的列数。
template<typename T >
void libMesh::SparseMatrix< T >::add_block_matrix ( const DenseMatrix< T > &  dm,
const std::vector< numeric_index_type > &  brows,
const std::vector< numeric_index_type > &  bcols 
)
virtualinherited

将完整矩阵 dm 添加到 SparseMatrix。这对于在装配时添加元素矩阵很有用。 矩阵被假定为块矩阵,brow、bcol 对应于*块*行和列索引。

libMesh::PetscMatrix< T > 重载.

在文件 sparse_matrix.C77 行定义.

参考 libMesh::DenseMatrixBase< T >::m() , 以及 libMesh::DenseMatrixBase< T >::n().

参考自 libMesh::SparseMatrix< T >::add_block_matrix().

80 {
81  libmesh_assert_equal_to (dm.m() / brows.size(), dm.n() / bcols.size());
82 
83  const numeric_index_type blocksize = cast_int<numeric_index_type>
84  (dm.m() / brows.size());
85 
86  libmesh_assert_equal_to (dm.m()%blocksize, 0);
87  libmesh_assert_equal_to (dm.n()%blocksize, 0);
88 
89  std::vector<numeric_index_type> rows, cols;
90 
91  rows.reserve(blocksize*brows.size());
92  cols.reserve(blocksize*bcols.size());
93 
94  for (auto & row : brows)
95  {
96  numeric_index_type i = row * blocksize;
97 
98  for (unsigned int v=0; v<blocksize; v++)
99  rows.push_back(i++);
100  }
101 
102  for (auto & col : bcols)
103  {
104  numeric_index_type j = col * blocksize;
105 
106  for (unsigned int v=0; v<blocksize; v++)
107  cols.push_back(j++);
108  }
109 
110  this->add_matrix (dm, rows, cols);
111 }
virtual void add_matrix(const DenseMatrix< T > &dm, const std::vector< numeric_index_type > &rows, const std::vector< numeric_index_type > &cols)=0
将完整矩阵 dm 添加到 SparseMatrix。这对于在装配时添加元素矩阵很有用。
dof_id_type numeric_index_type
Definition: id_types.h:99
template<typename T>
virtual void libMesh::SparseMatrix< T >::add_block_matrix ( const DenseMatrix< T > &  dm,
const std::vector< numeric_index_type > &  dof_indices 
)
inlinevirtualinherited

add_block_matrix() 相同,但假定行和列映射相同。 因此矩阵 dm 必须是方阵。

libMesh::PetscMatrix< T > 重载.

在文件 sparse_matrix.h278 行定义.

参考 libMesh::SparseMatrix< T >::add_block_matrix().

280  { this->add_block_matrix (dm, dof_indices, dof_indices); }
virtual void add_block_matrix(const DenseMatrix< T > &dm, const std::vector< numeric_index_type > &brows, const std::vector< numeric_index_type > &bcols)
将完整矩阵 dm 添加到 SparseMatrix。这对于在装配时添加元素矩阵很有用。 矩阵被假定为块矩阵,brow、bcol 对应于*块*行和列索引。
Definition: sparse_matrix.C:77
template<typename T >
void libMesh::LaspackMatrix< T >::add_matrix ( const DenseMatrix< T > &  dm,
const std::vector< numeric_index_type > &  rows,
const std::vector< numeric_index_type > &  cols 
)
overridevirtual

将一个DenseMatrix对象的元素加到LaspackMatrix对象的指定行和列。

参数
dm包含要添加的元素的DenseMatrix对象。
rows要添加的元素所在的行索引。
cols要添加的元素所在的列索引。

实现了 libMesh::SparseMatrix< T >.

在文件 laspack_matrix.C201 行定义.

参考 libMesh::initialized(), libMesh::DenseMatrixBase< T >::m() , 以及 libMesh::DenseMatrixBase< T >::n().

205 {
206  libmesh_assert (this->initialized());
207  unsigned int n_rows = cast_int<unsigned int>(rows.size());
208  unsigned int n_cols = cast_int<unsigned int>(cols.size());
209  libmesh_assert_equal_to (dm.m(), n_rows);
210  libmesh_assert_equal_to (dm.n(), n_cols);
211 
212 
213  for (unsigned int i=0; i<n_rows; i++)
214  for (unsigned int j=0; j<n_cols; j++)
215  this->add(rows[i],cols[j],dm(i,j));
216 }
virtual void add(const numeric_index_type i, const numeric_index_type j, const T value) override
将 处的值增加 value。
virtual bool initialized() const
template<typename T >
void libMesh::LaspackMatrix< T >::add_matrix ( const DenseMatrix< T > &  dm,
const std::vector< numeric_index_type > &  dof_indices 
)
overridevirtual

将一个DenseMatrix对象的元素加到LaspackMatrix对象的指定自由度索引。

参数
dm包含要添加的元素的DenseMatrix对象。
dof_indices要添加的元素所在的自由度索引。

实现了 libMesh::SparseMatrix< T >.

在文件 laspack_matrix.C407 行定义.

409 {
410  this->add_matrix (dm, dof_indices, dof_indices);
411 }
virtual void add_matrix(const DenseMatrix< T > &dm, const std::vector< numeric_index_type > &rows, const std::vector< numeric_index_type > &cols) override
将一个DenseMatrix对象的元素加到LaspackMatrix对象的指定行和列。
template<typename T>
virtual void libMesh::SparseMatrix< T >::add_sparse_matrix ( const SparseMatrix< T > &  ,
const std::map< numeric_index_type, numeric_index_type > &  ,
const std::map< numeric_index_type, numeric_index_type > &  ,
const T   
)
inlinevirtualinherited

scalar* spm 添加到此矩阵的行和列中: A(rows[i], cols[j]) += scalar * spm(i,j)

libMesh::PetscMatrix< T > 重载.

在文件 sparse_matrix.h297 行定义.

301  { libmesh_not_implemented(); }
template<typename T >
void libMesh::SparseMatrix< T >::attach_dof_map ( const DofMap dof_map)
inherited

设置要使用的 DofMap 的指针。如果不使用单独的稀疏性模式, 则使用来自 DofMap 的模式。

dof_map 的生命周期必须超过 this 的生命周期。

在文件 sparse_matrix.C58 行定义.

参考 libMesh::DofMap::get_sparsity_pattern().

参考自 libMesh::DofMap::update_sparsity_pattern().

59 {
60  _dof_map = &dof_map;
61  if (!_sp)
62  _sp = dof_map.get_sparsity_pattern();
63 }
const SparsityPattern::Graph & get_sparsity_pattern() const
Rows of sparse matrix indices, indexed by the offset from the first DoF on this processor.
SparsityPattern::Build const * _sp
与此对象关联的 sparsity pattern。在需要时, 应查询其入口计数(或使用 need_full_sparsity_pattern,模式)。
DofMap const * _dof_map
与此对象关联的 DofMap 对象。可以查询其在处理器上的自由度计数。
template<typename T >
void libMesh::SparseMatrix< T >::attach_sparsity_pattern ( const SparsityPattern::Build sp)
inherited

设置要使用的稀疏性模式的指针。在矩阵需要比系统中的大(或更小以提高效率)的模式, 或者在 DofMap 未计算系统稀疏性模式的情况下使用。

sp 的生命周期必须超过 this 的生命周期。

在文件 sparse_matrix.C68 行定义.

参考自 libMesh::DofMap::update_sparsity_pattern().

69 {
70  _sp = &sp;
71 }
SparsityPattern::Build const * _sp
与此对象关联的 sparsity pattern。在需要时, 应查询其入口计数(或使用 need_full_sparsity_pattern,模式)。
template<typename T >
std::unique_ptr< SparseMatrix< T > > libMesh::SparseMatrix< T >::build ( const Parallel::Communicator &  comm,
const SolverPackage  solver_package = libMesh::default_solver_package(),
const MatrixBuildType  matrix_build_type = MatrixBuildType::AUTOMATIC 
)
staticinherited

使用由 solver_package 指定的线性求解器包构建一个 SparseMatrix<T>。

在文件 sparse_matrix.C151 行定义.

参考 libMesh::EIGEN_SOLVERS, libMesh::LASPACK_SOLVERS, libMesh::libmesh_ignore() , 以及 libMesh::TRILINOS_SOLVERS.

参考自 libMesh::DofMap::process_mesh_constraint_rows().

154 {
155  // Avoid unused parameter warnings when no solver packages are enabled.
156  libmesh_ignore(comm);
157 
158  if (matrix_build_type == MatrixBuildType::DIAGONAL)
159  return std::make_unique<DiagonalMatrix<T>>(comm);
160 
161  // Build the appropriate vector
162  switch (solver_package)
163  {
164 
165 #ifdef LIBMESH_HAVE_LASPACK
166  case LASPACK_SOLVERS:
167  return std::make_unique<LaspackMatrix<T>>(comm);
168 #endif
169 
170 
171 #ifdef LIBMESH_HAVE_PETSC
172  case PETSC_SOLVERS:
173  return std::make_unique<PetscMatrix<T>>(comm);
174 #endif
175 
176 
177 #ifdef LIBMESH_TRILINOS_HAVE_EPETRA
178  case TRILINOS_SOLVERS:
179  return std::make_unique<EpetraMatrix<T>>(comm);
180 #endif
181 
182 
183 #ifdef LIBMESH_HAVE_EIGEN
184  case EIGEN_SOLVERS:
185  return std::make_unique<EigenSparseMatrix<T>>(comm);
186 #endif
187 
188  default:
189  libmesh_error_msg("ERROR: Unrecognized solver package: " << solver_package);
190  }
191 }
EIGEN_SOLVERS
Definition: libmesh.C:249
TRILINOS_SOLVERS
Definition: libmesh.C:247
void libmesh_ignore(const Args &...)
LASPACK_SOLVERS
Definition: libmesh.C:251
template<typename T >
void libMesh::LaspackMatrix< T >::clear ( )
overridevirtual

清空LaspackMatrix对象,释放分配的内存和资源。 这个函数用于清除矩阵的数据和状态。

实现了 libMesh::SparseMatrix< T >.

在文件 laspack_matrix.C254 行定义.

参考 libMesh::libMeshPrivateData::_is_initialized , 以及 libMesh::initialized().

255 {
256  if (this->initialized())
257  {
258  Q_Destr(&_QMat);
259  }
260 
261  _csr.clear();
262  _row_start.clear();
263  _closed = false;
264  this->_is_initialized = false;
265 }
std::vector< numeric_index_type > _csr
压缩行索引。
QMatrix _QMat
Laspack稀疏矩阵指针。
virtual bool initialized() const
bool _is_initialized
标志,指示矩阵是否已初始化。
std::vector< std::vector< numeric_index_type >::const_iterator > _row_start
压缩行索引数据结构中每行的起始位置。
bool _closed
指示矩阵是否已关闭的标志。
template<typename T >
std::unique_ptr< SparseMatrix< T > > libMesh::LaspackMatrix< T >::clone ( ) const
overridevirtual

克隆LaspackMatrix对象,创建一个具有相同属性和数据的新矩阵。 这个函数用于创建一个与原矩阵具有相同大小、属性和数据的新矩阵。

实现了 libMesh::SparseMatrix< T >.

在文件 laspack_matrix.C319 行定义.

320 {
321  // We don't currently have a faster implementation than making a
322  // zero clone and then filling in the values.
323  auto mat_copy = this->zero_clone();
324  mat_copy->add(1., *this);
325 
326  // Work around an issue on older compilers. We are able to simply
327  // "return mat_copy;" on newer compilers
328  return std::unique_ptr<SparseMatrix<T>>(mat_copy.release());
329 }
virtual std::unique_ptr< SparseMatrix< T > > zero_clone() const override
创建一个与LaspackMatrix对象具有相同属性但所有元素为零的新矩阵。 这个函数用于创建一个与原矩阵具有相同大小和属性的全零矩阵。
template<typename T >
void libMesh::LaspackMatrix< T >::close ( )
overridevirtual

关闭LaspackMatrix对象,标记矩阵已经完成构建,不再修改其结构。 这个函数用于标记矩阵的状态为已完成构建,之后不再修改其结构。

实现了 libMesh::SparseMatrix< T >.

在文件 laspack_matrix.C499 行定义.

参考 libMesh::initialized().

500 {
501  libmesh_assert(this->initialized());
502 
503  this->_closed = true;
504 
505  // We've probably changed some entries so we need to tell LASPACK
506  // that cached data is now invalid.
507  *_QMat.DiagElAlloc = _LPFalse;
508  *_QMat.ElSorted = _LPFalse;
509  if (*_QMat.ILUExists)
510  {
511  *_QMat.ILUExists = _LPFalse;
512  Q_Destr(_QMat.ILU);
513  }
514 }
QMatrix _QMat
Laspack稀疏矩阵指针。
virtual bool initialized() const
bool _closed
指示矩阵是否已关闭的标志。
template<typename T >
virtual bool libMesh::LaspackMatrix< T >::closed ( ) const
inlineoverridevirtual

检查LaspackMatrix对象是否已关闭。 这个函数用于检查矩阵是否已经完成构建并关闭,不再修改其结构。

实现了 libMesh::SparseMatrix< T >.

在文件 laspack_matrix.h244 行定义.

参考 libMesh::LaspackMatrix< T >::_closed.

244 { return _closed; }
bool _closed
指示矩阵是否已关闭的标志。
template<typename T>
virtual void libMesh::SparseMatrix< T >::create_submatrix ( SparseMatrix< T > &  submatrix,
const std::vector< numeric_index_type > &  rows,
const std::vector< numeric_index_type > &  cols 
) const
inlinevirtualinherited

此函数创建一个名为 "submatrix" 的矩阵,其定义由 "rows" 和 "cols" 条目中的行和列索引给定。 目前,此操作仅对 PetscMatrix 类型定义。 注意:rowscols 向量需要排序; 如果 rowscols 向量未排序,则使用下面的 nosort 版本; rowscols 仅包含由此处理器拥有的索引。

在文件 sparse_matrix.h388 行定义.

参考 libMesh::SparseMatrix< T >::_get_submatrix().

391  {
392  this->_get_submatrix(submatrix,
393  rows,
394  cols,
395  false); // false means DO NOT REUSE submatrix
396  }
virtual void _get_submatrix(SparseMatrix< T > &, const std::vector< numeric_index_type > &, const std::vector< numeric_index_type > &, const bool) const
创建子矩阵和 reinit_submatrix 例程的受保护实现。
template<typename T>
virtual void libMesh::SparseMatrix< T >::create_submatrix_nosort ( SparseMatrix< T > &  ,
const std::vector< numeric_index_type > &  ,
const std::vector< numeric_index_type > &   
) const
inlinevirtualinherited

与上述函数类似,此函数创建由 rowscols 向量中的索引定义的 submatrix。 注意:rowscols 可以是无序的; 如果索引已排序,则对于效率更高的操作,请使用上面的函数; rowscols 可以包含由其他处理器拥有的索引。

libMesh::PetscMatrix< T > 重载.

在文件 sparse_matrix.h404 行定义.

407  {
408  libmesh_not_implemented();
409  }
void libMesh::ReferenceCounter::disable_print_counter_info ( )
staticinherited

在文件 reference_counter.C100 行定义.

参考 libMesh::ReferenceCounter::_enable_print_counter.

101 {
102  _enable_print_counter = false;
103  return;
104 }
static bool _enable_print_counter
Flag to control whether reference count information is printed when print_info is called...
void libMesh::ReferenceCounter::enable_print_counter_info ( )
staticinherited

Methods to enable/disable the reference counter output from print_info()

在文件 reference_counter.C94 行定义.

参考 libMesh::ReferenceCounter::_enable_print_counter.

95 {
96  _enable_print_counter = true;
97  return;
98 }
static bool _enable_print_counter
Flag to control whether reference count information is printed when print_info is called...
template<typename T>
virtual void libMesh::SparseMatrix< T >::flush ( )
inlinevirtualinherited

对于 PETSc 矩阵,此函数类似于 close,但不收缩内存。 当我们希望在 ADD_VALUES 和 INSERT_VALUES 之间切换时,这很有用。 在使用矩阵之前应该调用 close。

libMesh::PetscMatrix< T > 重载.

在文件 sparse_matrix.h202 行定义.

参考 libMesh::SparseMatrix< T >::close().

202 { close(); }
virtual void close()=0
调用 SparseMatrix 的内部装配例程,确保值在处理器之间保持一致。
template<typename T >
void libMesh::LaspackMatrix< T >::get_diagonal ( NumericVector< T > &  dest) const
overridevirtual

获取矩阵的对角线元素,并存储到指定的NumericVector对象中。 这个函数用于获取矩阵的对角线元素。

参数
dest存储矩阵对角线元素的NumericVector对象。

实现了 libMesh::SparseMatrix< T >.

在文件 laspack_matrix.C221 行定义.

222 {
223  libmesh_not_implemented();
224 }
std::string libMesh::ReferenceCounter::get_info ( )
staticinherited

Gets a string containing the reference information.

在文件 reference_counter.C47 行定义.

参考 libMesh::ReferenceCounter::_counts.

参考自 libMesh::ReferenceCounter::print_info().

48 {
49 #if defined(LIBMESH_ENABLE_REFERENCE_COUNTING) && defined(DEBUG)
50 
51  std::ostringstream oss;
52 
53  oss << '\n'
54  << " ---------------------------------------------------------------------------- \n"
55  << "| Reference count information |\n"
56  << " ---------------------------------------------------------------------------- \n";
57 
58  for (const auto & [name, cd] : _counts)
59  oss << "| " << name << " reference count information:\n"
60  << "| Creations: " << cd.first << '\n'
61  << "| Destructions: " << cd.second << '\n';
62 
63  oss << " ---------------------------------------------------------------------------- \n";
64 
65  return oss.str();
66 
67 #else
68 
69  return "";
70 
71 #endif
72 }
static Counts _counts
Actually holds the data.
template<typename T>
virtual void libMesh::SparseMatrix< T >::get_row ( numeric_index_type  ,
std::vector< numeric_index_type > &  ,
std::vector< T > &   
) const
inlinevirtualinherited

从矩阵获取一行。

参数
i要获取的矩阵行
indices将填充为与(可能)非零值对应的列索引的容器
values包含列值的容器
注解
此函数检索矩阵的一行,并将提供的容器填充为列索引和值。

libMesh::PetscMatrix< T > 重载.

在文件 sparse_matrix.h469 行定义.

472  {
473  libmesh_not_implemented();
474  }
template<typename T >
void libMesh::LaspackMatrix< T >::get_transpose ( SparseMatrix< T > &  dest) const
overridevirtual

获取矩阵的转置,并存储到指定的SparseMatrix对象中。 这个函数用于获取矩阵的转置矩阵。

参数
dest存储矩阵转置的SparseMatrix对象。

实现了 libMesh::SparseMatrix< T >.

在文件 laspack_matrix.C229 行定义.

230 {
231  libmesh_not_implemented();
232 }
void libMesh::ReferenceCounter::increment_constructor_count ( const std::string &  name)
inlineprotectednoexceptinherited

Increments the construction counter.

Should be called in the constructor of any derived class that will be reference counted.

在文件 reference_counter.h183 行定义.

参考 libMesh::err.

参考自 libMesh::ReferenceCountedObject< SparseMatrix< T > >::ReferenceCountedObject().

184 {
185  libmesh_try
186  {
187  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
188  std::pair<unsigned int, unsigned int> & p = _counts[name];
189  p.first++;
190  }
191  libmesh_catch (...)
192  {
193  auto stream = libMesh::err.get();
194  stream->exceptions(stream->goodbit); // stream must not throw
195  libMesh::err << "Encountered unrecoverable error while calling "
196  << "ReferenceCounter::increment_constructor_count() "
197  << "for a(n) " << name << " object." << std::endl;
198  std::terminate();
199  }
200 }
OStreamProxy err
static Counts _counts
Actually holds the data.
void libMesh::ReferenceCounter::increment_destructor_count ( const std::string &  name)
inlineprotectednoexceptinherited

Increments the destruction counter.

Should be called in the destructor of any derived class that will be reference counted.

在文件 reference_counter.h207 行定义.

参考 libMesh::err.

参考自 libMesh::ReferenceCountedObject< SparseMatrix< T > >::~ReferenceCountedObject().

208 {
209  libmesh_try
210  {
211  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
212  std::pair<unsigned int, unsigned int> & p = _counts[name];
213  p.second++;
214  }
215  libmesh_catch (...)
216  {
217  auto stream = libMesh::err.get();
218  stream->exceptions(stream->goodbit); // stream must not throw
219  libMesh::err << "Encountered unrecoverable error while calling "
220  << "ReferenceCounter::increment_destructor_count() "
221  << "for a(n) " << name << " object." << std::endl;
222  std::terminate();
223  }
224 }
OStreamProxy err
static Counts _counts
Actually holds the data.
template<typename T >
virtual void libMesh::LaspackMatrix< T >::init ( const numeric_index_type  m,
const numeric_index_type  n,
const numeric_index_type  m_l,
const numeric_index_type  n_l,
const numeric_index_type  nnz = 30,
const numeric_index_type  noz = 10,
const numeric_index_type  blocksize = 1 
)
overridevirtual

初始化LaspackMatrix对象的属性,包括矩阵的行数、列数、非零元素的预估数量等。这些参数将影响矩阵的内存分配和性能。

参数
m矩阵的行数。
n矩阵的列数。
m_l矩阵的局部行数(仅在并行计算中使用)。
n_l矩阵的局部列数(仅在并行计算中使用)。
nnz非零元素的预估数量(默认为30)。
noz零元素的预估数量(默认为10)。
blocksize矩阵的块大小(默认为1)。

实现了 libMesh::SparseMatrix< T >.

template<typename T >
void libMesh::LaspackMatrix< T >::init ( ParallelType  = PARALLEL)
overridevirtual

初始化LaspackMatrix对象,指定并行类型(默认为PARALLEL)。 这个函数用于指定矩阵的并行计算方式。

实现了 libMesh::SparseMatrix< T >.

在文件 laspack_matrix.C150 行定义.

参考 libMesh::libMeshPrivateData::_is_initialized , 以及 libMesh::initialized().

151 {
152  // Ignore calls on initialized objects
153  if (this->initialized())
154  return;
155 
156  // We need the DofMap for this!
157  libmesh_assert(this->_dof_map);
158 
159  // Clear initialized matrices
160  if (this->initialized())
161  this->clear();
162 
163  const numeric_index_type n_rows = this->_dof_map->n_dofs();
164 #ifndef NDEBUG
165  // The following variables are only used for assertions,
166  // so avoid declaring them when asserts are inactive.
167  const numeric_index_type n_cols = n_rows;
168  const numeric_index_type n_l = this->_dof_map->n_dofs_on_processor(0);
169  const numeric_index_type m_l = n_l;
170 #endif
171 
172  // Laspack Matrices only work for uniprocessor cases
173  libmesh_assert_equal_to (n_rows, n_cols);
174  libmesh_assert_equal_to (m_l, n_rows);
175  libmesh_assert_equal_to (n_l, n_cols);
176 
177 #ifndef NDEBUG
178  // The following variables are only used for assertions,
179  // so avoid declaring them when asserts are inactive.
180  const std::vector<numeric_index_type> & n_nz = this->_sp->get_n_nz();
181  const std::vector<numeric_index_type> & n_oz = this->_sp->get_n_oz();
182 #endif
183 
184  // Make sure the sparsity pattern isn't empty
185  libmesh_assert_equal_to (n_nz.size(), n_l);
186  libmesh_assert_equal_to (n_oz.size(), n_l);
187 
188  if (n_rows==0)
189  return;
190 
191  Q_Constr(&_QMat, const_cast<char *>("Mat"), n_rows, _LPFalse, Rowws, Normal, _LPTrue);
192 
193  this->_is_initialized = true;
194 
195  libmesh_assert_equal_to (n_rows, this->m());
196 }
SparsityPattern::Build const * _sp
与此对象关联的 sparsity pattern。在需要时, 应查询其入口计数(或使用 need_full_sparsity_pattern,模式)。
QMatrix _QMat
Laspack稀疏矩阵指针。
dof_id_type n_dofs() const
Definition: dof_map.h:659
dof_id_type n_dofs_on_processor(const processor_id_type proc) const
Definition: dof_map.h:675
const std::vector< dof_id_type > & get_n_oz() const
The number of off-processor nonzeros in my portion of the global matrix.
virtual bool initialized() const
dof_id_type numeric_index_type
Definition: id_types.h:99
bool _is_initialized
标志,指示矩阵是否已初始化。
const std::vector< dof_id_type > & get_n_nz() const
The number of on-processor nonzeros in my portion of the global matrix.
virtual void clear() override
清空LaspackMatrix对象,释放分配的内存和资源。 这个函数用于清除矩阵的数据和状态。
DofMap const * _dof_map
与此对象关联的 DofMap 对象。可以查询其在处理器上的自由度计数。
virtual numeric_index_type m() const override
返回LaspackMatrix对象的行数。 这个函数用于获取矩阵的行数。
template<typename T>
virtual bool libMesh::SparseMatrix< T >::initialized ( ) const
inlinevirtualinherited
返回
如果矩阵已初始化,则为 true,否则为 false。

在文件 sparse_matrix.h102 行定义.

参考 libMesh::SparseMatrix< T >::_is_initialized.

参考自 libMesh::PetscMatrix< T >::_get_submatrix().

102 { return _is_initialized; }
bool _is_initialized
标志,指示矩阵是否已初始化。
template<typename T >
virtual Real libMesh::LaspackMatrix< T >::l1_norm ( ) const
inlineoverridevirtual

返回矩阵的 $ L^1 $ 范数。当前未实现。

实现了 libMesh::SparseMatrix< T >.

在文件 laspack_matrix.h233 行定义.

233 { libmesh_not_implemented(); return 0.; }
template<typename T >
virtual Real libMesh::LaspackMatrix< T >::linfty_norm ( ) const
inlineoverridevirtual

返回矩阵的 $ L^\infty $ 范数。当前未实现。

实现了 libMesh::SparseMatrix< T >.

在文件 laspack_matrix.h238 行定义.

238 { libmesh_not_implemented(); return 0.; }
template<typename T>
virtual numeric_index_type libMesh::SparseMatrix< T >::local_m ( ) const
inlinevirtualinherited

获取此进程拥有的行数。

libMesh::PetscMatrix< T > 重载.

在文件 sparse_matrix.h212 行定义.

参考 libMesh::SparseMatrix< T >::row_start() , 以及 libMesh::SparseMatrix< T >::row_stop().

212 { return row_stop() - row_start(); }
virtual numeric_index_type row_stop() const =0
virtual numeric_index_type row_start() const =0
template<typename T >
numeric_index_type libMesh::LaspackMatrix< T >::m ( ) const
overridevirtual

返回LaspackMatrix对象的行数。 这个函数用于获取矩阵的行数。

实现了 libMesh::SparseMatrix< T >.

在文件 laspack_matrix.C332 行定义.

参考 libMesh::initialized().

333 {
334  libmesh_assert (this->initialized());
335 
336  return static_cast<numeric_index_type>(Q_GetDim(const_cast<QMatrix*>(&_QMat)));
337 }
QMatrix _QMat
Laspack稀疏矩阵指针。
virtual bool initialized() const
dof_id_type numeric_index_type
Definition: id_types.h:99
template<typename T>
virtual void libMesh::SparseMatrix< T >::matrix_matrix_mult ( SparseMatrix< T > &  ,
SparseMatrix< T > &  ,
bool   
)
inlinevirtualinherited

计算 Y = A*X,其中 X 为矩阵。

libMesh::PetscMatrix< T > 重载.

在文件 sparse_matrix.h290 行定义.

291  { libmesh_not_implemented(); }
template<typename T >
numeric_index_type libMesh::LaspackMatrix< T >::n ( ) const
overridevirtual

返回LaspackMatrix对象的列数。 这个函数用于获取矩阵的列数。

实现了 libMesh::SparseMatrix< T >.

在文件 laspack_matrix.C342 行定义.

参考 libMesh::initialized().

343 {
344  libmesh_assert (this->initialized());
345 
346  return static_cast<numeric_index_type>(Q_GetDim(const_cast<QMatrix*>(&_QMat)));
347 }
QMatrix _QMat
Laspack稀疏矩阵指针。
virtual bool initialized() const
dof_id_type numeric_index_type
Definition: id_types.h:99
static unsigned int libMesh::ReferenceCounter::n_objects ( )
inlinestaticinherited

Prints the number of outstanding (created, but not yet destroyed) objects.

在文件 reference_counter.h85 行定义.

参考 libMesh::ReferenceCounter::_n_objects.

参考自 libMesh::LibMeshInit::~LibMeshInit().

86  { return _n_objects; }
static Threads::atomic< unsigned int > _n_objects
The number of objects.
template<typename T >
virtual bool libMesh::LaspackMatrix< T >::need_full_sparsity_pattern ( ) const
inlineoverridevirtual

LaspackMatrix 需要完整的稀疏性模式。

重载 libMesh::SparseMatrix< T > .

在文件 laspack_matrix.h83 行定义.

84  { return true; }
template<typename T >
T libMesh::LaspackMatrix< T >::operator() ( const numeric_index_type  i,
const numeric_index_type  j 
) const
overridevirtual

获取LaspackMatrix对象的指定位置 $ (i, j) $ 处的值。 这个函数用于获取矩阵的特定元素的值。

实现了 libMesh::SparseMatrix< T >.

在文件 laspack_matrix.C462 行定义.

参考 libMesh::initialized().

464 {
465  libmesh_assert (this->initialized());
466  libmesh_assert_less (i, this->m());
467  libmesh_assert_less (j, this->n());
468 
469  return Q_GetEl (const_cast<QMatrix*>(&_QMat), i+1, j+1);
470 }
QMatrix _QMat
Laspack稀疏矩阵指针。
virtual bool initialized() const
virtual numeric_index_type m() const override
返回LaspackMatrix对象的行数。 这个函数用于获取矩阵的行数。
virtual numeric_index_type n() const override
返回LaspackMatrix对象的列数。 这个函数用于获取矩阵的列数。
template<typename T >
LaspackMatrix& libMesh::LaspackMatrix< T >::operator= ( const LaspackMatrix< T > &  )
delete
template<typename T >
LaspackMatrix& libMesh::LaspackMatrix< T >::operator= ( LaspackMatrix< T > &&  )
delete
template<typename T >
numeric_index_type libMesh::LaspackMatrix< T >::pos ( const numeric_index_type  i,
const numeric_index_type  j 
) const
private
返回
压缩行存储方案中 $ (i,j) $ 元素的位置。
参数
i行索引。
j列索引。

在文件 laspack_matrix.C475 行定义.

477 {
478  libmesh_assert_less (i, this->m());
479  libmesh_assert_less (j, this->n());
480  libmesh_assert_less (i+1, _row_start.size());
481  libmesh_assert (_row_start.back() == _csr.end());
482 
483  // note this requires the _csr to be sorted
484  auto p = std::equal_range (_row_start[i], _row_start[i+1], j);
485 
486  // Make sure the row contains the element j
487  libmesh_assert (p.first != p.second);
488 
489  // Make sure the values match
490  libmesh_assert (*p.first == j);
491 
492  // Return the position in the compressed row
493  return std::distance (_row_start[i], p.first);
494 }
std::vector< numeric_index_type > _csr
压缩行索引。
std::vector< std::vector< numeric_index_type >::const_iterator > _row_start
压缩行索引数据结构中每行的起始位置。
virtual numeric_index_type m() const override
返回LaspackMatrix对象的行数。 这个函数用于获取矩阵的行数。
virtual numeric_index_type n() const override
返回LaspackMatrix对象的列数。 这个函数用于获取矩阵的列数。
template<>
void libMesh::SparseMatrix< Complex >::print ( std::ostream &  os,
const bool  sparse 
) const
inherited

在文件 sparse_matrix.C117 行定义.

参考 std::imag() , 以及 std::real().

118 {
119  // std::complex<>::operator<<() is defined, but use this form
120 
121  if (sparse)
122  {
123  libmesh_not_implemented();
124  }
125 
126  os << "Real part:" << std::endl;
127  for (auto i : make_range(this->m()))
128  {
129  for (auto j : make_range(this->n()))
130  os << std::setw(8) << (*this)(i,j).real() << " ";
131  os << std::endl;
132  }
133 
134  os << std::endl << "Imaginary part:" << std::endl;
135  for (auto i : make_range(this->m()))
136  {
137  for (auto j : make_range(this->n()))
138  os << std::setw(8) << (*this)(i,j).imag() << " ";
139  os << std::endl;
140  }
141 }
boost::multiprecision::float128 real(const boost::multiprecision::float128 in)
virtual numeric_index_type m() const =0
boost::multiprecision::float128 imag(const boost::multiprecision::float128)
virtual numeric_index_type n() const =0
template<typename T >
void libMesh::SparseMatrix< T >::print ( std::ostream &  os = libMesh::out,
const bool  sparse = false 
) const
inherited

将矩阵的内容以统一的样式打印到屏幕上,而不考虑正在使用的矩阵/求解器包。

在文件 sparse_matrix.C225 行定义.

参考 libMesh::initialized().

参考自 libMesh::EigenSparseMatrix< T >::print_personal() , 以及 libMesh::LaspackMatrix< T >::print_personal().

226 {
227  parallel_object_only();
228 
229  libmesh_assert (this->initialized());
230 
231  libmesh_error_msg_if(!this->_dof_map, "Error! Trying to print a matrix with no dof_map set!");
232 
233  // We'll print the matrix from processor 0 to make sure
234  // it's serialized properly
235  if (this->processor_id() == 0)
236  {
237  libmesh_assert_equal_to (this->_dof_map->first_dof(), 0);
238  for (numeric_index_type i=this->_dof_map->first_dof();
239  i!=this->_dof_map->end_dof(); ++i)
240  {
241  if (sparse)
242  {
243  for (auto j : make_range(this->n()))
244  {
245  T c = (*this)(i,j);
246  if (c != static_cast<T>(0.0))
247  {
248  os << i << " " << j << " " << c << std::endl;
249  }
250  }
251  }
252  else
253  {
254  for (auto j : make_range(this->n()))
255  os << (*this)(i,j) << " ";
256  os << std::endl;
257  }
258  }
259 
260  std::vector<numeric_index_type> ibuf, jbuf;
261  std::vector<T> cbuf;
262  numeric_index_type currenti = this->_dof_map->end_dof();
263  for (auto p : IntRange<processor_id_type>(1, this->n_processors()))
264  {
265  this->comm().receive(p, ibuf);
266  this->comm().receive(p, jbuf);
267  this->comm().receive(p, cbuf);
268  libmesh_assert_equal_to (ibuf.size(), jbuf.size());
269  libmesh_assert_equal_to (ibuf.size(), cbuf.size());
270 
271  if (ibuf.empty())
272  continue;
273  libmesh_assert_greater_equal (ibuf.front(), currenti);
274  libmesh_assert_greater_equal (ibuf.back(), ibuf.front());
275 
276  std::size_t currentb = 0;
277  for (;currenti <= ibuf.back(); ++currenti)
278  {
279  if (sparse)
280  {
281  for (numeric_index_type j=0; j<this->n(); j++)
282  {
283  if (currentb < ibuf.size() &&
284  ibuf[currentb] == currenti &&
285  jbuf[currentb] == j)
286  {
287  os << currenti << " " << j << " " << cbuf[currentb] << std::endl;
288  currentb++;
289  }
290  }
291  }
292  else
293  {
294  for (auto j : make_range(this->n()))
295  {
296  if (currentb < ibuf.size() &&
297  ibuf[currentb] == currenti &&
298  jbuf[currentb] == j)
299  {
300  os << cbuf[currentb] << " ";
301  currentb++;
302  }
303  else
304  os << static_cast<T>(0.0) << " ";
305  }
306  os << std::endl;
307  }
308  }
309  }
310  if (!sparse)
311  {
312  for (; currenti != this->m(); ++currenti)
313  {
314  for (numeric_index_type j=0; j<this->n(); j++)
315  os << static_cast<T>(0.0) << " ";
316  os << std::endl;
317  }
318  }
319  }
320  else
321  {
322  std::vector<numeric_index_type> ibuf, jbuf;
323  std::vector<T> cbuf;
324 
325  // We'll assume each processor has access to entire
326  // matrix rows, so (*this)(i,j) is valid if i is a local index.
327  for (numeric_index_type i=this->_dof_map->first_dof();
328  i!=this->_dof_map->end_dof(); ++i)
329  {
330  for (auto j : make_range(this->n()))
331  {
332  T c = (*this)(i,j);
333  if (c != static_cast<T>(0.0))
334  {
335  ibuf.push_back(i);
336  jbuf.push_back(j);
337  cbuf.push_back(c);
338  }
339  }
340  }
341  this->comm().send(0,ibuf);
342  this->comm().send(0,jbuf);
343  this->comm().send(0,cbuf);
344  }
345 }
virtual bool initialized() const
dof_id_type first_dof(const processor_id_type proc) const
Definition: dof_map.h:684
dof_id_type end_dof(const processor_id_type proc) const
Definition: dof_map.h:708
dof_id_type numeric_index_type
Definition: id_types.h:99
virtual numeric_index_type m() const =0
DofMap const * _dof_map
与此对象关联的 DofMap 对象。可以查询其在处理器上的自由度计数。
virtual numeric_index_type n() const =0
void libMesh::ReferenceCounter::print_info ( std::ostream &  out_stream = libMesh::out)
staticinherited

Prints the reference information, by default to libMesh::out.

在文件 reference_counter.C81 行定义.

参考 libMesh::ReferenceCounter::_enable_print_counter , 以及 libMesh::ReferenceCounter::get_info().

参考自 libMesh::LibMeshInit::~LibMeshInit().

82 {
84  out_stream << ReferenceCounter::get_info();
85 }
static std::string get_info()
Gets a string containing the reference information.
static bool _enable_print_counter
Flag to control whether reference count information is printed when print_info is called...
template<typename T>
virtual void libMesh::SparseMatrix< T >::print_matlab ( const std::string &  = "") const
inlinevirtualinherited

以 Matlab 的稀疏矩阵格式打印矩阵的内容。可选择将矩阵打印到名为 name 的文件中。 如果未指定 name ,则将其转储到屏幕上。

libMesh::PetscMatrix< T > 重载.

在文件 sparse_matrix.h376 行定义.

377  {
378  libmesh_not_implemented();
379  }
template<typename T >
virtual void libMesh::LaspackMatrix< T >::print_personal ( std::ostream &  os = libMesh::out) const
inlineoverridevirtual

打印LaspackMatrix对象的信息到指定的输出流(默认为libMesh::out)。 这个函数用于将矩阵的信息输出到指定的输出流中。

实现了 libMesh::SparseMatrix< T >.

在文件 laspack_matrix.h250 行定义.

参考 libMesh::SparseMatrix< T >::print().

250 { this->print(os); }
void print(std::ostream &os=libMesh::out, const bool sparse=false) const
将矩阵的内容以统一的样式打印到屏幕上,而不考虑正在使用的矩阵/求解器包。
template<typename T>
virtual void libMesh::SparseMatrix< T >::reinit_submatrix ( SparseMatrix< T > &  submatrix,
const std::vector< numeric_index_type > &  rows,
const std::vector< numeric_index_type > &  cols 
) const
inlinevirtualinherited

此函数与上述函数类似,但允许您重用 "submatrix" 的现有稀疏性模式,而不是再次分配它。 如果经常提取相同大小的子矩阵,这应该更有效。

在文件 sparse_matrix.h415 行定义.

参考 libMesh::SparseMatrix< T >::_get_submatrix().

418  {
419  this->_get_submatrix(submatrix,
420  rows,
421  cols,
422  true); // true 表示重用 submatrix
423  }
virtual void _get_submatrix(SparseMatrix< T > &, const std::vector< numeric_index_type > &, const std::vector< numeric_index_type > &, const bool) const
创建子矩阵和 reinit_submatrix 例程的受保护实现。
template<typename T >
numeric_index_type libMesh::LaspackMatrix< T >::row_start ( ) const
overridevirtual

返回LaspackMatrix对象的行起始位置。 这个函数用于获取矩阵的行起始位置,通常用于稀疏矩阵的索引操作。

实现了 libMesh::SparseMatrix< T >.

在文件 laspack_matrix.C352 行定义.

353 {
354  return 0;
355 }
template<typename T >
numeric_index_type libMesh::LaspackMatrix< T >::row_stop ( ) const
overridevirtual

返回LaspackMatrix对象的行结束位置。 这个函数用于获取矩阵的行结束位置,通常用于稀疏矩阵的索引操作。

实现了 libMesh::SparseMatrix< T >.

在文件 laspack_matrix.C360 行定义.

361 {
362  return this->m();
363 }
virtual numeric_index_type m() const override
返回LaspackMatrix对象的行数。 这个函数用于获取矩阵的行数。
template<typename T >
void libMesh::LaspackMatrix< T >::set ( const numeric_index_type  i,
const numeric_index_type  j,
const T  value 
)
overridevirtual

设置LaspackMatrix对象的指定位置 $ (i, j) $ 处的值为 value。

参数
i指定元素的行索引。
j指定元素的列索引。
value要设置的值。

实现了 libMesh::SparseMatrix< T >.

在文件 laspack_matrix.C368 行定义.

参考 libMesh::initialized().

371 {
372  libmesh_assert (this->initialized());
373  libmesh_assert_less (i, this->m());
374  libmesh_assert_less (j, this->n());
375 
376  const numeric_index_type position = this->pos(i,j);
377 
378  // Sanity check
379  libmesh_assert_equal_to (*(_row_start[i]+position), j);
380  libmesh_assert_equal_to ((j+1), Q_GetPos (&_QMat, i+1, position));
381 
382  Q_SetEntry (&_QMat, i+1, position, j+1, value);
383 }
QMatrix _QMat
Laspack稀疏矩阵指针。
virtual bool initialized() const
dof_id_type numeric_index_type
Definition: id_types.h:99
std::vector< std::vector< numeric_index_type >::const_iterator > _row_start
压缩行索引数据结构中每行的起始位置。
virtual numeric_index_type m() const override
返回LaspackMatrix对象的行数。 这个函数用于获取矩阵的行数。
virtual numeric_index_type n() const override
返回LaspackMatrix对象的列数。 这个函数用于获取矩阵的列数。
numeric_index_type pos(const numeric_index_type i, const numeric_index_type j) const
template<typename T >
void libMesh::LaspackMatrix< T >::update_sparsity_pattern ( const SparsityPattern::Graph sparsity_pattern)
overridevirtual

更新矩阵的稀疏性模式。这将告诉底层矩阵存储方案如何映射 $ (i,j) $ 元素。

参数
graph稀疏性模式的图形。

重载 libMesh::SparseMatrix< T > .

在文件 laspack_matrix.C42 行定义.

参考 libMesh::initialized().

43 {
44  // clear data, start over
45  this->clear ();
46 
47  // big trouble if this fails!
48  libmesh_assert(this->_dof_map);
49 
50  const numeric_index_type n_rows = sparsity_pattern.size();
51 
52  // Initialize the _row_start data structure,
53  // allocate storage for the _csr array
54  {
55  std::size_t size = 0;
56 
57  for (numeric_index_type row=0; row<n_rows; row++)
58  size += sparsity_pattern[row].size();
59 
60  _csr.resize (size);
61  _row_start.reserve(n_rows + 1);
62  }
63 
64 
65  // Initialize the _csr data structure.
66  {
67  std::vector<numeric_index_type>::iterator position = _csr.begin();
68 
69  _row_start.push_back (position);
70 
71  for (numeric_index_type row=0; row<n_rows; row++)
72  {
73  // insert the row indices
74  for (const auto & col : sparsity_pattern[row])
75  {
76  libmesh_assert (position != _csr.end());
77  *position = col;
78  ++position;
79  }
80 
81  _row_start.push_back (position);
82  }
83  }
84 
85 
86  // Initialize the matrix
87  libmesh_assert (!this->initialized());
88  this->init ();
89  libmesh_assert (this->initialized());
90  //libMesh::out << "n_rows=" << n_rows << std::endl;
91  //libMesh::out << "m()=" << m() << std::endl;
92  libmesh_assert_equal_to (n_rows, this->m());
93 
94  // Tell the matrix about its structure. Initialize it
95  // to zero.
96  for (numeric_index_type i=0; i<n_rows; i++)
97  {
98  auto rs = _row_start[i];
99 
100  const numeric_index_type length = _row_start[i+1] - rs;
101 
102  Q_SetLen (&_QMat, i+1, length);
103 
104  for (numeric_index_type l=0; l<length; l++)
105  {
106  const numeric_index_type j = *(rs+l);
107 
108  // sanity check
109  //libMesh::out << "m()=" << m() << std::endl;
110  //libMesh::out << "(i,j,l) = (" << i
111  // << "," << j
112  // << "," << l
113  // << ")" << std::endl;
114  //libMesh::out << "pos(i,j)=" << pos(i,j)
115  // << std::endl;
116  libmesh_assert_equal_to (this->pos(i,j), l);
117  Q_SetEntry (&_QMat, i+1, l, j+1, 0.);
118  }
119  }
120 
121  // That's it!
122  //libmesh_here();
123 }
std::vector< numeric_index_type > _csr
压缩行索引。
QMatrix _QMat
Laspack稀疏矩阵指针。
virtual bool initialized() const
dof_id_type numeric_index_type
Definition: id_types.h:99
virtual void init(const numeric_index_type m, const numeric_index_type n, const numeric_index_type m_l, const numeric_index_type n_l, const numeric_index_type nnz=30, const numeric_index_type noz=10, const numeric_index_type blocksize=1) override
初始化LaspackMatrix对象的属性,包括矩阵的行数、列数、非零元素的预估数量等。这些参数将影响矩阵的内存分配和性能。
virtual void clear() override
清空LaspackMatrix对象,释放分配的内存和资源。 这个函数用于清除矩阵的数据和状态。
DofMap const * _dof_map
与此对象关联的 DofMap 对象。可以查询其在处理器上的自由度计数。
std::vector< std::vector< numeric_index_type >::const_iterator > _row_start
压缩行索引数据结构中每行的起始位置。
virtual numeric_index_type m() const override
返回LaspackMatrix对象的行数。 这个函数用于获取矩阵的行数。
numeric_index_type pos(const numeric_index_type i, const numeric_index_type j) const
template<typename T >
void libMesh::SparseMatrix< T >::vector_mult ( NumericVector< T > &  dest,
const NumericVector< T > &  arg 
) const
inherited

将矩阵乘以 NumericVector arg 并将结果存储在 NumericVector dest 中。

参数
dest存储结果的目标 NumericVector。
arg乘法的源 NumericVector。
注解
此函数将矩阵乘以 NumericVector arg 并将结果存储在 dest 中。

在文件 sparse_matrix.C195 行定义.

参考 libMesh::NumericVector< T >::zero().

197 {
198  dest.zero();
199  this->vector_mult_add(dest,arg);
200 }
void vector_mult_add(NumericVector< T > &dest, const NumericVector< T > &arg) const
将矩阵乘以 NumericVector arg ,并将结果添加到 NumericVector dest 中。
template<typename T >
void libMesh::SparseMatrix< T >::vector_mult_add ( NumericVector< T > &  dest,
const NumericVector< T > &  arg 
) const
inherited

将矩阵乘以 NumericVector arg ,并将结果添加到 NumericVector dest 中。

在文件 sparse_matrix.C205 行定义.

参考 libMesh::NumericVector< T >::add_vector().

207 {
208  /* This functionality is actually implemented in the \p
209  NumericVector class. */
210  dest.add_vector(arg,*this);
211 }
template<typename T >
void libMesh::LaspackMatrix< T >::zero ( )
overridevirtual

将LaspackMatrix对象的所有元素置零。 这个函数用于将矩阵中的所有元素设置为零。

实现了 libMesh::SparseMatrix< T >.

在文件 laspack_matrix.C270 行定义.

271 {
272  const numeric_index_type n_rows = this->m();
273 
274  for (numeric_index_type row=0; row<n_rows; row++)
275  {
276  auto r_start = _row_start[row];
277 
278  const numeric_index_type len = (_row_start[row+1] - _row_start[row]);
279 
280  // Make sure we agree on the row length
281  libmesh_assert_equal_to (len, Q_GetLen(&_QMat, row+1));
282 
283  for (numeric_index_type l=0; l<len; l++)
284  {
285  const numeric_index_type j = *(r_start + l);
286 
287  // Make sure the data structures are working
288  libmesh_assert_equal_to ((j+1), Q_GetPos (&_QMat, row+1, l));
289 
290  Q_SetEntry (&_QMat, row+1, l, j+1, 0.);
291  }
292  }
293 
294  this->close();
295 }
QMatrix _QMat
Laspack稀疏矩阵指针。
virtual void close() override
关闭LaspackMatrix对象,标记矩阵已经完成构建,不再修改其结构。 这个函数用于标记矩阵的状态为已完成构建,之后不再修改其结构。
dof_id_type numeric_index_type
Definition: id_types.h:99
std::vector< std::vector< numeric_index_type >::const_iterator > _row_start
压缩行索引数据结构中每行的起始位置。
virtual numeric_index_type m() const override
返回LaspackMatrix对象的行数。 这个函数用于获取矩阵的行数。
template<typename T >
std::unique_ptr< SparseMatrix< T > > libMesh::LaspackMatrix< T >::zero_clone ( ) const
overridevirtual

创建一个与LaspackMatrix对象具有相同属性但所有元素为零的新矩阵。 这个函数用于创建一个与原矩阵具有相同大小和属性的全零矩阵。

实现了 libMesh::SparseMatrix< T >.

在文件 laspack_matrix.C300 行定义.

301 {
302  // This function is marked as "not implemented" since it hasn't been
303  // tested, the code below might serve as a possible implementation.
304  libmesh_not_implemented();
305 
306  // Make empty copy with matching comm, initialize, zero, and return.
307  auto mat_copy = std::make_unique<LaspackMatrix<T>>(this->comm());
308  mat_copy->init();
309  mat_copy->zero();
310 
311  // Work around an issue on older compilers. We are able to simply
312  // "return mat_copy;" on newer compilers
313  return std::unique_ptr<SparseMatrix<T>>(mat_copy.release());
314 }
template<typename T >
void libMesh::SparseMatrix< T >::zero_rows ( std::vector< numeric_index_type > &  rows,
diag_value = 0.0 
)
virtualinherited

将所有行条目设置为 0,然后将 diag_value 放在对角线条目。

libMesh::DiagonalMatrix< T > , 以及 libMesh::PetscMatrix< T > 重载.

在文件 sparse_matrix.C216 行定义.

217 {
218  /* This functionality isn't implemented or stubbed in every subclass yet */
219  libmesh_not_implemented();
220 }

友元及相关函数文档

template<typename T >
friend class LaspackLinearSolver< T >
friend

在文件 laspack_matrix.h308 行定义.

template<typename T >
friend class LaspackVector< T >
friend

使其他Laspack数据类型成为友元类。

在文件 laspack_matrix.h307 行定义.

类成员变量说明

template<typename T >
bool libMesh::LaspackMatrix< T >::_closed
private

指示矩阵是否已关闭的标志。

在文件 laspack_matrix.h302 行定义.

参考自 libMesh::LaspackMatrix< T >::closed().

ReferenceCounter::Counts libMesh::ReferenceCounter::_counts
staticprotectedinherited

Actually holds the data.

在文件 reference_counter.h124 行定义.

参考自 libMesh::ReferenceCounter::get_info().

template<typename T >
std::vector<numeric_index_type> libMesh::LaspackMatrix< T >::_csr
private

压缩行索引。

这个成员变量存储了LaspackMatrix对象的稀疏矩阵的压缩行索引 压缩行索引是一种数据结构,用于有效地存储矩阵的非零元素的位置信息,以节省内存和提高计算效率。

在文件 laspack_matrix.h289 行定义.

template<typename T>
DofMap const* libMesh::SparseMatrix< T >::_dof_map
protectedinherited

与此对象关联的 DofMap 对象。可以查询其在处理器上的自由度计数。

在文件 sparse_matrix.h494 行定义.

bool libMesh::ReferenceCounter::_enable_print_counter = true
staticprotectedinherited

Flag to control whether reference count information is printed when print_info is called.

在文件 reference_counter.h143 行定义.

参考自 libMesh::ReferenceCounter::disable_print_counter_info(), libMesh::ReferenceCounter::enable_print_counter_info() , 以及 libMesh::ReferenceCounter::print_info().

template<typename T>
bool libMesh::SparseMatrix< T >::_is_initialized
protectedinherited
Threads::spin_mutex libMesh::ReferenceCounter::_mutex
staticprotectedinherited

Mutual exclusion object to enable thread-safe reference counting.

在文件 reference_counter.h137 行定义.

Threads::atomic< unsigned int > libMesh::ReferenceCounter::_n_objects
staticprotectedinherited

The number of objects.

Print the reference count information when the number returns to 0.

在文件 reference_counter.h132 行定义.

参考自 libMesh::ReferenceCounter::n_objects(), libMesh::ReferenceCounter::ReferenceCounter() , 以及 libMesh::ReferenceCounter::~ReferenceCounter().

template<typename T >
QMatrix libMesh::LaspackMatrix< T >::_QMat
private

Laspack稀疏矩阵指针。

在文件 laspack_matrix.h281 行定义.

template<typename T >
std::vector<std::vector<numeric_index_type>::const_iterator> libMesh::LaspackMatrix< T >::_row_start
private

压缩行索引数据结构中每行的起始位置。

这个成员变量存储了LaspackMatrix对象的稀疏矩阵压缩行索引数据结构中每行的起始位置。 这些起始位置告诉程序在压缩行索引中的哪个位置开始存储每行的非零元素。这有助于高效地访问矩阵的行元素。

在文件 laspack_matrix.h297 行定义.

template<typename T>
SparsityPattern::Build const* libMesh::SparseMatrix< T >::_sp
protectedinherited

与此对象关联的 sparsity pattern。在需要时, 应查询其入口计数(或使用 need_full_sparsity_pattern,模式)。

在文件 sparse_matrix.h500 行定义.


该类的文档由以下文件生成: