Physical Quantities  v1.0.0
C++ library of physical quantities, physical models, and units of measure for scientific computing. https://github.com/acodcha/phq
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
PhQ::DimensionlessVector< NumericType > Class Template Reference

Abstract base class that represents any dimensionless vector physical quantity. Such a physical quantity is composed only of a value where the value is a three-dimensional vector. Such a physical quantity has no unit of measure and no dimension set. More...

#include "DimensionlessVector.hpp"

Public Member Functions

constexpr const PhQ::Vector< NumericType > & Value () const noexcept
 Value of this physical quantity. More...
 
std::string Print () const
 Prints this physical quantity as a string. More...
 
std::string JSON () const
 Serializes this physical quantity as a JSON message. More...
 
std::string XML () const
 Serializes this physical quantity as an XML message. More...
 
std::string YAML () const
 Serializes this physical quantity as a YAML message. More...
 

Static Public Member Functions

static constexpr PhQ::Dimensions Dimensions ()
 Physical dimension set of this physical quantity. Since this physical quantity is dimensionless, its physical dimension set is simply the null set. More...
 

Protected Member Functions

 DimensionlessVector ()=default
 Default constructor. Constructs a dimensionless vector physical quantity with an uninitialized value. More...
 
constexpr DimensionlessVector (const NumericType x, const NumericType y, const NumericType z)
 Constructor. Constructs a dimensionless vector physical quantity whose value has the given x, y, and z Cartesian components. More...
 
constexpr DimensionlessVector (const std::array< NumericType, 3 > &x_y_z)
 Constructor. Constructs a dimensionless vector physical quantity from a given array representing its value's x, y, and z Cartesian components. More...
 
constexpr DimensionlessVector (const PhQ::Vector< NumericType > &value)
 Constructor. Constructs a dimensionless vector physical quantity with a given value. More...
 
 ~DimensionlessVector () noexcept=default
 Destructor. Destroys this dimensionless vector physical quantity. More...
 
constexpr DimensionlessVector (const DimensionlessVector< NumericType > &other)=default
 Copy constructor. Constructs a dimensionless vector physical quantity by copying another one. More...
 
template<typename OtherNumericType >
constexpr DimensionlessVector (const DimensionlessVector< OtherNumericType > &other)
 Copy constructor. Constructs a dimensionless vector physical quantity by copying another one. More...
 
constexpr DimensionlessVector (DimensionlessVector< NumericType > &&other) noexcept=default
 Move constructor. Constructs a dimensionless vector physical quantity by moving another one. More...
 
constexpr DimensionlessVector< NumericType > & operator= (const DimensionlessVector< NumericType > &other)=default
 Copy assignment operator. Assigns this dimensionless vector physical quantity by copying another one. More...
 
template<typename OtherNumericType >
constexpr DimensionlessVector< NumericType > & operator= (const DimensionlessVector< OtherNumericType > &other)
 Copy assignment operator. Assigns this dimensionless vector physical quantity by copying another one. More...
 
constexpr DimensionlessVector< NumericType > & operator= (DimensionlessVector< NumericType > &&other) noexcept=default
 Move assignment operator. Assigns this dimensionless vector physical quantity by moving another one. More...
 

Protected Attributes

PhQ::Vector< NumericType > value
 Value of this physical quantity. More...
 

Detailed Description

template<typename NumericType = double>
class PhQ::DimensionlessVector< NumericType >

Abstract base class that represents any dimensionless vector physical quantity. Such a physical quantity is composed only of a value where the value is a three-dimensional vector. Such a physical quantity has no unit of measure and no dimension set.

Template Parameters
NumericTypeFloating-point numeric type: float, double, or long double. Defaults to double if unspecified.

Definition at line 47 of file DimensionlessVector.hpp.

Constructor & Destructor Documentation

◆ DimensionlessVector() [1/7]

template<typename NumericType = double>
PhQ::DimensionlessVector< NumericType >::DimensionlessVector ( )
protecteddefault

Default constructor. Constructs a dimensionless vector physical quantity with an uninitialized value.

◆ DimensionlessVector() [2/7]

template<typename NumericType = double>
constexpr PhQ::DimensionlessVector< NumericType >::DimensionlessVector ( const NumericType  x,
const NumericType  y,
const NumericType  z 
)
inlineconstexprprotected

Constructor. Constructs a dimensionless vector physical quantity whose value has the given x, y, and z Cartesian components.

Definition at line 91 of file DimensionlessVector.hpp.

◆ DimensionlessVector() [3/7]

template<typename NumericType = double>
constexpr PhQ::DimensionlessVector< NumericType >::DimensionlessVector ( const std::array< NumericType, 3 > &  x_y_z)
inlineexplicitconstexprprotected

Constructor. Constructs a dimensionless vector physical quantity from a given array representing its value's x, y, and z Cartesian components.

Definition at line 96 of file DimensionlessVector.hpp.

◆ DimensionlessVector() [4/7]

