Directory: | ./ |
---|---|
File: | src/affine-function.cc |
Date: | 2025-05-05 12:19:30 |
Exec | Total | Coverage | |
---|---|---|---|
Lines: | 6 | 12 | 50.0% |
Branches: | 2 | 12 | 16.7% |
Line | Branch | Exec | Source |
---|---|---|---|
1 | // Copyright (c) 2020, 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 | #include <hpp/constraints/affine-function.hh> | ||
30 | #include <hpp/pinocchio/liegroup-element.hh> | ||
31 | #include <hpp/util/serialization.hh> | ||
32 | #include <pinocchio/serialization/eigen.hpp> | ||
33 | |||
34 | namespace hpp { | ||
35 | namespace constraints { | ||
36 | using namespace boost::serialization; | ||
37 | |||
38 | template <class Archive> | ||
39 | ✗ | void Identity::serialize(Archive& ar, const unsigned int version) { | |
40 | (void)version; | ||
41 | ✗ | ar& make_nvp("base", base_object<DifferentiableFunction>(*this)); | |
42 | } | ||
43 | |||
44 | HPP_SERIALIZATION_IMPLEMENT(Identity); | ||
45 | |||
46 | template <class Archive> | ||
47 | ✗ | void AffineFunction::serialize(Archive& ar, const unsigned int version) { | |
48 | (void)version; | ||
49 | ✗ | ar& make_nvp("base", base_object<DifferentiableFunction>(*this)); | |
50 | ✗ | ar& make_nvp("J_", const_cast<matrix_t&>(J_)); | |
51 | ✗ | ar& make_nvp("b_", const_cast<vector_t&>(b_)); | |
52 | } | ||
53 | |||
54 | HPP_SERIALIZATION_IMPLEMENT(AffineFunction); | ||
55 | |||
56 | template <class Archive> | ||
57 | 4 | void ConstantFunction::serialize(Archive& ar, const unsigned int version) { | |
58 | (void)version; | ||
59 |
1/2✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
4 | ar& make_nvp("base", base_object<DifferentiableFunction>(*this)); |
60 |
1/2✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
|
4 | ar& make_nvp("c_", const_cast<LiegroupElement&>(c_)); |
61 | } | ||
62 | |||
63 | HPP_SERIALIZATION_IMPLEMENT(ConstantFunction); | ||
64 | |||
65 | } // namespace constraints | ||
66 | } // namespace hpp | ||
67 | |||
68 | 12 | BOOST_CLASS_EXPORT(hpp::constraints::Identity) | |
69 | 12 | BOOST_CLASS_EXPORT(hpp::constraints::AffineFunction) | |
70 | 12 | BOOST_CLASS_EXPORT(hpp::constraints::ConstantFunction) | |
71 |