Program listing for file kernel/src/simulationTools/MLCP.hpp#
Return to documentation for this file
1#ifndef MLCP_H
2#define MLCP_H
3
4#include "LinearOSNS.hpp"
5
6#include <mlcp_cst.h>
7
8#define MLCP_NB_BLOCKS_MAX 200
9
10class MLCP : public LinearOSNS {
11protected:
12
13 ACCEPT_SERIALIZATION(MLCP);
14
15
16 int _n = 0;
17
18
19 int _m = 0;
20
21 int _curBlock = 0;
22
23
24 SP::MixedLinearComplementarityProblem _numerics_problem;
25
26public:
27
28 MLCP(int numericsSolverId = SICONOS_MLCP_ENUM);
29
30
31 MLCP(SP::SolverOptions options);
32
33
34 virtual ~MLCP() { reset(); };
35
36
37 virtual void computeOptions(SP::Interaction inter1, SP::Interaction inter2);
38
39
40 void updateInteractionBlocks() override;
41
42
43 inline int getn() const { return _n; }
44
45
46
47 inline SP::MixedLinearComplementarityProblem getNumericsMLCP()
48 {
49 return _numerics_problem;
50 }
51
52
53 virtual void reset();
54
55
56 void
57 computeInteractionBlock(const InteractionsGraph::EDescriptor &ed) override;
58
59
60 void computeDiagonalInteractionBlock(
61 const InteractionsGraph::VDescriptor &vd) override;
62
63
64 int compute(double time) override;
65
66
67 int solve();
68
69
70 void display() const override;
71
72
73 bool checkCompatibleNSLaw(NonSmoothLaw &nslaw) override;
74
75 ACCEPT_STD_VISITORS();
76};
77
78#endif