![]() |
OGS
|
Lis vector wrapper class.
Definition at line 30 of file LisVector.h.
#include <LisVector.h>
Public Types | |
| using | IndexType = LIS_INT |
Public Member Functions | |
| LisVector (std::size_t length) | |
| LisVector (std::size_t length, double *data) | |
| LisVector (LisVector const &src) | |
| copy constructor | |
| virtual | ~LisVector () |
| std::size_t | size () const |
| return a vector length | |
| std::size_t | getRangeBegin () const |
| return a start index of the active data range | |
| std::size_t | getRangeEnd () const |
| return an end index of the active data range | |
| void | setZero () |
| double | operator[] (IndexType rowId) const |
| access entry | |
| double | get (IndexType rowId) const |
| get entry | |
| void | set (IndexType rowId, double v) |
| set entry | |
| void | add (IndexType rowId, double v) |
| add entry | |
| void | write (const std::string &filename) const |
| printout this equation for debugging | |
| LIS_VECTOR & | getRawVector () |
| return a raw Lis vector object | |
| template<class T_SUBVEC> | |
| void | set (const std::vector< IndexType > &pos, const T_SUBVEC &sub_vec) |
| set entries | |
| template<class T_SUBVEC> | |
| void | add (const std::vector< IndexType > &pos, const T_SUBVEC &sub_vec) |
| add entries | |
| void | copyValues (std::vector< double > &u) const |
| void | copyValues (std::span< double > u) const |
Private Attributes | |
| LIS_VECTOR | vec_ |
| using MathLib::LisVector::IndexType = LIS_INT |
Definition at line 33 of file LisVector.h.
|
explicit |
Constructor for initialization of the number of rows
| length | number of rows |
Definition at line 21 of file LisVector.cpp.
References vec_.
Referenced by LisVector().
| MathLib::LisVector::LisVector | ( | std::size_t | length, |
| double * | data ) |
Constructor using the given raw data
| length | the length of the vector |
| data | the raw data |
Definition at line 27 of file LisVector.cpp.
References vec_.
| MathLib::LisVector::LisVector | ( | LisVector const & | src | ) |
|
virtual |
|
inline |
add entries
Definition at line 107 of file LisVector.h.
References add().
|
inline |
add entry
Definition at line 84 of file LisVector.h.
References MathLib::v, and vec_.
Referenced by add().
|
inline |
Copy local entries to a span.
| u | a span for the values of local entries of correct size. If the sizes mismatch, exception will be thrown. |
Definition at line 127 of file LisVector.h.
References OGS_FATAL, size(), MathLib::u, and vec_.
|
inline |
Copy local entries to a vector.
| u | a vector for the values of local entries. It will be resized to hold the current vector data. |
Definition at line 118 of file LisVector.h.
References size(), MathLib::u, and vec_.
|
inline |
get entry
Definition at line 70 of file LisVector.h.
References MathLib::v, and vec_.
Referenced by operator[]().
|
inline |
return a start index of the active data range
Definition at line 60 of file LisVector.h.
|
inline |
return an end index of the active data range
Definition at line 62 of file LisVector.h.
References size().
|
inline |
return a raw Lis vector object
Definition at line 93 of file LisVector.h.
References vec_.
Referenced by MathLib::EigenLisLinearSolver::solve().
|
inline |
|
inline |
set entries
Definition at line 97 of file LisVector.h.
References set().
|
inline |
set entry
Definition at line 78 of file LisVector.h.
References MathLib::v, and vec_.
Referenced by set().
|
inline |
| std::size_t MathLib::LisVector::size | ( | ) | const |
return a vector length
Definition at line 46 of file LisVector.cpp.
References MathLib::checkLisError(), size(), and vec_.
Referenced by copyValues(), copyValues(), getRangeEnd(), size(), and MathLib::EigenLisLinearSolver::solve().
| void MathLib::LisVector::write | ( | const std::string & | filename | ) | const |
|
private |
Definition at line 141 of file LisVector.h.
Referenced by LisVector(), LisVector(), LisVector(), ~LisVector(), add(), copyValues(), copyValues(), get(), getRawVector(), set(), setZero(), size(), and write().