Falcon
Loading...
Searching...
No Matches

Public Types

using BaseClass = IData<Data<T>, ParentType>
Public Types inherited from IData< Data< T >, ParentType >
using Base

Public Member Functions

 Data (const std::vector< std::string > &labels, size_t nsamples)
 Data constructor with the labels for each column and the number of samples.
 Data (const Parameters &parameters)
 Data constructor from the parameters object.
void ClearData () override
 ClearData - clear the data.
Parameters parameters () const
size_t ncolumns () const
size_t nsamples () const
std::vector< std::string > labels () const
void set_data_column (std::string column, const std::vector< T > &data)
 set_data_column set all samples for one column based on the name of the column
void set_data_column (size_t column, const std::vector< T > &data)
 set_data_column set all samples for one column based on the column index
void set_data_sample (size_t sample, const std::vector< T > &data)
 set_data_sample set column data for one sample
void set_data_sample (size_t sample, size_t column, T data)
 set_data_sample set one data for one column index and one sample index
void set_data_sample (size_t sample, std::string column, T data)
 set_data_sample set one data for one column label and one sample index
std::vector< T > & data ()
 data - return full data with this format [c1s1, c1s2.., c1sn, c2s1, c2s2 ..., cns1,...cnsn]
const std::vector< T > & data () const
const T & data_sample (size_t sample, size_t column=0) const
 data_sample - return the data for one sample index and one column index
const T & data_sample (size_t sample, std::string column) const
 data_sample - return the data for one sample index and one column label
T & operator() (size_t sample, size_t column=0)
const T & operator() (size_t sample, size_t column=0) const
T & operator() (size_t sample, std::string column)
const T & operator() (size_t sample, std::string column) const
T & operator() (size_t index)
const T & operator() (size_t index) const
T * begin_sample (size_t sample)
 begin_sample iterator at the start of a sample index
T * end_sample (size_t sample)
 end_sample iterator at the end of a sample index
const T * begin_sample (size_t sample) const
const T * end_sample (size_t sample) const
stride_iter< T * > begin_column (size_t column)
 begin_column iterator at the start of the column based on the location in the dataset
stride_iter< T * > end_column (size_t column)
 end_column - iterator at the end of the column based on the location in the dataset
stride_iter< T * > begin_column (std::string column)
 begin_column - iterator at the start of the column based on name of the column
stride_iter< T * > end_column (std::string column)
 end_column - iterator at the end of the column based on name of the column
void SerializeBinary (std::ostream &stream, Serialization::Format format=Serialization::Format::FULL) const override
 SerializeBinary - add to the binary stream the data [columnxsample].
void SerializeFlatBuffer (flexbuffers::Builder &flex_builder) override
 SerializeFlatBuffer - add to the flexbuffer the data labeled [label0:nsamples, label1:nsamples...], the number of columns and the number of samples.
void SerializeYAML (YAML::Node &node, Serialization::Format format=Serialization::Format::FULL) const override
 SerializeYAML - add to the yaml node the data [columnxsample].
void YAMLDescription (YAML::Node &node, Serialization::Format format=Serialization::Format::FULL) const override
 YAMLDescription - this datatype add to the metadata describing the data format the signal, number of columns and samples format.
T sum_column (std::string column, bool absolute=false) const
 sum_column - compute the (absolute) sum of all samples in the same column
T sum_column (size_t column, bool absolute=false) const
 sum_column - compute the (absolute) sum of all samples in the same column
T mean_column (std::string column, bool absolute=false) const
 mean_column - compute the mean of the (absolute) sum of all samples in the same column
T mean_column (size_t column, bool absolute=false) const
 mean_column - compute the mean of the (absolute) sum of all samples in the same column
T sum_sample (size_t sample, bool absolute=false) const
 sum_sample - compute the (absolute) sum of all column data for the same sample index
T mean_sample (size_t sample, bool absolute=false) const
 mean_sample - compute the mean of the (absolute) sum of all column data for the same sample index
Public Member Functions inherited from IData< Data< T >, ParentType >
virtual std::string datatype () const
virtual std::string dataname () const

Static Public Member Functions

static const std::string static_datatype ()
static const std::string static_dataname ()

Protected Member Functions

size_t flat_index (size_t sample, size_t channel) const
size_t flat_index (size_t sample) const

Protected Attributes

size_t ncolumns_
size_t nsamples_
std::vector< std::string > labels_
std::vector< T > data_

Constructor & Destructor Documentation

◆ Data() [1/2]

template<typename T>
nsColumn::Data< T >::Data ( const std::vector< std::string > & labels,
size_t nsamples )
inline

Data constructor with the labels for each column and the number of samples.

Parameters
labelsgive a label for each column
nsamplesgive the number of samples

◆ Data() [2/2]

template<typename T>
nsColumn::Data< T >::Data ( const Parameters & parameters)
inline

Data constructor from the parameters object.

Parameters
parameters

Member Function Documentation

◆ begin_column() [1/2]

template<typename T>
stride_iter< T * > nsColumn::Data< T >::begin_column ( size_t column)
inline

begin_column iterator at the start of the column based on the location in the dataset

Parameters
column- column index
Returns

◆ begin_column() [2/2]

template<typename T>
stride_iter< T * > nsColumn::Data< T >::begin_column ( std::string column)
inline

begin_column - iterator at the start of the column based on name of the column

Parameters
column- column label
Returns

◆ begin_sample()

template<typename T>
T * nsColumn::Data< T >::begin_sample ( size_t sample)
inline

begin_sample iterator at the start of a sample index

Parameters
sample
Returns

◆ data()

template<typename T>
std::vector< T > & nsColumn::Data< T >::data ( )
inline

