Statistics.h
Go to the documentation of this file.
1 /*
2 * ==========================================================================
3 * This file is part of the implementation of
4 *
5 * <FrameFab: Robotic Fabrication of Frame Shapes>
6 * Yijiang Huang, Juyong Zhang, Xin Hu, Guoxian Song, Zhongyuan Liu, Lei Yu, Ligang Liu
7 * In ACM Transactions on Graphics (Proc. SIGGRAPH Asia 2016)
8 ----------------------------------------------------------------------------
9 * class: Statistics
10 *
11 * Description: Statistic data output
12 *
13 * Version: 2.0
14 * Created: Oct/10/2015
15 * Updated: Aug/24/2016
16 *
17 * Author: Xin Hu, Yijiang Huang, Guoxian Song
18 * Company: GCL@USTC
19 ----------------------------------------------------------------------------
20 * Copyright (C) 2016 Yijiang Huang, Xin Hu, Guoxian Song, Juyong Zhang
21 * and Ligang Liu.
22 *
23 * FrameFab is free software: you can redistribute it and/or modify
24 * it under the terms of the GNU General Public License as published by
25 * the Free Software Foundation, either version 3 of the License, or
26 * (at your option) any later version.
27 *
28 * FrameFab is distributed in the hope that it will be useful,
29 * but WITHOUT ANY WARRANTY; without even the implied warranty of
30 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31 * GNU General Public License for more details.
32 *
33 * You should have received a copy of the GNU General Public License
34 * along with FrameFab. If not, see <http://www.gnu.org/licenses/>.
35 * ==========================================================================
36 */
37 
38 #ifndef STATISTICS_H
39 #define STATISTICS_H
40 
41 #include <iostream>
42 #include <fstream>
43 #include <iomanip>
44 
45 #include <Eigen/Core>
46 #include <Eigen/Sparse>
47 
48 #include <vector>
49 #include <string>
50 
51 using namespace std;
52 using namespace Eigen;
53 
54 #define PATH "$HOME"
55 
56 class Statistics{
57 public:
59  Statistics(std::string _name, Eigen::VectorXd _VX, int _iteration, char *ptr_path = PATH)
60  :name_(_name),iteration_(_iteration)
61  {
62  Vx_ = _VX;
63  store_path_ = string(ptr_path);
64  }
65  Statistics(std::string _name, Eigen::VectorXd _VX, char *ptr_path = PATH)
66  :name_(_name),iteration_(-1)
67  {
68  Vx_ = _VX;
69  store_path_ = string(ptr_path);
70  }
71 
72  Statistics(std::string _name, Eigen::SparseMatrix<double> SpMat, char *ptr_path = PATH)
73  :name_(_name), iteration_(-1)
74  {
75  SpMat_ = SpMat;
76  store_path_ = string(ptr_path);
77  }
78 
79  Statistics(std::string _name, Eigen::MatrixXd Mat, char *ptr_path = PATH)
80  : name_(_name)
81  {
82  denMat_ = Mat;
83  store_path_ = string(ptr_path);
84  }
85 
86  Statistics(std::string _name, std::vector<double> _stdvec, char *ptr_path = PATH)
87  : name_(_name), iteration_(-1)
88  {
89  stdVec_ = _stdvec;
90  store_path_ = string(ptr_path);
91  }
93 
94  void StreamVectorOutPut();
95  void StreamSpMatrixOutput();
96  void StreamDenMatrixOutput();;
97 
98  void GenerateVectorFile();
99  void GenerateMatrixFile();
100  void GenerateSpFile();
101  void GenerateStdVecFile();
102  bool UniqueFileName();
103 
104  std::string name_;
106  std::string lastDir_;
107  std::string filename_;
108  std::string store_path_;
109  Eigen::SparseMatrix<double> SpMat_;
110  Eigen::MatrixXd denMat_;
111  Eigen::VectorXd Vx_;
112  std::vector<double> stdVec_;
113 };
114 
115 #endif // STATISTICS_H
std::string store_path_
Definition: Statistics.h:108
Eigen::VectorXd Vx_
Definition: Statistics.h:111
Eigen::SparseMatrix< double > SpMat_
Definition: Statistics.h:109
Statistics(std::string _name, Eigen::VectorXd _VX, char *ptr_path=PATH)
Definition: Statistics.h:65
Statistics(std::string _name, Eigen::SparseMatrix< double > SpMat, char *ptr_path=PATH)
Definition: Statistics.h:72
std::vector< double > stdVec_
Definition: Statistics.h:112
int iteration_
Definition: Statistics.h:105
GLsizei const GLchar *const * string
std::string name_
Definition: Statistics.h:104
Statistics(std::string _name, Eigen::MatrixXd Mat, char *ptr_path=PATH)
Definition: Statistics.h:79
Statistics(std::string _name, Eigen::VectorXd _VX, int _iteration, char *ptr_path=PATH)
Definition: Statistics.h:59
std::string filename_
Definition: Statistics.h:107
Eigen::MatrixXd denMat_
Definition: Statistics.h:110
Statistics(std::string _name, std::vector< double > _stdvec, char *ptr_path=PATH)
Definition: Statistics.h:86
#define PATH
Definition: Statistics.h:54
std::string lastDir_
Definition: Statistics.h:106


choreo_task_sequence_planner
Author(s): Yijiang Huang
autogenerated on Thu Jul 18 2019 04:03:14