PTEMS  0.1.0-dev+git.47ec727
PolyTopic Element Method Solver
ptems::BasicVector< T, 0 > Struct Template Reference

Vector representing a point in zero-dimensional space - this is purely required to allow "faces" of 1D elements to exist and should not be used in general. More...

#include <ptems/vector.hpp>

Public Types

using ConjugateType = BasicVector< typename std::conditional_t< is_complex_v< T >, T, std::complex< T > >, 1 >
 The type of the conjugate of the vector. More...
 

Public Member Functions

constexpr BasicVector ()
 Construct a zero vector. More...
 
template<typename U >
constexpr std::common_type_t< T, U > Dot (const BasicVector< U, 0 > &) const
 Computes the dot product of this vector with the specified vector. More...
 
constexpr remove_complex_t< T > Length () const
 Computes the length of the vector. More...
 
constexpr T Sum () const
 Computes the sum of the elements of the vector. More...
 
constexpr remove_complex_t< T > LengthSquared () const
 Gets the square of the length of the vector. More...
 
constexpr BasicVectorNormalise ()
 Normalises the current vector. More...
 
constexpr BasicVector Normalised () const
 Gets a new vector which is the normalised version of this vector. More...
 
ConjugateType Conjugate () const
 Computes the complex conjugate of the vector. More...
 
BasicVectorConjugateOverwrite () const
 Overwrites the vector with its complex conjugate. More...
 
std::size_t size () const
 Gets the number of elements in the vector. More...
 

Detailed Description

template<typename T>
struct ptems::BasicVector< T, 0 >

Vector representing a point in zero-dimensional space - this is purely required to allow "faces" of 1D elements to exist and should not be used in general.

Template Parameters
TThe type of the vector component

Member Typedef Documentation

◆ ConjugateType

template<typename T >
using ptems::BasicVector< T, 0 >::ConjugateType = BasicVector<typename std::conditional_t<is_complex_v<T>, T, std::complex<T> >,1>

The type of the conjugate of the vector.

Will either be the same type if T is complex, otherwise a vector of std::complex<T>.

Constructor & Destructor Documentation

◆ BasicVector()

template<typename T >
constexpr ptems::BasicVector< T, 0 >::BasicVector ( )
inlineconstexpr

Construct a zero vector.

Member Function Documentation

◆ Conjugate()

template<typename T >
ConjugateType ptems::BasicVector< T, 0 >::Conjugate ( ) const
inline

Computes the complex conjugate of the vector.

Returns
The complex conjugate of the vector

◆ ConjugateOverwrite()

template<typename T >
BasicVector& ptems::BasicVector< T, 0 >::ConjugateOverwrite ( ) const
inline

Overwrites the vector with its complex conjugate.

Returns
this

◆ Dot()

template<typename T >
template<typename U >
constexpr std::common_type_t<T,U> ptems::BasicVector< T, 0 >::Dot ( const BasicVector< U, 0 > &  ) const
inlineconstexpr

Computes the dot product of this vector with the specified vector.

Template Parameters
UType of the components of the vector to dot product with
Parameters
rhsVector to dot product with this vector
Returns
The result of the dot product

◆ Length()

template<typename T >
constexpr remove_complex_t<T> ptems::BasicVector< T, 0 >::Length ( ) const
inlineconstexpr

Computes the length of the vector.

Returns
The vector length.

◆ LengthSquared()

template<typename T >
constexpr remove_complex_t<T> ptems::BasicVector< T, 0 >::LengthSquared ( ) const
inlineconstexpr

Gets the square of the length of the vector.

Returns
The length squared.

◆ Normalise()

template<typename T >
constexpr BasicVector& ptems::BasicVector< T, 0 >::Normalise ( )
inlineconstexpr

Normalises the current vector.

Returns
Reference to this vector after normalisation.

◆ Normalised()

template<typename T >
constexpr BasicVector ptems::BasicVector< T, 0 >::Normalised ( ) const
inlineconstexpr

Gets a new vector which is the normalised version of this vector.

Returns
The normalised vector

◆ size()

template<typename T >
std::size_t ptems::BasicVector< T, 0 >::size ( ) const
inline

Gets the number of elements in the vector.

Returns
1

◆ Sum()

template<typename T >
constexpr T ptems::BasicVector< T, 0 >::Sum ( ) const
inlineconstexpr

Computes the sum of the elements of the vector.

Returns
The vector length.

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