Internal wrapper around Eigen::MatrixXd interface for multidimensional floating point data.
More...
#include <data.h>
|
| | 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, int32_t col_num) |
| | Returns the value stored at (row, col) in the object's internal Eigen::MatrixXd.
|
| |
| void | SetElement (data_size_t row_num, int32_t 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.
◆ ColumnMatrix() [1/2]
| 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.
- Parameters
-
| 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. |
◆ ColumnMatrix() [2/2]
| 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.
- Parameters
-
| 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. |
◆ GetElement()
| double StochTree::ColumnMatrix::GetElement |
( |
data_size_t |
row_num, |
|
|
int32_t |
col_num |
|
) |
| |
|
inline |
Returns the value stored at (row, col) in the object's internal Eigen::MatrixXd.
- Parameters
-
| row | Row number to query in the matrix |
| col | Column number to query in the matrix |
◆ SetElement()
| void StochTree::ColumnMatrix::SetElement |
( |
data_size_t |
row_num, |
|
|
int32_t |
col_num, |
|
|
double |
value |
|
) |
| |
|
inline |
Update an observation in the object's internal Eigen::MatrixXd to a new value.
- Parameters
-
| 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. |
◆ LoadData()
| 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.
- Parameters
-
| 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. |
The documentation for this class was generated from the following file: