trase
|
Raw data class, impliments a matrix with row major order. More...
#include <Data.hpp>
Public Member Functions | |
int | cols () const |
return the number of columns | |
int | rows () const |
return the number of rows | |
template<typename T > | |
void | add_column (T new_col_begin, T new_col_end) |
add a new column to the matrix using begin/end iterators. More... | |
template<typename T > | |
void | add_row (T new_row_begin, T new_row_end) |
add a new row to the matrix using begin/end iterators. More... | |
template<typename T > | |
void | add_column (const std::vector< T > &new_col) |
add a new column to the matrix. More... | |
template<typename T > | |
void | add_row (const std::vector< T > &new_row) |
add a new row to the matrix. More... | |
template<typename T > | |
void | set_column (int i, const std::vector< T > &new_col) |
set a column in the matrix. More... | |
ColumnIterator | begin (int i) const |
return a ColumnIterator to the beginning of column i | |
ColumnIterator | end (int i) const |
return a ColumnIterator to the end of column i | |
const std::set< std::string > & | string_data (int i) const |
return the set of strings for column i More... | |
template<typename T > | |
std::map< T, std::shared_ptr< RawData > > | facet (const std::vector< T > &data) const |
facets the data based on the input data column More... | |
template<typename T1 , typename T2 > | |
std::map< std::pair< T1, T2 >, std::shared_ptr< RawData > > | facet (const std::vector< T1 > &data1, const std::vector< T2 > &data2) const |
facets the data based on the dual input data columns More... | |
Raw data class, impliments a matrix with row major order.
void trase::RawData::add_column | ( | T | new_col_begin, |
T | new_col_end | ||
) |
add a new column to the matrix using begin/end iterators.
the data is copied into the new column
void trase::RawData::add_column | ( | const std::vector< T > & | new_col | ) |
add a new column to the matrix.
the data in new_col
is copied into the new column
void trase::RawData::add_row | ( | T | new_row_begin, |
T | new_row_end | ||
) |
add a new row to the matrix using begin/end iterators.
the data is copied into the new column
void trase::RawData::add_row | ( | const std::vector< T > & | new_row | ) |
add a new row to the matrix.
the data in new_row
is copied into the new row
std::map<T, std::shared_ptr<RawData> > trase::RawData::facet | ( | const std::vector< T > & | data | ) | const |
facets the data based on the input data column
The input data column (of the same number of rows as this dataset) contains N unique values. This function returns a map of each of these N values to a dataset containing all the rows that have this value
std::map<std::pair<T1, T2>, std::shared_ptr<RawData> > trase::RawData::facet | ( | const std::vector< T1 > & | data1, |
const std::vector< T2 > & | data2 | ||
) | const |
facets the data based on the dual input data columns
The input data columns (of the same number of rows as this dataset) contains NxM unique value pairs. This function returns a map of each of these NxM values to a dataset containing all the rows that have this value
void trase::RawData::set_column | ( | int | i, |
const std::vector< T > & | new_col | ||
) |
set a column in the matrix.
the data in new_col
is copied into column i
const std::set< std::string > & trase::RawData::string_data | ( | int | i | ) | const |
return the set of strings for column i
the returned set will be empty if column i contains numeric data