FMT 0.9.8
Forest management tools for forest planning
Loading...
Searching...
No Matches
FMTserializablematrix.hpp
Go to the documentation of this file.
1/*
2Copyright (c) 2019 Gouvernement du Québec
3
4SPDX-License-Identifier: LiLiQ-R-1.1
5License-Filename: LICENSES/EN/LiLiQ-R11unicode.txt
6*/
7
8#ifdef FMTWITHOSI
9#ifndef FMTserializablematrix_H_INCLUDED
10#define FMTserializablematrix_H_INCLUDED
11
12
13#include <memory>
14#include <vector>
15#include "FMTutility.hpp"
16#include <boost/serialization/vector.hpp>
17
18class OsiSolverInterface;
19class CoinPackedMatrix;
20
21namespace Models
22{
23// DocString: FMTserializablematrix
32 {
33 // DocString: FMTserializablematrix::matrix
35 std::unique_ptr<CoinPackedMatrix> matrix;
36 // DocString: FMTserializablematrix::collb
38 std::vector<double>collb;
39 // DocString: FMTserializablematrix::colub
41 std::vector<double>colub;
42 // DocString: FMTserializablematrix::obj
44 std::vector<double>obj;
45 // DocString: FMTserializablematrix::rowlb
47 std::vector<double>rowlb;
48 // DocString: FMTserializablematrix::rowub
50 std::vector<double>rowub;
51 // DocString: FMTserializablematrix::colsolution
53 std::vector<double>colsolution;
54 // DocString: FMTserializablematrix::rowprice
56 std::vector<double>rowprice;
57 // DocString: FMTserializablematrix::serialize
61 friend class boost::serialization::access;
62 template<class Archive>
63 void serialize(Archive& ar, const unsigned int version)
64 {
65 const bool loading = Archive::is_loading::value;
66 bool order;
67 double extragap;
68 double extramajor;
69 int sizevector;
70 int minordim;
71 int numelements;
72 int majordim;
73 int maxsize;
74 std::vector<double> lelement;
75 std::vector<int> lindex;
76 std::vector<int> llength;
77 std::vector<int> lstart;
78 //members
79 std::vector<double> lcollb;
80 std::vector<double> lcolub;
81 std::vector<double> lobj;
82 std::vector<double> lrowlb;
83 std::vector<double> lrowub;
84 std::vector<double> lcolsolution;
85 std::vector<double> lrowprice;
86 if (!loading)
87 {
88 getsetmatrixelements(false,
89 order,
90 extragap,
91 extramajor,
92 sizevector,
93 minordim,
94 numelements,
95 majordim,
96 maxsize,
97 lelement,
98 lindex,
99 llength,
100 lstart);
101 getsetmemberelements(false,
102 lcollb,
103 lcolub,
104 lobj,
105 lrowlb,
106 lrowub,
107 lcolsolution,
108 lrowprice);
109 }
110 ar&order;
111 ar& extragap;
112 ar& extramajor;
113 ar& sizevector;
114 ar& minordim;
115 ar& numelements;
116 ar& majordim;
117 ar& maxsize;
118 ar& lelement;
119 ar& lindex;
120 ar& llength;
121 ar& lstart;
122 //members
123 ar& lcollb;
124 ar& lcolub;
125 ar& lobj;
126 ar& lrowlb;
127 ar& lrowub;
128 ar& lcolsolution;
129 ar& lrowprice;
130 if (loading)
131 {
132 getsetmatrixelements(true,
133 order,
134 extragap,
135 extramajor,
136 sizevector,
137 minordim,
138 numelements,
139 majordim,
140 maxsize,
141 lelement,
142 lindex,
143 llength,
144 lstart);
145 getsetmemberelements(true,
146 lcollb,
147 lcolub,
148 lobj,
149 lrowlb,
150 lrowub,
151 lcolsolution,
152 lrowprice);
153 }
154
155
156 }
157 void getsetmatrixelements(bool loading,
158 bool& order,
159 double& extragap,
160 double& extramajor,
161 int& sizevector,
162 int& minordim,
163 int& numelements,
164 int& majordim,
165 int& maxsize,
166 std::vector<double>& lelement,
167 std::vector<int>& lindex,
168 std::vector<int>& llength,
169 std::vector<int>& lstart);
170 void getsetmemberelements(bool loading,
171 std::vector<double>&lcollb,
172 std::vector<double>&lcolub,
173 std::vector<double>&lobj,
174 std::vector<double>&lrowlb,
175 std::vector<double>&lrowub,
176 std::vector<double>&lcolsolution,
177 std::vector<double>&lrowprice);
178 public:
179 // DocString: FMTserializablematrix()
184 // DocString: FMTserializablematrix(const FMTserializablematrix)
189 // DocString: FMTserializablematrix::operator=
194 // DocString: FMTserializablematrix(const std::shared_ptr<OsiSolverInterface>,const FMTsolverinterface)
199 FMTserializablematrix(const std::shared_ptr<OsiSolverInterface>& solverinterface);
200 // DocString: FMTserializablematrix::setsolvertype
204 //void setsolvertype(FMTsolverinterface& lsolvertype) const;
205 // DocString: FMTserializablematrix::setmatrix
209 void setmatrix(std::shared_ptr<OsiSolverInterface>& solverinterface) const;
210 // DocString: FMTserializablematrix::buildsolverinterface
214 //std::shared_ptr<OsiSolverInterface> buildsolverinterface(const FMTsolverinterface& lsolvertype, CoinMessageHandler* handler) const;
215 // DocString: FMTserializablematrix::copysolverinterface
219 //std::shared_ptr<OsiSolverInterface> copysolverinterface(const std::shared_ptr<OsiSolverInterface>& solver_ptr, const FMTsolverinterface& lsolvertype, CoinMessageHandler* handler) const;
220 // DocString: ~FMTserializablematrix()
225 };
226
227}
228
229#endif
230#endif
#define FMTEXPORT
Definition: FMTutility.hpp:92
Definition: FMTserializablematrix.hpp:32
void setmatrix(std::shared_ptr< OsiSolverInterface > &solverinterface) const
FMTserializablematrix(const FMTserializablematrix &rhs)
FMTserializablematrix(const std::shared_ptr< OsiSolverInterface > &solverinterface)
Namespace containing all enumerator and classes used to construct or manipulate the different type of...
Definition: FMTareaparser.hpp:50