TransFlow  0.1.0
A transient pipeline flow simulation library
TimeSeries::Series Class Reference

#include <timeseries.hpp>

Public Member Functions

 Series (const bool active=false)
 Default construct. Not active by default. More...
 
 Series (const arma::vec &value)
 Construct from arma::vec. Active by default. Allows implicit conversion from arma::vec to Series. More...
 
 Series (const arma::vec &value, const bool active)
 Construct from arma::vec and bool active. More...
 
void set (const arma::vec &value)
 Set new value. Makes it an active boundary condition.
 
void set (const arma::vec &value, const bool active)
 Set new value and active status.
 
void fill (const double value)
 Armadillo-like fill. Fills member vector with value, and sets it active.
 
void setActive (const bool active)
 Set the active/inactive property.
 
Seriesoperator= (const arma::vec &value)
 Copy assignment operator from arma::vec. Sets it active. More...
 
double operator() (const arma::uword i) const
 Get element by index.
 
arma::uword size () const
 Get the size of the member arma::vec.
 
bool isActive () const
 If the Series is an active boundary condition.
 
bool isActive ()
 If the Series is an active boundary condition.
 
const arma::vec & vec () const
 Get (const ref) member arma::vec m_vec.
 

Private Member Functions

arma::vec & vec ()
 Get (non-const ref) member arma::vec m_vec (private)
 

Private Attributes

bool m_isActive = false
 If the Series is an active boundary condition.
 
arma::vec m_vec
 The value of the Series.
 

Friends

class TimeSeries
 

Detailed Description

Contains a single property, and information regarding whether it is an active boundary condition or not

Constructor & Destructor Documentation

◆ Series() [1/3]

TimeSeries::Series::Series ( const bool  active = false)
inline

Default construct. Not active by default.

Parameters
activeIf it is an active boundary condition

◆ Series() [2/3]

TimeSeries::Series::Series ( const arma::vec &  value)
inline

Construct from arma::vec. Active by default. Allows implicit conversion from arma::vec to Series.

Parameters
valueValue

◆ Series() [3/3]

TimeSeries::Series::Series ( const arma::vec &  value,
const bool  active 
)
inline

Construct from arma::vec and bool active.

Parameters
valueValue
activeIf it is an active boundary condition

Member Function Documentation

◆ operator=()

Series& TimeSeries::Series::operator= ( const arma::vec &  value)
inline

Copy assignment operator from arma::vec. Sets it active.

Allows for example

Series s;
s = arma::zeros<vec>(10) + 100;
Parameters
valueNew value
Returns
Series instance

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