1 #ifndef _FdEnergyDepositFinderKG_LinearAlgebra_h_
2 #define _FdEnergyDepositFinderKG_LinearAlgebra_h_
4 #include <utl/AugerException.h>
8 namespace FdEnergyDepositFinderKG {
19 class LowerTriangularMatrix;
74 const double&
operator()(
const int row,
const int col)
const
75 {
return fElements[(row*(row+1))/2 + col]; }
78 {
return fElements[(row*(row+1))/2 + col]; }
120 const double&
operator()(
const int row,
const int col)
const;
122 double&
operator()(
const int row,
const int col);
159 : AugerException(message) { }
162 virtual std::string GetExceptionName()
const
163 {
return "Singular Matrix Exception"; }
void Clear()
Free the vector (requiring another SetSize(n) call for reuse)
const double & operator()(const int row, const int col) const
Read-only access to a matrix element.
ColumnVector()
Empty row vector (needs SetSize() later)
const double & operator()(const int row, const int col) const
Read-only access to a matrix element.
void Zero()
Set all elements to 0.
Base class for all exceptions used in the auger offline code.
DiagonalMatrix(const int n)
(n*n) diagonal matrix
void SetSize(const int n)
Set the size of the vector. Does NOT initialize elements to 0.
unsigned int GetSize() const
DiagonalMatrix GetInverse() const
ColumnVector operator*(const ColumnVector &rhs) const
void SetSize(const int n)
DiagonalMatrix(const int n, const double x)
(n*n) diagonal matrix, elements intialized to x
LowerTriangularMatrix(const int n)
(n*n) lower triangular matrix
LowerTriangularMatrix operator+(const LowerTriangularMatrix &rhs) const
LowerTriangularMatrix()
Empty matrix (needs SetSize() later)
ColumnVector(const int n, const double x)
Row vector with n elements, intializing to x.
ColumnVector operator+(const ColumnVector &rhs) const
void Clear()
Free the matrix (requiring another SetSize(n) call for reuse)
std::vector< double > fElements
double & operator()(const int row, const int col)
Read/write access to a matrix element.
void Zero()
Set all elements to 0.
unsigned int GetSize() const
LowerTriangularMatrix GetInverse() const
Get the inverse of the matrix.
void Print() const
Dump ASCII representation to STDOUT (for debugging)
ColumnVector operator*(const ColumnVector &rhs) const
const double & operator()(const int iDiagonal) const
Read-only access to a diagonal matrix element.
void SetSize(const int n)
double & operator()(const int row)
Read/write access to a vector element.
std::vector< double > fElements
LowerTriangularMatrix(const int n, const double x)
(n*n) lower triangular matrix, elements intialized to x
DiagonalMatrix operator+(const DiagonalMatrix &rhs) const
void Zero()
Set all elements to 0.
unsigned int GetSize() const
double & operator()(const int iDiagonal)
Read/write access to a diagonal matrix element.
void Print() const
Dump ASCII representation to STDOUT (for debugging)
DiagonalMatrix()
Empty matrix (needs SetSize() later)
const double & operator()(const int row) const
Read-only access to a vector element.
ColumnVector(const int n)
Row vector with n elements.
void Clear()
Free the matrix (requiring another SetSize(n) call for reuse)
std::vector< double > fElements