29 #ifndef HPP_CONSTRAINTS_MATRIX_VIEW_HH 30 #define HPP_CONSTRAINTS_MATRIX_VIEW_HH 34 #include <hpp/pinocchio/util.hh> 35 #include <hpp/util/indent.hh> 39 #define HPP_EIGEN_USE_EVALUATOR EIGEN_VERSION_AT_LEAST(3, 2, 92) 59 static size_type
cardinal(
const segments_t& a);
65 template <
typename Derived>
67 const Eigen::ArrayBase<Derived>& array);
71 static void sort(segments_t& a);
76 static void shrink(segments_t& a);
79 static bool overlap(
const segment_t& a,
const segment_t& b);
82 static segments_t
sum(
const segment_t& a,
const segment_t& b);
85 static void add(segments_t& a,
const segment_t& b);
88 static void add(segments_t& a,
const segments_t& b);
91 static segments_t
difference(
const segment_t& a,
const segment_t& b);
95 static segments_t
difference(
const segments_t& a,
const segment_t& b);
99 static segments_t
difference(
const segment_t& a,
const segments_t& b);
103 static segments_t
difference(
const segments_t& a,
const segments_t& b);
111 static segments_t
split(segments_t& segments,
const size_type&
cardinal);
119 static segments_t
extract(
const segments_t& segments, size_type start,
123 template <
typename ArgType,
int _Rows,
int _Cols,
bool _allRows,
bool _allCols>
136 template <
bool _allRows = false,
bool _allCols = false>
141 template <
bool _allRows = false,
bool _allCols = false>
145 template <
bool condition>
147 template <
class Then,
class Else>
148 static constexpr
inline Then&
rr(Then& f, Else&) {
151 template <
class Then,
class Else>
152 static constexpr
inline Then
pp(Then f, Else) {
158 template <
class Then,
class Else>
159 static constexpr
inline Else&
rr(Then&, Else& s) {
162 template <
class Then,
class Else>
163 static constexpr
inline Else
pp(Then, Else s) {
171 template <
typename In_t>
173 template <
typename In0_t,
typename In1_t>
175 static constexpr
inline Index
size() {
return 1; }
176 inline constexpr
const Index&
operator[](
const Index& i)
const {
return i; }
179 template <
bool _allRows,
bool _allCols>
181 enum { AllRows = _allRows, AllCols = _allCols };
186 typename internal::conditional<_allCols, internal::empty_struct,
190 template <
bool _allRows,
bool _allCols>
192 enum { AllRows = _allRows, AllCols = _allCols };
196 typedef typename internal::conditional<_allCols, internal::empty_struct,
201 template <
typename ArgType,
int _Rows,
int _Cols,
bool _allRows,
bool _allCols>
203 #if HPP_EIGEN_USE_EVALUATOR 204 typedef typename ArgType::StorageIndex StorageIndex;
205 #else // HPP_EIGEN_USE_EVALUATOR 206 typedef typename ArgType::Index
Index;
207 #endif // HPP_EIGEN_USE_EVALUATOR 209 typedef typename traits<ArgType>::XprKind
XprKind;
212 #if !HPP_EIGEN_USE_EVALUATOR 213 CoeffReadCost = ArgType::CoeffReadCost,
214 #endif // !HPP_EIGEN_USE_EVALUATOR 215 Flags = ~PacketAccessBit & ~DirectAccessBit & ~ActualPacketAccessBit &
216 ~LinearAccessBit & ArgType::Flags,
217 RowsAtCompileTime = (_allRows ? ArgType::RowsAtCompileTime : _Rows),
218 ColsAtCompileTime = (_allCols ? ArgType::ColsAtCompileTime : _Cols),
219 MaxRowsAtCompileTime = ArgType::MaxRowsAtCompileTime,
220 MaxColsAtCompileTime = ArgType::MaxColsAtCompileTime
224 #if HPP_EIGEN_USE_EVALUATOR 225 template <
typename Derived,
typename ArgType,
int _Rows,
int _Cols,
226 bool _allRows,
bool _allCols,
typename Functor,
typename Scalar>
227 struct Assignment<Derived,
229 Functor, Dense2Dense, Scalar> {
232 static EIGEN_STRONG_INLINE
void run(Derived& dst,
const OtherDerived& src,
233 const Functor& func) {
234 dst.resize(src.rows(), src.cols());
235 typedef Block<Derived> BlockDerived;
236 typedef Assignment<BlockDerived,
typename OtherDerived::BlockConstXprType,
239 for (
typename OtherDerived::block_iterator b(src); b.valid(); ++b) {
240 BlockDerived bdst(dst.block(b.ro(), b.co(), b.rs(), b.cs()));
241 AssignmentType::run(bdst, src._block(b), func);
245 #else // HPP_EIGEN_USE_EVALUATOR 246 template <
typename Derived,
typename ArgType,
int _Rows,
int _Cols,
247 bool _allRows,
bool _allCols>
248 struct assign_selector<
249 Derived,
MatrixBlockView<ArgType, _Rows, _Cols, _allRows, _allCols>, false,
253 static EIGEN_STRONG_INLINE Derived&
run(Derived& dst,
258 template <
typename ActualDerived,
typename ActualOtherDerived>
259 static EIGEN_STRONG_INLINE Derived&
evalTo(ActualDerived& dst,
260 const ActualOtherDerived& other) {
265 template <
typename Derived,
typename ArgType,
int _Rows,
int _Cols,
266 bool _allRows,
bool _allCols>
267 struct assign_selector<
268 Derived,
MatrixBlockView<ArgType, _Rows, _Cols, _allRows, _allCols>, false,
272 static EIGEN_STRONG_INLINE Derived&
run(Derived& dst,
274 other.
writeTo(dst.transpose());
277 template <
typename ActualDerived,
typename ActualOtherDerived>
278 static EIGEN_STRONG_INLINE Derived&
evalTo(ActualDerived& dst,
279 const ActualOtherDerived& other) {
280 Transpose<ActualDerived> dstTrans(dst);
281 other.evalTo(dstTrans);
285 #endif // HPP_EIGEN_USE_EVALUATOR 287 template <
typename Src,
typename Dst>
289 template <
typename Src,
typename _ArgType,
int _Rows,
int _Cols,
bool _allRows,
295 static void run(
const Src& src, Dst& dst) {
297 dst.
_block(b) = src.block(b.ro(), b.co(), b.rs(), b.cs());
300 template <
typename _ArgType,
int _Rows,
int _Cols,
bool _allRows,
bool _allCols,
306 static void run(
const Src& src, Dst& dst) {
308 dst.block(b.ro(), b.co(), b.rs(), b.cs()) = src.
_block(b);
311 template <
typename _ArgType,
int _Rows,
int _Cols,
bool _allRows,
bool _allCols,
312 typename _ArgType2,
int _Rows2,
int _Cols2,
bool _allRows2,
320 static void run(
const Src& src, Dst& dst) {
331 template <
typename ReturnType,
typename View,
bool AllRows = View::AllRows,
332 bool AllCols = View::AllCols>
335 template <
typename Derived>
336 static ReturnType
run(Derived&
d, size_type r, size_type c, size_type rs,
338 return ReturnType(d, r, c, rs, cs);
341 template <
typename ReturnType,
typename View>
344 template <
typename Derived>
345 static ReturnType
run(Derived&
d, size_type r, size_type, size_type rs,
347 return d.middleRows(r, rs);
350 template <
typename ReturnType,
typename View>
353 template <
typename Derived>
354 static ReturnType
run(Derived&
d, size_type, size_type c, size_type,
356 return d.middleCols(c, cs);
361 template <
typename BlockIndexType>
362 static void run(std::ostream&,
const BlockIndexType&) {}
365 template <
typename BlockIndexType>
366 static void run(std::ostream& os,
const BlockIndexType& bi) {
367 for (std::size_t i = 0; i < bi.size(); ++i)
368 os <<
"[ " << bi[i].first <<
", " << bi[i].second <<
"], ";
372 #if HPP_EIGEN_USE_EVALUATOR 373 template <
typename ArgType,
int _Rows,
int _Cols,
bool _allRows,
bool _allCols>
374 struct unary_evaluator<
375 MatrixBlockView<ArgType, _Rows, _Cols, _allRows, _allCols> >
377 MatrixBlockView<ArgType, _Rows, _Cols, _allRows, _allCols> > {
381 CoeffReadCost = evaluator<ArgType>::CoeffReadCost,
382 Flags = ~PacketAccessBit & ~DirectAccessBit & ~ActualPacketAccessBit &
383 ~LinearAccessBit & ArgType::Flags,
386 EIGEN_DEVICE_FUNC
explicit unary_evaluator(
const XprType& view)
389 const XprType& m_view;
391 #endif // HPP_EIGEN_USE_EVALUATOR 394 #define EIGEN_MATRIX_BLOCKS_PUBLIC_INTERFACE(Derived) \ 395 enum { AllRows = _allRows, AllCols = _allCols }; \ 396 typedef MatrixBlocksBase<Derived> Base; \ 397 typedef typename Base::size_type size_type; \ 398 typedef typename Base::segments_t segments_t; \ 399 typedef typename Base::segment_t segment_t; \ 400 typedef typename Base::RowIndices_t RowIndices_t; \ 401 typedef typename Base::ColIndices_t ColIndices_t; 406 template <
typename Derived>
410 AllRows = internal::traits<Derived>::AllRows,
411 AllCols = internal::traits<Derived>::AllCols,
412 OneDimension = bool(AllRows) || bool(AllCols)
424 template <
typename MatrixType,
int _Rows = MatrixType::RowsAtCompileTime,
425 int _Cols = MatrixType::ColsAtCompileTime>
430 Derived
const&
derived()
const {
return static_cast<Derived const&
>(*this); }
431 Derived&
derived() {
return static_cast<Derived&
>(*this); }
437 template <
typename MatrixType>
438 EIGEN_STRONG_INLINE
typename View<MatrixType>::type
lview(
439 const MatrixBase<MatrixType>& other)
const {
440 MatrixType& o =
const_cast<MatrixBase<MatrixType>&
>(other).derived();
441 if (Derived::OneDimension)
442 return typename View<MatrixType>::type(o, nbIndices(), indices());
444 return typename View<MatrixType>::type(o, nbRows(), rows(), nbCols(),
452 template <
typename MatrixType>
453 EIGEN_STRONG_INLINE
typename View<const MatrixType>::type
rview(
454 const MatrixBase<MatrixType>& other)
const {
455 if (Derived::OneDimension)
456 return typename View<const MatrixType>::type(other.derived(), nbIndices(),
459 return typename View<const MatrixType>::type(other.derived(), nbRows(),
460 rows(), nbCols(), cols());
489 inline const RowIndices_t&
rows()
const {
return derived().rows(); }
493 inline const ColIndices_t&
cols()
const {
return derived().cols(); }
501 return AllRows ? nbCols() : nbRows();
506 inline const size_type&
nbRows()
const {
return derived().nbRows(); }
510 inline const size_type&
nbCols()
const {
return derived().nbCols(); }
516 size_type nj)
const {
545 template <
bool _allRows,
bool _allCols>
572 : m_nbRows(nbRows), m_nbCols(nbCols), m_rows(rows), m_cols(cols) {}
580 : m_nbRows(_allRows ? 0 : size),
581 m_nbCols(_allCols ? 0 : size),
601 : m_nbRows(_allRows ? 0 : idx.second),
602 m_nbCols(_allCols ? 0 : idx.second),
607 template <
typename MBDerived>
609 : m_nbRows(other.nbRows()),
610 m_nbCols(other.nbCols()),
611 m_rows(other.rows()),
612 m_cols(other.cols()) {
613 EIGEN_STATIC_ASSERT((
bool(AllRows) ==
bool(MBDerived::AllRows)) &&
614 (
bool(AllCols) ==
bool(MBDerived::AllCols)),
615 YOU_MIXED_MATRICES_OF_DIFFERENT_SIZES);
657 template <
bool Sort,
bool Shrink,
bool Cardinal>
659 update<Sort, Shrink, Cardinal>(m_rows, m_nbRows);
666 template <
bool Sort,
bool Shrink,
bool Cardinal>
668 update<Sort, Shrink, Cardinal>(m_cols, m_nbCols);
673 inline const RowIndices_t&
rows()
const {
return m_rows; }
687 template <
bool Sort,
bool Shrink,
bool Cardinal>
689 update<Sort, Shrink, Cardinal>(
691 _allRows ? m_nbCols : m_nbRows);
699 template <
bool Sort,
bool Shrink,
bool Cardinal>
708 template <
bool _allRows,
bool _allCols>
720 : m_nbRows(nbRows), m_nbCols(nbCols), m_rows(rows), m_cols(cols) {}
723 template <
typename Derived1,
typename Derived2>
731 bool(Derived1::OneDimension) &&
bool(Derived2::OneDimension),
732 YOU_MIXED_MATRICES_OF_DIFFERENT_SIZES);
741 : m_nbRows(_allRows ? 0 : nidx),
742 m_nbCols(_allCols ? 0 : nidx),
749 m_nbRows(other.nbRows()),
750 m_nbCols(other.nbCols()),
751 m_rows(other.rows()),
752 m_cols(other.cols()) {}
756 inline const RowIndices_t& rows()
const {
return m_rows; }
760 inline const ColIndices_t& cols()
const {
return m_cols; }
764 inline const size_type& nbRows()
const {
return m_nbRows; }
768 inline const size_type& nbCols()
const {
return m_nbCols; }
776 template <
typename Derived>
780 typename internal::conditional<Derived::AllRows,
784 typename internal::conditional<Derived::AllCols,
785 internal::dont_print_indices,
787 if (!Derived::AllRows) {
789 row_printer::run(os, mbi.
rows());
790 if (!Derived::AllCols) os << hpp::iendl;
792 if (!Derived::AllCols) {
794 col_printer::run(os, mbi.
cols());
828 template <
typename _ArgType,
int _Rows = _ArgType::RowsAtCompileTime,
829 int _Cols = _ArgType::ColsAtCompileTime,
bool _allRows =
false,
830 bool _allCols =
false>
833 MatrixBlockView<_ArgType, _Rows, _Cols, _allRows, _allCols> > {
836 enum { Rows = _Rows, Cols = _Cols, AllRows = _allRows, AllCols = _allCols };
840 internal::variable_if_dynamic<size_type, (_allRows ? 0 : Dynamic)>
_ro;
841 internal::variable_if_dynamic<size_type, (_allCols ? 0 : Dynamic)>
_co;
843 : view(v), row(0), col(0), _ro(0), _co(0) {}
845 size_type
ro()
const {
return _ro.value(); }
847 size_type
co()
const {
return _co.value(); }
849 size_type
ri()
const {
855 size_type
ci()
const {
861 size_type
rs()
const {
867 size_type
cs()
const {
874 _ro.setValue(_ro.value() + rs());
876 if (row == (size_type)view.
m_rows.size()) {
879 _co.setValue(_co.value() + cs());
892 return (AllRows || view.
m_rows.size() > 0) &&
893 (col < (size_type)(AllCols ? 1 : view.
m_cols.size()));
901 typedef Matrix<Scalar, RowsAtCompileTime, ColsAtCompileTime>
PlainObject;
909 template <typename Derived>
911 typedef Block<Derived,
912 (AllRows ? Derived::RowsAtCompileTime : Eigen::Dynamic),
913 (AllCols ? Derived::ColsAtCompileTime : Eigen::Dynamic),
914 (AllCols ? (bool)Derived::IsRowMajor
915 : (AllRows ? (
bool)!Derived::IsRowMajor :
false))>
925 typedef typename internal::conditional<_allCols,
const internal::empty_struct,
931 const RowIndices_t rows,
const size_type& nbCols,
932 const ColIndices_t cols)
941 const Indices_t& indices)
943 m_nbRows(_allRows ? arg.rows() : nbIndices),
945 m_nbCols(_allCols ? arg.cols() : nbIndices),
948 EIGEN_STRONG_INLINE size_type
rows()
const {
return m_nbRows; }
949 EIGEN_STRONG_INLINE size_type
cols()
const {
return m_nbCols; }
951 EIGEN_STRONG_INLINE CoeffReturnType
coeff(size_type index)
const {
953 "It is not possible to access the coefficients of " 954 "MatrixBlockView this way.");
956 EIGEN_STRONG_INLINE CoeffReturnType
coeff(size_type row,
957 size_type col)
const {
959 "It is not possible to access the coefficients of " 960 "MatrixBlockView this way.");
962 EIGEN_STRONG_INLINE Scalar&
coeffRef(size_type index) {
964 "It is not possible to access the coefficients of " 965 "MatrixBlockView this way.");
967 EIGEN_STRONG_INLINE Scalar&
coeffRef(size_type row,
const size_type& col) {
969 "It is not possible to access the coefficients of " 970 "MatrixBlockView this way.");
972 template <
typename Dest>
973 EIGEN_STRONG_INLINE
void evalTo(Dest& dst)
const {
977 template <
typename Dest>
978 EIGEN_STRONG_INLINE
void writeTo(Dest& dst)
const {
979 dst.resize(rows(), cols());
980 evalTo(dst.derived());
989 template <
typename OtherDerived>
991 const EigenBase<OtherDerived>& other) {
992 EIGEN_STATIC_ASSERT_LVALUE(
ArgType);
994 other.derived(), *
this);
998 EIGEN_STRONG_INLINE size_type
_blocks()
const {
999 return m_rows.size() * m_cols.size();
1007 EIGEN_STRONG_INLINE
const BlockConstXprType
1010 const BlockConstXprType,
1019 const RealScalar& prec = NumTraits<Scalar>::dummy_precision())
const {
1021 if (!m_arg.block(block.ri(), block.ci(), block.rs(), block.cs())
1041 #undef HPP_EIGEN_USE_EVALUATOR 1044 template <
int Option>
1047 return os <<
"[ " << s.first <<
", " << s.first + s.second <<
" ]";
1052 #endif // HPP_CONSTRAINTS_MATRIX_VIEW_HH std::vector< segment_t > segments_t
Definition: fwd.hh:84
static segments_t split(segments_t &segments, const size_type &cardinal)
void addCol(const size_type &col, const size_type size)
Definition: matrix-view.hh:648
Matrix< Scalar, RowsAtCompileTime, ColsAtCompileTime > PlainObject
Definition: matrix-view.hh:901
MatrixBlocksRef< AllCols, AllRows > transpose() const
Definition: matrix-view.hh:463
MatrixBlockView< ArgType, _Rows, _Cols, _allRows, _allCols > OtherDerived
Definition: matrix-view.hh:271
Definition: matrix-view.hh:142
MatrixIndices_t::segments_t Indices_t
Definition: matrix-view.hh:922
MatrixXd::Index Index
Definition: matrix-view.hh:169
constexpr const Index & operator[](const Index &i) const
Definition: matrix-view.hh:176
const RowIndices_t & rows() const
Definition: matrix-view.hh:489
static ReturnType run(Derived &d, size_type r, size_type, size_type rs, size_type)
Definition: matrix-view.hh:345
const MatrixBlockView & view
Definition: matrix-view.hh:838
Definition: matrix-view.hh:137
MatrixBlocks(size_type start, size_type size)
Definition: matrix-view.hh:579
size_type cs() const
number of ColS
Definition: matrix-view.hh:867
MatrixBlocksRef< true, AllCols > keepCols() const
Definition: matrix-view.hh:473
const size_type & nbCols() const
Definition: matrix-view.hh:685
MatrixBlockView(ArgType &arg, const size_type &nbRows, const RowIndices_t rows, const size_type &nbCols, const ColIndices_t cols)
Definition: matrix-view.hh:930
EIGEN_STRONG_INLINE MatrixBlockView & operator=(const EigenBase< OtherDerived > &other)
Definition: matrix-view.hh:990
static size_type cardinal(const segments_t &a)
Definition: matrix-view.hh:49
size_type m_nbCols
Definition: matrix-view.hh:694
internal::conditional< _allRows, internal::empty_struct, const BlockIndex::segments_t & >::type RowIndices_t
Definition: matrix-view.hh:195
size_type ro() const
Row in the Output matrix
Definition: matrix-view.hh:845
static void run(const Src &src, Dst &dst)
Definition: matrix-view.hh:306
const ColIndices_t & cols() const
Definition: matrix-view.hh:493
const Derived & d
Definition: matrix-view-operation.hh:138
traits< ArgType >::XprKind XprKind
Definition: matrix-view.hh:209
Definition: active-set-differentiable-function.hh:36
block_iterator(const MatrixBlockView &v)
Definition: matrix-view.hh:842
ArgType::Scalar Scalar
Definition: matrix-view.hh:210
EIGEN_STRONG_INLINE BlockXprType _block(const block_iterator &b)
Definition: matrix-view.hh:1001
Definition: matrix-view.hh:364
MatrixBase< MatrixBlockView< _ArgType, _Rows, _Cols, _allRows, _allCols > > Base
Definition: matrix-view.hh:898
Derived & derived()
Definition: matrix-view.hh:431
MatrixBlockView< _ArgType, _Rows, _Cols, _allRows, _allCols > Src
Definition: matrix-view.hh:318
EIGEN_STRONG_INLINE void evalTo(Dest &dst) const
Definition: matrix-view.hh:973
void updateIndices()
Definition: matrix-view.hh:688
block_t< ArgType >::type BlockXprType
Definition: matrix-view.hh:918
MatrixBlockView< _ArgType, _Rows, _Cols, _allRows, _allCols > Dst
Definition: matrix-view.hh:294
EIGEN_STRONG_INLINE block_iterator _block_iterator() const
Definition: matrix-view.hh:1014
size_type m_nbRows
Definition: matrix-view.hh:694
MatrixBlockView< MatrixType, _Rows, _Cols, AllRows, AllCols > type
Definition: matrix-view.hh:427
MatrixBlocks(const segments_t &idx)
Definition: matrix-view.hh:590
MatrixBlocks< AllRows, AllCols > block(size_type i, size_type j, size_type ni, size_type nj) const
Definition: matrix-view.hh:515
static void run(const Src &src, Dst &dst)
Definition: matrix-view.hh:295
MatrixBlocks(const size_type &nbRows, const RowIndices_t &rows, const size_type &nbCols, const ColIndices_t &cols)
Definition: matrix-view.hh:570
static constexpr Else & rr(Then &, Else &s)
Definition: matrix-view.hh:159
internal::remove_all< ArgType >::type NestedExpression
Definition: matrix-view.hh:905
static EIGEN_STRONG_INLINE Derived & evalTo(ActualDerived &dst, const ActualOtherDerived &other)
Definition: matrix-view.hh:259
static segments_t difference(const segment_t &a, const segment_t &b)
Compute the set difference between two segments.
Definition: matrix-view.hh:146
size_type co() const
Col in the Output matrix
Definition: matrix-view.hh:847
#define EIGEN_MATRIX_BLOCKS_PUBLIC_INTERFACE(Derived)
Definition: matrix-view.hh:394
void clearRows()
Clear rows.
Definition: matrix-view.hh:626
hpp::constraints::size_type size_type
Definition: matrix-view.hh:835
static EIGEN_STRONG_INLINE Derived & evalTo(ActualDerived &dst, const ActualOtherDerived &other)
Definition: matrix-view.hh:278
std::pair< size_type, size_type > segment_t
Definition: fwd.hh:83
MatrixBlockView< ArgType, _Rows, _Cols, _allRows, _allCols > OtherDerived
Definition: matrix-view.hh:252
ColIndices_t m_cols
Definition: matrix-view.hh:696
static ReturnType run(Derived &d, size_type r, size_type c, size_type rs, size_type cs)
Definition: matrix-view.hh:336
hpp::constraints::segment_t segment_t
Interval of indices [first, first + second - 1].
Definition: matrix-view.hh:53
EIGEN_STRONG_INLINE size_type rows() const
Definition: matrix-view.hh:948
constexpr empty_struct(In0_t, In1_t)
Definition: matrix-view.hh:174
void addRow(const size_type &row, const size_type size)
Definition: matrix-view.hh:640
EIGEN_STRONG_INLINE size_type _blocks() const
Definition: matrix-view.hh:998
const size_type & nbCols() const
Definition: matrix-view.hh:510
internal::conditional< _allRows, const internal::empty_struct, const Indices_t & >::type RowIndices_t
Definition: matrix-view.hh:924
MatrixBlocksBase()
Empty constructor.
Definition: matrix-view.hh:539
static void run(std::ostream &os, const BlockIndexType &bi)
Definition: matrix-view.hh:366
EIGEN_STRONG_INLINE Scalar & coeffRef(size_type index)
Definition: matrix-view.hh:962
internal::variable_if_dynamic< size_type,(_allRows ? 0 :Dynamic)> _ro
Definition: matrix-view.hh:840
EIGEN_STRONG_INLINE void writeTo(Dest &dst) const
Definition: matrix-view.hh:978
MatrixBlocks(const segment_t &idx)
Definition: matrix-view.hh:600
block_iterator operator++(int)
Definition: matrix-view.hh:886
block_iterator & operator++()
Definition: matrix-view.hh:873
static void run(const Src &src, Dst &dst)
Definition: matrix-view.hh:320
Definition: matrix-view.hh:168
EIGEN_STRONG_INLINE const BlockConstXprType _block(const block_iterator &b) const
Definition: matrix-view.hh:1008
MatrixBlocks< _allRows, _allCols > MatrixIndices_t
Definition: matrix-view.hh:921
hpp::constraints::size_type size_type
Index of vector or matrix.
Definition: matrix-view.hh:51
constexpr bool valid() const
Definition: matrix-view.hh:891
static void shrink(segments_t &a)
static constexpr Else pp(Then, Else s)
Definition: matrix-view.hh:163
assert(d.lhs()._blocks()==d.rhs()._blocks())
static void add(segments_t &a, const segment_t &b)
In place addition of a segment_t to segments_t.
Definition: matrix-view.hh:407
Definition: matrix-view.hh:124
static constexpr Index size()
Definition: matrix-view.hh:175
static segments_t fromLogicalExpression(const Eigen::ArrayBase< Derived > &array)
Definition: matrix-view.hh:31
const size_type & nbIndices() const
Definition: matrix-view.hh:500
MatrixBlocks< AllRows, AllCols > middleRows(size_type i, size_type ni) const
Definition: matrix-view.hh:524
Definition: matrix-view.hh:333
size_type ri() const
Row in the Input matrix
Definition: matrix-view.hh:849
BlockIndex::segments_t segments_t
vector of segments
Definition: matrix-view.hh:419
size_type ci() const
Col in the Input matrix
Definition: matrix-view.hh:855
Definition: matrix-view.hh:360
RowIndices_t m_rows
Definition: matrix-view.hh:695
EIGEN_STRONG_INLINE Scalar & coeffRef(size_type row, const size_type &col)
Definition: matrix-view.hh:967
MatrixBlockView< _ArgType2, _Rows2, _Cols2, _allRows2, _allCols2 > Dst
Definition: matrix-view.hh:319
block_t< const ArgType >::type BlockConstXprType
Definition: matrix-view.hh:919
View::size_type size_type
Definition: matrix-view.hh:334
const size_type & nbRows() const
Definition: matrix-view.hh:681
static void sort(segments_t &a)
const segments_t & indices() const
Definition: matrix-view.hh:483
EIGEN_STRONG_INLINE View< const MatrixType >::type rview(const MatrixBase< MatrixType > &other) const
Definition: matrix-view.hh:453
internal::conditional< _allCols, const internal::empty_struct, const Indices_t & >::type ColIndices_t
Definition: matrix-view.hh:926
static constexpr Then pp(Then f, Else)
Definition: matrix-view.hh:152
ColIndices_t m_cols
Definition: matrix-view.hh:1031
_ArgType ArgType
Definition: matrix-view.hh:903
static constexpr Then & rr(Then &f, Else &)
Definition: matrix-view.hh:148
MatrixBlockView< _ArgType, _Rows, _Cols, _allRows, _allCols > Src
Definition: matrix-view.hh:305
ArgType & m_arg
Definition: matrix-view.hh:1027
Definition: matrix-view.hh:837
static EIGEN_STRONG_INLINE Derived & run(Derived &dst, const OtherDerived &other)
Definition: matrix-view.hh:272
MatrixBlocks(const MatrixBlocksBase< MBDerived > &other)
Copy constructor.
Definition: matrix-view.hh:608
RowIndices_t m_rows
Definition: matrix-view.hh:1029
EIGEN_STRONG_INLINE CoeffReturnType coeff(size_type index) const
Definition: matrix-view.hh:951
size_type m_nbRows
Definition: matrix-view.hh:1028
EIGEN_STRONG_INLINE PlainObject eval() const
Definition: matrix-view.hh:983
internal::conditional< _allCols, internal::empty_struct, const BlockIndex::segments_t & >::type ColIndices_t
Definition: matrix-view.hh:198
EIGEN_STRONG_INLINE View< MatrixType >::type lview(const MatrixBase< MatrixType > &other) const
Definition: matrix-view.hh:438
static bool overlap(const segment_t &a, const segment_t &b)
Whether two segments overlap.
static void run(std::ostream &, const BlockIndexType &)
Definition: matrix-view.hh:362
size_type m_nbCols
Definition: matrix-view.hh:1030
MatrixBlocksRef< AllRows, true > keepRows() const
Definition: matrix-view.hh:468
const ColIndices_t & cols() const
Definition: matrix-view.hh:677
internal::traits< Derived >::ColIndices_t ColIndices_t
Definition: matrix-view.hh:421
static segments_t sum(const segment_t &a, const segment_t &b)
Compute the union of tws segments.
ArgType::Index Index
Definition: matrix-view.hh:206
void clearCols()
Clear cols.
Definition: matrix-view.hh:632
EIGEN_STRONG_INLINE size_type cols() const
Definition: matrix-view.hh:949
View::size_type size_type
Definition: matrix-view.hh:343
pinocchio::size_type size_type
Definition: fwd.hh:47
Smaller matrix composed by concatenation of the blocks.
Definition: matrix-view.hh:426
EIGEN_STRONG_INLINE CoeffReturnType coeff(size_type row, size_type col) const
Definition: matrix-view.hh:956
hpp::constraints::segments_t segments_t
vector of segments
Definition: matrix-view.hh:55
MatrixBlocks< AllRows, AllCols > middleCols(size_type j, size_type nj) const
Definition: matrix-view.hh:532
internal::traits< Derived >::RowIndices_t RowIndices_t
Definition: matrix-view.hh:420
Derived const & derived() const
Definition: matrix-view.hh:430
MatrixBlockView(ArgType &arg, const size_type &nbIndices, const Indices_t &indices)
Valid only when _allRows or _allCols is true.
Definition: matrix-view.hh:940
const size_type & nbRows() const
Definition: matrix-view.hh:506
View::size_type size_type
Definition: matrix-view.hh:352
const RowIndices_t & rows() const
Definition: matrix-view.hh:673
MatrixBlocksBase(const MatrixBlocksBase &)
Copy constructor.
Definition: matrix-view.hh:542
void updateCols()
Definition: matrix-view.hh:667
MatrixBlocks(const segments_t &rows, const segments_t &cols)
Definition: matrix-view.hh:558
Block< Derived,(AllRows ? Derived::RowsAtCompileTime :Eigen::Dynamic),(AllCols ? Derived::ColsAtCompileTime :Eigen::Dynamic),(AllCols ?(bool) Derived::IsRowMajor :(AllRows ?(bool)!Derived::IsRowMajor :false))> type
Definition: matrix-view.hh:916
static EIGEN_STRONG_INLINE Derived & run(Derived &dst, const OtherDerived &other)
Definition: matrix-view.hh:253
static std::ostream & run(std::ostream &os, const constraints::segment_t &s)
Definition: matrix-view.hh:1046
internal::ref_selector< ArgType >::type ArgTypeNested
Definition: matrix-view.hh:904
hpp::constraints::size_type size_type
Index of vector or matrix.
Definition: matrix-view.hh:415
EIGEN_STRONG_INLINE bool isZero(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: matrix-view.hh:1018
internal::conditional< _allRows, internal::empty_struct, BlockIndex::segments_t >::type RowIndices_t
Definition: matrix-view.hh:184
traits< ArgType >::StorageKind StorageKind
Definition: matrix-view.hh:208
MatrixBlocks & operator=(const MatrixBlocks &other)
Definition: matrix-view.hh:618
size_type row
Definition: matrix-view.hh:839
static segments_t extract(const segments_t &segments, size_type start, size_type cardinal)
BlockIndex::segment_t segment_t
Interval of indices [first, first + second - 1].
Definition: matrix-view.hh:417
internal::conditional< _allCols, internal::empty_struct, BlockIndex::segments_t >::type ColIndices_t
Definition: matrix-view.hh:187
static ReturnType run(Derived &d, size_type, size_type c, size_type, size_type cs)
Definition: matrix-view.hh:354
Definition: matrix-view.hh:288
void updateRows()
Definition: matrix-view.hh:658
constexpr empty_struct(In_t)
Definition: matrix-view.hh:172
internal::variable_if_dynamic< size_type,(_allCols ? 0 :Dynamic)> _co
Definition: matrix-view.hh:841
size_type rs() const
number of RowS
Definition: matrix-view.hh:861
Definition: matrix-view.hh:910