data - return full data with this format [c1s1, c1s2.., c1sn, c2s1, c2s2 ..., cns1,...cnsn]

Returns

◆ data_sample() [1/2]

template<typename T>
const T & nsColumn::Data< T >::data_sample ( size_t sample,
size_t column = 0 ) const
inline

data_sample - return the data for one sample index and one column index

Parameters
sample- selected sample index
column- selected column index
Returns

◆ data_sample() [2/2]

template<typename T>
const T & nsColumn::Data< T >::data_sample ( size_t sample,
std::string column ) const
inline

data_sample - return the data for one sample index and one column label

Parameters
sample- selected sample index
column- selected column label
Returns

◆ end_column() [1/2]

template<typename T>
stride_iter< T * > nsColumn::Data< T >::end_column ( size_t column)
inline

end_column - iterator at the end of the column based on the location in the dataset

Parameters
column- column index
Returns

◆ end_column() [2/2]

template<typename T>
stride_iter< T * > nsColumn::Data< T >::end_column ( std::string column)
inline

end_column - iterator at the end of the column based on name of the column

Parameters
column- column label
Returns

◆ end_sample()

template<typename T>
T * nsColumn::Data< T >::end_sample ( size_t sample)
inline

end_sample iterator at the end of a sample index

Parameters
sample
Returns

◆ mean_column() [1/2]

template<typename T>
T nsColumn::Data< T >::mean_column ( size_t column,
bool absolute = false ) const
inline

mean_column - compute the mean of the (absolute) sum of all samples in the same column

Parameters
column- column index
absolute- absolute sum or not
Returns
mean of the (absolute) sum

◆ mean_column() [2/2]

template<typename T>
T nsColumn::Data< T >::mean_column ( std::string column,
bool absolute = false ) const
inline

mean_column - compute the mean of the (absolute) sum of all samples in the same column

Parameters
column- column label
absolute- absolute sum or not
Returns
mean of the (absolute) sum

◆ mean_sample()

template<typename T>
T nsColumn::Data< T >::mean_sample ( size_t sample,
bool absolute = false ) const
inline

mean_sample - compute the mean of the (absolute) sum of all column data for the same sample index

Parameters
sample- sample index
absolute- absolute sum or not
Returns
the mean of the (absolute) sum

◆ SerializeBinary()

template<typename T>
void nsColumn::Data< T >::SerializeBinary ( std::ostream & stream,
Serialization::Format format = Serialization::Format::FULL ) const
inlineoverride

SerializeBinary - add to the binary stream the data [columnxsample].

Parameters
stream
format

◆ SerializeFlatBuffer()

template<typename T>
void nsColumn::Data< T >::SerializeFlatBuffer ( flexbuffers::Builder & flex_builder)
inlineoverride

SerializeFlatBuffer - add to the flexbuffer the data labeled [label0:nsamples, label1:nsamples...], the number of columns and the number of samples.

Parameters
flex_builder

◆ SerializeYAML()

template<typename T>
void nsColumn::Data< T >::SerializeYAML ( YAML::Node & node,
Serialization::Format format = Serialization::Format::FULL ) const
inlineoverride

SerializeYAML - add to the yaml node the data [columnxsample].

Parameters
node
format

◆ set_data_column() [1/2]

template<typename T>
void nsColumn::Data< T >::set_data_column ( size_t column,
const std::vector< T > & data )
inline

set_data_column set all samples for one column based on the column index

Parameters
column- selected column index
data- vector containing data for all samples

◆ set_data_column() [2/2]

template<typename T>
void nsColumn::Data< T >::set_data_column ( std::string column,
const std::vector< T > & data )
inline

set_data_column set all samples for one column based on the name of the column

Parameters
column- selected column name
data- vector containing data for all samples

◆ set_data_sample() [1/3]

template<typename T>
void nsColumn::Data< T >::set_data_sample ( size_t sample,
const std::vector< T > & data )
inline

set_data_sample set column data for one sample

Parameters
sample- selected sample index
data- vector containing data for all columns

◆ set_data_sample() [2/3]

template<typename T>
void nsColumn::Data< T >::set_data_sample ( size_t sample,
size_t column,
T data )
inline

set_data_sample set one data for one column index and one sample index

Parameters
sample- selected sample index
column- selected column index
data

◆ set_data_sample() [3/3]

template<typename T>
void nsColumn::Data< T >::set_data_sample ( size_t sample,
std::string column,
T data )
inline

set_data_sample set one data for one column label and one sample index

Parameters
sample- selected sample index
column- selected column label
data

◆ sum_column() [1/2]

template<typename T>
T nsColumn::Data< T >::sum_column ( size_t column,
bool absolute = false ) const
inline

sum_column - compute the (absolute) sum of all samples in the same column

Parameters
column- column index
absolute- absolute sum or not
Returns
(absolute) sum

◆ sum_column() [2/2]

template<typename T>
T nsColumn::Data< T >::sum_column ( std::string column,
bool absolute = false ) const
inline

sum_column - compute the (absolute) sum of all samples in the same column

Parameters
column- column label
absolute- absolute sum or not
Returns
(absolute) sum

◆ sum_sample()

template<typename T>
T nsColumn::Data< T >::sum_sample ( size_t sample,
bool absolute = false ) const
inline

sum_sample - compute the (absolute) sum of all column data for the same sample index

Parameters
sample- sample index
absolute- absolute sum or not
Returns
(absolute) sum

◆ YAMLDescription()

template<typename T>
void nsColumn::Data< T >::YAMLDescription ( YAML::Node & node,
Serialization::Format format = Serialization::Format::FULL ) const
inlineoverride

YAMLDescription - this datatype add to the metadata describing the data format the signal, number of columns and samples format.

Parameters
format

The documentation for this class was generated from the following file: