RFFGen
 All Classes Namespaces Files Functions Typedefs Enumerations Groups
modifyInvariants.hh
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the C++-library RFFGen. */
4 /* Copyright 2015 Lars Lubkoll */
5 /* */
6 /* RFFGen is free software: you can redistribute it and/or modify */
7 /* it under the terms of the GNU General Public License as published by */
8 /* the Free Software Foundation, either version 3 of the License, or */
9 /* (at your option) any later version. */
10 /* */
11 /* RFFGen is distributed in the hope that it will be useful, */
12 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
13 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
14 /* GNU General Public License for more details. */
15 /* */
16 /* You should have received a copy of the GNU General Public License */
17 /* along with RFFGen. If not, see <http://www.gnu.org/licenses/>. */
18 /* */
19 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
20 
21 #ifndef RFFGEN_UTIL_MODIFY_INVARIANTS_HH
22 #define RFFGEN_UTIL_MODIFY_INVARIANTS_HH
23 
24 #include "../operations.hh"
25 #include "../CMath/pow.hh"
26 
27 namespace RFFGen
28 {
32  namespace Detail
33  {
34  template <class Matrix,class FirstInvariant>
35  using FirstPrincipalInvariantBase = MathematicalOperations::Product< MathematicalOperations::Chain<CMath::Pow<-1,3> , LinearAlgebra::ThirdPrincipalInvariant<Matrix> > , FirstInvariant >;
36 
37  template <class Matrix,class SecondInvariant>
38  using SecondPrincipalInvariantBase = MathematicalOperations::Product< MathematicalOperations::Chain<CMath::Pow<-2,3> , LinearAlgebra::ThirdPrincipalInvariant<Matrix> > , SecondInvariant >;
39  }
40 
41  template <class Matrix, class FirstInvariant>
42  struct ModifyFirstPrincipalInvariant : Detail::FirstPrincipalInvariantBase<Matrix,FirstInvariant>
43  {
44  ModifyFirstPrincipalInvariant() = default;
45 
46  ModifyFirstPrincipalInvariant(const Matrix& A, const FirstInvariant& inv)
47  : Detail::FirstPrincipalInvariantBase<Matrix,FirstInvariant> ( A , inv )
48  {}
49  };
50 
51  template <class Matrix, class SecondInvariant>
52  struct ModifySecondPrincipalInvariant : Detail::SecondPrincipalInvariantBase<Matrix,SecondInvariant>
53  {
54  ModifySecondPrincipalInvariant() = default;
55 
56  ModifySecondPrincipalInvariant(const Matrix& A, const SecondInvariant& inv)
57  : Detail::SecondPrincipalInvariantBase<Matrix,SecondInvariant> ( A , inv )
58  {}
59  };
63 }
64 
65 #endif // RFFGEN_UTIL_MODIFY_INVARIANTS_HH