OGS
LinAlgEnums.cpp
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2
// SPDX-License-Identifier: BSD-3-Clause
3
4
#include "
LinAlgEnums.h
"
5
6
namespace
MathLib
7
{
8
std::string
convertVecNormTypeToString
(
VecNormType
normType)
9
{
10
switch
(normType)
11
{
12
case
VecNormType::NORM1
:
13
return
"NORM1"
;
14
case
VecNormType::NORM2
:
15
return
"NORM2"
;
16
case
VecNormType::INFINITY_N
:
17
return
"INFINITY_N"
;
18
default
:
19
return
"INVALID"
;
20
}
21
}
22
23
VecNormType
convertStringToVecNormType
(
const
std::string& str)
24
{
25
if
(str ==
"NORM1"
)
26
{
27
return
VecNormType::NORM1
;
28
}
29
if
(str ==
"NORM2"
)
30
{
31
return
VecNormType::NORM2
;
32
}
33
if
(str ==
"INFINITY_N"
)
34
{
35
return
VecNormType::INFINITY_N
;
36
}
37
return
VecNormType::INVALID
;
38
}
39
40
}
// end namespace MathLib
LinAlgEnums.h
MathLib
Definition
CreateComponent.h:23
MathLib::VecNormType
VecNormType
Definition
LinAlgEnums.h:14
MathLib::VecNormType::NORM2
@ NORM2
Definition
LinAlgEnums.h:16
MathLib::VecNormType::NORM1
@ NORM1
Definition
LinAlgEnums.h:15
MathLib::VecNormType::INVALID
@ INVALID
Definition
LinAlgEnums.h:18
MathLib::VecNormType::INFINITY_N
@ INFINITY_N
Definition
LinAlgEnums.h:17
MathLib::convertVecNormTypeToString
std::string convertVecNormTypeToString(VecNormType normType)
convert VecNormType to string
Definition
LinAlgEnums.cpp:8
MathLib::convertStringToVecNormType
VecNormType convertStringToVecNormType(const std::string &str)
convert string to VecNormType
Definition
LinAlgEnums.cpp:23
MathLib
LinAlg
LinAlgEnums.cpp
Generated by
1.14.0