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");