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


C++ MatrixT::size2方法代码示例

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


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

示例1: backwardSolve

void backwardSolve(MatrixT const & R, VectorT const & y, VectorT & x)
{
  for (long i2 = static_cast<long>(R.size2())-1; i2 >= 0; i2--)
  {
    vcl_size_t i = static_cast<vcl_size_t>(i2);
    x(i) = y(i);
    for (vcl_size_t j = static_cast<vcl_size_t>(i)+1; j < R.size2(); ++j)
      x(i) -= R(i,j)*x(j);

    x(i) /= R(i,i);
  }
}
开发者ID:Rombur,项目名称:viennacl-dev,代码行数:12,代码来源:spai-static.hpp

示例2: inv

 inline DCMatrix inv(const MatrixT &mat, double regularizationCoeff = 0.0) {
   BOOST_ASSERT(mat.size1() == mat.size2());
   unsigned int n = mat.size1();
   DCMatrix inv = mat; // copy data, as it will be modified below
   if (regularizationCoeff != 0.0)
     inv += regularizationCoeff * ublas::identity_matrix<double>(n);
   std::vector<int> ipiv(n); // pivot vector, is first filled by trf, then used by tri to inverse matrix
   lapack::getrf(inv,ipiv); // inv and ipiv will both be modified
   lapack::getri(inv,ipiv); // afterwards, "inv" is the inverse
   return inv;
 }
开发者ID:FrankMoosmann,项目名称:FranksVelodyneAlgos,代码行数:11,代码来源:MatrixDefs.hpp

示例3: invSym

 inline DCMatrix invSym(const MatrixT &mat, double regularizationCoeff = 0.0) {
   BOOST_ASSERT(mat.size1() == mat.size2());
   unsigned int n = mat.size1();
   DCMatrix inv = mat; // copy data, as it will be modified below
   if (regularizationCoeff != 0.0)
     inv += regularizationCoeff * ublas::identity_matrix<double>(n);
   std::vector<int> ipiv(n); // pivot vector, is first filled by trf, then used by tri to inverse matrix
   // TODO (9): use "po..." (po=positive definite matrix) instead if "sy..." (symmetric indefinite matrix) to make it faster
   lapack::sytrf('U',inv,ipiv); // inv and ipiv will both be modified
   lapack::sytri('U',inv,ipiv); // afterwards, "inv" is the real inverse, but only the upper elements are valid!!!
   ublas::symmetric_adaptor<DCMatrix, ublas::upper> iSym(inv);
   return iSym; // copies upper matrix to lower
 }
开发者ID:FrankMoosmann,项目名称:FranksVelodyneAlgos,代码行数:13,代码来源:MatrixDefs.hpp

示例4: init

 ilut_precond(MatrixT const & mat, ilut_tag const & tag) : tag_(tag), LU_(mat.size1(), mat.size2())
 {
   //initialize preconditioner:
   //std::cout << "Start CPU precond" << std::endl;
   init(mat);
   //std::cout << "End CPU precond" << std::endl;
 }
开发者ID:andiselinger,项目名称:viennacl-dev,代码行数:7,代码来源:ilut.hpp

示例5: LLT

 ichol0_precond(MatrixT const & mat, ichol0_tag const & tag) : tag_(tag), LLT(mat.size1(), mat.size2(), viennacl::context(viennacl::MAIN_MEMORY))
 {
     //initialize preconditioner:
     //std::cout << "Start CPU precond" << std::endl;
     init(mat);
     //std::cout << "End CPU precond" << std::endl;
 }
开发者ID:aanchan,项目名称:viennacl-dev,代码行数:7,代码来源:ichol.hpp


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