Cosan
1.0
Data Analytics Library
OverUnderFlowTest.cpp
Go to the documentation of this file.
1
//
2
// Created by Xinyu Zhang on 3/26/21.
3
//
4
// gcc -I/Users/xinyuzhang/Desktop/Spring2021/c++pattern/project/cosan /Users/xinyuzhang/Desktop/Spring2021/c++pattern/project/cosan/test/preprocessor/OverUnderFlowTest.cpp
5
6
#include <iostream>
7
#include <Eigen/Dense>
8
#include <Eigen/Core>
9
#include <
cosan/data/CosanData.h
>
10
#include <gsl/gsl>
11
#include <
cosan/preprocessing/overunderflow.h
>
12
#include <vector>
13
//using namespace Eigen;
14
//using namespace std;
15
16
typedef
double
NumericType
;
17
int
main
() {
18
19
Cosan::CosanRawData<NumericType>
CRD(
"./example_data/toy2/X_.csv"
,
"./example_data/toy2/Y_.csv"
);
20
// std::cout<<CRD.GetSummaryMessageX()<<CRD.GetSummaryMessageY()<<std::endl;
21
Cosan::OverUnderFlow
ouf(CRD);
22
23
myarray = myarray.unaryExpr([](
double
v) {
return
std::isfinite(v)? v : 0.0; });
24
25
std::cout<<(1-CRD.
GetTarget
().array().isNaN()).cast<double>().array()*CRD.
GetTarget
().array()<<std::endl;
26
int
a = 1;
27
28
std::string cout;
29
cout =(a==1 ?
"Hello!"
:
"I am doing good!"
) ;
30
std::cout<<CRD.
GetTarget
().size() <<std::endl;
31
// std::vector<std::vector<gsl::index>> a({{1,2},{2,3},{3,4},{4,5},{5,6},{6,7},{7,8},{8,9},{9,10},{10,11}});
32
// std::vector<std::vector<gsl::index>> b;
33
// select(b, a, {3,4,7,9});
34
// // std::transform(a.begin(),a.end(),b.begin(),[]()->bool {});
35
// std::cout<<b.size()<<std::endl;
36
// for (auto each: b){
37
// std::cout<<each[0]<<each[1]<<std::endl;
38
// }
39
40
// gsl::index c=11,d=5;
41
// std::cout<<c/d<<std::endl;
42
43
44
45
return
0;
46
//
47
// m.transposeInPlace();
48
// cout<<m<<endl;
49
// m.resize(1,4);
50
// cout<<n<<endl;
51
}
CosanData.h
Cosan::CosanRawData::GetTarget
CosanMatrix< NumericType > GetTarget()
Get a copy of CosanMatrix<NumericType> Y.
Definition:
CosanData.h:147
Cosan::OverUnderFlow
Definition:
overunderflow.h:14
main
int main()
Definition:
OverUnderFlowTest.cpp:17
Cosan::CosanRawData
Raw Data container.
Definition:
CosanData.h:36
overunderflow.h
NumericType
double NumericType
Definition:
OverUnderFlowTest.cpp:16
test
preprocessor
OverUnderFlowTest.cpp
Generated by
1.8.20