diagmtrx.hxx
来自「不错的国外的有限元程序代码,附带详细的manual,可以节省很多的底层工作.」· HXX 代码 · 共 39 行
HXX
39 行
// *****************************
// *** CLASS DIAGONAL MATRIX ***
// *****************************
#include "flotmtrx.hxx"
#include "debug.def"
class DiagonalMatrix : public FloatMatrix
/*
This class implements a square matrix containing non zero coefficients
only on the diagonal. Diagonal matrices are typically used as mass
matrices of finite elements.
DESCRIPTION :
A diagonal matrix of size n has nRows=n and nColumns=1. 'values' stores
only the n diagonal coefficients.
TASKS :
Similar to a standard FloatMatrix.
*/
{
enum { FALSE , TRUE } ;
public :
DiagonalMatrix (int n) : FloatMatrix(n,1) { }
# ifdef DEBUG
double& at (int i,int j)
{this->checkBounds(i,j) ; return values[i-1];}
# else
double& at (int i,int j) { return values[i-1] ;}
# endif
void checkBounds (int,int) ;
FloatMatrix* GiveCopy () ;
int isDiagonal () { return TRUE ;}
void printYourself () ;
} ;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?