World Ocean Simulation System (WOSS) library
woss::TimeArr Class Reference

Channel power delay profile class. More...

#include <time-arrival-definitions.h>

Collaboration diagram for woss::TimeArr:
Collaboration graph

Public Member Functions

 TimeArr (long double custom_delay_prec=TIMEARR_CUSTOM_DELAY_PRECISION)
 
 TimeArr (TimeArrMap &map, long double custom_delay_prec=TIMEARR_CUSTOM_DELAY_PRECISION)
 
 TimeArr (const Pressure &pressure, double delay=TIMEARR_PRESSURE_CONVERSION_DELAY, long double custom_delay_prec=TIMEARR_CUSTOM_DELAY_PRECISION)
 
 TimeArr (const TimeArr &copy)
 
virtual operator std::complex< double > () const
 
virtual TimeArrcreate (long double custom_delay_prec=TIMEARR_CUSTOM_DELAY_PRECISION) const
 
virtual TimeArrcreate (TimeArrMap &map, long double custom_delay_prec=TIMEARR_CUSTOM_DELAY_PRECISION) const
 
virtual TimeArrcreate (const Pressure &pressure, double delay=TIMEARR_PRESSURE_CONVERSION_DELAY, long double custom_delay_prec=TIMEARR_CUSTOM_DELAY_PRECISION) const
 
virtual TimeArrcreate (const TimeArr &copy) const
 
virtual TimeArrclone () const
 
virtual TimeArrcreateArray (unsigned int array_size) const
 
TimeArrinsertValue (double delay, const Pressure &pressure)
 
void sumValue (double delay, const Pressure &pressure)
 
TimeArrCIt findValue (double delay) const
 
TimeArreraseValue (double delay)
 
virtual TimeArrcoherentSumSample (double time_delay)
 
virtual TimeArrincoherentSumSample (double time_delay)
 
virtual TimeArrcrop (double time_start, double time_end)
 
virtual bool checkPressureAttenuation (double distance, double frequency)
 
TimeArrCIt begin () const
 
TimeArrCIt end () const
 
TimeArrCRIt rbegin () const
 
TimeArrCRIt rend () const
 
TimeArrCIt at (const int i) const
 
TimeArrCIt lowerBoundTxLoss (double threshold_db) const
 
int size () const
 
bool empty () const
 
void clear ()
 
TimeArrsetDelayPrecision (long double precision)
 
double getMaxDelayValue () const
 
double getMinDelayValue () const
 
long double getDelayPrecision () const
 
virtual bool isValid () const
 
virtual bool isConvertedFromPressure () const
 
TimeArroperator= (const TimeArr &copy)
 

Static Public Member Functions

static TimeArrMapcreateNotValid ()
 
static TimeArrMapcreateImpulse ()
 
static void setDebug (bool flag)
 

Protected Attributes

long double delay_precision
 
TimeArrMap time_arr_map
 

Static Protected Attributes

static bool debug = false
 

Friends

bool operator== (const TimeArr &left, const TimeArr &right)
 
bool operator!= (const TimeArr &left, const TimeArr &right)
 
const TimeArr operator+ (const TimeArr &left, const TimeArr &right)
 
const TimeArr operator- (const TimeArr &left, const TimeArr &right)
 
const TimeArr operator+ (const TimeArr &left, const double right)
 
const TimeArr operator- (const TimeArr &left, const double right)
 
const TimeArr operator/ (const TimeArr &left, const double right)
 
const TimeArr operator* (const TimeArr &left, const double right)
 
const TimeArr operator+ (const double left, const TimeArr &right)
 
const TimeArr operator- (const double left, const TimeArr &right)
 
const TimeArr operator/ (const double left, const TimeArr &right)
 
const TimeArr operator* (const double left, const TimeArr &right)
 
TimeArroperator+= (TimeArr &left, const TimeArr &right)
 
TimeArroperator-= (TimeArr &left, const TimeArr &right)
 
TimeArroperator+= (TimeArr &left, double right)
 
TimeArroperator-= (TimeArr &left, double right)
 
TimeArroperator/= (TimeArr &left, double right)
 
TimeArroperator*= (TimeArr &left, double right)
 
std::ostream & operator<< (std::ostream &os, const TimeArr &instance)
 

