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

📄 samplist.h

📁 c++的数学物理方程数值算法源程序。这是"Numerical Methods for Physics"第二版的源程序。
💻 H
字号:
class SampList {public:// Class data (sorting lists)
int ncell, nsamp;
double *ave_n, *ave_ux, *ave_uy, *ave_uz, *ave_T;

// Default Constructor. SampList() {
  initLists(1);}// Regular Constructor. SampList(int ncell_in) {
  initLists(ncell_in);
}

// Destructor. Called when a SampList object goes out of scope.~SampList() {  delete [] ave_n;   // Release allocated memory
  delete [] ave_ux;
  delete [] ave_uy;
  delete [] ave_uz;
  delete [] ave_T;
}
//*********************************************************

private:
// Initialization routine
void initLists(int ncell_in) {
  ncell = ncell_in;
  nsamp = 0;
  ave_n = new double [ncell+1];  // Allocate memory
  ave_ux = new double [ncell+1];
  ave_uy = new double [ncell+1];
  ave_uz = new double [ncell+1];
  ave_T = new double [ncell+1];
  int i;
  for( i=1; i<=ncell; i++ ) {
	ave_n[i] = 0;
	ave_ux[i] = 0;
	ave_uy[i] = 0;
	ave_uz[i] = 0;
	ave_T[i] = 0;
  }
}
}; // Class SampList

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -