GCC Code Coverage Report


Directory: ./
File: src/visitor/interpolate.hh
Date: 2025-05-04 12:09:19
Exec Total Coverage
Lines: 0 8 0.0%
Branches: 0 13 0.0%

Line Branch Exec Source
1 // Copyright (c) 2020, CNRS
2 // Authors: Joseph Mirabel
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 #ifndef HPP_PINOCCHIO_SRC_VISITOR_INTERPOLATE_HH
30 #define HPP_PINOCCHIO_SRC_VISITOR_INTERPOLATE_HH
31
32 namespace hpp {
33 namespace pinocchio {
34 namespace liegroupType {
35 namespace visitor {
36 /// Interpolate
37 struct Interpolate : public boost::static_visitor<> {
38 Interpolate(const vectorIn_t& e1, const vectorIn_t& e2, value_type u,
39 vectorOut_t& er)
40 : e1_(e1), e2_(e2), u_(u), er_(er), iq_(0), iv_(0) {}
41 template <typename LiegroupType>
42 void operator()(LiegroupType& op) {
43 op.interpolate(e1_.segment<LiegroupType::NQ>(iq_, op.nq()),
44 e2_.segment<LiegroupType::NQ>(iq_, op.nq()), u_,
45 er_.segment<LiegroupType::NQ>(iq_, op.nq()));
46
47 iq_ += op.nq();
48 iv_ += op.nv();
49 }
50 const vectorIn_t& e1_;
51 const vectorIn_t& e2_;
52 value_type u_;
53 vectorOut_t& er_;
54 size_type iq_, iv_;
55 }; // struct Interpolate Visitor
56 } // namespace visitor
57 } // namespace liegroupType
58 } // namespace pinocchio
59 } // namespace hpp
60
61 #endif // HPP_PINOCCHIO_SRC_VISITOR_INTERPOLATE_HH
62