|
Correlation 4.10.0
An Analysis Tool for Liquids and for Amorphous Solids
|
A lightweight, constexpr, stack-based 3D vector. More...
#include <LinearAlgebra.hpp>

Public Types | |
| using | value_type = T |
| Scalar type. | |
Public Member Functions | |
| constexpr | Vector3 () noexcept |
| Default constructor. Initializes all components to zero. | |
| constexpr | Vector3 (T x_val, T y_val, T z_val) noexcept |
| Parameterized constructor. | |
| template<typename U> | |
| constexpr | Vector3 (U x_val, U y_val, U z_val) noexcept |
| template<typename U> | |
| constexpr | Vector3 (const Vector3< U > &other) noexcept |
| constexpr | Vector3 (const std::array< T, 3 > &arr) noexcept |
| Array-based constructor. | |
| constexpr T | operator[] (std::size_t idx) const noexcept |
| Access component by index (0, 1, or 2). | |
| constexpr T & | operator[] (std::size_t idx) noexcept |
| Access mutable component by index (0, 1, or 2). | |
| constexpr T | x () const noexcept |
| constexpr T & | x () noexcept |
| constexpr T | y () const noexcept |
| constexpr T & | y () noexcept |
| constexpr T | z () const noexcept |
| constexpr T & | z () noexcept |
| constexpr T & | operator() (std::size_t idx) noexcept |
| Access component by index (alternative syntax). | |
| constexpr T | operator() (std::size_t idx) const noexcept |
| Access component by index (alternative syntax). | |
| constexpr bool | empty () const noexcept |
| Checks if the vector is a zero vector. | |
| constexpr const T * | begin () const noexcept |
| constexpr const T * | end () const noexcept |
| constexpr T * | begin () noexcept |
| constexpr T * | end () noexcept |
| constexpr Vector3 | operator+ (const Vector3 &rhs) const noexcept |
| Vector addition. | |
| constexpr Vector3 | operator- (const Vector3 &rhs) const noexcept |
| Vector subtraction. | |
| constexpr Vector3 | operator- () const noexcept |
| Unary negation. | |
| constexpr Vector3 | operator* (T scalar) const noexcept |
| Scalar multiplication. | |
| constexpr Vector3 | operator/ (T scalar) const noexcept |
| Scalar division. | |
| constexpr Vector3 & | operator+= (const Vector3 &rhs) noexcept |
| In-place addition. | |
| constexpr Vector3 & | operator-= (const Vector3 &rhs) noexcept |
| In-place subtraction. | |
| constexpr Vector3 & | operator*= (T scalar) noexcept |
| In-place scalar multiplication. | |
| constexpr Vector3 & | operator/= (T scalar) noexcept |
| In-place scalar division. | |
| constexpr T | operator* (const Vector3 &rhs) const noexcept |
| Vector-vector multiplication (dot product shorthand). | |
| constexpr std::array< T, 3 > | array () const noexcept |
| Converts the vector to a std::array. | |
| constexpr bool | operator== (const Vector3 &rhs) const noexcept |
| Equality comparison. | |
| constexpr bool | operator!= (const Vector3 &rhs) const noexcept |
| Inequality comparison. | |
Private Attributes | |
| std::array< T, 3 > | data_ |
| Underlying vector components. | |
A lightweight, constexpr, stack-based 3D vector.
Provides basic linear algebra operations for 3D geometric calculations. Supports SIMD optimization for specific types (e.g., double).
| T | The scalar type stored by the vector (e.g., float, double, int). |
| using correlation::math::Vector3< T >::value_type = T |
Scalar type.
|
inlineconstexprnoexcept |
Default constructor. Initializes all components to zero.
|
inlineconstexprnoexcept |
Parameterized constructor.
| x_val | X-component value. |
| y_val | Y-component value. |
| z_val | Z-component value. |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineexplicitconstexprnoexcept |
Array-based constructor.
| arr | Standard array containing {x, y, z}. |
|
inlinenodiscardconstexprnoexcept |
Converts the vector to a std::array.
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
Checks if the vector is a zero vector.
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
Inequality comparison.
| rhs | The vector to compare with. |
|
inlinenodiscardconstexprnoexcept |
Access component by index (alternative syntax).
| idx | Index. |
|
inlineconstexprnoexcept |
Access component by index (alternative syntax).
| idx | Index. |
|
inlinenodiscardconstexprnoexcept |
Vector-vector multiplication (dot product shorthand).
| rhs | The vector to multiply with. |
|
inlinenodiscardconstexprnoexcept |
Scalar multiplication.
| scalar | The scalar factor. |
|
inlineconstexprnoexcept |
In-place scalar multiplication.
| scalar | The scalar factor. |
|
inlinenodiscardconstexprnoexcept |
Vector addition.
| rhs | The vector to add. |
|
inlineconstexprnoexcept |
In-place addition.
| rhs | The vector to add. |
|
inlinenodiscardconstexprnoexcept |
Unary negation.
|
inlinenodiscardconstexprnoexcept |
Vector subtraction.
| rhs | The vector to subtract. |
|
inlineconstexprnoexcept |
In-place subtraction.
| rhs | The vector to subtract. |
|
inlinenodiscardconstexprnoexcept |
Scalar division.
| scalar | The scalar divisor. |
|
inlineconstexprnoexcept |
In-place scalar division.
| scalar | The scalar divisor. |
|
inlinenodiscardconstexprnoexcept |
Equality comparison.
| rhs | The vector to compare with. |
|
inlinenodiscardconstexprnoexcept |
Access component by index (0, 1, or 2).
| idx | Index of the component. |
|
inlineconstexprnoexcept |
Access mutable component by index (0, 1, or 2).
| idx | Index of the component. |
|
inlinenodiscardconstexprnoexcept |

|
inlineconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |

|
inlineconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |

|
inlineconstexprnoexcept |
|
private |
Underlying vector components.