template<typename NumericType = double>
constexpr PhQ::DimensionlessVector< NumericType >::DimensionlessVector ( const PhQ::Vector< NumericType > &  value)
inlineexplicitconstexprprotected

Constructor. Constructs a dimensionless vector physical quantity with a given value.

Definition at line 99 of file DimensionlessVector.hpp.

◆ ~DimensionlessVector()

template<typename NumericType = double>
PhQ::DimensionlessVector< NumericType >::~DimensionlessVector ( )
protecteddefaultnoexcept

Destructor. Destroys this dimensionless vector physical quantity.

◆ DimensionlessVector() [5/7]

template<typename NumericType = double>
constexpr PhQ::DimensionlessVector< NumericType >::DimensionlessVector ( const DimensionlessVector< NumericType > &  other)
constexprprotecteddefault

Copy constructor. Constructs a dimensionless vector physical quantity by copying another one.

◆ DimensionlessVector() [6/7]

template<typename NumericType = double>
template<typename OtherNumericType >
constexpr PhQ::DimensionlessVector< NumericType >::DimensionlessVector ( const DimensionlessVector< OtherNumericType > &  other)
inlineexplicitconstexprprotected

Copy constructor. Constructs a dimensionless vector physical quantity by copying another one.

Template Parameters
OtherNumericTypeFloating-point numeric type of the other physical quantity. Deduced automatically.

Definition at line 113 of file DimensionlessVector.hpp.

◆ DimensionlessVector() [7/7]

template<typename NumericType = double>
constexpr PhQ::DimensionlessVector< NumericType >::DimensionlessVector ( DimensionlessVector< NumericType > &&  other)
constexprprotecteddefaultnoexcept

Move constructor. Constructs a dimensionless vector physical quantity by moving another one.

Member Function Documentation

◆ Dimensions()

template<typename NumericType = double>
static constexpr PhQ::Dimensions PhQ::DimensionlessVector< NumericType >::Dimensions ( )
inlinestaticconstexpr

Physical dimension set of this physical quantity. Since this physical quantity is dimensionless, its physical dimension set is simply the null set.

Definition at line 55 of file DimensionlessVector.hpp.

References PhQ::Dimensionless.

◆ JSON()

template<typename NumericType = double>
std::string PhQ::DimensionlessVector< NumericType >::JSON ( ) const
inline

Serializes this physical quantity as a JSON message.

Definition at line 70 of file DimensionlessVector.hpp.

References PhQ::DimensionlessVector< NumericType >::value.

◆ operator=() [1/3]

template<typename NumericType = double>
constexpr DimensionlessVector<NumericType>& PhQ::DimensionlessVector< NumericType >::operator= ( const DimensionlessVector< NumericType > &  other)
constexprprotecteddefault

Copy assignment operator. Assigns this dimensionless vector physical quantity by copying another one.

◆ operator=() [2/3]

template<typename NumericType = double>
template<typename OtherNumericType >
constexpr DimensionlessVector<NumericType>& PhQ::DimensionlessVector< NumericType >::operator= ( const DimensionlessVector< OtherNumericType > &  other)
inlineconstexprprotected

Copy assignment operator. Assigns this dimensionless vector physical quantity by copying another one.

Template Parameters
OtherNumericTypeFloating-point numeric type of the other physical quantity. Deduced automatically.

Definition at line 130 of file DimensionlessVector.hpp.

References PhQ::DimensionlessVector< NumericType >::Value(), and PhQ::DimensionlessVector< NumericType >::value.

◆ operator=() [3/3]

template<typename NumericType = double>
constexpr DimensionlessVector<NumericType>& PhQ::DimensionlessVector< NumericType >::operator= ( DimensionlessVector< NumericType > &&  other)
constexprprotecteddefaultnoexcept

Move assignment operator. Assigns this dimensionless vector physical quantity by moving another one.

◆ Print()

template<typename NumericType = double>
std::string PhQ::DimensionlessVector< NumericType >::Print ( ) const
inline

Prints this physical quantity as a string.

Definition at line 65 of file DimensionlessVector.hpp.

References PhQ::DimensionlessVector< NumericType >::value.

Referenced by PhQ::operator<<().

◆ Value()

template<typename NumericType = double>
constexpr const PhQ::Vector<NumericType>& PhQ::DimensionlessVector< NumericType >::Value ( ) const
inlineconstexprnoexcept

◆ XML()

template<typename NumericType = double>
std::string PhQ::DimensionlessVector< NumericType >::XML ( ) const
inline

Serializes this physical quantity as an XML message.

Definition at line 75 of file DimensionlessVector.hpp.

References PhQ::DimensionlessVector< NumericType >::value.

◆ YAML()

template<typename NumericType = double>
std::string PhQ::DimensionlessVector< NumericType >::YAML ( ) const
inline

Serializes this physical quantity as a YAML message.

Definition at line 80 of file DimensionlessVector.hpp.

References PhQ::DimensionlessVector< NumericType >::value.

Member Data Documentation

◆ value

template<typename NumericType = double>
PhQ::Vector<NumericType> PhQ::DimensionlessVector< NumericType >::value
protected

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