#include <BaseVector.h>

Public Member Functions | |
| virtual | ~BaseVector () |
| virtual int | size (void) const =0 |
| Number of elements. | |
| virtual SReal | element (int i) const =0 |
| Read the value of element i. | |
| virtual void | resize (int dim)=0 |
| Resize the vector, and reset all values to 0. | |
| virtual void | clear ()=0 |
| Reset all values to 0. | |
| virtual void | set (int i, SReal v)=0 |
| Write the value of element i. | |
| virtual void | add (int i, SReal v)=0 |
| Add v to the existing value of element i. | |
| virtual void | clear (int i) |
| Reset the value of element i to 0. | |
Note that accessing values using this class is rather slow and should only be used in codes where the provided genericity is necessary.
Definition at line 40 of file BaseVector.h.
| virtual sofa::defaulttype::BaseVector::~BaseVector | ( | ) | [inline, virtual] |
Definition at line 43 of file BaseVector.h.
Add v to the existing value of element i.
Implemented in sofa::component::linearsolver::FullVector< T >, sofa::component::linearsolver::NewMatVector, sofa::gpu::cuda::CudaBaseVector< T >, and sofa::component::linearsolver::FullVector< double >.
Referenced by sofa::component::mass::UniformMass< DataTypes, MassType >::addMDxToVector(), and sofa::component::linearsolver::SparseMatrix< double >::mulTranspose().
| virtual void sofa::defaulttype::BaseVector::clear | ( | int | i | ) | [inline, virtual] |
| virtual void sofa::defaulttype::BaseVector::clear | ( | ) | [pure virtual] |
Reset all values to 0.
Implemented in sofa::component::linearsolver::FullVector< T >, sofa::component::linearsolver::NewMatVector, sofa::gpu::cuda::CudaBaseVector< T >, and sofa::component::linearsolver::FullVector< double >.
Referenced by sofa::component::constraint::FixedConstraint< DataTypes >::applyConstraint(), and sofa::component::constraint::AttachConstraint< DataTypes >::applyConstraint().
Read the value of element i.
Implemented in sofa::component::linearsolver::FullVector< T >, sofa::component::linearsolver::NewMatVector, sofa::gpu::cuda::CudaBaseVector< T >, and sofa::component::linearsolver::FullVector< double >.
Referenced by sofa::component::MechanicalObject< DataTypes >::addBaseVectorToState(), sofa::component::constraint::UncoupledConstraintCorrection< TDataTypes >::applyContactForce(), sofa::component::constraint::PrecomputedConstraintCorrection< TDataTypes >::applyContactForce(), sofa::component::constraint::LinearSolverConstraintCorrection< TDataTypes >::applyContactForce(), sofa::component::linearsolver::SparseMatrix< double >::mul(), and sofa::component::linearsolver::SparseMatrix< double >::mulTranspose().
| virtual void sofa::defaulttype::BaseVector::resize | ( | int | dim | ) | [pure virtual] |
Resize the vector, and reset all values to 0.
Implemented in sofa::component::linearsolver::FullVector< T >, sofa::component::linearsolver::MKLVector, sofa::component::linearsolver::NewMatVector, sofa::gpu::cuda::CudaBaseVector< T >, and sofa::component::linearsolver::FullVector< double >.
Referenced by sofa::component::linearsolver::SparseMatrix< double >::mul(), and sofa::component::linearsolver::SparseMatrix< double >::mulTranspose().
Write the value of element i.
Implemented in sofa::component::linearsolver::FullVector< T >, sofa::component::linearsolver::NewMatVector, sofa::gpu::cuda::CudaBaseVector< T >, and sofa::component::linearsolver::FullVector< double >.
Referenced by sofa::component::constraint::UnilateralInteractionConstraint< DataTypes >::getConstraintValue(), sofa::component::MechanicalObject< DataTypes >::loadInBaseVector(), and sofa::component::linearsolver::SparseMatrix< double >::mul().
| virtual int sofa::defaulttype::BaseVector::size | ( | void | ) | const [pure virtual] |
Number of elements.
Implemented in sofa::component::linearsolver::FullVector< T >, sofa::component::linearsolver::NewMatVector, sofa::gpu::cuda::CudaBaseVector< T >, and sofa::component::linearsolver::FullVector< double >.
1.5.7.1