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 segment(
24 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 segment(
34 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 middleCols(
51 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 middleCols(
61 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 middleRows(
78 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 middleRows(
88 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 block(
105 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 block(
118 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 segment(
142 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 segment(
151 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 middleCols(
167 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 middleCols(
176 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 middleRows(
192 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 middleRows(
201 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 block(
217 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 block(
228 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);
Main pinocchio namespace.