Detailed Description

Channel power delay profile class.

TimeArr class offers the possibility to store and manipulate channel power delay profiles, e.g. a collection of time delay values associated to a Pressure attenuation value.

Constructor & Destructor Documentation

◆ TimeArr() [1/4]

TimeArr::TimeArr ( long double  custom_delay_prec = TIMEARR_CUSTOM_DELAY_PRECISION)

Default TimeArr constructor

Parameters
custom_delay_precdelay precision [s]

Referenced by clone(), and create().

◆ TimeArr() [2/4]

TimeArr::TimeArr ( TimeArrMap map,
long double  custom_delay_prec = TIMEARR_CUSTOM_DELAY_PRECISION 
)

TimeArr constructor

Parameters
mapcustom time arrival map
custom_delay_precdelay precision [s]

References time_arr_map.

◆ TimeArr() [3/4]

TimeArr::TimeArr ( const Pressure pressure,
double  delay = TIMEARR_PRESSURE_CONVERSION_DELAY,
long double  custom_delay_prec = TIMEARR_CUSTOM_DELAY_PRECISION 
)

TimeArr constructor. Needed for Pressure to TimeArr conversion

Parameters
pressurePressure value
delaydelay value [s]
custom_delay_precdelay precision [s]

References woss::Pressure::createNotValid(), woss::Pressure::isValid(), and time_arr_map.

Here is the call graph for this function:

◆ TimeArr() [4/4]

TimeArr::TimeArr ( const TimeArr copy)

TimeArr copy constructor

Parameters
copyTimeArr to be copied

References delay_precision, and time_arr_map.

Member Function Documentation

◆ at()

TimeArrCIt TimeArr::at ( const int  i) const

Returns a const iterator to the Pressure value at i-th position

Parameters
iinteger should be between 0 and size()
Returns
const iterator to end() if position i is not found

References time_arr_map.

◆ begin()

TimeArrCIt woss::TimeArr::begin ( ) const
inline

Returns a const iterator to the beginning of the time arrival map

Returns
const iterator

References time_arr_map.

Referenced by woss::Pressure::Pressure(), and woss::ResTimeArrBinDb::writeMap().

◆ checkPressureAttenuation()

bool TimeArr::checkPressureAttenuation ( double  distance,
double  frequency 
)
virtual

Check the Pressure value of each delay. If amplitude is >= 1, it replaces with a new Pressure with same phase and new amplitude given by the Thorp absorption process at given frequency and along given distance

Parameters
distancegiven distance [m]
frequencygiven frequency [hz]
Returns
true if correction was applied, false otherwise

References woss::Pressure::checkAttenuation(), and time_arr_map.

Here is the call graph for this function:

◆ clear()

◆ clone()

virtual TimeArr * woss::TimeArr::clone ( ) const
inlinevirtual

TimeArr virtual factory method

Returns
a heap-created copy of this instance

References TimeArr().

Referenced by woss::DefHandler::operator=().

Here is the call graph for this function:

◆ coherentSumSample()

TimeArr * TimeArr::coherentSumSample ( double  time_delay)
virtual

Sample the TimeArr with sample-time delay. Pressure of the new TimeArr are the coherent sum of previous object with equal sampled delay.

Parameters
delaydelay value [s]
Returns
a new TimeArr object

References create(), delay_precision, and time_arr_map.

Here is the call graph for this function:

◆ create() [1/4]

virtual TimeArr * woss::TimeArr::create ( const Pressure pressure,
double  delay = TIMEARR_PRESSURE_CONVERSION_DELAY,
long double  custom_delay_prec = TIMEARR_CUSTOM_DELAY_PRECISION 
) const
inlinevirtual

TimeArr virtual factory method

Parameters
pressurePressure value
delaydelay value [s]
custom_delay_precdelay precision [s]
Returns
a heap-created TimeArr object

References TimeArr().

Here is the call graph for this function:

◆ create() [2/4]

virtual TimeArr * woss::TimeArr::create ( const TimeArr copy) const
inlinevirtual

TimeArr virtual factory method

Parameters
copyTimeArr to be copied
Returns
a heap-created TimeArr object

References TimeArr().

Here is the call graph for this function:

