-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfeatures.cpp
More file actions
52 lines (42 loc) · 861 Bytes
/
features.cpp
File metadata and controls
52 lines (42 loc) · 861 Bytes
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
#include <iostream>
#include <fstream>
#include <sstream>
#include <stdlib.h>
#include "features.h"
#include <iomanip>
MatrixFeatures & MatrixFeatures::operator=(const MatrixFeatures & matft)
{
if(this == &matft)
return *this;
mat_file = matft.mat_file;
features = matft.features;
mat = matft.mat;
return *this;
}
void MatrixFeatures::ReadCOO0()
{
SpaCOO coo;
coo.ReadMat0(mat_file);
mat = coo;
}
void MatrixFeatures::ReadCOO1()
{
SpaCOO coo;
coo.ReadMat1(mat_file);
mat = coo;
}
void MatrixFeatures::PrintCSRByRow(INT num)
{
mat.PrintPartialMat(num);
}
void MatrixFeatures::DumpFeatures2JsonFile(const std::string json_file)
{
std::ofstream j_file(json_file);
j_file << std::setw(4) << features << std::endl;
}
void MatrixFeatures::Features_1_1_Nrows()
{
std::string name = "nrows";
INT val = mat.GetRow();
features[name] = val;
}