-
Notifications
You must be signed in to change notification settings - Fork 0
/
boost_typedefs.hpp
94 lines (76 loc) · 4.13 KB
/
boost_typedefs.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#ifndef TYPEDEFS_HPP_
#define TYPEDEFS_HPP_
#define BEGIN_TIME(var) static double var=0; var-=clock();
#define END_TIME(var) var+=clock(); cout<<#var<<": "<<var/CLOCKS_PER_SEC<<endl;
#include <boost/numeric/ublas/vector.hpp>
#include <boost/numeric/ublas/vector_proxy.hpp>
#include <boost/numeric/ublas/vector_sparse.hpp>
#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/matrix_sparse.hpp>
#include <boost/numeric/ublas/matrix_proxy.hpp>
#include <boost/numeric/ublas/io.hpp>
#include <boost/numeric/ublas/operation.hpp>
#include <boost/numeric/ublas/operation_sparse.hpp>
#include <boost/lexical_cast.hpp>
#include <complex>
namespace BoostTypedefs
{
typedef boost::numeric::ublas::range Range;
//basic numeric types
typedef double Real;
typedef std::complex<double> Complex;
//basic types
typedef boost::numeric::ublas::vector<Real> VectorType;
typedef boost::numeric::ublas::matrix<Real> MatrixType;
typedef boost::numeric::ublas::matrix<Real,boost::numeric::ublas::column_major> MatrixTypeColMaj;
typedef boost::numeric::ublas::matrix_range<boost::numeric::ublas::matrix<Real, boost::numeric::ublas::column_major> >MatrixRangeTypeColMaj;
typedef boost::numeric::ublas::compressed_vector<Real> SparseVectorType;
typedef boost::numeric::ublas::compressed_matrix<Real> SparseMatrixType;
//basic complex types
typedef boost::numeric::ublas::vector<Complex> CVectorType;
typedef boost::numeric::ublas::matrix<Complex> CMatrixType;
typedef boost::numeric::ublas::matrix<Complex,boost::numeric::ublas::column_major> CMatrixTypeColMaj;
typedef boost::numeric::ublas::matrix_range<boost::numeric::ublas::matrix<Complex, boost::numeric::ublas::column_major> >CMatrixRangeTypeColMaj;
typedef boost::numeric::ublas::compressed_vector<Complex> SparseCVectorType;
typedef boost::numeric::ublas::compressed_matrix<Complex> SparseCMatrixType;
typedef boost::numeric::ublas::matrix_range<CMatrixType> CMatrixTypeRange;
//integer types
typedef boost::numeric::ublas::vector<int> IntVectorType;
typedef boost::numeric::ublas::matrix<int> IntMatrixType;
typedef boost::numeric::ublas::vector<uint> UintVectorType;
typedef boost::numeric::ublas::vector<uint> CoordVectorType;
//matrix proxies
typedef boost::numeric::ublas::matrix_column<MatrixType> MatrixColumnType;
typedef boost::numeric::ublas::matrix_row<MatrixType> MatrixRowType;
typedef boost::numeric::ublas::matrix_range<MatrixType> MatrixRangeType;
typedef boost::numeric::ublas::matrix_range<SparseMatrixType> SparseMatrixRangeType;
//complex matrix proxies
typedef boost::numeric::ublas::matrix_column<CMatrixType> CMatrixColumnType;
typedef boost::numeric::ublas::matrix_row<CMatrixType> CMatrixRowType;
typedef boost::numeric::ublas::matrix_range<CMatrixType> CMatrixRangeType;
//const matrix proxies
typedef boost::numeric::ublas::matrix_column<const MatrixType> ConstMatrixColumnType;
typedef boost::numeric::ublas::matrix_range<const MatrixType> ConstMatrixRangeType;
typedef boost::numeric::ublas::matrix_range<const SparseMatrixType> ConstSparseMatrixRangeType;
//vector proxies
typedef boost::numeric::ublas::vector_range<VectorType> VectorRangeType;
typedef boost::numeric::ublas::vector_range<CoordVectorType> CoordVectorRangeType;
//complex vector proxies
typedef boost::numeric::ublas::vector_range<CVectorType> CVectorRangeType;
//const vector proxies
typedef boost::numeric::ublas::vector_range<const VectorType> ConstVectorRangeType;
typedef boost::numeric::ublas::vector_range<const CVectorType> ConstCVectorRangeType;
//special matrices/vectors
typedef boost::numeric::ublas::identity_matrix<Real> IdentityMatrixType;
typedef boost::numeric::ublas::zero_matrix<Real> ZeroMatrixType;
typedef boost::numeric::ublas::zero_vector<Real> ZeroVectorType;
typedef boost::numeric::ublas::scalar_vector<Real> ScalarVectorType;
//complex special matrices/vectors
typedef boost::numeric::ublas::identity_matrix<Complex> IdentityCMatrixType;
typedef boost::numeric::ublas::zero_matrix<Complex> ZeroCMatrixType;
typedef boost::numeric::ublas::zero_vector<Complex> ZeroCVectorType;
typedef boost::numeric::ublas::scalar_vector<Complex> ScalarCVectorType;
//range
typedef boost::numeric::ublas::range RangeType;
}
#endif /*TYPEDEFS_HPP_*/