ParMooN
 All Classes Functions Variables Friends Pages
Public Member Functions | Protected Attributes | Friends | List of all members
TMatrix2D Class Reference
Inheritance diagram for TMatrix2D:
Inheritance graph
[legend]
Collaboration diagram for TMatrix2D:
Collaboration graph
[legend]

Public Member Functions

 TMatrix2D (TStructure2D *structure)
 
 TMatrix2D ()
 generate empty matrix
 
void SetStructure (TStructure2D *structure)
 fill empty matrix, More...
 
 ~TMatrix2D ()
 
TStructure2DGetStructure () const
 
TMatrix2Doperator*= (double alpha)
 scale all active rows
 
void resetNonActive ()
 set all Dirichlet rows to zero. That means all rows where the test space has nonactive degrees of freedom.
 
- Public Member Functions inherited from TMatrix
 TMatrix (TStructure *structure)
 
 TMatrix (TStructure *structure, double *Entries)
 
void SetStructure (TStructure *structure)
 reset the structure, this may mean that the entries need to be reallocated
 
 TMatrix (int nRows, int nCols)
 
 ~TMatrix ()
 
void Reset ()
 
int GetN_Rows () const
 
int GetN_Columns () const
 
int GetN_Entries () const
 
int GetHangingN_Entries () const
 
int * GetKCol () const
 
int * GetHangingKCol () const
 
int * GetHangingRowPtr () const
 
int * GetRowPtr () const
 
TStructureGetStructure () const
 
double * GetEntries () const
 
double GetNorm (int p=-1) const
 
int Write (const char *filename) const
 
void Print (const char *name="a") const
 Print matrix into the shell.
 
void PrintFull (std::string name="", int fieldWidth=4) const
 print the full matrix, including all zeros More...
 
void add (int i, int j, double val)
 
void add (int i, std::map< int, double > vals, double factor=1.0)
 
void add (std::map< int, std::map< int, double > > vals, double factor=1.0)
 
void set (int i, int j, double val)
 
const double & get (int i, int j) const
 
double & get (int i, int j)
 
void setEntries (double *entries)
 
TMatrixGetTransposed () const
 return a new TMatrix which is the transposed of this matrix More...
 
void changeRows (std::map< int, std::map< int, double > > entries, bool deleteOldArrays=false)
 replace several rows in the matrix with new entries. More...
 
virtual TMatrixoperator+= (const TMatrix *A)
 add another matrix to this one More...
 
virtual TMatrixoperator-= (const TMatrix *A)
 substract another matrix to this one More...
 
virtual TMatrixoperator+= (const TMatrix &A)
 add another matrix to this one More...
 
TMatrixoperator= (const TMatrix &A)
 copy entries from A to this More...
 
void multiply (const double *const x, double *y, double a=1.0) const
 compute y += a * A*x More...
 
TMatrixmultiply (const TMatrix *const B, double a=1.0) const
 compute matrix-matrix product C = a*A*B, More...
 
void scale (const double *const factor, bool from_left=true)
 scale a matrix using a vector More...
 
void remove_zeros (double tol=0.0)
 remove all entries from sparsity structure where a zero is stored More...
 
double & operator() (const int i, const int j)
 get/set a specific matrix entry More...
 
const double & operator() (const int i, const int j) const
 get a specific matrix entry More...
 

Protected Attributes

TStructure2Dstructure
 
- Protected Attributes inherited from TMatrix
TStructurestructure
 
double * Entries
 

Friends

TMatrix2Doperator+ (const TMatrix2D &A, const TMatrix2D &B)
 add two matrices A and B More...
 
TMatrix2Doperator- (const TMatrix2D &A, const TMatrix2D &B)
 substract matrices A and B, i.e. C = A - B More...
 
TMatrix2Doperator* (const TMatrix2D &A, const double alpha)
 C = A*alpha. More...
 
TMatrix2Doperator* (const double alpha, const TMatrix2D &A)
 C = alpha*A. More...
 
double * operator* (const TMatrix2D &A, const double *x)
 y = A*x More...
 

Constructor & Destructor Documentation

TMatrix2D::TMatrix2D ( TStructure2D structure)

generate the matrix

TMatrix2D::~TMatrix2D ( )

destructor: free Entries array

Member Function Documentation

void TMatrix2D::SetStructure ( TStructure2D structure)

fill empty matrix,

you can either call the constructor TMatrix2D(TStructure2D*); or use TMatrix2D(); and then void SetStructure(TStructure2D*);

Friends And Related Function Documentation

TMatrix2D& operator* ( const TMatrix2D A,
const double  alpha 
)
friend

C = A*alpha.

C will consist of the active entries of A scaled by alpha. C will have zero entries in nonactive rows.

TMatrix2D& operator* ( const double  alpha,
const TMatrix2D A 
)
friend
double* operator* ( const TMatrix2D A,
const double *  x 
)
friend

y = A*x

note: only active DOF are multiplied, others are just copied from x note: the user has to delete y

TMatrix2D& operator+ ( const TMatrix2D A,
const TMatrix2D B 
)
friend

add two matrices A and B

note: only active DOF are added note: only works for matrices with the same sparsity pattern

TMatrix2D& operator- ( const TMatrix2D A,
const TMatrix2D B 
)
friend

substract matrices A and B, i.e. C = A - B

note: only active DOF are substracted note: only works for matrices with the same sparsity pattern

Member Data Documentation

TStructure2D* TMatrix2D::structure
protected

matrix structure


The documentation for this class was generated from the following files: