当前位置: 首页>>代码示例>>C++>>正文


C++ array2d::size方法代码示例

本文整理汇总了C++中array2d::size方法的典型用法代码示例。如果您正苦于以下问题:C++ array2d::size方法的具体用法?C++ array2d::size怎么用?C++ array2d::size使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在array2d的用法示例。


在下文中一共展示了array2d::size方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ParaDividing

int HMatrix::ParaDividing( 
		const array2d &vec2,
		array2d &product
	) const
{
	if(nColumns != (int)vec2[0].size())
	{
//		cout << "MatrixParaProduct has different columns for vec1 and vec2!" << endl;
		return -1;
	}

	product.resize( vec2.size(), array1d(nRows) );

	for (int i=0; i<(int)vec2.size(); i++)
	{
		for (int j=0; j<nRows; j++)
		{
			product[i][j] = 0.0;
			for (int k=0; k<nColumns; k++)
			{
				product[i][j] += data[j][k] / vec2[i][k];
			}
			if(product[i][j] == 0.0) product[i][j] = EPS;
		}
	}

	return 1;
}
开发者ID:cran,项目名称:gnmf,代码行数:28,代码来源:HMatrix.cpp

示例2: du

inline void
time_step_indexed(array2d& u, const Constants& c)
{
  // compute du/dt
  array2d du(c.nx, c.ny, u.rate(), 0, u.cache_size());
  for (int y = 1; y < c.ny - 1; y++) {
    for (int x = 1; x < c.nx - 1; x++) {
      double uxx = (u(x - 1, y) - 2 * u(x, y) + u(x + 1, y)) / (c.dx * c.dx);
      double uyy = (u(x, y - 1) - 2 * u(x, y) + u(x, y + 1)) / (c.dy * c.dy);
      du(x, y) = c.dt * c.k * (uxx + uyy);
    }
  }
  // take forward Euler step
  for (uint i = 0; i < u.size(); i++)
    u[i] += du[i];
}
开发者ID:LLNL,项目名称:ZFP,代码行数:16,代码来源:diffusion.cpp


注:本文中的array2d::size方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。