-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsaver.cpp
More file actions
71 lines (59 loc) · 1.39 KB
/
saver.cpp
File metadata and controls
71 lines (59 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <matio.h>
#include <eigen3>
using namespace std;
struct obolochka
{
vector <double> vec1;
vector<vector<vector<double>>> vec2;
vector<vector<vector<double>>> vec3;
};
obolochka SavingFunction ()
{
obolochka MyObject;
MyObject.vec1 = {1.0,1.0};
MyObject.vec2 = {{{1.0, 1.0, 1.0}, {4.0, 5.0, 1.0}},{{1.0, 1.0, 1.0}, {2.0, 5.0, 4.0}}};
MyObject.vec3 = {{{2.0, 3.0, 4.0}, {5.0, 1.0, 5.0}},{{9.0, 6.0, 1.0}, {2.0, 5.0, 4.0}}};
return MyObject;
}
int main ()
{
obolochka result = SavingFunction();
// Использование результатов
cout << "vec1: ";
for (const auto &value : result.vec1)
{
cout << value << " ";
}
cout << endl<< " ";
cout << "vec2:" << endl;
for (const auto &matrix : result.vec2)
{
for (const auto &row : matrix)
{
for (const auto &value : row)
{
cout << value << " ";
}
cout << endl;
}
cout << endl;
}
cout << "vec3:" << endl;
for (const auto &matrix : result.vec3)
{
for (const auto &row : matrix)
{
for (const auto &value : row)
{
cout << value << " ";
}
cout << std::endl;
}
cout << std::endl;
}
return 0;
}