BioDynaMo  v1.05.120-25dc9790
Public Member Functions | Private Member Functions | Private Attributes | List of all members
bdm::experimental::LinearTransformer Class Reference

#include <time_series.h>

Inheritance diagram for bdm::experimental::LinearTransformer:
[legend]
Collaboration diagram for bdm::experimental::LinearTransformer:
[legend]

Public Member Functions

void TransformXValues (const std::vector< real_t > &old_x_values, std::vector< real_t > &new_x_values) const final
 Transforms the x-values according to the linear transformation. More...
 
void TransformYValues (const std::vector< real_t > &old_y_values, std::vector< real_t > &new_y_values) const final
 Transforms the y-values according to the linear transformation. More...
 
void TransformYErrorLow (const std::vector< real_t > &old_y_error_low, std::vector< real_t > &new_y_error_low) const final
 Transforms the y-error-low according to the linear transformation. More...
 
void TransformYErrorHigh (const std::vector< real_t > &old_y_error_high, std::vector< real_t > &new_y_error_high) const final
 Transforms the y-error-high according to the linear transformation. More...
 
void SetXSlope (real_t slope)
 
void SetXIntercept (real_t intercept)
 
void SetYSlope (real_t slope)
 
void SetYIntercept (real_t intercept)
 
void SetYErrorLowSlope (real_t slope)
 
void SetYErrorLowIntercept (real_t intercept)
 
void SetYErrorHighSlope (real_t slope)
 
void SetYErrorHighIntercept (real_t intercept)
 
- Public Member Functions inherited from bdm::experimental::DataTransformer
virtual ~DataTransformer ()=default
 
 BDM_CLASS_DEF (DataTransformer, 1)
 

Private Member Functions

 BDM_CLASS_DEF_OVERRIDE (LinearTransformer, 1)
 

Private Attributes

real_t x_slope_ = 1.0
 
real_t x_intercept_ = 0.0
 
real_t y_slope_ = 1.0
 
real_t y_intercept_ = 0.0
 
real_t y_error_low_slope_ = 1.0
 
real_t y_error_low_intercept_ = 0.0
 
real_t y_error_high_slope_ = 1.0
 
real_t y_error_high_intercept_ = 0.0
 

Detailed Description

This class implements a linear transformation of the data of a time series. It is used to transform the data of a time series entry. The transformation is applied to the x-vales, y-values, y-error-low, and y-error-high. Each transformation is linear and has its own slope and intercept.

LinearTransformer transformer;
transformer.SetXSlope(2.0);
transformer.SetXIntercept(1.0);
ts.AddTransformedData("my-entry", "my-entry-transformed", transformer);

This adds a new entry to the time series with the name "my-entry-transformed" whose data has been transformed according to the member functions.

Definition at line 70 of file time_series.h.

Member Function Documentation

◆ BDM_CLASS_DEF_OVERRIDE()

bdm::experimental::LinearTransformer::BDM_CLASS_DEF_OVERRIDE ( LinearTransformer  ,
 
)
private

◆ SetXIntercept()

void bdm::experimental::LinearTransformer::SetXIntercept ( real_t  intercept)

Definition at line 72 of file time_series.cc.

◆ SetXSlope()

void bdm::experimental::LinearTransformer::SetXSlope ( real_t  slope)

Definition at line 71 of file time_series.cc.

◆ SetYErrorHighIntercept()

void bdm::experimental::LinearTransformer::SetYErrorHighIntercept ( real_t  intercept)

Definition at line 88 of file time_series.cc.

◆ SetYErrorHighSlope()

void bdm::experimental::LinearTransformer::SetYErrorHighSlope ( real_t  slope)

Definition at line 85 of file time_series.cc.

◆ SetYErrorLowIntercept()

void bdm::experimental::LinearTransformer::SetYErrorLowIntercept ( real_t  intercept)

Definition at line 82 of file time_series.cc.

◆ SetYErrorLowSlope()

void bdm::experimental::LinearTransformer::SetYErrorLowSlope ( real_t  slope)

Definition at line 79 of file time_series.cc.

◆ SetYIntercept()

void bdm::experimental::LinearTransformer::SetYIntercept ( real_t  intercept)

Definition at line 76 of file time_series.cc.

◆ SetYSlope()

void bdm::experimental::LinearTransformer::SetYSlope ( real_t  slope)

Definition at line 75 of file time_series.cc.

◆ TransformXValues()

void bdm::experimental::LinearTransformer::TransformXValues ( const std::vector< real_t > &  old_x_values,
std::vector< real_t > &  new_x_values 
) const
finalvirtual

Transforms the x-values according to the linear transformation.

Parameters
old_x_valuesx-values of the time series entry
new_x_valuesx_slope_ * old_x_values + x_intercept_

Implements bdm::experimental::DataTransformer.

Definition at line 28 of file time_series.cc.

◆ TransformYErrorHigh()

void bdm::experimental::LinearTransformer::TransformYErrorHigh ( const std::vector< real_t > &  old_y_error_high,
std::vector< real_t > &  new_y_error_high 
) const
finalvirtual

Transforms the y-error-high according to the linear transformation.

Parameters
old_y_error_highy-error-high of the time series entry
new_y_error_highy_error_high_slope_ * old_y_error_high + y_error_high_intercept_

Implements bdm::experimental::DataTransformer.

Definition at line 59 of file time_series.cc.

◆ TransformYErrorLow()

void bdm::experimental::LinearTransformer::TransformYErrorLow ( const std::vector< real_t > &  old_y_error_low,
std::vector< real_t > &  new_y_error_low 
) const
finalvirtual

Transforms the y-error-low according to the linear transformation.

Parameters
old_y_error_lowy-error-low of the time series entry
new_y_error_lowy_error_low_slope_ * old_y_error_low + y_error_low_intercept_

Implements bdm::experimental::DataTransformer.

Definition at line 48 of file time_series.cc.

◆ TransformYValues()

void bdm::experimental::LinearTransformer::TransformYValues ( const std::vector< real_t > &  old_y_values,
std::vector< real_t > &  new_y_values 
) const
finalvirtual

Transforms the y-values according to the linear transformation.

Parameters
old_y_valuesy-values of the time series entry
new_y_valuesy_slope_ * old_y_values + y_intercept_

Implements bdm::experimental::DataTransformer.

Definition at line 38 of file time_series.cc.

Member Data Documentation

◆ x_intercept_

real_t bdm::experimental::LinearTransformer::x_intercept_ = 0.0
private

Definition at line 109 of file time_series.h.

◆ x_slope_

real_t bdm::experimental::LinearTransformer::x_slope_ = 1.0
private

Definition at line 108 of file time_series.h.

◆ y_error_high_intercept_

real_t bdm::experimental::LinearTransformer::y_error_high_intercept_ = 0.0
private

Definition at line 115 of file time_series.h.

◆ y_error_high_slope_

real_t bdm::experimental::LinearTransformer::y_error_high_slope_ = 1.0
private

Definition at line 114 of file time_series.h.

◆ y_error_low_intercept_

real_t bdm::experimental::LinearTransformer::y_error_low_intercept_ = 0.0
private

Definition at line 113 of file time_series.h.

◆ y_error_low_slope_

real_t bdm::experimental::LinearTransformer::y_error_low_slope_ = 1.0
private

Definition at line 112 of file time_series.h.

◆ y_intercept_

real_t bdm::experimental::LinearTransformer::y_intercept_ = 0.0
private

Definition at line 111 of file time_series.h.

◆ y_slope_

real_t bdm::experimental::LinearTransformer::y_slope_ = 1.0
private

Definition at line 110 of file time_series.h.


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