#include <Vec.h>
Public Member Functions | |
| Vec (size_t const n=0) | |
| Vec (std::vector< T > const &data) | |
| Vec (Vec const &v) | |
| bool | isAlmostEq (Vec const &v) const |
| bool | isAlmostZero () const |
| std::ostream & | output (std::ostream &out) const |
| Vec & | set (T const x) |
| Vec & | add (Vec const &v) |
| Vec & | subtract (Vec const &v) |
| Vec & | scale (T const x) |
| Vec & | scale (Vec const &v) |
| T | length () const |
| T | squaredLength () const |
| T | minElement () const |
| T | maxElement () const |
| size_t | argMax () const |
| size_t | argMin () const |
| T | dot (Vec const &v) const |
| T | sum () const |
| Vec & | normalize () |
| Vec & | setLength (T const x) |
| Vec & | clampMaxLength (T const x) |
| Vec & | shuffle () |
| Vec & | randomize () |
| Vec & | wrap (Vec const &v) |
| Vec & | clamp (Vec const &lower, Vec const &upper) |
| Vec & | probabilityDistribution () |
| Make this into a probability distribution. | |
| Vec | relativeTo (Vec const &v) const |
| Calculate a new vector that is this vector relative to v. | |
The world probably doesn't need yet another vector class, but this one has several desirable properties:
It is not however meant to be a fully fledged linear algebra class. If you are looking for such a library try www.boost.org, geometrictools.com, or any of a host of other libraries.
1.5.1