43 static const std::array<std::pair<std::string_view, Precision>, 5> nameToPrecision
45 {
"Float32", Precision::float32 },
46 {
"Float64", Precision::float64 },
47 {
"UInt32", Precision::uint32 },
48 {
"UInt8", Precision::uint8 },
49 {
"Int32", Precision::int32 },
52 for (
const auto& [name, precision] : nameToPrecision)
53 if (name == precisionName)
56 DUNE_THROW(Dune::InvalidStateException,
"Unknown precision type " << precisionName);
Precision stringToPrecision(std::string_view precisionName)
Maps a string (e.g. from input) to a Dune precision type.
Definition precision.hh:39