Specialization of class vecng for DIM == 3.
More...
#include <geogram/basic/vecg.h>
|
| | vecng () |
| | Default vector constructor.
|
| |
| | vecng (const T &x_in, const T &y_in, const T &z_in) |
| | Constructs a vector from coordinates.
|
| |
| | vecng (T &&x_in, T &&y_in, T &&z_in) |
| | Constructs a vector from coordinates.
|
| |
|
| vecng (const vecng< 3, T > &rhs)=default |
| |
|
| vecng (vecng< 3, T > &&rhs)=default |
| |
| template<class T2 > |
| | vecng (const vecng< dim, T2 > &v) |
| | Constructs a vector by copy.
|
| |
| template<class T2 > |
| | vecng (const T2 *v) |
| | Constructs a vector from an array.
|
| |
| | vecng (const std::initializer_list< T > &Vi) |
| |
|
vecng< 3, T > & | operator= (const vecng< 3, T > &rhs)=default |
| |
|
vecng< 3, T > & | operator= (vecng< 3, T > &&rhs)=default |
| |
| T | length2 () const |
| | Gets the squared length of the vector.
|
| |
| T | length () const |
| | Gets the length of the vector.
|
| |
| T | distance2 (const vector_type &v) const |
| |
| T | distance (const vector_type &v) const |
| |
| vector_type & | operator+= (const vector_type &v) |
| |
| vector_type & | operator-= (const vector_type &v) |
| |
| template<class T2 > |
| vector_type & | operator*= (T2 s) |
| | Multiplies by a scalar in place.
|
| |
| template<class T2 > |
| vector_type & | operator/= (T2 s) |
| | Divides by a scalar in place.
|
| |
| vector_type | operator+ (const vector_type &v) const |
| |
| vector_type | operator- (const vector_type &v) const |
| |
| template<class T2 > |
| vector_type | operator* (T2 s) const |
| | Multiplies a vector by a scalar.
|
| |
| template<class T2 > |
| vector_type | operator/ (T2 s) const |
| | Divides a vector by a scalar.
|
| |
| vector_type | operator- () const |
| | Negates a vector.
|
| |
| index_t | dimension () const |
| | Gets the vector dimension.
|
| |
| T * | data () |
| | Gets modifiable vector data.
|
| |
| const T * | data () const |
| | Gets non-modifiable vector data.
|
| |
| T & | operator[] (index_t i) |
| | Gets a modifiable vector coordinate.
|
| |
| const T & | operator[] (index_t i) const |
| | Gets a non-modifiable vector coordinate.
|
| |
| void | optimize () |
| | Optimizes coordinate representation.
|
| |
|
| T | x |
| | Vector x coordinate.
|
| |
| T | y |
| | Vector y coordinate.
|
| |
| T | z |
| | Vector z coordinate.
|
| |
|
| static constexpr index_t | dim = 3 |
| | The dimension of the vector.
|
| |
template<class T>
class GEO::vecng< 3, T >
Specialization of class vecng for DIM == 3.
- See also
- vecng
Definition at line 746 of file vecg.h.
◆ value_type
The type of the vector coordinates.
Definition at line 755 of file vecg.h.
◆ vector_type
This vector type.
Definition at line 752 of file vecg.h.
◆ vecng() [1/6]
Default vector constructor.
All coordinates are initialized to 0 (zero).
Definition at line 758 of file vecg.h.
◆ vecng() [2/6]
template<class T >
| GEO::vecng< 3, T >::vecng |
( |
const T & |
x_in, |
|
|
const T & |
y_in, |
|
|
const T & |
z_in |
|
) |
| |
|
inline |
Constructs a vector from coordinates.
- Parameters
-
| [in] | x_in,y_in,z_in | references to vector coordinates |
Definition at line 768 of file vecg.h.
◆ vecng() [3/6]
template<class T >
| GEO::vecng< 3, T >::vecng |
( |
T && |
x_in, |
|
|
T && |
y_in, |
|
|
T && |
z_in |
|
) |
| |
|
inline |
Constructs a vector from coordinates.
- Parameters
-
| [in] | x_in,y_in,z_in | vector coordinates as rvalues |
Definition at line 778 of file vecg.h.
◆ vecng() [4/6]
template<class T >
template<class T2 >
Constructs a vector by copy.
This copies coordinates of vector v to this vector. The type T2 of the coordinates in v must be convertible to the type T of this vector.
- Parameters
-
| [in] | v | an vector of same dimension with coordinates of type T2 |
- Template Parameters
-
| T2 | the type of coordinates in vector v |
Definition at line 789 of file vecg.h.
◆ vecng() [5/6]
template<class T >
template<class T2 >
Constructs a vector from an array.
This copies coordinates the first DIM coordinates of array v to this vector. The type T2 of the coordinates in v must be convertible to the type T of this vector.
- Parameters
-
| [in] | v | an array of values of type T2 |
- Template Parameters
-
| T2 | the type of coordinates in vector v |
Definition at line 797 of file vecg.h.
◆ vecng() [6/6]
template<class T >
| GEO::vecng< 3, T >::vecng |
( |
const std::initializer_list< T > & |
Vi | ) |
|
|
inline |
◆ data() [1/2]
Gets modifiable vector data.
- Returns
- a pointer to the first element of the vector
Definition at line 906 of file vecg.h.
◆ data() [2/2]
Gets non-modifiable vector data.
- Returns
- a const pointer to the first element of the vector
Definition at line 911 of file vecg.h.
◆ dimension()
Gets the vector dimension.
- Returns
- the value of
DIM
Definition at line 901 of file vecg.h.
◆ distance()
◆ distance2()
◆ length()
Gets the length of the vector.
Definition at line 822 of file vecg.h.
◆ length2()
Gets the squared length of the vector.
Definition at line 817 of file vecg.h.
◆ operator*()
template<class T >
template<class T2 >
Multiplies a vector by a scalar.
Builds a vector by multipying this vector coordinates by value s. The type T2 of s must be convertible to the type T of this vector coordinates.
- Parameters
-
- Template Parameters
-
- Returns
- the result vector (
this * s)
Definition at line 885 of file vecg.h.
◆ operator*=()
template<class T >
template<class T2 >
Multiplies by a scalar in place.
Multiplies this vector coordinates by value s. The type T2 of s must be convertible to the type T of this vector coordinates.
- Parameters
-
- Template Parameters
-
- Returns
- a reference to this vector
Definition at line 857 of file vecg.h.
◆ operator+()
◆ operator+=()
◆ operator-() [1/2]
Negates a vector.
Builds a vector by negating coordinates of this vector.
- Returns
- the result vector (-
this)
Definition at line 896 of file vecg.h.
◆ operator-() [2/2]
◆ operator-=()
◆ operator/()
template<class T >
template<class T2 >
Divides a vector by a scalar.
Builds a vector by dividing this vector coordinates by value s. The type T2 of s must be convertible to the type T of this vector coordinates.
- Parameters
-
- Template Parameters
-
- Returns
- the result vector (
this / s)
Definition at line 891 of file vecg.h.
◆ operator/=()
template<class T >
template<class T2 >
Divides by a scalar in place.
Divides this vector coordinates by value s. The type T2 of s must be convertible to the type T of this vector coordinates.
- Parameters
-
- Template Parameters
-
- Returns
- a reference to this vector
Definition at line 866 of file vecg.h.
◆ operator[]() [1/2]
Gets a modifiable vector coordinate.
- Parameters
-
| [in] | i | index of the coordinate |
- Returns
- a reference to coordinate at index
i
Definition at line 916 of file vecg.h.
◆ operator[]() [2/2]
Gets a non-modifiable vector coordinate.
- Parameters
-
| [in] | i | index of the coordinate |
- Returns
- a const reference to coordinate at index
i
Definition at line 922 of file vecg.h.
◆ optimize()
Optimizes coordinate representation.
Definition at line 928 of file vecg.h.
◆ dim
The dimension of the vector.
Definition at line 749 of file vecg.h.
Vector x coordinate.
Definition at line 935 of file vecg.h.
Vector y coordinate.
Definition at line 937 of file vecg.h.
Vector z coordinate.
Definition at line 939 of file vecg.h.
The documentation for this class was generated from the following file: