|
StochTree 0.5.0.9000
|
Internal wrapper around Eigen::MatrixXd interface for multidimensional floating point data.
More...
#include <data.h>
Public Member Functions | |
| ColumnMatrix (double *data_ptr, data_size_t num_row, int num_col, bool is_row_major) | |
Construct a new ColumnMatrix object from in-memory data buffer. | |
| ColumnMatrix (std::string filename, std::string column_index_string, bool header=true, bool precise_float_parser=false) | |
| Construct a new ColumnMatrix object from CSV file. | |
| double | GetElement (data_size_t row_num, int col_num) |
Returns the value stored at (row, col) in the object's internal Eigen::MatrixXd. | |
| void | SetElement (data_size_t row_num, int col_num, double value) |
Update an observation in the object's internal Eigen::MatrixXd to a new value. | |
| void | LoadData (double *data_ptr, data_size_t num_row, int num_col, bool is_row_major) |
Update the data in a ColumnMatrix object from an in-memory data buffer. This will erase the existing matrix. | |
| data_size_t | NumRows () |
Number of rows in the object's internal Eigen::MatrixXd. | |
| int | NumCols () |
Number of columns in the object's internal Eigen::MatrixXd. | |
| Eigen::MatrixXd & | GetData () |
Return a reference to the object's internal Eigen::MatrixXd, for interfaces that require a raw matrix. | |
Internal wrapper around Eigen::MatrixXd interface for multidimensional floating point data.
| StochTree::ColumnMatrix::ColumnMatrix | ( | double * | data_ptr, |
| data_size_t | num_row, | ||
| int | num_col, | ||
| bool | is_row_major | ||
| ) |
Construct a new ColumnMatrix object from in-memory data buffer.
| data_ptr | Pointer to first element of a contiguous array of data storing a matrix. |
| num_row | Number of rows in the matrix. |
| num_col | Number of columns / covariates in the matrix. |
| is_row_major | Whether or not the data in data_ptr are organized in a row-major or column-major fashion. |
| StochTree::ColumnMatrix::ColumnMatrix | ( | std::string | filename, |
| std::string | column_index_string, | ||
| bool | header = true, |
||
| bool | precise_float_parser = false |
||
| ) |
Construct a new ColumnMatrix object from CSV file.
| filename | Name of the file (including any necessary path prefixes). |
| column_index_string | Comma-delimited string listing columns to extract into covariates matrix. |
| header | Whether or not the file contains a header of column names / non-data. |
| precise_float_parser | Whether floating point numbers in the CSV should be parsed precisely. |
|
inline |
Returns the value stored at (row, col) in the object's internal Eigen::MatrixXd.
| row | Row number to query in the matrix |
| col | Column number to query in the matrix |
|
inline |
Update an observation in the object's internal Eigen::MatrixXd to a new value.
| row | Row number to be overwritten. |
| col | Column number to be overwritten. |
| value | New value to write in (row, col) in the object's internal Eigen::MatrixXd. |
| void StochTree::ColumnMatrix::LoadData | ( | double * | data_ptr, |
| data_size_t | num_row, | ||
| int | num_col, | ||
| bool | is_row_major | ||
| ) |
Update the data in a ColumnMatrix object from an in-memory data buffer. This will erase the existing matrix.
| data_ptr | Pointer to first element of a contiguous array of data storing a matrix. |
| num_row | Number of rows in the matrix. |
| num_col | Number of columns / covariates in the matrix. |
| is_row_major | Whether or not the data in data_ptr are organized in a row-major or column-major fashion. |