-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexplanation_matrix_and_main_function
More file actions
52 lines (40 loc) · 1.12 KB
/
explanation_matrix_and_main_function
File metadata and controls
52 lines (40 loc) · 1.12 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
What do you need to write in the main to create the
coordinate matrix
genes cells matrix
with input:
n is the nb of genes
m is the nb of cells
! we will need to change the string in int
in txt_to_matrix.cpp if the name of the gene is an integer and not a string
You can test the code using the 3 test files test_nk.txt, test_coo_k.txt and "csv_projet_test"
#include "matrix.h"
#include <iostream>
#include <string>
#include <sstream>
#include <iterator>
#include <vector>
#include <algorithm>
using namespace std;
using std::cout; using std::cin;
using std::endl; using std::string;
using std::vector; using std::istringstream;
using std::stringstream;
int main(){
int n=10;
int m=10;
int c=2;
int d=4;
string file_name_nk="test_nk.txt";
string file_name_coo="test_coo_k.txt";
string file_csv="csv_projet_test";
Matrix mat_nk;
Matrix mat_coo;
Matrix mat_csv;
mat_nk.file_to_matrix(n,m,file_name_nk);
mat_nk.print_matrix();
mat_coo.file_to_matrix(n,c,file_name_coo);
mat_coo.print_matrix();
mat_csv.file_to_matrix(n,d,file_csv);
mat_csv.print_matrix();
return 0;
}