33 mgadsmproblem():size(0),type(0),e(0),rp(0),AUdist(0),DVtotal(0),DVonboard(0) {};
34 mgadsmproblem(
int t,
const int *seq,
const size_t &size_,
const double &AUdist_,
const double &DVtotal_,
const double &DVonboard_,
35 const double &e_,
const double &rp_):
36 size(size_),type(t),sequence(seq,seq + size),e(e_),rp(rp_),AUdist(AUdist_),DVtotal(DVtotal_),
37 DVonboard(DVonboard_),r(size),v(size),DV(size + 1),vrelin_vec(size-2) {
38 for (
size_t i = 0; i < size; ++i) {
41 for (
size_t j = 0; j < 3; ++j) {
47 mgadsmproblem(
const mgadsmproblem &m):size(m.size),type(m.type),sequence(m.sequence),e(m.e),rp(m.rp),asteroid(m.asteroid),
48 AUdist(m.AUdist),DVtotal(m.DVtotal),DVonboard(m.DVonboard),r(m.size),v(m.size),DV(m.DV),vrelin_vec(m.vrelin_vec) {
49 for (
size_t i = 0; i < size; ++i) {
52 for (
size_t j = 0; j < 3; ++j) {
59 for (
size_t i = 0; i < size; ++i) {
66 std::vector<int> sequence;
69 customobject asteroid;
75 mutable std::vector<double*> r;
76 mutable std::vector<double*> v;
77 mutable std::vector<double> DV;
78 mutable std::vector<double> vrelin_vec;
80 friend class boost::serialization::access;
81 template<
class Archive>
82 void serialize(Archive &ar,
const unsigned int version) {
83 ar &
const_cast<size_t &
>(size);
94 boost::serialization::split_member(ar, *
this, version);
96 template<
class Archive>
97 void save(Archive & ar,
const unsigned int)
const {
98 std::vector<std::vector<double> > r_values(size,std::vector<double>(3));
99 std::vector<std::vector<double> > v_values(size,std::vector<double>(3));
100 for (
int i = 0; i < (int)size; ++i) {
101 for(
int j = 0; j < 3; ++j){
102 r_values[(size_t)i][j] = r[i][j];
105 for (
int i = 0; i < (int)size; ++i) {
106 for(
int j = 0; j < 3; ++j){
107 v_values[(size_t)i][j] = v[i][j];
110 ar << static_cast<const std::vector<std::vector<double> > &>(r_values);
111 ar << static_cast<const std::vector<std::vector<double> > &>(v_values);
113 template<
class Archive>
114 void load(Archive & ar,
const unsigned int) {
115 std::vector<std::vector<double> > r_values;
116 std::vector<std::vector<double> > v_values;
120 for (
int i = 0; i < (int)size; ++i) {
121 for(
int j = 0; j < 3; ++j){
122 r[(size_t)i][j] = r_values[i][j];
125 for (
int i = 0; i < (int)size; ++i) {
126 for(
int j = 0; j < 3; ++j){
127 v[(size_t)i][j] = v_values[i][j];
136 const std::vector<double> &x ,
137 const mgadsmproblem &mgadsm,