27 #ifndef energylevelmap_h 28 #define energylevelmap_h 75 if (mvalue.
npages() not_eq 1 or mvalue.
nrows() not_eq 1)
78 if (mvalue.
npages() not_eq 1 or mvalue.
nrows() not_eq 1 or mvalue.
ncols() not_eq 1)
81 if (mvalue.
npages() not_eq 0 or mvalue.
nrows() not_eq 0 or mvalue.
ncols() not_eq 0)
88 for (
auto& e: mvib_energy)
if (e < 0)
return false;
93 void ThrowIfNotOK()
const {
if (not OK())
throw std::runtime_error(
"Class in bad state");}
96 mvib_energy(0), mvalue(0, 0, 0, 0) {ThrowIfNotOK();}
100 mtype(new_type), mlevels(old.mlevels), mvib_energy(old.mvib_energy),
101 mvalue(old.mlevels.
nelem(), pages, rows, cols) {ThrowIfNotOK();};
152 return std::any_of(keys.cbegin(), keys.cend(), [x](
auto y){
return x == y;});
162 else if (s ==
"Vector")
164 else if (s ==
"Numeric")
166 else if (s ==
"None")
194 #endif // energylevelmap_h INDEX Index
The type to use for all integer numbers and indices.
Index nelem() const
Number of elements.
String energylevelmaptype2string(EnergyLevelMapType type)
static EnergyLevelMapType string2Type(const String &s) noexcept
const Tensor4 & Data() const noexcept
Energy level type.
Index npages() const
Returns the number of pages.
const Vector & Energies() const noexcept
Energy level type.
invlib::Vector< ArtsVector > Vector
invlib wrapper type for ARTS vectors.
std::ostream & operator<<(std::ostream &os, const EnergyLevelMap &elm)
Contains the absorption namespace.
EnergyLevelMapType string2energylevelmaptype(const String &s)
ArrayOfQuantumIdentifier & Levels() noexcept
Energy level type.
G0 G2 FVC Y DV Numeric Numeric Numeric Zeeman LowerQuantumNumbers void * data
EnergyLevelMap(EnergyLevelMapType new_type, Index pages, Index rows, Index cols, const EnergyLevelMap &old)
Index nrows() const
Returns the number of rows.
Index nelem() const
Returns the number of elements.
EnergyLevelMapType Type() const noexcept
Energy level type.
ArrayOfQuantumIdentifier mlevels
Tensor4 & Data() noexcept
Energy level type.
void ThrowIfNotOK() const
const ArrayOfQuantumIdentifier & Levels() const noexcept
Energy level type.
NUMERIC Numeric
The type to use for all floating point numbers.
Index nelem(const Lines &l)
Number of lines.
Index nbooks() const
Returns the number of books.
static bool validIndexForType(Index x) noexcept
constexpr std::array< T, 1+sizeof...(Ts)> stdarrayify(const T &first, const Ts &... the_rest)
Make a std::array of a list of variables (must be 1-long at least)
Vector & Energies() noexcept
Energy level type.
Index ncols() const
Returns the number of columns.
EnergyLevelMapType & Type() noexcept
Energy level type.
This file contains the definition of String, the ARTS string class.
void Type(EnergyLevelMapType x) noexcept
Energy level type.