Program listing for file kernel/src/simulationTools/OSNSMatrix.hpp#
Return to documentation for this file
1#ifndef OSNSM_H
2#define OSNSM_H
3
4#include "SiconosFwd.hpp"
5#include "SiconosSerialization.hpp"
6#include "SimulationTypeDef.hpp"
7#include "NumericsMatrix.h"
8
9
10class OSNSMatrix
11{
12protected:
13
14 ACCEPT_SERIALIZATION(OSNSMatrix);
15
16
17 unsigned int _dimRow;
18
19
20 unsigned int _dimColumn;
21
22
23 NM_types _storageType;
24
25
26 size_t _triplet_nzmax;
27
28
29 SP::NumericsMatrix _numericsMatrix;
30
31
32 SP::SiconosMatrix _M1;
33
34
35 SP::BlockCSRMatrix _M2;
36
37
38 virtual unsigned updateSizeAndPositions(InteractionsGraph & indexSet);
39
40
41 virtual unsigned updateSizeAndPositions(DynamicalSystemsGraph & DSG);
42
43private:
44
45 OSNSMatrix(const OSNSMatrix&);
46
47
48 OSNSMatrix& operator=(const OSNSMatrix&);
49
50public:
51
52
53 OSNSMatrix();
54
55
56 OSNSMatrix(unsigned int n, NM_types stor);
57
58
59 OSNSMatrix(unsigned int n, unsigned int m, NM_types stor);
60
61
62 OSNSMatrix(InteractionsGraph& indexSet, NM_types stor);
63
64
65 OSNSMatrix(const SiconosMatrix& MSource);
66
67
68 virtual ~OSNSMatrix(){};
69
70
71 inline unsigned int size() const
72 {
73 return _dimRow;
74 };
75
76
77 inline void setSize(unsigned int size)
78 {
79 _dimRow =size;
80 };
81
82
83 inline unsigned int sizeColumn() const
84 {
85 return _dimColumn;
86 };
87
88
89 inline NM_types storagetype() const
90 {
91 return _storageType;
92 };
93
94
95 inline void setStorageType(NM_types i)
96 {
97 _storageType = i;
98 };
99
100
101 inline SP::NumericsMatrix numericsMatrix()
102 {
103 return _numericsMatrix;
104 };
105
106
107 inline SP::SiconosMatrix defaultMatrix()
108 {
109 return _M1;
110 };
111
112
113 virtual void fillM(InteractionsGraph&indexSet, bool update = true);
114
115
116
117 void computeM(SP::NumericsMatrix Winverse, SP::NumericsMatrix H);
118
119
120
121 virtual void fillW(DynamicalSystemsGraph& DSG, bool update = true);
122
123
124 virtual void fillWinverse(DynamicalSystemsGraph& DSG, bool update = true);
125
126
127 virtual void fillH(DynamicalSystemsGraph& DSG, InteractionsGraph& indexSet, bool update = true);
128
129
130 virtual void fillHtrans(DynamicalSystemsGraph& DSG, InteractionsGraph& indexSet, bool update = true);
131
132
133 void convert();
134
135
136 void display() const;
137};
138
139#endif