Correlation 4.10.0
An Analysis Tool for Liquids and for Amorphous Solids
Loading...
Searching...
No Matches
correlation::render3d::Vector4< T > Class Template Reference

Stack-allocated 4D homogeneous vector. More...

#include <Math3D.hpp>

Public Types

using value_type = T

Public Member Functions

constexpr Vector4 () noexcept
 Default constructor. Initializes all components to zero.
constexpr Vector4 (T coord_x, T coord_y, T coord_z, T coord_w) noexcept
 Component-wise constructor.
constexpr Vector4 (const math::Vector3< T > &vec3, T coord_w=static_cast< T >(1)) noexcept
 Constructs Vector4 from 3D vector and w component.
constexpr Vector4 (const std::array< T, 4 > &arr) noexcept
 Constructs Vector4 from std::array.
constexpr T x () const noexcept
constexpr T y () const noexcept
constexpr T z () const noexcept
constexpr T w () const noexcept
constexpr T & operator[] (std::size_t idx) noexcept
constexpr const T & operator[] (std::size_t idx) const noexcept
constexpr const std::array< T, 4 > & data () const noexcept
constexpr math::Vector3< T > toVector3 () const noexcept
constexpr Vector4 operator+ (const Vector4 &rhs) const noexcept
constexpr Vector4 operator- (const Vector4 &rhs) const noexcept
constexpr Vector4 operator* (T scalar) const noexcept
constexpr Vector4 operator/ (T scalar) const
constexpr T dot (const Vector4 &rhs) const noexcept
T length () const noexcept
Vector4 normalized () const
constexpr bool operator== (const Vector4 &rhs) const noexcept

Private Attributes

std::array< T, 4 > data_ {0, 0, 0, 0}

Detailed Description

template<typename T = float>
requires std::is_floating_point_v<T>
class correlation::render3d::Vector4< T >

Stack-allocated 4D homogeneous vector.

Template Parameters
TFloating-point scalar type.

Member Typedef Documentation

◆ value_type

template<typename T = float>
using correlation::render3d::Vector4< T >::value_type = T

Constructor & Destructor Documentation

◆ Vector4() [1/4]

template<typename T = float>
correlation::render3d::Vector4< T >::Vector4 ( )
inlineconstexprnoexcept

Default constructor. Initializes all components to zero.

Here is the caller graph for this function:

◆ Vector4() [2/4]

template<typename T = float>
correlation::render3d::Vector4< T >::Vector4 ( T coord_x,
T coord_y,
T coord_z,
T coord_w )
inlineconstexprnoexcept

Component-wise constructor.

Parameters
coord_xX coordinate.
coord_yY coordinate.
coord_zZ coordinate.
coord_wW coordinate (homogeneous scale).

◆ Vector4() [3/4]

template<typename T = float>
correlation::render3d::Vector4< T >::Vector4 ( const math::Vector3< T > & vec3,
T coord_w = static_cast<T>(1) )
inlineexplicitconstexprnoexcept

Constructs Vector4 from 3D vector and w component.

Parameters
vec33D vector.
coord_wHomogeneous coordinate (default 1.0).
Here is the call graph for this function:

◆ Vector4() [4/4]

template<typename T = float>
correlation::render3d::Vector4< T >::Vector4 ( const std::array< T, 4 > & arr)
inlineexplicitconstexprnoexcept

Constructs Vector4 from std::array.

Parameters
arrArray containing {x, y, z, w}.

Member Function Documentation

◆ data()

template<typename T = float>
const std::array< T, 4 > & correlation::render3d::Vector4< T >::data ( ) const
inlinenodiscardconstexprnoexcept

◆ dot()

template<typename T = float>
T correlation::render3d::Vector4< T >::dot ( const Vector4< T > & rhs) const
inlinenodiscardconstexprnoexcept
Here is the call graph for this function:
Here is the caller graph for this function:

◆ length()

template<typename T = float>
T correlation::render3d::Vector4< T >::length ( ) const
inlinenodiscardnoexcept
Here is the call graph for this function:
Here is the caller graph for this function:

◆ normalized()

template<typename T = float>
Vector4 correlation::render3d::Vector4< T >::normalized ( ) const
inlinenodiscard
Here is the call graph for this function:

◆ operator*()

template<typename T = float>
Vector4 correlation::render3d::Vector4< T >::operator* ( T scalar) const
inlinenodiscardconstexprnoexcept
Here is the call graph for this function:

◆ operator+()

template<typename T = float>
Vector4 correlation::render3d::Vector4< T >::operator+ ( const Vector4< T > & rhs) const
inlinenodiscardconstexprnoexcept
Here is the call graph for this function:

◆ operator-()

template<typename T = float>
Vector4 correlation::render3d::Vector4< T >::operator- ( const Vector4< T > & rhs) const
inlinenodiscardconstexprnoexcept
Here is the call graph for this function:

◆ operator/()

template<typename T = float>
Vector4 correlation::render3d::Vector4< T >::operator/ ( T scalar) const
inlinenodiscardconstexpr
Here is the call graph for this function:

◆ operator==()

template<typename T = float>
bool correlation::render3d::Vector4< T >::operator== ( const Vector4< T > & rhs) const
inlinenodiscardconstexprnoexcept
Here is the call graph for this function:

◆ operator[]() [1/2]

template<typename T = float>
const T & correlation::render3d::Vector4< T >::operator[] ( std::size_t idx) const
inlinenodiscardconstexprnoexcept

◆ operator[]() [2/2]

template<typename T = float>
T & correlation::render3d::Vector4< T >::operator[] ( std::size_t idx)
inlinenodiscardconstexprnoexcept

◆ toVector3()

template<typename T = float>
math::Vector3< T > correlation::render3d::Vector4< T >::toVector3 ( ) const
inlinenodiscardconstexprnoexcept
Here is the caller graph for this function:

◆ w()

template<typename T = float>
T correlation::render3d::Vector4< T >::w ( ) const
inlinenodiscardconstexprnoexcept

◆ x()

template<typename T = float>
T correlation::render3d::Vector4< T >::x ( ) const
inlinenodiscardconstexprnoexcept
Here is the caller graph for this function:

◆ y()

template<typename T = float>
T correlation::render3d::Vector4< T >::y ( ) const
inlinenodiscardconstexprnoexcept
Here is the caller graph for this function:

◆ z()

template<typename T = float>
T correlation::render3d::Vector4< T >::z ( ) const
inlinenodiscardconstexprnoexcept
Here is the caller graph for this function:

Member Data Documentation

◆ data_

template<typename T = float>
std::array<T, 4> correlation::render3d::Vector4< T >::data_ {0, 0, 0, 0}
private

The documentation for this class was generated from the following file: