-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfeatures.h
More file actions
50 lines (36 loc) · 1.04 KB
/
Copy pathfeatures.h
File metadata and controls
50 lines (36 loc) · 1.04 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
#ifndef features_h
#define features_h
#include <string>
#include <vector>
#include "base.h"
#include "sparsemat.h"
#include "json.hpp"
class MatrixFeatures
{
public:
// constructor
MatrixFeatures(){}
MatrixFeatures(std::string mfile):mat_file(mfile){}
// copy constructor
MatrixFeatures(const MatrixFeatures & matft):mat_file(matft.mat_file),features(matft.features),mat(matft.mat){}
// copy assignment constructor
MatrixFeatures & operator=(const MatrixFeatures & matft);
// destructor
~MatrixFeatures(){}
// read matrix from coo, index in file begin with 0
void ReadCOO0();
// read matrix from coo, index in file begin with 1
void ReadCOO1();
// print the CSR matrix: from row 0 to row num
void PrintCSRByRow(INT num);
// output the features to a json file for future usage
void DumpFeatures2JsonFile(const std::string json_file);
//================================================================
// extract features
void Features_1_1_Nrows();
protected:
std::string mat_file;
nlohmann::json features;
SpaCSR mat;
};
#endif