36 std::ostringstream os;
37 os <<
"Cannot convert Rational " << *
this <<
" to Index.";
38 throw std::runtime_error(os.str());
86 nom=strtol(s.c_str(), &endptr, 10);
87 if (endptr != s.c_str()+s.nelem())
88 throw std::runtime_error(
"Error parsing quantum number");
91 else if (as.
nelem() == 2)
93 nom=strtol(as[0].c_str(), &endptr, 10);
94 if (endptr != as[0].c_str()+as[0].nelem())
95 throw std::runtime_error(
"Error parsing quantum number nominator");
96 denom=strtol(as[1].c_str(), &endptr, 10);
97 if (endptr != as[1].c_str()+as[1].nelem())
98 throw std::runtime_error(
"Error parsing quantum number denominator");
102 throw std::runtime_error(
"Error parsing quantum number");
INDEX Index
The type to use for all integer numbers and indices.
Index nelem() const
Number of elements.
std::istream & operator>>(std::istream &is, Rational &a)
The implementation for String, the ARTS string class.
This can be used to make arrays out of anything.
Contains the rational class definition.
Rational abs(const Rational &a)
std::ostream & operator<<(std::ostream &os, const Rational &a)
This file contains the definition of String, the ARTS string class.