| Directory: | ./ |
|---|---|
| File: | include/hpp/constraints/impl/matrix-view.hh |
| Date: | 2025-05-05 12:19:30 |
| Exec | Total | Coverage | |
|---|---|---|---|
| Lines: | 9 | 9 | 100.0% |
| Branches: | 7 | 10 | 70.0% |
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // Copyright (c) 2017, Joseph Mirabel | ||
| 2 | // Authors: Joseph Mirabel (joseph.mirabel@laas.fr) | ||
| 3 | // | ||
| 4 | |||
| 5 | // Redistribution and use in source and binary forms, with or without | ||
| 6 | // modification, are permitted provided that the following conditions are | ||
| 7 | // met: | ||
| 8 | // | ||
| 9 | // 1. Redistributions of source code must retain the above copyright | ||
| 10 | // notice, this list of conditions and the following disclaimer. | ||
| 11 | // | ||
| 12 | // 2. Redistributions in binary form must reproduce the above copyright | ||
| 13 | // notice, this list of conditions and the following disclaimer in the | ||
| 14 | // documentation and/or other materials provided with the distribution. | ||
| 15 | // | ||
| 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
| 17 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
| 18 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
| 19 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
| 20 | // HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| 21 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
| 22 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
| 23 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
| 24 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
| 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH | ||
| 27 | // DAMAGE. | ||
| 28 | |||
| 29 | namespace Eigen { | ||
| 30 | template <typename Derived> | ||
| 31 | 124 | typename BlockIndex::segments_t BlockIndex::fromLogicalExpression( | |
| 32 | const Eigen::ArrayBase<Derived>& array) { | ||
| 33 | 124 | segments_t res; | |
| 34 |
2/2✓ Branch 2 taken 1346 times.
✓ Branch 3 taken 124 times.
|
1470 | for (size_type i = 0; i < array.derived().size(); ++i) |
| 35 |
4/6✓ Branch 2 taken 1346 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 735 times.
✓ Branch 5 taken 611 times.
✓ Branch 8 taken 735 times.
✗ Branch 9 not taken.
|
1346 | if (array.derived()[i]) res.push_back(segment_t(i, 1)); |
| 36 |
1/2✓ Branch 1 taken 124 times.
✗ Branch 2 not taken.
|
124 | shrink(res); |
| 37 | 124 | return res; | |
| 38 | } | ||
| 39 | } // namespace Eigen | ||
| 40 | |||
| 41 | #include <hpp/pinocchio/util.hh> | ||
| 42 | |||
| 43 | namespace hpp { | ||
| 44 | template <int Option> | ||
| 45 | struct prettyPrint<Eigen::BlockIndex::segments_t, Option> { | ||
| 46 | 33 | static std::ostream& run(std::ostream& os, | |
| 47 | const constraints::segments_t& segs) { | ||
| 48 | 33 | Eigen::internal::print_indices::run(os, segs); | |
| 49 | 33 | return os; | |
| 50 | } | ||
| 51 | }; | ||
| 52 | } // namespace hpp | ||
| 53 |