Program listing for file kernel/src/utils/SiconosAlgebra/SiconosAlgebraTypeDef.hpp#
Return to documentation for this file
1#ifndef SiconosAlgebraTypeDef
2#define SiconosAlgebraTypeDef
3
4
5#ifndef BIND_FORTRAN_LOWERCASE_UNDERSCORE
6#define BIND_FORTRAN_LOWERCASE_UNDERSCORE
7#endif
8
9
10#ifndef BOOST_ALL_NO_LIB
11#define BOOST_ALL_NO_LIB
12#endif
13
14#include <vector>
15#include <limits>
16#include <boost/numeric/ublas/fwd.hpp>
17
18#include "SiconosConfig.h"
19#include <array>
20
21#include <complex>
22#include "SiconosPointers.hpp"
23
24#include "SiconosFwd.hpp"
25
26#include "SiconosVisitor.hpp"
27
28
29const char N_DOUBLE_PRECISION[] = "%1.52e ";
30const unsigned int M_MAXSIZEFORDISPLAY = 10;
31const std::string DEFAULT_FORMAT = "ascii";
32
33namespace siconos
34{
35
36 enum UBLAS_TYPE {
37 BLOCK =0,
38
39 DENSE = 1,
40
41 TRIANGULAR=2,
42
43 SYMMETRIC=3,
44
45 SPARSE=4,
46
47 BANDED=5,
48
49 ZERO=6,
50
51 IDENTITY=7,
52
53 SPARSE_COORDINATE=8};
54}
55
56
57
58
59
60
61
62
63
64
65typedef std::vector<SP::SiconosVector> VectorOfVectors;
66
67
68typedef std::vector<SP::BlockVector> VectorOfBlockVectors;
69
70
71typedef std::vector<SP::SiconosMatrix> VectorOfMatrices;
72
73
74
75typedef std::vector<SP::SimpleMatrix> VectorOfSMatrices;
76
77
78
79
80typedef VectorOfMatrices::iterator VectorOfMatricesIterator;
81
82
83typedef VectorOfMatrices::const_iterator VectorOfMatricesConstIterator;
84
85
86typedef std::vector<std::size_t> Index;
87TYPEDEF_SPTR(Index)
88TYPEDEF_SPTR(VectorOfBlockVectors)
89TYPEDEF_SPTR(VectorOfVectors)
90TYPEDEF_SPTR(VectorOfMatrices)
91TYPEDEF_SPTR(VectorOfSMatrices)
92
93namespace ublas = boost::numeric::ublas;
94
95
96
97
98typedef ublas::matrix<double, ublas::column_major, std::vector<double> > DenseMat;
99
100TYPEDEF_SPTR(DenseMat)
101
102
103typedef ublas::triangular_matrix<double, ublas::upper, ublas::column_major> TriangMat;
104
105TYPEDEF_SPTR(TriangMat)
106
107
108typedef ublas::symmetric_matrix<double, ublas::upper, ublas::column_major> SymMat;
109
110TYPEDEF_SPTR(SymMat)
111
112
113typedef ublas::banded_matrix<double, ublas::column_major > BandedMat;
114TYPEDEF_SPTR(BandedMat)
115
116
117typedef ublas::compressed_matrix<double, ublas::column_major, 0, Index > SparseMat;
118TYPEDEF_SPTR(SparseMat)
119
120
121typedef ublas::coordinate_matrix<double, ublas::column_major, 0, Index > SparseCoordinateMat;
122TYPEDEF_SPTR(SparseCoordinateMat)
123
124
125typedef ublas::zero_matrix<double> ZeroMat;
126TYPEDEF_SPTR(ZeroMat)
127
128
129typedef ublas::identity_matrix<double> IdentityMat;
130TYPEDEF_SPTR(IdentityMat)
131
132
133typedef ublas::compressed_matrix<SP::SiconosMatrix> BlocksMat;
134TYPEDEF_SPTR(BlocksMat)
135
136
137typedef ublas::matrix<std::complex<double>, ublas::column_major> complex_matrix;
138TYPEDEF_SPTR(complex_matrix)
139
140
141
142
143typedef ublas::vector<double, std::vector<double> > DenseVect;
144TYPEDEF_SPTR(DenseVect)
145
146
147typedef ublas::compressed_vector<double> SparseVect;
148TYPEDEF_SPTR(SparseVect)
149
150
151typedef ublas::vector<std::complex<double> > complex_vector;
152TYPEDEF_SPTR(complex_vector)
153
154
155
156#define USE_OPTIMAL_WORKSPACE
157
158#endif