|
IMP Reference Guide
develop.169ea894ba,2025/11/01
The Integrative Modeling Platform
|
A Cartesian vector in D-dimensions. More...
#include <IMP/algebra/VectorBaseD.h>
Inheritance diagram for IMP::algebra::VectorBaseD< D >:A Cartesian vector in D-dimensions.
Store a vector of Cartesian coordinates. It supports all expected mathematical operators, including using * for the dot product.
See geometric primitives for more information.
Definition at line 58 of file VectorBaseD.h.
Public Member Functions | |
| template<class Range > | |
| VectorBaseD (const Range &r) | |
| VectorBaseD () | |
| Default constructor. More... | |
| iterator | begin () |
| const_iterator | begin () const |
| iterator | end () |
| const_iterator | end () const |
| Floats | get_coordinates () const |
| const double * | get_data () const |
| Return a pointer to the data stored. More... | |
| unsigned int | get_dimension () const |
| double | get_distance (const VectorBaseD< D > &o) const |
| Return the distance between this and another vector. More... | |
| double | get_magnitude () const |
| double | get_scalar_product (const VectorBaseD &o) const |
| double | get_squared_magnitude () const |
| template<class R > | |
| VectorBaseD< D > & | operator= (const R &r) |
| double | operator[] (unsigned int i) const |
| Return the ith Cartesian coordinate. More... | |
| double & | operator[] (unsigned int i) |
| Return the ith Cartesian coordinate. More... | |
Static Public Attributes | |
| static const int | DIMENSION = D |
|
explicit |
Will accept a list of floats from Python.
Definition at line 89 of file VectorBaseD.h.
| IMP::algebra::VectorBaseD< D >::VectorBaseD | ( | ) |
Default constructor.
Definition at line 133 of file VectorBaseD.h.
| const double* IMP::algebra::VectorBaseD< D >::get_data | ( | ) | const |
Return a pointer to the data stored.
Useful for conversion to other types.
Definition at line 257 of file VectorBaseD.h.
| double IMP::algebra::VectorBaseD< D >::get_distance | ( | const VectorBaseD< D > & | o | ) | const |
Return the distance between this and another vector.
This is essentially identical to (v1 - v2).get_magnitude() but may be slightly more efficient as it avoids creating a temporary vector object.
Definition at line 164 of file VectorBaseD.h.
| double IMP::algebra::VectorBaseD< D >::operator[] | ( | unsigned int | i | ) | const |
Return the ith Cartesian coordinate.
In 3D use [0] to get the x coordinate etc.
Definition at line 119 of file VectorBaseD.h.
| double& IMP::algebra::VectorBaseD< D >::operator[] | ( | unsigned int | i | ) |
Return the ith Cartesian coordinate.
In 3D use [0] to get the x coordinate etc.
Definition at line 126 of file VectorBaseD.h.