12 #ifndef BOGUS_EIGEN_PROBLEM_TRAITS_HPP
13 #define BOGUS_EIGEN_PROBLEM_TRAITS_HPP
15 #include "EigenMatrixTraits.hpp"
20 template <
typename Scalar_ >
23 typedef Scalar_ Scalar ;
25 typedef Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > DynVector ;
26 typedef Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > DynMatrix ;
27 template <
typename OtherMatrix >
30 typedef Eigen::Matrix< Scalar,
31 OtherMatrix::RowsAtCompileTime,
32 OtherMatrix::ColsAtCompileTime > Type ;
37 template< DenseIndexType Dimension,
typename Scalar_ >
40 enum { dimension = Dimension } ;
42 typedef Scalar_ Scalar ;
43 typedef Eigen::Matrix< Scalar, Dimension, 1 > Vector ;
44 typedef Eigen::Array< Scalar, Dimension, 1 > Array ;
45 typedef Eigen::Matrix< Scalar, Dimension, Dimension > Matrix ;
50 typedef Eigen::Matrix< Scalar, Dimension-1, Dimension-1 > TgMatrix ;
52 static Scalar np(
const Vector & v )
54 static Scalar& np( Vector & v )
57 static typename Vector::template ConstFixedSegmentReturnType< Dimension - 1 >::Type
58 tp(
const Vector & v ) {
return v.template segment< Dimension - 1 >( 1 ) ; }
59 static typename Vector::template FixedSegmentReturnType< Dimension - 1 >::Type
60 tp( Vector & v ) {
return v.template segment< Dimension - 1 >( 1 ) ; }
62 static typename Matrix::ColXpr
63 nc( Matrix & m ) {
return m.col( 0 ) ; }
64 static Eigen::Block< Matrix, Dimension, Dimension -1 >
65 tc( Matrix & m ) {
return m.template block< Dimension, Dimension - 1 >( 0, 1 ) ; }
68 nnb( Matrix & m ) {
return m( 0, 0 ) ; }
69 static Eigen::Block< Matrix, Dimension - 1, Dimension -1 >
70 ttb( Matrix & m ) {
return m.template block< Dimension - 1, Dimension - 1 >( 1, 1 ) ; }
71 static Eigen::Block< Matrix, Dimension - 1, 1 >
72 tnb( Matrix & m ) {
return m.template block< Dimension - 1, 1 >( 1, 0 ) ; }
73 static Eigen::Block< Matrix, 1, Dimension -1 >
74 ntb( Matrix & m ) {
return m.template block< 1, Dimension - 1 >( 0, 1 ) ; }
77 template<
typename Scalar >
80 typedef Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > Matrix ;
83 typedef typename Base::DynVector Vector ;
84 typedef typename Base::DynMatrix TgMatrix ;
86 static Scalar np(
const Vector & v )
88 static Scalar& np( Vector & v )
91 static typename Vector::ConstSegmentReturnType
92 tp(
const Vector & v ) {
return v.segment( 1, v.rows() - 1 ) ; }
93 static typename Vector::SegmentReturnType
94 tp( Vector & v ) {
return v.segment( 1, v.rows() - 1 ) ; }
96 static typename Matrix::ColXpr
97 nc( Matrix & m ) {
return m.col( 0 ) ; }
98 static Eigen::Block< Matrix >
99 tc( Matrix & m ) {
return m.block( 0, 1, m.rows(), m.cols()-1 ) ; }
102 nnb( Matrix & m ) {
return m( 0, 0 ) ; }
103 static Eigen::Block< Matrix >
104 ttb( Matrix & m ) {
return m.block( 1, 1, m.rows()-1, m.cols()-1 ) ; }
105 static Eigen::Block< Matrix >
106 tnb( Matrix & m ) {
return m.block( 1, 0, m.rows()-1, 1 ) ; }
107 static Eigen::Block< Matrix >
108 ntb( Matrix & m ) {
return m.block( 0, 1, 1, m.cols()-1 ) ; }
Definition: EigenProblemTraits.hpp:28
Base class for LDLT factorizations.
Definition: LinearSolverBase.hpp:72
Definition: BlockSolvers.fwd.hpp:33
Base class for LU factorizations.
Definition: LinearSolverBase.hpp:66
Definition: EigenProblemTraits.hpp:38