Phoxonics  1.0
Object Oriented FDTD Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Matrix.hpp
Go to the documentation of this file.
1 /*
2  * Matrix.hpp
3  *
4  * Created on: Oct 25, 2014
5  * Author: nano
6  */
7 
8 #ifndef MATRIX_HPP_
9 #define MATRIX_HPP_
10 
11 #include <string>
12 #include <vector>
13 #include <fstream> // std::ifstream
14 #include <iostream>
15 #include <cmath>
16 #include "../common/CommonBase.hpp"
17 
18 namespace phoxonics {
19 namespace common {
20 
21 class Matrix : public CommonBase {
22 public:
23  Matrix();
24  virtual ~Matrix();
25 
31  void get_file_rows_cols(std::string file_path, int row_cols[2], std::string delim);
32 
38  void create_string_matrix_from_file(std::string data_file,
39  std::vector<std::vector<std::string>> &matrix, std::string delim);
40 
41  void create_double_matrix_from_file(std::string data_file,
42  std::vector<std::vector<double>>& matrix, std::string delim);
43 
44  void rotate_points(std::string source_data_file, std::string target_data_file, double ang,
45  unsigned int start_at = 0);
46 
47  void save_double_matrix_to_file(std::vector<std::vector<double>>& matrix, std::string separator,
48  std::string target_data_file);
49 
54  void print_matrix(std::vector<std::vector<std::string>>& matrix, std::string title);
55 
62  std::vector<std::string> split(const std::string& src, const std::string& delim);
63 };
64 
65 } /* namespace common */
66 } /* namespace phoxonics */
67 
68 #endif /* MATRIX_HPP_ */
void rotate_points(std::string source_data_file, std::string target_data_file, double ang, unsigned int start_at=0)
Definition: Matrix.cpp:96
void get_file_rows_cols(std::string file_path, int row_cols[2], std::string delim)
Definition: Matrix.cpp:21
Matrix()
Definition: Matrix.cpp:13
Definition: CommonBase.hpp:14
void create_double_matrix_from_file(std::string data_file, std::vector< std::vector< double >> &matrix, std::string delim)
Definition: Matrix.cpp:81
virtual ~Matrix()
Definition: Matrix.cpp:17
Definition: CommonBase.hpp:17
void print_matrix(std::vector< std::vector< std::string >> &matrix, std::string title)
Definition: Matrix.cpp:145
void create_string_matrix_from_file(std::string data_file, std::vector< std::vector< std::string >> &matrix, std::string delim)
Definition: Matrix.cpp:47
std::vector< std::string > split(const std::string &src, const std::string &delim)
Definition: Matrix.cpp:157
Definition: Matrix.hpp:21
void save_double_matrix_to_file(std::vector< std::vector< double >> &matrix, std::string separator, std::string target_data_file)
Definition: Matrix.cpp:127