CppNoddy
0.92
|
A matrix class that constructs a BANDED matrix. More...
#include <BandedMatrix.h>
Public Types | |
typedef DenseVector< _Type >::elt_iter | elt_iter |
Public Member Functions | |
BandedMatrix () | |
Empty constructor .. should we stop this? More... | |
void | blank () |
BandedMatrix (const std::size_t &rows, const std::size_t &offdiag, const _Type &fill) | |
Noddy Banded Matrix constructor. More... | |
BandedMatrix (const BandedMatrix &source) | |
Copy constructor. More... | |
BandedMatrix & | operator= (const BandedMatrix &source) |
Assignment operator. More... | |
const _Type & | operator() (const std::size_t &row, const std::size_t &col) const |
Access operator. More... | |
_Type & | operator() (const std::size_t &row, const std::size_t &col) |
Access operator. More... | |
const _Type & | get (const std::size_t &row, const std::size_t &col) const |
Access operator. More... | |
_Type & | set (const std::size_t &row, const std::size_t &col) |
Access operator. More... | |
std::size_t | nrows () const |
Get the number of rows. More... | |
std::size_t | ncols () const |
Get the number of columns. More... | |
std::size_t | nelts () const |
Get the number of elements. More... | |
void | scale (const _Type &mult) |
Scale all entries in the matrix by a scalar. More... | |
void | transpose () |
Transpose the matrix. More... | |
double | one_norm () const |
double | two_norm () const |
double | inf_norm () const |
double | frob_norm () const |
DenseVector< _Type > | multiply (const DenseVector< _Type > &X) const |
Right multiply the matrix by a DENSE vector. More... | |
void | dump () const |
Output the matrix contents to std::cout. More... | |
void | assign (_Type elt) |
Assign a value the matrix so that it has the same geometry, but zero entries in all locations including those reserved for pivotting. More... | |
std::size_t | noffdiag () const |
Get the number of off-diagonal elements where the total INPUT band width is 2*noffdiag+1 since the band structure is symmetric. More... | |
void | row_swap (const std::size_t &row1, const std::size_t &row2) |
Exchange rows in the matrix. More... | |
double * | base () |
Allow direct access to the vector m_storage. More... | |
elt_iter | get_elt_iter (std::size_t row, std::size_t col) |
double * | base () |
double * | base () |
![]() | |
Sequential_Matrix_base () | |
An empty constructor. More... | |
virtual | ~Sequential_Matrix_base () |
virtual const _Type & | operator() (const std::size_t &row, const std::size_t &col) const =0 |
virtual _Type & | operator() (const std::size_t &row, const std::size_t &col)=0 |
virtual const _Type & | get (const std::size_t &row, const std::size_t &col) const =0 |
virtual _Type & | set (const std::size_t &row, const std::size_t &col)=0 |
virtual std::size_t | nrows () const =0 |
virtual std::size_t | ncols () const =0 |
virtual std::size_t | nelts () const =0 |
virtual void | scale (const _Type &mult)=0 |
virtual void | dump () const =0 |
Public Attributes | |
DenseVector< _Type > | m_storage |
A contiguous vector. More... | |
std::size_t | m_N |
The number of rows/cols in the matrix. More... | |
std::size_t | m_L |
Max number of (INPUT) bands above OR below the main diagonal. More... | |
A matrix class that constructs a BANDED matrix.
Definition at line 16 of file BandedMatrix.h.
typedef DenseVector<_Type>::elt_iter CppNoddy::BandedMatrix< _Type >::elt_iter |
Definition at line 20 of file BandedMatrix.h.
|
inline |
CppNoddy::BandedMatrix< _Type >::BandedMatrix | ( | const std::size_t & | rows, |
const std::size_t & | offdiag, | ||
const _Type & | fill | ||
) |
Noddy Banded Matrix constructor.
rows | The number of rows in the matrix. |
offdiag | The maximum number of bands above OR below the diagonal. The total number stored will be 3 * offdiag + 1; i.e. assumes the number of offdiagonal elts is the same both above and below, and we must an extra 'offdiag' because of fill-in during pivotting. |
fill | The initial value to be placed in each element of the banded matrix. |
Definition at line 16 of file BandedMatrix.cpp.
References CppNoddy::BandedMatrix< _Type >::m_L, CppNoddy::BandedMatrix< _Type >::m_N, and CppNoddy::BandedMatrix< _Type >::m_storage.
CppNoddy::BandedMatrix< _Type >::BandedMatrix | ( | const BandedMatrix< _Type > & | source | ) |
Copy constructor.
source | The source object to be copied |
Definition at line 31 of file BandedMatrix.cpp.
|
inline |
Assign a value the matrix so that it has the same geometry, but zero entries in all locations including those reserved for pivotting.
elt | The value to be assigned to all entries |
Definition at line 106 of file BandedMatrix.h.
References CppNoddy::BandedMatrix< _Type >::m_storage.
Referenced by CppNoddy::PDE_IBVP< _Type >::assemble_matrix_problem().
double * CppNoddy::BandedMatrix< _Type >::base | ( | ) |
Allow direct access to the vector m_storage.
Dangerous, but used for passing to LAPACK.
double * CppNoddy::BandedMatrix< double >::base | ( | ) |
Definition at line 160 of file BandedMatrix.cpp.
double * CppNoddy::BandedMatrix< std::complex< double > >::base | ( | ) |
Definition at line 165 of file BandedMatrix.cpp.
|
inline |
Definition at line 26 of file BandedMatrix.h.
References CppNoddy::BandedMatrix< _Type >::m_L, CppNoddy::BandedMatrix< _Type >::m_N, and CppNoddy::BandedMatrix< _Type >::m_storage.
|
virtual |
Output the matrix contents to std::cout.
Implements CppNoddy::Sequential_Matrix_base< _Type >.
Definition at line 137 of file BandedMatrix.cpp.
double CppNoddy::BandedMatrix< _Type >::frob_norm |
Definition at line 126 of file BandedMatrix.cpp.
References CppNoddy::DenseVector< _Type >::two_norm().
|
inlinevirtual |
Access operator.
Implements CppNoddy::Sequential_Matrix_base< _Type >.
Definition at line 205 of file BandedMatrix.h.
|
inline |
Definition at line 127 of file BandedMatrix.h.
References CppNoddy::BandedMatrix< _Type >::m_L, and CppNoddy::BandedMatrix< _Type >::m_storage.
Referenced by CppNoddy::PDE_IBVP< _Type >::assemble_matrix_problem().
double CppNoddy::BandedMatrix< _Type >::inf_norm |
Definition at line 114 of file BandedMatrix.cpp.
References CppNoddy::DenseVector< _Type >::inf_norm().
DenseVector< _Type > CppNoddy::BandedMatrix< _Type >::multiply | ( | const DenseVector< _Type > & | X | ) | const |
Right multiply the matrix by a DENSE vector.
X | The DENSE vector to multiply by |
Definition at line 58 of file BandedMatrix.cpp.
|
inlinevirtual |
Get the number of columns.
Implements CppNoddy::Sequential_Matrix_base< _Type >.
Definition at line 222 of file BandedMatrix.h.
|
virtual |
Get the number of elements.
Implements CppNoddy::Sequential_Matrix_base< _Type >.
Definition at line 47 of file BandedMatrix.cpp.
|
inline |
Get the number of off-diagonal elements where the total INPUT band width is 2*noffdiag+1 since the band structure is symmetric.
Definition at line 227 of file BandedMatrix.h.
Referenced by CppNoddy::PDE_IBVP< _Type >::assemble_matrix_problem(), and main().
|
inlinevirtual |
Get the number of rows.
Implements CppNoddy::Sequential_Matrix_base< _Type >.
Definition at line 217 of file BandedMatrix.h.
double CppNoddy::BandedMatrix< _Type >::one_norm |
Definition at line 90 of file BandedMatrix.cpp.
References CppNoddy::DenseVector< _Type >::one_norm().
|
inlinevirtual |
Access operator.
Implements CppNoddy::Sequential_Matrix_base< _Type >.
Definition at line 175 of file BandedMatrix.h.
|
inlinevirtual |
Access operator.
Implements CppNoddy::Sequential_Matrix_base< _Type >.
Definition at line 147 of file BandedMatrix.h.
|
inline |
void CppNoddy::BandedMatrix< _Type >::row_swap | ( | const std::size_t & | row1, |
const std::size_t & | row2 | ||
) |
Exchange rows in the matrix.
row1 | First row to be swapped |
row2 | Second row to be swapped |
Definition at line 79 of file BandedMatrix.cpp.
|
virtual |
Scale all entries in the matrix by a scalar.
mult | The scalar multiplier |
Implements CppNoddy::Sequential_Matrix_base< _Type >.
Definition at line 52 of file BandedMatrix.cpp.
|
inlinevirtual |
Access operator.
Implements CppNoddy::Sequential_Matrix_base< _Type >.
Definition at line 211 of file BandedMatrix.h.
void CppNoddy::BandedMatrix< _Type >::transpose |
Transpose the matrix.
Definition at line 68 of file BandedMatrix.cpp.
double CppNoddy::BandedMatrix< _Type >::two_norm |
Definition at line 102 of file BandedMatrix.cpp.
References CppNoddy::DenseVector< _Type >::two_norm().
std::size_t CppNoddy::BandedMatrix< _Type >::m_L |
Max number of (INPUT) bands above OR below the main diagonal.
Definition at line 138 of file BandedMatrix.h.
Referenced by CppNoddy::BandedMatrix< _Type >::BandedMatrix(), CppNoddy::BandedMatrix< _Type >::blank(), and CppNoddy::BandedMatrix< _Type >::get_elt_iter().
std::size_t CppNoddy::BandedMatrix< _Type >::m_N |
The number of rows/cols in the matrix.
Definition at line 136 of file BandedMatrix.h.
Referenced by CppNoddy::BandedMatrix< _Type >::BandedMatrix(), and CppNoddy::BandedMatrix< _Type >::blank().
DenseVector<_Type> CppNoddy::BandedMatrix< _Type >::m_storage |
A contiguous vector.
Definition at line 134 of file BandedMatrix.h.
Referenced by CppNoddy::BandedMatrix< _Type >::assign(), CppNoddy::BandedMatrix< _Type >::BandedMatrix(), CppNoddy::BandedMatrix< _Type >::blank(), and CppNoddy::BandedMatrix< _Type >::get_elt_iter().
© 2012
R.E. Hewitt