-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathformat.cpp
More file actions
executable file
·80 lines (62 loc) · 1.81 KB
/
format.cpp
File metadata and controls
executable file
·80 lines (62 loc) · 1.81 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
72
73
74
75
76
77
78
79
80
#include <iostream>
#include <cstdlib>
#include <string>
#include "classes/simplicialChainComplex.h"
using namespace std;
int main(int argc, char* argv[]) {
string name_simplexes = "simplexes";
string name_boundary_operator = "d";
string name_fundamental_class = "Gamma";
int n;
cin >> n; //nombre de matrius de simplexs. Es a dir, dim + 1
// simplexs
cout << "# name: " << name_simplexes << endl;
cout << "# type: cell" << endl;
cout << "# rows: 1" << endl;
cout << "# columns: " << n << endl;
for (int i = 0 ; i < n ; i++) {
int r, c;
cin >> r >> c;
cout << "# name: <cell-element>" << endl;
cout << "# type: matrix" << endl;
cout << "# rows: " << r << endl;
cout << "# columns: " << c << endl;
int a;
for (int i = 0 ; i < r; i++) {
for (int j = 0; j < c; j++) {
cin >> a;
cout << " " << a;
}
cout << endl;
}
cout << endl << endl << endl;
}
// operadors bora
cout << "# name: " << name_boundary_operator << endl;
cout << "# type: cell" << endl;
cout << "# rows: 1" << endl;
cout << "# columns: " << n-1 << endl;
for (int i = 0 ; i < n-1 ; i++) {
sparseMatrix d;
d.read(cin);
cout << "# name: <cell-element>" << endl;
cout << "# type: matrix" << endl;
cout << "# rows: " << d.size(1) << endl;
cout << "# columns: " << d.size(2) << endl;
d.print_full(cout);
cout << endl << endl << endl;
}
// classe fonamental
cin >> n; // llargada de la classe fonamental
cout << "# name: " << name_fundamental_class << endl;
cout << "# type: matrix" << endl;
cout << "# rows: " << n << endl;
cout << "# columns: 1" << endl;
int a;
for (int i = 0; i < n; i++) {
cin >> a;
cout << " " << a << endl;
}
cout << endl << endl << endl;
return 0;
}