ARTS  2.4.0(git:4fb77825)
QuantumNumbers Class Reference

Container class for Quantum Numbers. More...

#include <quantum.h>

Public Types

typedef std::array< Rational, Index(QuantumNumberType::FINAL_ENTRY)> QuantumContainer
 

Public Member Functions

constexpr QuantumNumbers () noexcept
 Initializer with undefined values. More...
 
constexpr QuantumNumbers (Rational J, Rational N, Rational v) noexcept
 
constexpr Rational operator[] (const Index qn) const noexcept
 Access operator. More...
 
constexpr Rational operator[] (const QuantumNumberType qn) const noexcept
 Access operator. More...
 
Rationaloperator[] (const Index qn) noexcept
 Access operator. More...
 
Rationaloperator[] (const QuantumNumberType qn) noexcept
 Access operator. More...
 
void Set (Index qn, Rational r)
 Set quantum number at position. More...
 
void Set (QuantumNumberType qn, Rational r)
 Set quantum number at position. More...
 
void Set (String qn, Rational r)
 Set quantum number at position. More...
 
const QuantumContainerGetNumbers () const
 Get the numbers. More...
 
Index nNumbers () const
 The number of defined quantum numbers. More...
 
bool Compare (const QuantumNumbers &qn) const
 Compare Quantum Numbers Ignores any undefined numbers in the comparison. More...
 

Private Attributes

QuantumContainer mqnumbers
 

Detailed Description

Container class for Quantum Numbers.

Definition at line 222 of file quantum.h.

Member Typedef Documentation

◆ QuantumContainer

Constructor & Destructor Documentation

◆ QuantumNumbers() [1/2]

constexpr QuantumNumbers::QuantumNumbers ( )
inlineconstexprnoexcept

Initializer with undefined values.

Definition at line 228 of file quantum.h.

References RATIONAL_UNDEFINED.

◆ QuantumNumbers() [2/2]

constexpr QuantumNumbers::QuantumNumbers ( Rational  J,
Rational  N,
Rational  v 
)
inlineconstexprnoexcept

Definition at line 250 of file quantum.h.

References N, and RATIONAL_UNDEFINED.

Member Function Documentation

◆ Compare()

bool QuantumNumbers::Compare ( const QuantumNumbers qn) const

Compare Quantum Numbers Ignores any undefined numbers in the comparison.

Parameters
[in]qnQuantum Numbers to compare to
Returns
true For a match
false Otherwise

Definition at line 33 of file quantum.cc.

References GetNumbers(), J, and mqnumbers.

Referenced by operator==().

◆ GetNumbers()

const QuantumContainer& QuantumNumbers::GetNumbers ( ) const
inline

Get the numbers.

Returns
const QuantumContainer& All the numbers

Definition at line 338 of file quantum.h.

References mqnumbers.

Referenced by Compare(), and xml_write_to_stream().

◆ nNumbers()

Index QuantumNumbers::nNumbers ( ) const
inline

The number of defined quantum numbers.

Returns
Index Count of defined numbers

Definition at line 344 of file quantum.h.

References mqnumbers.

◆ operator[]() [1/4]

constexpr Rational QuantumNumbers::operator[] ( const Index  qn) const
inlineconstexprnoexcept

Access operator.

Parameters
[in]qnIndex Pos to access
Returns
constexpr Rational Copy of value at pos

Definition at line 274 of file quantum.h.

References mqnumbers.

◆ operator[]() [2/4]

Rational& QuantumNumbers::operator[] ( const Index  qn)
inlinenoexcept

Access operator.

Parameters
[in]qnIndex Pos to access
Returns
constexpr Rational Copy of value at pos

Definition at line 292 of file quantum.h.

References mqnumbers.

◆ operator[]() [3/4]

constexpr Rational QuantumNumbers::operator[] ( const QuantumNumberType  qn) const
inlineconstexprnoexcept

Access operator.

Parameters
qn[in]Index Pos to access
Returns
constexpr Rational Copy of value at pos

Definition at line 283 of file quantum.h.

References mqnumbers.

◆ operator[]() [4/4]

Rational& QuantumNumbers::operator[] ( const QuantumNumberType  qn)
inlinenoexcept

Access operator.

Parameters
qn[in]Index Pos to access
Returns
constexpr Rational Copy of value at pos

Definition at line 301 of file quantum.h.

References mqnumbers.

◆ Set() [1/3]

void QuantumNumbers::Set ( Index  qn,
Rational  r 
)
inline

◆ Set() [2/3]

void QuantumNumbers::Set ( QuantumNumberType  qn,
Rational  r 
)
inline

Set quantum number at position.

Parameters
[in]qnIndex Pos to set at
[in]rRational to set

Definition at line 320 of file quantum.h.

References J, and mqnumbers.

◆ Set() [3/3]

void QuantumNumbers::Set ( String  qn,
Rational  r 
)
inline

Set quantum number at position.

Parameters
[in]qnString Pos to set at by name
[in]rRational to set

Definition at line 330 of file quantum.h.

References mqnumbers, and string2quantumnumbertype().

Member Data Documentation

◆ mqnumbers

QuantumContainer QuantumNumbers::mqnumbers
private

Definition at line 362 of file quantum.h.

Referenced by Compare(), GetNumbers(), nNumbers(), operator[](), and Set().


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