◆ create() [3/4]

virtual TimeArr * woss::TimeArr::create ( long double  custom_delay_prec = TIMEARR_CUSTOM_DELAY_PRECISION) const
inlinevirtual

TimeArr virtual factory method

Parameters
custom_delay_precdelay precision [s]
Returns
a heap-created TimeArr object

References TimeArr().

Referenced by coherentSumSample(), crop(), woss::ResTimeArrTxtDb::getValue(), and incoherentSumSample().

Here is the call graph for this function:

◆ create() [4/4]

virtual TimeArr * woss::TimeArr::create ( TimeArrMap map,
long double  custom_delay_prec = TIMEARR_CUSTOM_DELAY_PRECISION 
) const
inlinevirtual

TimeArr virtual factory method

Parameters
mapcustom time arrival map
custom_delay_precdelay precision [s]
Returns
a heap-created TimeArr object

References TimeArr().

Here is the call graph for this function:

◆ createArray()

virtual TimeArr * woss::TimeArr::createArray ( unsigned int  array_size) const
inlinevirtual

TimeArr virtual factory method

Parameters
array_sizesize of array
Returns
a heap-created array of size array_size

◆ createImpulse()

TimeArrMap & woss::TimeArr::createImpulse ( )
inlinestatic

Creates an impulsive instance

Returns
a new impulsive instance ( e.g. delay 0.0 = (+1.0, 0.0 ) )

References time_arr_map.

Referenced by woss::WossManagerResDb::getWossTimeArr(), woss::WossManagerResDbMT::getWossTimeArr(), and woss::WossManager::getWossTimeArr().

◆ createNotValid()

TimeArrMap & woss::TimeArr::createNotValid ( )
inlinestatic

Creates an instance not valid

Returns
a new instance not valid ( e.g. delay 0.0 = (+inf, +inf) )

References woss::Pressure::createNotValid(), and time_arr_map.

Referenced by woss::WossManagerResDb::dbGetTimeArr(), woss::WossDbManager::getTimeArr(), woss::ResTimeArrTxtDb::getValue(), woss::WossManager::getWossTimeArr(), woss::ArrAscResReader::readTimeArr(), and woss::ArrBinResReader::readTimeArr().

Here is the call graph for this function:

◆ crop()

TimeArr * TimeArr::crop ( double  time_start,
double  time_end 
)
virtual

Crops the TimeArr between given time values and returns a new heap-allocated object. The new object will have time values in [time_start, time_end)

Parameters
time_startstart time value [s]
time_endend time value [s]
Returns
a new TimeArr object

References create(), delay_precision, and time_arr_map.

Here is the call graph for this function:

◆ empty()

bool woss::TimeArr::empty ( ) const
inline

Checks if the instance has stored values

Returns
true if condition applies, false otherwise

References time_arr_map.

◆ end()

TimeArrCIt woss::TimeArr::end ( ) const
inline

Returns a const iterator to the end of the time arrival map

Returns
const iterator

References time_arr_map.

Referenced by woss::Pressure::Pressure(), and woss::ResTimeArrBinDb::writeMap().

◆ eraseValue()

TimeArr & woss::TimeArr::eraseValue ( double  delay)
inline

Erase the Pressure value with key == delay parameter

Parameters
delaydelay value [s]
Returns
reference to *this

References time_arr_map.

◆ findValue()

TimeArrCIt woss::TimeArr::findValue ( double  delay) const
inline

Returns a const iterator to the Pressure with key == delay parameter

Parameters
delaydelay value [s]
Returns
const iterator to end() if delay is not found

References time_arr_map.

◆ getDelayPrecision()

long double woss::TimeArr::getDelayPrecision ( ) const
inline

Returns the delay precision

Returns
delay precision [s]

References delay_precision.

◆ getMaxDelayValue()

double woss::TimeArr::getMaxDelayValue ( ) const
inline

Returns the maximum delay value

Returns
maximum delay [s]

References time_arr_map.

◆ getMinDelayValue()

double woss::TimeArr::getMinDelayValue ( ) const
inline

Returns the maximum delay value

Returns
maximum delay [s]

References time_arr_map.

◆ incoherentSumSample()

TimeArr * TimeArr::incoherentSumSample ( double  time_delay)
virtual

