STIR  6.2.0
MatrixFunction.h
Go to the documentation of this file.
1 //
2 //
3 /*
4  Copyright (C) 2004- 2007, Hammersmith Imanet Ltd
5  This file is part of STIR.
6 
7  SPDX-License-Identifier: Apache-2.0
8 
9  See STIR/LICENSE.txt for details
10 */
11 #ifndef __stir_numerics_MatrixFunction_H__
12 #define __stir_numerics_MatrixFunction_H__
13 
23 #include "stir/Array.h"
24 #include "stir/BasicCoordinate.h"
25 
26 START_NAMESPACE_STIR
27 
28 //----------------------------------------------------------------------
33 
35 
42 template <class elemT>
43 inline elemT inner_product(const Array<1, elemT>& v1, const Array<1, elemT>& v2);
44 
46 
48 template <class elemT>
49 inline double angle(const Array<1, elemT>& v1, const Array<1, elemT>& v2);
50 
52 
53 //----------------------------------------------------------------------
58 
60 
62 template <class elemT>
63 inline Array<1, elemT> matrix_multiply(const Array<2, elemT>& m, const Array<1, elemT>& vec);
64 
66 
69 template <int dimension, class elemT>
70 inline BasicCoordinate<dimension, elemT> matrix_multiply(const Array<2, elemT>& m, const BasicCoordinate<dimension, elemT>& vec);
71 
73 
75 template <class elemT>
76 inline Array<2, elemT> matrix_multiply(const Array<2, elemT>& m1, const Array<2, elemT>& m2);
77 
79 template <class elemT>
80 inline Array<2, elemT> matrix_transpose(const Array<2, elemT>& m);
81 
83 
96 template <class elemT>
97 inline Array<2, elemT> diagonal_matrix(const unsigned dimension, const elemT value);
98 
100 
114 template <int dimension, class elemT>
115 inline Array<2, elemT> diagonal_matrix(const BasicCoordinate<dimension, elemT>& values);
116 
118 
119 END_NAMESPACE_STIR
120 
122 
123 #endif
elemT inner_product(const Array< 1, elemT > &v1, const Array< 1, elemT > &v2)
Inner product of 2 1D arrays.
Definition: MatrixFunction.inl:39
Implementation of functions for matrices.
Array< 2, elemT > matrix_transpose(const Array< 2, elemT > &m)
matrix transposition
Definition: MatrixFunction.inl:160
defines the Array class for multi-dimensional (numeric) arrays
This file declares class stir::BasicCoordinate and some functions acting on stir::BasicCoordinate obj...
Array< 2, elemT > matrix_multiply(const Array< 2, elemT > &m1, const Array< 2, elemT > &m2)
matrix multiplication
Definition: MatrixFunction.inl:125
double angle(const Array< 1, elemT > &v1, const Array< 1, elemT > &v2)
angle between 2 1D arrays
Definition: MatrixFunction.inl:65
Array< 2, elemT > diagonal_matrix(const BasicCoordinate< dimension, elemT > &values)
construct a diagonal matrix
Definition: MatrixFunction.inl:192