SCOREC core
Parallel unstructured mesh tools
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
mth.h
Go to the documentation of this file.
1 /******************************************************************************
2 
3  Copyright 2015 Scientific Computation Research Center,
4  Rensselaer Polytechnic Institute. All rights reserved.
5 
6  This work is open source software, licensed under the terms of the
7  BSD license as described in the LICENSE file in the top-level directory.
8 
9 *******************************************************************************/
10 
11 #ifndef MTH_H
12 #define MTH_H
13 
14 #include "mthTensor.h"
15 
21 namespace mth {
22 
24 template <class T>
25 Vector3<T> cross(Vector<T,3> const& a, Vector<T,3> const& b);
26 
28 template <class T>
29 Matrix3x3<T> cross(Vector<T,3> const& a);
30 
32 template <class T, unsigned N>
33 Vector<T,N> project(Vector<T,N> const& a, Vector<T,N> const& b);
34 
36 template <class T, unsigned N>
37 Vector<T,N> reject(Vector<T,N> const& a, Vector<T,N> const& b);
38 
40 template <class T, unsigned M, unsigned N>
41 Matrix<T,M,N> transpose(Matrix<T,M,N> const& a);
42 
44 template <class T>
45 T determinant(Matrix<T,2,2> const& a);
46 
48 template <class T>
49 T determinant(Matrix<T,3,3> const& a);
50 
52 template <class T>
53 Matrix<T,2,2> inverse(Matrix<T,2,2> const& a);
54 
56 template <class T>
57 Matrix<T,3,3> inverse(Matrix<T,3,3> const& a);
58 
60 template <class T>
61 T trace(Tensor<T> const& a);
62 
64 template <class T>
65 T norm(Tensor<T> const& a);
66 
68 template <class T>
69 T determinant(Tensor<T> const& a);
70 
72 template <class T>
73 void transpose(Tensor<T> const& a, Tensor<T>& r);
74 
76 template <class T>
77 void inverse(Tensor<T> const& a, Tensor<T>& r);
78 
80 template <class T>
81 Tensor<T> eye(unsigned d);
82 
83 }
84 
85 #endif
T determinant(Matrix< T, 2, 2 > const &a)
determinant of a 2 by 2 matrix
Matrix< T, M, N > transpose(Matrix< T, M, N > const &a)
transpose of a static matrix
Vector< T, N > project(Vector< T, N > const &a, Vector< T, N > const &b)
returns vector a projected onto vector b
T norm(Tensor< T > const &a)
Frobenius norm of a tensor.
Vector< T, N > reject(Vector< T, N > const &a, Vector< T, N > const &b)
vector rejection
T trace(Tensor< T > const &a)
trace of a tensor
Matrix< T, 2, 2 > inverse(Matrix< T, 2, 2 > const &a)
invert a 2 by 2 matrix
Tensor< T > eye(unsigned d)
identity tensor
Vector3< T > cross(Vector< T, 3 > const &a, Vector< T, 3 > const &b)
returns vector cross product