hpp-constraints  4.9.1
Definition of basic geometric constraints for motion planning
matrix-view.hh
Go to the documentation of this file.
1 // Copyright (c) 2017, Joseph Mirabel
2 // Authors: Joseph Mirabel (joseph.mirabel@laas.fr)
3 //
4 // This file is part of hpp-constraints.
5 // hpp-constraints is free software: you can redistribute it
6 // and/or modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation, either version
8 // 3 of the License, or (at your option) any later version.
9 //
10 // hpp-constraints is distributed in the hope that it will be
11 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
12 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // General Lesser Public License for more details. You should have
14 // received a copy of the GNU Lesser General Public License along with
15 // hpp-constraints. If not, see <http://www.gnu.org/licenses/>.
16 
17 namespace Eigen {
18  template <typename Derived>
20  (const Eigen::ArrayBase<Derived>& array)
21  {
22  segments_t res;
23  for (size_type i = 0; i < array.derived().size(); ++i)
24  if (array.derived()[i]) res.push_back (segment_t(i, 1));
25  shrink(res);
26  return res;
27  }
28 } // namespace Eigen
29 
30 #include <hpp/pinocchio/util.hh>
31 
32 namespace hpp {
33  template <int Option> struct prettyPrint <Eigen::BlockIndex::segments_t, Option>
34  {
35  static std::ostream& run (std::ostream& os, const constraints::segments_t& segs)
36  {
38  return os;
39  }
40  };
41 } // namespace hpp
Definition: fwd.hh:26
std::vector< segment_t > segments_t
vector of segments
Definition: matrix-view.hh:43
std::vector< segment_t > segments_t
Definition: fwd.hh:69
static void run(std::ostream &os, const BlockIndexType &bi)
Definition: matrix-view.hh:298
hpp::constraints::size_type size_type
Index of vector or matrix.
Definition: matrix-view.hh:39
static segments_t fromLogicalExpression(const Eigen::ArrayBase< Derived > &array)
Definition: matrix-view.hh:20
std::pair< size_type, size_type > segment_t
Interval of indices [first, first + second - 1].
Definition: matrix-view.hh:41
static std::ostream & run(std::ostream &os, const constraints::segments_t &segs)
Definition: matrix-view.hh:35