Phoxonics  1.0
Object Oriented FDTD Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | List of all members
phoxonics::common::Matrix Class Reference
Inheritance diagram for phoxonics::common::Matrix:
Inheritance graph
[legend]
Collaboration diagram for phoxonics::common::Matrix:
Collaboration graph
[legend]

Public Member Functions

 Matrix ()
 
virtual ~Matrix ()
 
void get_file_rows_cols (std::string file_path, int row_cols[2], std::string delim)
 
void create_string_matrix_from_file (std::string data_file, std::vector< std::vector< std::string >> &matrix, std::string delim)
 
void create_double_matrix_from_file (std::string data_file, std::vector< std::vector< double >> &matrix, std::string delim)
 
void rotate_points (std::string source_data_file, std::string target_data_file, double ang, unsigned int start_at=0)
 
void save_double_matrix_to_file (std::vector< std::vector< double >> &matrix, std::string separator, std::string target_data_file)
 
void print_matrix (std::vector< std::vector< std::string >> &matrix, std::string title)
 
std::vector< std::string > split (const std::string &src, const std::string &delim)
 

Additional Inherited Members

- Protected Types inherited from phoxonics::common::CommonBase
typedef Formatter fmt_
 
- Protected Member Functions inherited from phoxonics::common::CommonBase
 CommonBase ()
 
virtual ~CommonBase ()
 
- Protected Attributes inherited from phoxonics::common::CommonBase
Logger log_
 

Constructor & Destructor Documentation

phoxonics::common::Matrix::Matrix ( )
phoxonics::common::Matrix::~Matrix ( )
virtual

Member Function Documentation

void phoxonics::common::Matrix::create_double_matrix_from_file ( std::string  data_file,
std::vector< std::vector< double >> &  matrix,
std::string  delim 
)
void phoxonics::common::Matrix::create_string_matrix_from_file ( std::string  data_file,
std::vector< std::vector< std::string >> &  matrix,
std::string  delim 
)

Creates a matrix from datafile and prints it to screen

Parameters
dataFileThe data file
matrixThe resulting matrix

References phoxonics::common::CommonBase::log_, phoxonics::common::Logger::log_trac(), and split().

Referenced by create_double_matrix_from_file().

void phoxonics::common::Matrix::get_file_rows_cols ( std::string  file_path,
int  row_cols[2],
std::string  delim 
)

Get file number of rows and columns, utilize a delimiter to find columns

Parameters
filePathThe file location
rowColsThe resulting rows and columns

References phoxonics::common::CommonBase::log_, phoxonics::common::Logger::log_trac(), and split().

void phoxonics::common::Matrix::print_matrix ( std::vector< std::vector< std::string >> &  matrix,
std::string  title 
)

Helper for printing matrixes

Parameters
matrixThe matrix to print

References phoxonics::common::CommonBase::log_, and phoxonics::common::Logger::log_trac().

void phoxonics::common::Matrix::rotate_points ( std::string  source_data_file,
std::string  target_data_file,
double  ang,
unsigned int  start_at = 0 
)
void phoxonics::common::Matrix::save_double_matrix_to_file ( std::vector< std::vector< double >> &  matrix,
std::string  separator,
std::string  target_data_file 
)
std::vector< std::string > phoxonics::common::Matrix::split ( const std::string &  src,
const std::string &  delim 
)

Splits a string using defined delimiter

Parameters
srcsource string
delimthe delimiter to use
Returns
a vector with the strings splited

References phoxonics::common::CommonBase::log_, and phoxonics::common::Logger::log_trac().

Referenced by create_string_matrix_from_file(), and get_file_rows_cols().