CouplingMatrix Class Reference
#include <coupling_matrix.h>
Public Member Functions | |
| CouplingMatrix (const unsigned int n=0) | |
| unsigned char | operator() (const unsigned int i, const unsigned int j) const |
| unsigned char & | operator() (const unsigned int i, const unsigned int j) |
| unsigned int | size () const |
| void | resize (const unsigned int n) |
| void | clear () |
| bool | empty () const |
Private Attributes | |
| std::vector< unsigned char > | _values |
| unsigned int | _size |
Detailed Description
This class defines a coupling matrix. A coupling matrix is simply a matrix of ones and zeros describing how different components in a system couple with each other. A coupling matrix is necessarily square but not necessarily symmetric.Definition at line 41 of file coupling_matrix.h.
Constructor & Destructor Documentation
| CouplingMatrix::CouplingMatrix | ( | const unsigned int | n = 0 |
) | [inline] |
Member Function Documentation
| void CouplingMatrix::clear | ( | ) | [inline] |
| bool CouplingMatrix::empty | ( | ) | const [inline] |
- Returns:
- true if the matrix is empty.
Definition at line 173 of file coupling_matrix.h.
References _size.
Referenced by SparsityPattern::Build::operator()().
00174 { 00175 return (_size == 0); 00176 }
| unsigned char & CouplingMatrix::operator() | ( | const unsigned int | i, | |
| const unsigned int | j | |||
| ) | [inline] |
| unsigned char CouplingMatrix::operator() | ( | const unsigned int | i, | |
| const unsigned int | j | |||
| ) | const [inline] |
| void CouplingMatrix::resize | ( | const unsigned int | n | ) | [inline] |
Resizes the matrix and initializes all entries to be 0.
Definition at line 150 of file coupling_matrix.h.
References _size, and _values.
Referenced by CouplingMatrix().
00151 { 00152 _size = n; 00153 00154 _values.resize(_size*_size); 00155 00156 for (unsigned int i=0; i<_values.size(); i++) 00157 _values[i] = 0; 00158 }
| unsigned int CouplingMatrix::size | ( | ) | const [inline] |
- Returns:
- the size of the matrix, i.e. N for an NxN matrix.
Definition at line 142 of file coupling_matrix.h.
References _size.
Referenced by SparsityPattern::Build::operator()().
00143 { 00144 return _size; 00145 }
Member Data Documentation
unsigned int CouplingMatrix::_size [private] |
The size of the matrix.
Definition at line 98 of file coupling_matrix.h.
Referenced by clear(), empty(), operator()(), resize(), and size().
std::vector<unsigned char> CouplingMatrix::_values [private] |
The actual matrix values. These are stored as unsigned chars because a vector of bools is not what you think.
Definition at line 93 of file coupling_matrix.h.
Referenced by clear(), operator()(), and resize().
The documentation for this class was generated from the following file: