Three dimensional vector. More...
#include <vec3d.hpp>
Public Member Functions | |
| Vec3D (double x) | |
| Vec3D (double x, double y) | |
| Vec3D (double x, double y, double z) | |
| Vec3D (const class Vec4D &vec) | |
| Vec3D (std::istream &s) | |
| double & | operator[] (int i) |
| const double & | operator[] (int i) const |
| double & | operator() (int i) |
| const double & | operator() (int i) const |
| Vec3D | operator+ (const Vec3D &vec) const |
| Vector addition More... | |
| Vec3D | operator- (const Vec3D &vec) const |
| Vector difference More... | |
| Vec3D & | operator+= (const Vec3D &vec) |
| Vector accumulation More... | |
| double | operator* (const Vec3D &vec) const |
| Dot product. More... | |
| Vec3D | operator* (double x) const |
| Vector scaling. More... | |
| Vec3D | operator- (void) const |
| Unary minus. More... | |
| Vec3D & | operator*= (double x) |
| Vector scaling. More... | |
| Vec3D & | operator/= (double x) |
| Vector scaling with divisor. More... | |
| bool | operator!= (const Vec3D &x) const |
| Inequality test. More... | |
| bool | operator== (const Vec3D &x) const |
| Equality test. More... | |
| bool | approx (const Vec3D &x, double eps=1.0e-6) const |
| Approximate equality test. More... | |
| Vec3D & | operator= (const Vec3D &x) |
| Assignment. More... | |
| Vec3D & | operator= (const double &x) |
| Assignment of every coordinate. More... | |
| void | abs (void) |
| Calculate absolute value of each component. More... | |
| void | normalize (void) |
| Normalize vector. More... | |
| double | norm2 (void) const |
| Returns 2-norm of vector. More... | |
| double | max (void) const |
| Returns inf-norm of vector. More... | |
| double | ssqr (void) const |
| Returns square of 2-norm of vector. More... | |
| int | min_element (void) const |
| Returns the index of element with minimum magnitude (abs). More... | |
| Vec3D | arb_perpendicular (void) const |
| Returns arbitrary vector perpendicular to input vector. More... | |
| void | save (std::ostream &os) const |
| Saves data to stream os. More... | |
Static Public Member Functions | |
| static Vec3D | standard_basis (int i) |
| Returns standard basis vector i. More... | |
Friends | |
| Vec3D | cross (const Vec3D &vec1, const Vec3D &vec2) |
| Cross product. More... | |
| double | norm2 (const Vec3D &vec) |
| Second norm of vector. More... | |
| double | ssqr (const Vec3D &vec) |
| Sum of squares or square of 2-norm of vector. More... | |
| Vec3D | operator* (double x, const Vec3D &vec) |
| Vector scaling. More... | |
| Vec3D | operator* (double x, const class Int3D &i) |
| Vector scaling for integer vector. More... | |
| std::ostream & | operator<< (std::ostream &os, const Vec3D &vec) |
| Outputting to stream. More... | |
| std::basic_ostream< wchar_t > & | operator<< (std::basic_ostream< wchar_t > &os, const Vec3D &vec) |
Detailed Description
Three dimensional vector.
Member Function Documentation
◆ abs()
|
inline |
Calculate absolute value of each component.
◆ approx()
| bool Vec3D::approx | ( | const Vec3D & | x, |
| double | eps = 1.0e-6 |
||
| ) | const |
Approximate equality test.
Does not require exact equality, but absolute or relative error less than eps (which ever is less strict). Be careful using this function!
◆ arb_perpendicular()
| Vec3D Vec3D::arb_perpendicular | ( | void | ) | const |
Returns arbitrary vector perpendicular to input vector.
◆ max()
| double Vec3D::max | ( | void | ) | const |
Returns inf-norm of vector.
Returns maximum component of vector.
◆ min_element()
| int Vec3D::min_element | ( | void | ) | const |
Returns the index of element with minimum magnitude (abs).
◆ norm2()
|
inline |
Returns 2-norm of vector.
◆ normalize()
|
inline |
Normalize vector.
◆ operator!=()
| bool Vec3D::operator!= | ( | const Vec3D & | x | ) | const |
Inequality test.
Require exact equality.
◆ operator*() [1/2]
|
inline |
Dot product.
◆ operator*() [2/2]
|
inline |
Vector scaling.
◆ operator*=()
|
inline |
Vector scaling.
◆ operator+()
◆ operator+=()
◆ operator-() [1/2]
◆ operator-() [2/2]
|
inline |
Unary minus.
◆ operator/=()
|
inline |
Vector scaling with divisor.
◆ operator=() [1/2]
|
inline |
Assignment of every coordinate.
◆ operator=() [2/2]
◆ operator==()
| bool Vec3D::operator== | ( | const Vec3D & | x | ) | const |
Equality test.
Requires exact equality.
◆ save()
|
inline |
Saves data to stream os.
◆ ssqr()
|
inline |
Returns square of 2-norm of vector.
◆ standard_basis()
|
static |
Returns standard basis vector i.
Friends And Related Function Documentation
◆ cross
◆ norm2
|
friend |
Second norm of vector.
◆ operator* [1/2]
◆ operator* [2/2]
◆ operator<<
|
friend |
Outputting to stream.
◆ ssqr
|
friend |
Sum of squares or square of 2-norm of vector.
The documentation for this class was generated from the following files: