⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 diagmtrx.hxx

📁 不错的国外的有限元程序代码,附带详细的manual,可以节省很多的底层工作.
💻 HXX
字号:
//   *****************************
//   *** 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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -