Specialization of class vecn3 for DIM == 4.
More...
#include <geogram/basic/vecg.h>
|
T | x |
| Vector x coordinate.
|
|
T | y |
| Vector y coordinate.
|
|
T | z |
| Vector z coordinate.
|
|
T | w |
| Vector w coordinate.
|
|
template<class T>
class GEO::vecng< 4, T >
Specialization of class vecn3 for DIM == 4.
- See also
- vecng
Definition at line 958 of file vecg.h.
◆ value_type
The type of the vector coordinates.
Definition at line 967 of file vecg.h.
◆ vector_type
This vector type.
Definition at line 964 of file vecg.h.
◆ vecng() [1/5]
Default vector constructor.
All coordinates are initialized to 0 (zero).
Definition at line 970 of file vecg.h.
◆ vecng() [2/5]
Constructs a vector from coordinates.
- Parameters
-
[in] | x_in,y_in,z_in,w_in | vector coordinates |
Definition at line 981 of file vecg.h.
◆ vecng() [3/5]
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 990 of file vecg.h.
◆ vecng() [4/5]
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 999 of file vecg.h.
◆ vecng() [5/5]
◆ data() [1/2]
Gets modifiable vector data.
- Returns
- a pointer to the first element of the vector
Definition at line 1111 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 1116 of file vecg.h.
◆ dimension()
Gets the vector dimension.
- Returns
- the value of
DIM
Definition at line 1041 of file vecg.h.
◆ distance()
Gets the distance to a vector.
- Parameters
-
- Returns
- (
v
- this
).length()
Definition at line 1036 of file vecg.h.
◆ distance2()
Gets the squared distance to a vector.
- Parameters
-
- Returns
- (
v
- this
).length2()
Definition at line 1027 of file vecg.h.
◆ length()
Gets the length of the vector.
Definition at line 1022 of file vecg.h.
◆ length2()
Gets the squared length of the vector.
Definition at line 1017 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 1095 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 1065 of file vecg.h.
◆ operator+()
Adds 2 vectors.
Builds a vector by adding coordinates of this vector and coordinates of vector v
.
- Parameters
-
- Returns
- the result vector (
this
+ v
)
Definition at line 1084 of file vecg.h.
◆ operator+=()
Adds a vector in place.
Adds coordinates of vector v
to this vector coordinates
- Parameters
-
- Returns
- a reference to this vector
Definition at line 1046 of file vecg.h.
◆ operator-() [1/2]
Negates a vector.
Builds a vector by negating coordinates of this vector.
- Returns
- the result vector (-
this
)
Definition at line 1106 of file vecg.h.
◆ operator-() [2/2]
Subtracts 2 vectors.
Builds a vector by subtracting coordinates of vector v
to coordinates of this vector.
- Parameters
-
- Returns
- the result vector (
this
- v
)
Definition at line 1089 of file vecg.h.
◆ operator-=()
Subtracts a vector in place.
Subtracts coordinates of vector v
from this vector coordinates
- Parameters
-
- Returns
- a reference to this vector
Definition at line 1055 of file vecg.h.
◆ 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 1101 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 1075 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 1121 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 1127 of file vecg.h.
◆ dim
The dimension of the vector.
Definition at line 961 of file vecg.h.
The documentation for this class was generated from the following file: