Biorbd Release_1.13.0
Loading...
Searching...
No Matches
Vector.h
1#ifndef BIORBD_UTILS_VECTOR_H
2#define BIORBD_UTILS_VECTOR_H
3
4#include "biorbdConfig.h"
5
6#include "Utils/Scalar.h"
7#include "rbdl/rbdl_math.h"
8
9namespace BIORBD_NAMESPACE {
10namespace utils {
11class Vector3d;
12
16#ifdef SWIG
17class BIORBD_API Vector
18#else
19class BIORBD_API Vector : public RigidBodyDynamics::Math::VectorNd
20#endif
21{
22 public:
26 Vector();
27
32 Vector(size_t size);
33
38 Vector(const Vector& other);
39
44 Vector(const RigidBodyDynamics::Math::VectorNd& other);
45
50 Vector(const Vector3d& other);
51
52#ifdef BIORBD_USE_EIGEN3_MATH
57 template <typename OtherDerived>
58 Vector(const Eigen::MatrixBase<OtherDerived>& other)
59 : Eigen::VectorXd(other) {}
60#endif
61
62#ifdef BIORBD_USE_CASADI_MATH
67 Vector(const casadi::MX& other);
68
73 Vector(const RBDLCasadiMath::MX_Xd_SubMatrix& other);
74#endif
75
82 Scalar norm(size_t p = 2, bool skipRoot = false) const;
83
91 Vector normGradient(size_t p = 2, bool skipRoot = false);
92
93#ifndef SWIG
98 void operator=(const Vector& other);
99#ifdef BIORBD_USE_EIGEN3_MATH
104 template <typename OtherDerived>
105 Vector& operator=(const Eigen::MatrixBase<OtherDerived>& other) {
106 this->Eigen::VectorXd::operator=(other);
107 return *this;
108 }
109#endif
110#ifdef BIORBD_USE_CASADI_MATH
115 void operator=(const RBDLCasadiMath::MX_Xd_SubMatrix& other);
116
121 void operator=(const casadi::MX& other);
122#endif
123
124#endif
125};
126
127} // namespace utils
128} // namespace BIORBD_NAMESPACE
129
130#endif // BIORBD_UTILS_VECTOR_H
Wrapper around Eigen Vector3d and attach it to a parent.
Definition Vector3d.h:27
Wrapper of the Eigen VectorXd.
Definition Vector.h:21
Vector normGradient(size_t p=2, bool skipRoot=false)
Return the gradient of the p-norm.
Definition Vector.cpp:57
Scalar norm(size_t p=2, bool skipRoot=false) const
Return the Euclidian p-norm of the vector.
Definition Vector.cpp:34
Vector()
Construct vector.
Definition Vector.cpp:10
void operator=(const Vector &other)
operator= For submatrices
Definition Vector.cpp:83