Revision b2766f5923c94aea0c8f7bb62242f34e2976b156 authored by Christoph Lehmann on 10 November 2021, 12:23:45 UTC, committed by Christoph Lehmann on 10 November 2021, 12:23:45 UTC
This reverts commit b9ba034d9738504890359c908b63bd31be8b5fd0.
1 parent 48d0c8e
Raw File
LinAlgEnums.cpp
/**
 * \author Wenqing Wang
 *
 * \file
 * \copyright
 * Copyright (c) 2012-2021, OpenGeoSys Community (http://www.opengeosys.org)
 *            Distributed under a Modified BSD License.
 *              See accompanying file LICENSE.txt or
 *              http://www.opengeosys.org/project/license
 *
 */

#include "LinAlgEnums.h"

namespace MathLib
{
std::string convertVecNormTypeToString(VecNormType normType)
{
    switch (normType)
    {
        case VecNormType::NORM1:
            return "NORM1";
        case VecNormType::NORM2:
            return "NORM2";
        case VecNormType::INFINITY_N:
            return "INFINITY_N";
        default:
            return "INVALID";
    }
}

VecNormType convertStringToVecNormType(const std::string& str)
{
    if (str == "NORM1")
    {
        return VecNormType::NORM1;
    }
    if (str == "NORM2")
    {
        return VecNormType::NORM2;
    }
    if (str == "INFINITY_N")
    {
        return VecNormType::INFINITY_N;
    }
    return VecNormType::INVALID;
}

}  // end namespace MathLib
back to top