diff --git a/MathLib/LinAlg/LinAlgEnums.cpp b/MathLib/LinAlg/LinAlgEnums.cpp index 1d28a11e7ce78caa2fa1a89146bea69c013bebb8..0c5dcdf1f78d4efe574a9075eed6f7caba374e08 100644 --- a/MathLib/LinAlg/LinAlgEnums.cpp +++ b/MathLib/LinAlg/LinAlgEnums.cpp @@ -25,11 +25,11 @@ std::string convertVecNormTypeToString(VecNormType normType) } } -VecNormType convertVecNormTypeToString(const std::string &str) +VecNormType convertStringToVecNormType(const std::string &str) { - if (str.compare("NORM1")==0) return VecNormType::NORM1; - if (str.compare("NORM2")==0) return VecNormType::NORM2; - if (str.compare("INFINITY_N")==0) return VecNormType::INFINITY_N; + if (str == "NORM1") return VecNormType::NORM1; + if (str == "NORM2") return VecNormType::NORM2; + if (str == "INFINITY_N") return VecNormType::INFINITY_N; return VecNormType::INVALID; } diff --git a/MathLib/LinAlg/LinAlgEnums.h b/MathLib/LinAlg/LinAlgEnums.h index 1c801d03776e31abd0cee56f646036c132df8df1..fd07a3bc9a257a123890a555ae591ee854fb4304 100644 --- a/MathLib/LinAlg/LinAlgEnums.h +++ b/MathLib/LinAlg/LinAlgEnums.h @@ -30,7 +30,7 @@ enum class VecNormType std::string convertVecNormTypeToString(VecNormType normType); /// convert string to VecNormType -VecNormType convertVecNormTypeToString(const std::string &str); +VecNormType convertStringToVecNormType(const std::string &str); } // end namespace MathLib