5 #ifndef __pinocchio_math_matrix_block_hpp__ 6 #define __pinocchio_math_matrix_block_hpp__ 18 typedef typename Mat::template FixedSegmentReturnType<NV>::Type Type;
19 typedef typename Mat::template ConstFixedSegmentReturnType<NV>::Type ConstType;
23 static typename SegmentReturn<D>::ConstType
24 segment(
const Eigen::MatrixBase<D> & mat,
25 typename Eigen::DenseBase<D>::Index start,
26 typename Eigen::DenseBase<D>::Index size = NV)
28 PINOCCHIO_UNUSED_VARIABLE(size);
29 return mat.template segment<NV>(start);
33 static typename SegmentReturn<D>::Type
34 segment(Eigen::MatrixBase<D> & mat,
35 typename Eigen::DenseBase<D>::Index start,
36 typename Eigen::DenseBase<D>::Index size = NV)
38 PINOCCHIO_UNUSED_VARIABLE(size);
39 return mat.template segment<NV>(start);
45 typedef typename Mat::template NColsBlockXpr<NV>::Type Type;
46 typedef typename Mat::template ConstNColsBlockXpr<NV>::Type ConstType;
50 static typename ColsReturn<D>::ConstType
51 middleCols(
const Eigen::MatrixBase<D> & mat,
52 typename Eigen::DenseBase<D>::Index start,
53 typename Eigen::DenseBase<D>::Index size = NV)
55 PINOCCHIO_UNUSED_VARIABLE(size);
56 return mat.template middleCols<NV>(start);
60 static typename ColsReturn<D>::Type
61 middleCols(Eigen::MatrixBase<D> & mat,
62 typename Eigen::DenseBase<D>::Index start,
63 typename Eigen::DenseBase<D>::Index size = NV)
65 PINOCCHIO_UNUSED_VARIABLE(size);
66 return mat.template middleCols<NV>(start);
72 typedef typename Mat::template NRowsBlockXpr<NV>::Type Type;
73 typedef typename Mat::template ConstNRowsBlockXpr<NV>::Type ConstType;
77 static typename RowsReturn<D>::ConstType
78 middleRows(
const Eigen::MatrixBase<D> & mat,
79 typename Eigen::DenseBase<D>::Index start,
80 typename Eigen::DenseBase<D>::Index size = NV)
82 PINOCCHIO_UNUSED_VARIABLE(size);
83 return mat.template middleRows<NV>(start);
87 static typename RowsReturn<D>::Type
88 middleRows(Eigen::MatrixBase<D> & mat,
89 typename Eigen::DenseBase<D>::Index start,
90 typename Eigen::DenseBase<D>::Index size = NV)
92 PINOCCHIO_UNUSED_VARIABLE(size);
93 return mat.template middleRows<NV>(start);
99 typedef Eigen::Block<Mat, NV, NV> Type;
100 typedef const Eigen::Block<const Mat, NV, NV> ConstType;
104 static typename BlockReturn<D>::ConstType
105 block(
const Eigen::MatrixBase<D> & mat,
106 typename Eigen::DenseBase<D>::Index row_id,
107 typename Eigen::DenseBase<D>::Index col_id,
108 typename Eigen::DenseBase<D>::Index row_size_block = NV,
109 typename Eigen::DenseBase<D>::Index col_size_block = NV)
111 PINOCCHIO_UNUSED_VARIABLE(row_size_block);
112 PINOCCHIO_UNUSED_VARIABLE(col_size_block);
113 return mat.template block<NV,NV>(row_id,col_id);
117 static typename BlockReturn<D>::Type
118 block(Eigen::MatrixBase<D> & mat,
119 typename Eigen::DenseBase<D>::Index row_id,
120 typename Eigen::DenseBase<D>::Index col_id,
121 typename Eigen::DenseBase<D>::Index row_size_block = NV,
122 typename Eigen::DenseBase<D>::Index col_size_block = NV)
124 PINOCCHIO_UNUSED_VARIABLE(row_size_block);
125 PINOCCHIO_UNUSED_VARIABLE(col_size_block);
126 return mat.template block<NV,NV>(row_id,col_id);
136 typedef typename Mat::SegmentReturnType Type;
137 typedef typename Mat::ConstSegmentReturnType ConstType;
141 static typename SegmentReturn<D>::ConstType
142 segment(
const Eigen::MatrixBase<D> & mat,
143 typename Eigen::DenseBase<D>::Index start,
144 typename Eigen::DenseBase<D>::Index size)
146 return mat.segment(start,size);
150 static typename SegmentReturn<D>::Type
151 segment(Eigen::MatrixBase<D> & mat,
152 typename Eigen::DenseBase<D>::Index start,
153 typename Eigen::DenseBase<D>::Index size)
155 return mat.segment(start,size);
161 typedef typename Mat::ColsBlockXpr Type;
162 typedef typename Mat::ConstColsBlockXpr ConstType;
166 static typename ColsReturn<D>::ConstType
167 middleCols(
const Eigen::MatrixBase<D> & mat,
168 typename Eigen::DenseBase<D>::Index start,
169 typename Eigen::DenseBase<D>::Index size)
171 return mat.middleCols(start,size);
175 static typename ColsReturn<D>::Type
176 middleCols(Eigen::MatrixBase<D> & mat,
177 typename Eigen::DenseBase<D>::Index start,
178 typename Eigen::DenseBase<D>::Index size)
180 return mat.middleCols(start,size);
186 typedef typename Mat::RowsBlockXpr Type;
187 typedef typename Mat::ConstRowsBlockXpr ConstType;
191 static typename RowsReturn<D>::ConstType
192 middleRows(
const Eigen::MatrixBase<D> & mat,
193 typename Eigen::DenseBase<D>::Index start,
194 typename Eigen::DenseBase<D>::Index size)
196 return mat.middleRows(start,size);
200 static typename RowsReturn<D>::Type
201 middleRows(Eigen::MatrixBase<D> & mat,
202 typename Eigen::DenseBase<D>::Index start,
203 typename Eigen::DenseBase<D>::Index size)
205 return mat.middleRows(start,size);
211 typedef Eigen::Block<Mat> Type;
212 typedef const Eigen::Block<const Mat> ConstType;
216 static typename BlockReturn<D>::ConstType
217 block(
const Eigen::MatrixBase<D> & mat,
218 typename Eigen::DenseBase<D>::Index row_id,
219 typename Eigen::DenseBase<D>::Index col_id,
220 typename Eigen::DenseBase<D>::Index row_size_block,
221 typename Eigen::DenseBase<D>::Index col_size_block)
223 return mat.block(row_id,col_id,row_size_block,col_size_block);
227 static typename BlockReturn<D>::Type
228 block(Eigen::MatrixBase<D> & mat,
229 typename Eigen::DenseBase<D>::Index row_id,
230 typename Eigen::DenseBase<D>::Index col_id,
231 typename Eigen::DenseBase<D>::Index row_size_block,
232 typename Eigen::DenseBase<D>::Index col_size_block)
234 return mat.block(row_id,col_id,row_size_block,col_size_block);
239 #endif // ifndef __pinocchio_math_matrix_block_hpp__
Main pinocchio namespace.