A simple class to store adjacency information in a compressed format suitable for sparse matrix operations. If built for row-major storage the inner indices are column indices and the pattern should be used as (row,icol), otherwise as (col,irow).
More...
#include <graph_toolbox.hpp>
|
| | CCompressedSparsePattern ()=default |
| | Default construction.
|
| |
| template<class Iterator > |
| | CCompressedSparsePattern (Iterator outerPtrBegin, Iterator outerPtrEnd, Index_t defaultInnerIdx) |
| | Construct with default inner indices.
|
| |
| | CCompressedSparsePattern (su2vector< Index_t > &&outerPtr, su2vector< Index_t > &&innerIdx) |
| | Construct from rvalue refs.
|
| |
| template<class T > |
| | CCompressedSparsePattern (const T &outerPtr, const T &innerIdx) |
| | Construct from vector-like objects of any type with methods "size()" and "data()" (returning a pointer).
|
| |
| template<class T > |
| | CCompressedSparsePattern (const T &lil) |
| | Build from a "list of lists" type object.
|
| |
| void | buildDiagPtr () |
| | Build a list of pointers to the diagonal entries of the pattern.
|
| |
| void | buildTransposePtr () |
| | Build a list of pointers to the transpose entries of the pattern, requires symmetry.
|
| |
| bool | empty () const |
| |
| Index_t | getOuterSize () const |
| |
| Index_t | getNumNonZeros () const |
| |
| Index_t | getNumNonZeros (Index_t iOuterIdx) const |
| |
| Index_t | getInnerIdx (Index_t iOuterIdx, Index_t iNonZero) const |
| |
| Index_t & | getInnerIdx (Index_t iOuterIdx, Index_t iNonZero) |
| |
| CInnerIter | getInnerIter (Index_t iOuterIdx) const |
| |
| Index_t | findInnerIdx (Index_t iOuterIdx, Index_t iInnerIdx) const |
| |
| bool | isNonZero (Index_t iOuterIdx, Index_t iInnerIdx) const |
| |
| Index_t | quickFindInnerIdx (Index_t iOuterIdx, Index_t iInnerIdx) const |
| |
| Index_t | getDiagPtr (Index_t iDiagIdx) const |
| |
| const Index_t * | outerPtr () const |
| |
| const Index_t * | innerIdx () const |
| |
| const Index_t * | innerIdx (Index_t iOuterIdx) const |
| |
| const Index_t * | diagPtr () const |
| |
| const su2vector< Index_t > & | transposePtr () const |
| |
| Index_t | getMinInnerIdx () const |
| |
| Index_t | getMaxInnerIdx () const |
| |
template<typename Index_t>
class CCompressedSparsePattern< Index_t >
A simple class to store adjacency information in a compressed format suitable for sparse matrix operations. If built for row-major storage the inner indices are column indices and the pattern should be used as (row,icol), otherwise as (col,irow).
◆ IndexType
template<typename Index_t >
◆ CCompressedSparsePattern() [1/5]
template<typename Index_t >
◆ CCompressedSparsePattern() [2/5]
template<typename Index_t >
template<class Iterator >
Construct with default inner indices.
- Parameters
-
| [in] | outerPtrBegin | - Start of outer pointers. |
| [in] | outerPtrEnd | - End of outer pointers. |
| [in] | defaultInnerIdx | - Default value for inner indices. |
◆ CCompressedSparsePattern() [3/5]
template<typename Index_t >
Construct from rvalue refs.
- Note
- This is the most efficient constructor as no data copy occurs.
- Parameters
-
| [in] | outerPtr | - Outer index pointers. |
| [in] | innerIdx | - Inner indices. |
◆ CCompressedSparsePattern() [4/5]
template<typename Index_t >
template<class T >
Construct from vector-like objects of any type with methods "size()" and "data()" (returning a pointer).
- Parameters
-
| [in] | outerPtr | - Outer index pointers. |
| [in] | innerIdx | - Inner indices. |
◆ CCompressedSparsePattern() [5/5]
template<typename Index_t >
template<class T >
Build from a "list of lists" type object.
- Parameters
-
| [in] | lil | - An object with operator [][] and method "size" e.g. vector<vector<?> >. |
◆ buildDiagPtr()
template<typename Index_t >
Build a list of pointers to the diagonal entries of the pattern.
◆ buildTransposePtr()
template<typename Index_t >
Build a list of pointers to the transpose entries of the pattern, requires symmetry.
◆ diagPtr()
template<typename Index_t >
- Returns
- Raw pointer to the diagonal pointer vector.
◆ empty()
template<typename Index_t >
- Returns
- True if the pattern is empty, i.e. has not been built yet.
◆ findInnerIdx()
template<typename Index_t >
- Parameters
-
| [in] | iOuterIdx | - Outer index (row/col). |
| [in] | iInnerIdx | - Inner index (col/row). |
- Returns
- Absolute position of non zero entry (iOuterIdx,iInnerIdx), or NNZ if position does not belong to the pattern.
◆ getDiagPtr()
template<typename Index_t >
- Parameters
-
| [in] | iDiagIdx | - Diagonal index (row == col). |
- Returns
- Absolute position of the diagonal entry.
◆ getInnerIdx() [1/2]
template<typename Index_t >
- Parameters
-
| [in] | iOuterIdx | - Outer index. |
| [in] | iNonZero | - Relative position of the inner index. |
- Returns
- The index of the i'th inner index associated with the outer index.
◆ getInnerIdx() [2/2]
template<typename Index_t >
- Parameters
-
| [in] | iOuterIdx | - Outer index. |
| [in] | iNonZero | - Relative position of the inner index. |
- Returns
- The index of the i'th inner index associated with the outer index.
◆ getInnerIter()
template<typename Index_t >
- Parameters
-
| [in] | iOuterIdx | - Outer index. |
- Returns
- Iterator to inner dimension to use in range for loops.
◆ getMaxInnerIdx()
template<typename Index_t >
- Returns
- The maximum inner index.
◆ getMinInnerIdx()
template<typename Index_t >
- Returns
- The minimum inner index.
◆ getNumNonZeros() [1/2]
template<typename Index_t >
- Returns
- Number of non zero entries.
◆ getNumNonZeros() [2/2]
template<typename Index_t >
- Parameters
-
| [in] | iOuterIdx | - Outer index. |
- Returns
- Number of inner indices associated with the outer index.
◆ getOuterSize()
template<typename Index_t >
- Returns
- Number of rows/columns.
◆ innerIdx() [1/2]
template<typename Index_t >
- Returns
- Raw pointer to the inner index vector.
◆ innerIdx() [2/2]
template<typename Index_t >
- Returns
- Raw pointer to the inner index vector, offset for a given outer index.
◆ isNonZero()
template<typename Index_t >
- Parameters
-
| [in] | iOuterIdx | - Outer index (row/col). |
| [in] | iInnerIdx | - Inner index (col/row). |
- Returns
- True if (iOuterIdx,iInnerIdx) exists, i.e. is non zero.
◆ outerPtr()
template<typename Index_t >
- Returns
- Raw pointer to the outer pointer vector.
◆ quickFindInnerIdx()
template<typename Index_t >
- Parameters
-
| [in] | iOuterIdx | - Outer index (row/col). |
| [in] | iInnerIdx | - Inner index (col/row). |
- Returns
- Absolute position of non zero entry (iOuterIdx,iInnerIdx).
- Note
- This method is only safe if the entry exists.
◆ transposePtr()
template<typename Index_t >
- Returns
- Raw pointer to the transpose pointer vector.
The documentation for this class was generated from the following file: