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 * <https://shark-ml.github.io/Shark/>
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>
49//this ensures, that Sequence is serializable
50#include <boost/serialization/deque.hpp>
51#include <deque>
52
53namespace shark{
54
55namespace blas{
56using namespace remora;
57}
58#define SHARK_VECTOR_MATRIX_TYPEDEFS(basetype, prefix) \
59 typedef blas::vector< basetype > prefix##Vector; \
60 typedef blas::matrix< basetype, blas::row_major > prefix##Matrix; \
61 typedef blas::compressed_vector< basetype > Compressed##prefix##Vector; \
62 typedef blas::compressed_matrix< basetype > Compressed##prefix##Matrix;
63
64 SHARK_VECTOR_MATRIX_TYPEDEFS(long double, BigReal);
67 SHARK_VECTOR_MATRIX_TYPEDEFS(std::complex<double>, Complex)
69 SHARK_VECTOR_MATRIX_TYPEDEFS(unsigned int, UInt)
71#undef SHARK_VECTOR_MATRIX_TYPEDEFS
72
73typedef blas::vector< double, blas::gpu_tag > RealGPUVector;
74typedef blas::vector< float, blas::gpu_tag > FloatGPUVector;
75typedef blas::matrix< double, blas::row_major, blas::gpu_tag > RealGPUMatrix;
76typedef blas::matrix< float, blas::row_major, blas::gpu_tag > FloatGPUMatrix;
77
78typedef blas::permutation_matrix PermutationMatrix;
79
80///Type of Data sequences.
81typedef std::deque<RealVector> Sequence;
82}
83#endif