GCC Code Coverage Report


Directory: ./
File: include/crocoddyl/core/states/euclidean.hpp
Date: 2025-03-26 19:23:43
Exec Total Coverage
Lines: 1 1 100.0%
Branches: 1 2 50.0%

Line Branch Exec Source
1 ///////////////////////////////////////////////////////////////////////////////
2 // BSD 3-Clause License
3 //
4 // Copyright (C) 2019-2025, LAAS-CNRS, Heriot-Watt University
5 // Copyright note valid unless otherwise stated in individual files.
6 // All rights reserved.
7 ///////////////////////////////////////////////////////////////////////////////
8
9 #ifndef CROCODDYL_CORE_STATES_EUCLIDEAN_HPP_
10 #define CROCODDYL_CORE_STATES_EUCLIDEAN_HPP_
11
12 #include "crocoddyl/core/fwd.hpp"
13 #include "crocoddyl/core/state-base.hpp"
14
15 namespace crocoddyl {
16
17 template <typename _Scalar>
18 class StateVectorTpl : public StateAbstractTpl<_Scalar> {
19 public:
20 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
21
1/2
✓ Branch 3 taken 5 times.
✗ Branch 4 not taken.
20 CROCODDYL_DERIVED_CAST(StateBase, StateVectorTpl)
22
23 typedef _Scalar Scalar;
24 typedef MathBaseTpl<Scalar> MathBase;
25 typedef typename MathBase::VectorXs VectorXs;
26 typedef typename MathBase::MatrixXs MatrixXs;
27
28 explicit StateVectorTpl(const std::size_t nx);
29 virtual ~StateVectorTpl();
30
31 virtual VectorXs zero() const override;
32 virtual VectorXs rand() const override;
33 virtual void diff(const Eigen::Ref<const VectorXs>& x0,
34 const Eigen::Ref<const VectorXs>& x1,
35 Eigen::Ref<VectorXs> dxout) const override;
36 virtual void integrate(const Eigen::Ref<const VectorXs>& x,
37 const Eigen::Ref<const VectorXs>& dx,
38 Eigen::Ref<VectorXs> xout) const override;
39 virtual void Jdiff(const Eigen::Ref<const VectorXs>&,
40 const Eigen::Ref<const VectorXs>&,
41 Eigen::Ref<MatrixXs> Jfirst, Eigen::Ref<MatrixXs> Jsecond,
42 const Jcomponent firstsecond = both) const override;
43 virtual void Jintegrate(const Eigen::Ref<const VectorXs>& x,
44 const Eigen::Ref<const VectorXs>& dx,
45 Eigen::Ref<MatrixXs> Jfirst,
46 Eigen::Ref<MatrixXs> Jsecond,
47 const Jcomponent firstsecond = both,
48 const AssignmentOp = setto) const override;
49 virtual void JintegrateTransport(const Eigen::Ref<const VectorXs>& x,
50 const Eigen::Ref<const VectorXs>& dx,
51 Eigen::Ref<MatrixXs> Jin,
52 const Jcomponent firstsecond) const override;
53
54 template <typename NewScalar>
55 StateVectorTpl<NewScalar> cast() const;
56
57 /**
58 * @brief Print relevant information of the state vector
59 *
60 * @param[out] os Output stream object
61 */
62 virtual void print(std::ostream& os) const override;
63
64 protected:
65 using StateAbstractTpl<Scalar>::nx_;
66 using StateAbstractTpl<Scalar>::ndx_;
67 using StateAbstractTpl<Scalar>::nq_;
68 using StateAbstractTpl<Scalar>::nv_;
69 using StateAbstractTpl<Scalar>::lb_;
70 using StateAbstractTpl<Scalar>::ub_;
71 using StateAbstractTpl<Scalar>::has_limits_;
72 };
73
74 } // namespace crocoddyl
75
76 /* --- Details -------------------------------------------------------------- */
77 /* --- Details -------------------------------------------------------------- */
78 /* --- Details -------------------------------------------------------------- */
79 #include "crocoddyl/core/states/euclidean.hxx"
80
81 CROCODDYL_DECLARE_EXTERN_TEMPLATE_CLASS(crocoddyl::StateVectorTpl)
82
83 #endif // CROCODDYL_CORE_STATES_EUCLIDEAN_HPP_
84