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


C++ matrix_type::at方法代码示例

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


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

示例1: ir

	static scalar_type ir(int row, int col, const matrix_type& m)
	{
		BOOST_ASSERT(row >= 0);
		BOOST_ASSERT(row < rows);
		BOOST_ASSERT(col >= 0);
		BOOST_ASSERT(col < cols);
		return m.at(col, row);
	}
开发者ID:13793297073,项目名称:ERICLI,代码行数:8,代码来源:matrix_traits.hpp

示例2: r

	static scalar_type r(const matrix_type& m)
	{
		BOOST_STATIC_ASSERT(Row >= 0);
		BOOST_STATIC_ASSERT(Row < rows);
		BOOST_STATIC_ASSERT(Col >= 0);
		BOOST_STATIC_ASSERT(Col < cols);
		return m.at(Col, Row);
	}
开发者ID:13793297073,项目名称:ERICLI,代码行数:8,代码来源:matrix_traits.hpp

示例3: fill_from_file

void fill_from_file(matrix_type& tens, const std::string& str)
{
   std::ifstream ifs(str);
   for(int j = 0 ; j < tens.extent<1>(); ++j)
      for(int i = 0 ; i < tens.extent<0>(); ++i)
   {
      ifs >> tens.at(i,j);
   }
}
开发者ID:IanHG,项目名称:tensor_code_generator.spirit,代码行数:9,代码来源:main_libmda.cpp

示例4: print

void print(const matrix_type& mat, const std::string& str)
{
   std::ofstream of(str);
   of << std::showpos;
   using limit_type = std::numeric_limits<typename matrix_type::value_type>;
   of << std::scientific;
   of << std::setprecision(limit_type::max_digits10);
   for(int j = 0 ; j < mat.extent<1>(); ++j)
      for(int i = 0 ; i < mat.extent<0>(); ++i)
   {
      of << mat.at(i,j) << std::endl;
   }
}
开发者ID:IanHG,项目名称:tensor_code_generator.spirit,代码行数:13,代码来源:main_libmda.cpp


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