Sample the TimeArr with sample-time delay. Pressure of the new TimeArr are the incoherent sum of previous object with equal sampled delay.

Parameters
delaydelay value [s]
Returns
a new TimeArr object

References create(), delay_precision, and time_arr_map.

Here is the call graph for this function:

◆ insertValue()

TimeArr & woss::TimeArr::insertValue ( double  delay,
const Pressure pressure 
)
inline

Inserts and replace a Pressure value at given delay

Parameters
delaydelay value [s]
pressurePressure value
Returns
reference to *this

References woss::Pressure::isValid(), and time_arr_map.

Referenced by woss::ResTimeArrBinDb::importMap().

Here is the call graph for this function:

◆ isConvertedFromPressure()

virtual bool woss::TimeArr::isConvertedFromPressure ( ) const
inlinevirtual

Checks if the TimeArr was constructed from a Pressure value, therefore not carrying a valid delay information

Returns
true if it has at least one value, false otherwise

References time_arr_map.

◆ isValid()

bool TimeArr::isValid ( ) const
virtual

Checks the validity of TimeArr

Returns
true if it has at least one value, false otherwise

References woss::Pressure::createNotValid(), and time_arr_map.

Referenced by woss::WossManagerResDb::getWossPressure(), woss::WossManagerResDbMT::getWossPressure(), woss::WossManagerResDb::getWossTimeArr(), woss::WossManagerResDbMT::getWossTimeArr(), and woss::Pressure::Pressure().

Here is the call graph for this function:

◆ lowerBoundTxLoss()

TimeArrCIt TimeArr::lowerBoundTxLoss ( double  threshold_db) const

Returns a const iterator to the Pressure that has txLoss >= threshold_db

Parameters
ithreshold in db re upa
Returns
const iterator to end() if position i is not found

References woss::Pressure::getTxLossDb(), and time_arr_map.

Here is the call graph for this function:

◆ operator std::complex< double >()

TimeArr::operator std::complex< double > ( ) const
virtual

complex<double> operator for implicit casting

Returns
the coherent sum

◆ operator=()

TimeArr & TimeArr::operator= ( const TimeArr copy)

Assignment operator

Parameters
copyconst reference to a TimeArr object to be copied
Returns
TimeArr reference to this

References delay_precision, and time_arr_map.

◆ rbegin()

TimeArrCRIt woss::TimeArr::rbegin ( ) const
inline

Returns a const reverse iterator to the reverse beginning of the time arrival map

Returns
const iterator

References time_arr_map.

◆ rend()

TimeArrCRIt woss::TimeArr::rend ( ) const
inline

Returns a const reverse iterator to the reverse end of the time arrival map

Returns
const iterator

References time_arr_map.

◆ setDebug()

static void woss::TimeArr::setDebug ( bool  flag)
inlinestatic

Sets debug flag for all instances

Parameters
flagdebug bool

References debug.

◆ setDelayPrecision()

woss::TimeArr & TimeArr::setDelayPrecision ( long double  precision)

Sets the delay precision for all PDouble delay values. If the given precision is different from current value, the profile will be modified accordingly

Parameters
precisiondelay precision [m]
Returns
reference to *this

References time_arr_map.

◆ size()

int woss::TimeArr::size ( ) const
inline

Returns the number of Pressure stored

Returns
number of Pressure values stored

References time_arr_map.

Referenced by woss::ResTimeArrBinDb::writeMap().

◆ sumValue()

void woss::TimeArr::sumValue ( double  delay,
const Pressure pressure 
)
inline

Inserts and (complex) sums a Pressure value at given delay

Parameters
delaydelay value [s]
pressurePressure value

References woss::Pressure::isValid(), and time_arr_map.

Referenced by woss::ArrBinResReader::getArrBinFile().

Here is the call graph for this function:

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( const TimeArr left,
const TimeArr right 
)
friend

Inequality operator

Parameters
leftleft operand const reference
rightright operand const reference
Returns
true if left != right, false otherwise

◆ operator* [1/2]

const TimeArr operator* ( const double  left,
const TimeArr right 
)
friend

Multiplication operator

Parameters
leftleft operand const reference
rightright operand const reference
Returns
a new const instance holding the operation result

