A Cartesian vector in D-dimensions.
More...
#include <IMP/algebra/VectorD.h>
|
typedef const double * | CoordinateConstIterator |
|
typedef double * | CoordinateIterator |
|
|
| VectorD (const Floats &f) |
|
template<class It > |
| VectorD (It b, It e) |
|
| VectorD (double x) |
| Initialize the 1-vector from its value.
|
|
| VectorD (double x, double y) |
| Initialize a 2-vector from separate x,y values.
|
|
| VectorD (double x, double y, double z) |
| Initialize a 3-vector from separate x,y,z values.
|
|
| VectorD (double x0, double x1, double x2, double x3) |
| Initialize a 4-vector from separate w,x,y,z values.
|
|
| VectorD () |
| Default constructor.
|
|
CoordinateIterator | coordinates_begin () |
|
CoordinateConstIterator | coordinates_begin () const |
|
CoordinateIterator | coordinates_end () |
|
CoordinateConstIterator | coordinates_end () const |
|
Floats | get_coordinates () const |
|
unsigned int | get_dimension () const |
|
double | get_magnitude () const |
|
double | get_scalar_product (const VectorD< D > &o) const |
|
double | get_squared_magnitude () const |
|
VectorD | get_unit_vector () const |
|
double | operator[] (unsigned int i) const |
|
double & | operator[] (unsigned int i) |
|
|
These functions write geometry to text files, one line per geometric primitive. Each line has the form “x y z” for points or “x y z r” for spheres. We can easily add general dimension support if requested.. Lines beginning with "#" are treated as comments.
|
void | write_pts (const Vector3Ds &vs, base::TextOutput out) |
| Write a set of 3D vectors to a file. More...
|
|
Vector3Ds | read_pts (base::TextInput input) |
| Read a set of 3D vectors from a file. More...
|
|
|
These functions generate vector objects. Some of the methods, those with random in their name, generate a single vector chosen uniformly from the specified domain. Others, the cover methods, generate a set of points distributed (somewhat) evenly over the domain.
|
template<int D> |
VectorD< D > | get_random_vector_in (const BoundingBoxD< D > &bb) |
| Generate a random vector in a box with uniform density.
|
|
template<int D> |
VectorD< D > | get_random_vector_on (const BoundingBoxD< D > &bb) |
| Generate a random vector on a box with uniform density.
|
|
Vector3Ds | get_uniform_surface_cover (const SpherePatch3D &sph, unsigned int number_of_points) |
| Generate a set of 3d points that uniformly cover a patch of a sphere. More...
|
|
template<int D>
class IMP::algebra::VectorD< D >
Store a vector of Cartesian coordinates. It supports all expected mathematical operators, including using * for the dot product.
- See Also
- Vector3D
-
Vector2D
- Note
- This class is a geometric primitive. Also, this class is not not initialized by its default constructor.
Definition at line 48 of file VectorD.h.
template<int D>
template<class It >
The distance between b and e must be equal to D.
Definition at line 103 of file VectorD.h.
Returns a unit vector pointing at the same direction as this vector.
- Note
- If the magnitude of this vector is smaller than 1e-12 (an arbitrarily selected small number), returns a unit vector pointing at a random direction
Definition at line 201 of file VectorD.h.
Return the ith Cartesian coordinate. In 3D use [0] to get the x coordinate etc.
Definition at line 164 of file VectorD.h.
Return the ith Cartesian coordinate. In 3D use [0] to get the x coordinate etc.
Definition at line 171 of file VectorD.h.
Note that this is not very reliable and probably should not be used.
Definition at line 374 of file VectorD.h.
template<int D>
VectorD< D > get_basis_vector_d |
( |
unsigned int |
coordinate | ) |
|
|
related |
Return the unit vector pointing in the direction of the requested coordinate. That is
get_basis_vector_d<3>(2)==
Vector3D(0,0,1);
Definition at line 415 of file VectorD.h.
Return the vector that is the elementwise product of the two.
Definition at line 607 of file VectorD.h.
Return the vector that is the elementwise product of the two.
Definition at line 620 of file VectorD.h.
- Note
- the implementation can be improved
template<int D>
void set_vector_d_geometry |
( |
VectorD< D > & |
g, |
|
|
const VectorD< D > & |
v |
|
) |
| |
|
related |
The documentation for this class was generated from the following files: