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


C++ MatrixBase::derived方法代码示例

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


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

示例1: computeRNEADerivatives

 inline void
 computeRNEADerivatives(const ModelTpl<Scalar,Options,JointCollectionTpl> & model,
                        DataTpl<Scalar,Options,JointCollectionTpl> & data,
                        const Eigen::MatrixBase<ConfigVectorType> & q,
                        const Eigen::MatrixBase<TangentVectorType1> & v,
                        const Eigen::MatrixBase<TangentVectorType2> & a)
 {
   computeRNEADerivatives(model,data,q.derived(),v.derived(),a.derived(),
                          data.dtau_dq, data.dtau_dv, data.M);
 }
开发者ID:nim65s,项目名称:pinocchio,代码行数:10,代码来源:rnea-derivatives.hpp

示例2: NullaryExpr

CwiseNullaryOp<indexing_functor<ArgType,RowIndexType,ColIndexType>, typename indexing_functor<ArgType,RowIndexType,ColIndexType>::MatrixType>
indexing(const Eigen::MatrixBase<ArgType>& arg, const RowIndexType& row_indices, const ColIndexType& col_indices)
{
  typedef indexing_functor<ArgType,RowIndexType,ColIndexType> Func;
  typedef typename Func::MatrixType MatrixType;
  return MatrixType::NullaryExpr(row_indices.size(), col_indices.size(), Func(arg.derived(), row_indices, col_indices));
}
开发者ID:muhammedabdelnasser,项目名称:Vehicle-Steering-Using-Model-Predictive-Control,代码行数:7,代码来源:nullary_indexing.cpp

示例3: solve

 template<typename Rhs> inline const Eigen::internal::solve_retval<MyJacobiPreconditioner, Rhs>
 solve(const Eigen::MatrixBase<Rhs>& b) const
 {
   eigen_assert(m_isInitialized && "MyJacobiPreconditioner is not initialized.");
   eigen_assert(m_invdiag.size()==b.rows()
             && "MyJacobiPreconditioner::solve(): invalid number of rows of the right hand side matrix b");
   return Eigen::internal::solve_retval<MyJacobiPreconditioner, Rhs>(*this, b.derived());
 }
开发者ID:aeslaughter,项目名称:libmesh,代码行数:8,代码来源:matrixfree_cg.cpp

示例4: undistort

void RadialTangentialDistortion::undistort(
    const Eigen::MatrixBase<DERIVED> & yconst,
    const Eigen::MatrixBase<DERIVED_JY> & outJy) const {

  EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE_OR_DYNAMIC(
      Eigen::MatrixBase<DERIVED>, 2);
  EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE_OR_DYNAMIC(
      Eigen::MatrixBase<DERIVED_JY>, 2, 2);

  Eigen::MatrixBase<DERIVED> & y =
      const_cast<Eigen::MatrixBase<DERIVED> &>(yconst);
  y.derived().resize(2);

  // we use f^-1 ' = ( f'(f^-1) ) '
  // with f^-1 the undistortion
  // and  f the distortion
  undistort(y);  // first get the undistorted image

  Eigen::Vector2d kp = y;
  Eigen::Matrix2d Jd;
  distort(kp, Jd);

  // now y = f^-1(y0)
  DERIVED_JY & J = const_cast<DERIVED_JY &>(outJy.derived());

  J = Jd.inverse();

  /*  std::cout << "J: " << std::endl << J << std::endl;

   double mx2_u = y[0]*y[0];
   double my2_u = y[1]*y[1];
   //double mxy_u = y[0]*y[1];
   double rho2_u = mx2_u+my2_u;

   double rad_dist_u = _k1*rho2_u+_k2*rho2_u*rho2_u;
   // take the inverse as Jacobian.
   J(0,0) = 1/(1 + rad_dist_u + _k1*2*mx2_u + _k2*rho2_u*4*mx2_u + 2*_p1*y[1] + 6*_p2*y[0]);
   J(1,0) = (_k1*2*y[0]*y[1] + _k2*4*rho2_u*y[0]*y[1] + _p1*2*y[0] + 2*_p2*y[1]);
   J(0,1) = J(1,0);
   J(1,1) = 1/(1 + rad_dist_u + _k1*2*my2_u + _k2*rho2_u*4*my2_u + 6*_p1*y[1] + 2*_p2*y[0]);

   // this should only happen if the distortion coefficients are 0
   // the coefficients being zero removes the cross dependence then it is safe to set J(1,0) = 0
   if (J(1,0) != 0)
   J(1,0) = 1/J(1,0);
   J(0,1) = J(1,0);*/

}
开发者ID:AliAlawieh,项目名称:kalibr,代码行数:48,代码来源:RadialTangentialDistortion.hpp

示例5:

 Eigen::Product<MatrixReplacement,Rhs,Eigen::AliasFreeProduct> operator*(const Eigen::MatrixBase<Rhs>& x) const {
   return Eigen::Product<MatrixReplacement,Rhs,Eigen::AliasFreeProduct>(*this, x.derived());
 }
开发者ID:muhammedabdelnasser,项目名称:Vehicle-Steering-Using-Model-Predictive-Control,代码行数:3,代码来源:matrixfree_cg.cpp

示例6: resize

 static void resize( Eigen::MatrixBase< Derived > &m1 , const Eigen::MatrixBase< Derived > &m2 )
 {
     m1.derived().resizeLike(m2);
 }
开发者ID:12307,项目名称:EasyDarwin,代码行数:4,代码来源:eigen_resize.hpp

示例7:

 MatrixReplacement_ProductReturnType<Rhs> operator*(const Eigen::MatrixBase<Rhs>& x) const {
   return MatrixReplacement_ProductReturnType<Rhs>(*this, x.derived());
 }
开发者ID:aeslaughter,项目名称:libmesh,代码行数:3,代码来源:matrixfree_cg.cpp

示例8:

 Eigen::Product<MutatorEquation, Rhs, Eigen::AliasFreeProduct> operator*(const Eigen::MatrixBase<Rhs> &x) const {
     return Eigen::Product<MutatorEquation, Rhs, Eigen::AliasFreeProduct>(*this, x.derived());
 }
开发者ID:mrpejker,项目名称:MutatorModel,代码行数:3,代码来源:MutatorEquation.hpp

示例9: NullaryExpr

CwiseNullaryOp<circulant_functor<ArgType>, typename circulant_helper<ArgType>::MatrixType>
makeCirculant(const Eigen::MatrixBase<ArgType>& arg)
{
  typedef typename circulant_helper<ArgType>::MatrixType MatrixType;
  return MatrixType::NullaryExpr(arg.size(), arg.size(), circulant_functor<ArgType>(arg.derived()));
}
开发者ID:13221325403,项目名称:openbr,代码行数:6,代码来源:make_circulant2.cpp

示例10: operator

	void operator()(Eigen::MatrixBase<T1> &x, Eigen::MatrixBase<T2> &result) const {
		memcpy(goc.fc->est, x.derived().data(), sizeof(double) * goc.fc->numParam);
		goc.fc->copyParamToModel();
		goc.solEqBFun();
		result = goc.equality;
	}
开发者ID:bwiernik,项目名称:OpenMx,代码行数:6,代码来源:nloptcpp.cpp


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