Base.h
Go to the documentation of this file.
1 /*!
2  *
3  *
4  * \brief Entry Point for all Basic Linear Algebra(BLAS) in shark
5  *
6  *
7  *
8  * \author O.Krause, T.Glasmachers, T. Voss
9  * \date 2010-2011
10  *
11  *
12  * \par Copyright 1995-2017 Shark Development Team
13  *
14  * <BR><HR>
15  * This file is part of Shark.
16  * <http://shark-ml.org/>
17  *
18  * Shark is free software: you can redistribute it and/or modify
19  * it under the terms of the GNU Lesser General Public License as published
20  * by the Free Software Foundation, either version 3 of the License, or
21  * (at your option) any later version.
22  *
23  * Shark is distributed in the hope that it will be useful,
24  * but WITHOUT ANY WARRANTY; without even the implied warranty of
25  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26  * GNU Lesser General Public License for more details.
27  *
28  * You should have received a copy of the GNU Lesser General Public License
29  * along with Shark. If not, see <http://www.gnu.org/licenses/>.
30  *
31  */
32 #ifndef SHARK_LINALG_BASE_H
33 #define SHARK_LINALG_BASE_H
34 
35 /**
36 * \brief Shark linear algebra definitions
37 *
38 * \par
39 * This file provides all basic definitions for linear algebra.
40 * If defines objects and views for vectors and matrices over
41 * several base types as well as a lot of usefull functions.
42 */
43 
44 //for debug error handling of linear algebra
45 #include <shark/Core/Shark.h>
47 #include <shark/Core/Exception.h>
48 #include <shark/LinAlg/Tools.h>
49 #include <shark/LinAlg/Metrics.h>
50 //this ensures, that Sequence is serializable
51 #include <boost/serialization/deque.hpp>
52 #include <deque>
53 
54 namespace shark{
55 
56 namespace blas{
57 using namespace remora;
58 }
59 #define SHARK_VECTOR_MATRIX_TYPEDEFS(basetype, prefix) \
60  typedef blas::vector< basetype > prefix##Vector; \
61  typedef blas::matrix< basetype, blas::row_major > prefix##Matrix; \
62  typedef blas::compressed_vector< basetype > Compressed##prefix##Vector; \
63  typedef blas::compressed_matrix< basetype > Compressed##prefix##Matrix;
64 
65  SHARK_VECTOR_MATRIX_TYPEDEFS(long double, BigReal);
66  SHARK_VECTOR_MATRIX_TYPEDEFS(double, Real)
67  SHARK_VECTOR_MATRIX_TYPEDEFS(float, Float)
68  SHARK_VECTOR_MATRIX_TYPEDEFS(std::complex<double>, Complex)
70  SHARK_VECTOR_MATRIX_TYPEDEFS(unsigned int, UInt)
71  SHARK_VECTOR_MATRIX_TYPEDEFS(bool, Bool);
72 #undef SHARK_VECTOR_MATRIX_TYPEDEFS
73 
74 typedef blas::permutation_matrix PermutationMatrix;
75 
76 ///Type of Data sequences.
77 typedef std::deque<RealVector> Sequence;
78 }
79 #endif