ARTS 2.5.0 (git: 9ee3ac6c)
QuantumNumbers Class Reference

Container class for Quantum Numbers. More...

#include <quantum.h>

Public Types

using QuantumContainer = std::array< Rational, Index(QuantumNumberType::FINAL)>
 

Public Member Functions

constexpr QuantumNumbers () noexcept
 Initializer with undefined values. More...
 
constexpr QuantumNumbers (Rational J, Rational N, Rational v) noexcept
 
constexpr const Rationaloperator[] (const Index qn) const noexcept
 Access operator. More...
 
constexpr const Rationaloperator[] (const QuantumNumberType qn) const noexcept
 Access operator. More...
 
constexpr Rationaloperator[] (const Index qn) noexcept
 Access operator. More...
 
constexpr Rationaloperator[] (const QuantumNumberType qn) noexcept
 Access operator. More...
 
constexpr void Set (Index qn, Rational r)
 Set quantum number at position. More...
 
constexpr void Set (QuantumNumberType qn, Rational r)
 Set quantum number at position. More...
 
constexpr void Set (const std::string_view qn, Rational r)
 Set quantum number at position. More...
 
constexpr const QuantumContainerGetNumbers () const
 Get the numbers. More...
 
constexpr Index nNumbers () const
 The number of defined quantum numbers. More...
 
constexpr bool Any () const
 Check if there's any quantum numbers defined. More...
 
String toString () const
 Returns this as a string. More...
 

Private Attributes

QuantumContainer mqnumbers
 

Detailed Description

Container class for Quantum Numbers.

Definition at line 112 of file quantum.h.

Member Typedef Documentation

◆ QuantumContainer

using QuantumNumbers::QuantumContainer = std::array<Rational, Index(QuantumNumberType::FINAL)>

Definition at line 114 of file quantum.h.

Constructor & Destructor Documentation

◆ QuantumNumbers() [1/2]

constexpr QuantumNumbers::QuantumNumbers ( )
inlineconstexprnoexcept

Initializer with undefined values.

Definition at line 117 of file quantum.h.

References RATIONAL_UNDEFINED.

◆ QuantumNumbers() [2/2]

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

Definition at line 139 of file quantum.h.

References N, RATIONAL_UNDEFINED, and v.

Member Function Documentation

◆ Any()

constexpr bool QuantumNumbers::Any ( ) const
inlineconstexpr

Check if there's any quantum numbers defined.

Definition at line 238 of file quantum.h.

References mqnumbers.

◆ GetNumbers()

constexpr const QuantumContainer & QuantumNumbers::GetNumbers ( ) const
inlineconstexpr

Get the numbers.

Returns
const QuantumContainer& All the numbers

Definition at line 225 of file quantum.h.

References mqnumbers.

Referenced by xml_write_to_stream().

◆ nNumbers()

constexpr Index QuantumNumbers::nNumbers ( ) const
inlineconstexpr

The number of defined quantum numbers.

Returns
Index Count of defined numbers

Definition at line 231 of file quantum.h.

References mqnumbers.

◆ operator[]() [1/4]

constexpr const 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 163 of file quantum.h.

References mqnumbers.

◆ operator[]() [2/4]

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

Access operator.

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

Definition at line 181 of file quantum.h.

References mqnumbers.

◆ operator[]() [3/4]

constexpr const 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 172 of file quantum.h.

References mqnumbers.

◆ operator[]() [4/4]

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

Access operator.

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

Definition at line 190 of file quantum.h.

References mqnumbers.

◆ Set() [1/3]

constexpr void QuantumNumbers::Set ( const std::string_view  qn,
Rational  r 
)
inlineconstexpr

Set quantum number at position.

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

Definition at line 217 of file quantum.h.

References mqnumbers.

◆ Set() [2/3]

constexpr void QuantumNumbers::Set ( Index  qn,
Rational  r 
)
inlineconstexpr

Set quantum number at position.

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

Definition at line 199 of file quantum.h.

References mqnumbers.

Referenced by ArtsXMLTag::get_attribute_value(), operator>>(), QuantumFieldDescription::Parse(), and test_zeeman().

◆ Set() [3/3]

constexpr void QuantumNumbers::Set ( QuantumNumberType  qn,
Rational  r 
)
inlineconstexpr

Set quantum number at position.

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

Definition at line 208 of file quantum.h.

References mqnumbers.

◆ toString()

String QuantumNumbers::toString ( ) const

Returns this as a string.

Definition at line 180 of file quantum.cc.

Member Data Documentation

◆ mqnumbers

QuantumContainer QuantumNumbers::mqnumbers
private

Definition at line 247 of file quantum.h.

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


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