template<typename Derived, typename Enable = void>
class SofaCaribou::Algebra::EigenVector< Derived, Enable >
This class can be use to represent any Eigen vector within SOFA.
It implements (and overloads) the BaseVector class of Sofa. This class hence allows to either to create a new Eigen vector or copy/map an existing one and use it in Sofa's components or visitors.
- Template Parameters
-
|
| EigenVector (std::remove_reference_t< Derived > &eigen_vector) |
| Construct the class using another Eigen vector. More...
|
|
| EigenVector (Eigen::Index n) |
| Construct a new Eigen vector of type Derived have n elements. More...
|
|
Index | size () const final |
| Number of elements in the vector.
|
|
SReal | element (Index index) const final |
| Read the value of element i.
|
|
void | resize (Index n) final |
| Resize the vector. More...
|
|
void | clear () final |
| Reset all values to 0.
|
|
void | set (Index index, SReal value) final |
| Write the value of element index.
|
|
void | add (Index index, SReal value) final |
| Add v to the existing value of element i.
|
|
Base::ElementType | getElementType () const final |
| Type of elements stored in this matrix.
|
|
std::size_t | getElementSize () const final |
| Size of one element stored in this matrix.
|
|
const EigenType & | vector () const |
| Get a const reference to the underlying Eigen vector
|
|
EigenType & | vector () |
| Get a reference to the underlying Eigen vector
|
|
template<typename Derived , typename Enable = void>
Construct the class using another Eigen vector.
Depending on the template parameter used for the class, this constructor will either create a new Eigen vector and copy its content from the parameter eigen_matrix, or it will simply store a reference to this external matrix.
- Parameters
-
eigen_matrix | The external matrix |