ARTS 2.5.11 (git: 6827797f)
|
A list of many quantum numbers. Should always remain sorted. More...
#include <quantum_numbers.h>
Public Member Functions | |
ValueList (std::string_view s, bool legacy=false) | |
From text. | |
ValueList (std::string_view upp, std::string_view low) | |
From legacy text. | |
std::strong_ordering | operator<=> (const ValueList &v) const |
ValueList (Array< Value > values_) | |
From values (resorted) | |
ValueList () | |
Empty. | |
Array< Value >::iterator | begin () |
For iterators. | |
Array< Value >::iterator | end () |
Array< Value >::iterator | cbegin () |
Array< Value >::iterator | cend () |
Array< Value >::const_iterator | begin () const |
Array< Value >::const_iterator | end () const |
Array< Value >::const_iterator | cbegin () const |
Array< Value >::const_iterator | cend () const |
void | finalize () |
Should always be called before this object is handed to another user. | |
Index | nelem () const ARTS_NOEXCEPT |
Return number of quantum numbers. | |
bool | perpendicular (const ValueList &that) const ARTS_NOEXCEPT |
Finds whether two ValueList describe completely different sets of quantum numbers (e.g., local vs global) | |
template<typename... Types> | |
bool | has (Types... ts) const ARTS_NOEXCEPT |
Returns whether all the Types are part of the list, the types must be sorted. | |
const Value & | operator[] (Type t) const ARTS_NOEXCEPT |
Returns the value of the Type (assumes it exist) | |
Value & | operator[] (Index i) |
Legacy manipulation operator access. | |
Value & | add (Type t) |
Add for manipulation. | |
Value & | add (Value v) |
Add for manipulation. | |
void | set (Value v) |
Sets the value if it exists or adds it otherwise. | |
void | set (Index i, std::string_view upp, std::string_view low) |
Set a value in value list. | |
CheckMatch | check_match (const ValueList &other) const ARTS_NOEXCEPT |
Returns upper and lower matching status. | |
void | add_type_wo_sort (Type) |
Add a type without sorting (WARNING, many things might break if you don't sort in the end) | |
bool | good () const |
Private Member Functions | |
void | sort_by_type () |
Internal sort function. Should be called whenever new items are created. | |
bool | has_unique_increasing_types () const |
Internal check function. Remember to sort by type before calling this. | |
Private Attributes | |
Array< Value > | values |
Friends | |
std::ostream & | operator<< (std::ostream &os, const ValueList &vl) |
ouptut stream if all values | |
std::istream & | operator>> (std::istream &is, ValueList &vl) |
input stream must have pre-set size | |
A list of many quantum numbers. Should always remain sorted.
Definition at line 898 of file quantum_numbers.h.
|
explicit |
From text.
Definition at line 104 of file quantum_numbers.cc.
References add(), ARTS_USER_ERROR_IF, begin(), Quantum::Number::count_items(), end(), finalize(), Quantum::Number::fix_legacy(), has(), Quantum::Number::items(), Quantum::Number::Value::set(), set(), and values.
Quantum::Number::ValueList::ValueList | ( | std::string_view | upp, |
std::string_view | low | ||
) |
From legacy text.
Definition at line 177 of file quantum_numbers.cc.
References a, add(), ARTS_USER_ERROR_IF, begin(), Quantum::Number::count_items(), end(), Quantum::Number::fix_legacy(), and Quantum::Number::items().
From values (resorted)
Definition at line 924 of file quantum_numbers.h.
|
inline |
Empty.
Definition at line 929 of file quantum_numbers.h.
Value & Quantum::Number::ValueList::add | ( | Type | t | ) |
Add for manipulation.
Definition at line 330 of file quantum_numbers.cc.
References begin(), end(), finalize(), v, and values.
Referenced by Quantum::Number::from_hitran(), Absorption::ReadFromArtscat5Stream(), set(), and ValueList().
Add for manipulation.
Definition at line 339 of file quantum_numbers.cc.
References begin(), end(), finalize(), v, and values.
void Quantum::Number::ValueList::add_type_wo_sort | ( | Type | t | ) |
Add a type without sorting (WARNING, many things might break if you don't sort in the end)
Definition at line 1048 of file quantum_numbers.cc.
References values.
Referenced by Quantum::Number::LocalState::set_unsorted_qns().
For iterators.
Definition at line 932 of file quantum_numbers.h.
Referenced by add(), has_unique_increasing_types(), Quantum::Number::LocalState::same_types_as(), set(), sort_by_type(), and ValueList().
Definition at line 936 of file quantum_numbers.h.
Definition at line 934 of file quantum_numbers.h.
Definition at line 942 of file quantum_numbers.h.
Definition at line 935 of file quantum_numbers.h.
Definition at line 945 of file quantum_numbers.h.
CheckMatch Quantum::Number::ValueList::check_match | ( | const ValueList & | other | ) | const |
Returns upper and lower matching status.
Definition at line 304 of file quantum_numbers.cc.
References Quantum::Number::LevelMatch::low, Quantum::Number::CheckMatch::low, Quantum::Number::update(), Quantum::Number::LevelMatch::upp, and Quantum::Number::CheckMatch::upp.
Referenced by Quantum::Number::GlobalState::part_of(), and Quantum::Number::StateMatch::StateMatch().
Definition at line 933 of file quantum_numbers.h.
Referenced by add(), has_unique_increasing_types(), Quantum::Number::LocalState::same_types_as(), set(), sort_by_type(), and ValueList().
Definition at line 939 of file quantum_numbers.h.
void Quantum::Number::ValueList::finalize | ( | ) |
Should always be called before this object is handed to another user.
Definition at line 279 of file quantum_numbers.cc.
References ARTS_USER_ERROR_IF, has_unique_increasing_types(), and sort_by_type().
Referenced by add(), and ValueList().
bool Quantum::Number::ValueList::good | ( | ) | const |
Definition at line 1132 of file quantum_numbers.cc.
|
inline |
Returns whether all the Types are part of the list, the types must be sorted.
Definition at line 960 of file quantum_numbers.h.
References ARTS_ASSERT, and Quantum::Number::is_sorted().
Referenced by Quantum::Number::from_hitran(), global_quantumidentifier(), Quantum::Helpers::molecular_term_symbol(), Quantum::Number::GlobalState::part_of(), ReadArrayOfARTSCAT(), ReadARTSCAT(), Absorption::ReadFromArtscat5Stream(), ReadHITRAN(), set(), and ValueList().
|
private |
Internal check function. Remember to sort by type before calling this.
Definition at line 53 of file quantum_numbers.cc.
References a, b, begin(), end(), and values.
Referenced by finalize().
|
inline |
Return number of quantum numbers.
Definition at line 953 of file quantum_numbers.h.
References Array< base >::nelem().
|
inline |
Definition at line 914 of file quantum_numbers.h.
References v.
|
inline |
Legacy manipulation operator access.
Definition at line 978 of file quantum_numbers.h.
const Value & Quantum::Number::ValueList::operator[] | ( | Type | t | ) | const |
Returns the value of the Type (assumes it exist)
Definition at line 323 of file quantum_numbers.cc.
References ARTS_ASSERT.
bool Quantum::Number::ValueList::perpendicular | ( | const ValueList & | that | ) | const |
Finds whether two ValueList describe completely different sets of quantum numbers (e.g., local vs global)
Definition at line 287 of file quantum_numbers.cc.
References ARTS_ASSERT.
void Quantum::Number::ValueList::set | ( | Index | i, |
std::string_view | upp, | ||
std::string_view | low | ||
) |
Set a value in value list.
Definition at line 356 of file quantum_numbers.cc.
References values, and var_string().
void Quantum::Number::ValueList::set | ( | Value | v | ) |
Sets the value if it exists or adds it otherwise.
Definition at line 348 of file quantum_numbers.cc.
References add(), begin(), end(), has(), and v.
Referenced by Quantum::Number::from_hitran(), global_quantumidentifier(), Absorption::Lines::QuantumIdentityOfLine(), lm_hitran_2017::read(), ReadArrayOfARTSCAT(), ReadARTSCAT(), Absorption::ReadFromArtscat5Stream(), ReadHITRAN(), Absorption::SingleLine::SetAutomaticZeeman(), Absorption::split_list_of_external_lines(), and ValueList().
|
private |
Internal sort function. Should be called whenever new items are created.
Definition at line 49 of file quantum_numbers.cc.
References a, b, begin(), and end().
Referenced by finalize().
|
friend |
ouptut stream if all values
Definition at line 360 of file quantum_numbers.cc.
|
friend |
input stream must have pre-set size
Definition at line 368 of file quantum_numbers.cc.
Definition at line 899 of file quantum_numbers.h.
Referenced by add(), add_type_wo_sort(), has_unique_increasing_types(), set(), and ValueList().