◆ operator* [2/2]

const TimeArr operator* ( const TimeArr left,
const double  right 
)
friend

Multiplication operator

Parameters
leftleft operand const reference
rightright operand const reference
Returns
a new const instance holding the operation result

◆ operator*=

TimeArr & operator*= ( TimeArr left,
double  right 
)
friend

Compound assignment multiplication operator

Parameters
leftleft operand reference
rightright operand const reference
Returns
left reference after the operation

◆ operator+ [1/3]

const TimeArr operator+ ( const double  left,
const TimeArr right 
)
friend

Sum operator

Parameters
leftleft operand const reference
rightright operand const reference
Returns
a new const instance holding the operation result

◆ operator+ [2/3]

const TimeArr operator+ ( const TimeArr left,
const double  right 
)
friend

Sum operator

Parameters
leftleft operand const reference
rightright operand const reference
Returns
a new const instance holding the operation result

◆ operator+ [3/3]

const TimeArr operator+ ( const TimeArr left,
const TimeArr right 
)
friend

Sum operator

Parameters
leftleft operand const reference
rightright operand const reference
Returns
a new const instance holding the operation result

◆ operator+= [1/2]

TimeArr & operator+= ( TimeArr left,
const TimeArr right 
)
friend

Compound assignment sum operator

Parameters
leftleft operand reference
rightright operand const reference
Returns
left reference after the operation

◆ operator+= [2/2]

TimeArr & operator+= ( TimeArr left,
double  right 
)
friend

Compound assignment sum operator

Parameters
leftleft operand reference
rightright operand const reference
Returns
left reference after the operation

◆ operator- [1/3]

const TimeArr operator- ( const double  left,
const TimeArr right 
)
friend

Subtraction operator

Parameters
leftleft operand const reference
rightright operand const reference
Returns
a new const instance holding the operation result

◆ operator- [2/3]

const TimeArr operator- ( const TimeArr left,
const double  right 
)
friend

Subtraction operator

Parameters
leftleft operand const reference
rightright operand const reference
Returns
a new const instance holding the operation result

◆ operator- [3/3]

const TimeArr operator- ( const TimeArr left,
const TimeArr right 
)
friend

Subtraction operator

Parameters
leftleft operand const reference
rightright operand const reference
Returns
a new const instance holding the operation result

◆ operator-= [1/2]

TimeArr & operator-= ( TimeArr left,
const TimeArr right 
)
friend

Compound assignment subtraction operator

Parameters
leftleft operand reference
rightright operand const reference
Returns
left reference after the operation

◆ operator-= [2/2]

TimeArr & operator-= ( TimeArr left,
double  right 
)
friend

Compound assignment subtraction operator

Parameters
leftleft operand reference
rightright operand const reference
Returns
left reference after the operation

◆ operator/ [1/2]

const TimeArr operator/ ( const double  left,
const TimeArr right 
)
friend

Division operator

Parameters
leftleft operand const reference
rightright operand const reference
Returns
a new const instance holding the operation result

◆ operator/ [2/2]

const TimeArr operator/ ( const TimeArr left,
const double  right 
)
friend

Division operator

Parameters
leftleft operand const reference
rightright operand const reference
Returns
a new const instance holding the operation result

◆ operator/=

TimeArr & operator/= ( TimeArr left,
double  right 
)
friend

Compound assignment division operator

Parameters
leftleft operand reference
rightright operand const reference
Returns
left reference after the operation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const TimeArr instance 
)
friend

<< operator

Parameters
osleft operand ostream reference
instanceright operand const Pressure reference
Returns
os reference after the operation

◆ operator==

bool operator== ( const TimeArr left,
const TimeArr right 
)
friend

Equality operator

Parameters
leftleft operand const reference
rightright operand const reference
Returns
true if left == right, false otherwise

Member Data Documentation

◆ debug

bool TimeArr::debug = false
staticprotected

Debug flag

Referenced by setDebug().

◆ delay_precision

long double woss::TimeArr::delay_precision
protected

Stores the precision of all PDouble delay instances [s]

Referenced by coherentSumSample(), crop(), getDelayPrecision(), incoherentSumSample(), operator=(), and TimeArr().

◆ time_arr_map


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