Biorbd
Vector.h
1 #ifndef BIORBD_UTILS_VECTOR_H
2 #define BIORBD_UTILS_VECTOR_H
3 
4 #include "biorbdConfig.h"
5 #include "rbdl_math.h"
6 #include "Utils/Scalar.h"
7 
8 namespace biorbd {
9 namespace utils {
10 class Vector3d;
11 
15 #ifdef SWIG
16 class BIORBD_API Vector
17 #else
18 class BIORBD_API Vector : public RigidBodyDynamics::Math::VectorNd
19 #endif
20 {
21 public:
25  Vector();
26 
31  Vector(
32  unsigned int size);
33 
38  Vector(
39  const biorbd::utils::Vector& other);
40 
45  Vector(
46  const RigidBodyDynamics::Math::VectorNd& other);
47 
48 
53  Vector(
54  const biorbd::utils::Vector3d& other);
55 
56 #ifdef BIORBD_USE_EIGEN3_MATH
57  template<typename OtherDerived> Vector(const Eigen::MatrixBase<OtherDerived>& other) :
62  Eigen::VectorXd(other){}
63 #endif
64 
65 #ifdef BIORBD_USE_CASADI_MATH
66  Vector(
71  const casadi::MX& other);
72 
77  Vector(
78  const RBDLCasadiMath::MX_Xd_SubMatrix& other);
79 #endif
80 
87  biorbd::utils::Scalar norm(
88  unsigned int p = 2,
89  bool skipRoot = false) const;
90 
97  biorbd::utils::Vector normGradient(
98  unsigned int p = 2,
99  bool skipRoot = false);
100 
101 #ifndef SWIG
102  void operator=(
107  const biorbd::utils::Vector& other);
108 #ifdef BIORBD_USE_EIGEN3_MATH
109  template<typename OtherDerived>
114  biorbd::utils::Vector& operator=(const Eigen::MatrixBase <OtherDerived>& other){
115  this->Eigen::VectorXd::operator=(other);
116  return *this;
117  }
118 #endif
119 #ifdef BIORBD_USE_CASADI_MATH
120  void operator=(
125  const RBDLCasadiMath::MX_Xd_SubMatrix& other);
126 
131  void operator=(
132  const casadi::MX& other);
133 #endif
134 
135 #endif
136 };
137 
138 }}
139 
140 #endif // BIORBD_UTILS_VECTOR_H
biorbd::utils::Vector
Wrapper of the Eigen VectorXd.
Definition: Vector.h:20
biorbd::utils::Vector3d
Wrapper around Eigen Vector3d and attach it to a parent.
Definition: Vector3d.h:24