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)=default
 TimeArr (TimeArr &&tmp)=default
virtual ~TimeArr ()=default
virtual operator std::complex< double > () const
virtual std::unique_ptr< TimeArrcreate (long double custom_delay_prec=TIMEARR_CUSTOM_DELAY_PRECISION) const
virtual std::unique_ptr< TimeArrcreate (TimeArrMap &map, long double custom_delay_prec=TIMEARR_CUSTOM_DELAY_PRECISION) const
virtual std::unique_ptr< TimeArrcreate (const Pressure &pressure, double delay=TIMEARR_PRESSURE_CONVERSION_DELAY, long double custom_delay_prec=TIMEARR_CUSTOM_DELAY_PRECISION) const
virtual std::unique_ptr< TimeArrclone () const
virtual std::unique_ptr< TimeArr[]> createArray (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 std::unique_ptr< TimeArrcoherentSumSample (double time_delay) const
virtual std::unique_ptr< TimeArrincoherentSumSample (double time_delay) const
virtual std::unique_ptr< TimeArrcrop (double time_start, double time_end) const
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)=default
TimeArroperator= (TimeArr &&tmp)=default

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/5]

TimeArr::TimeArr ( long double custom_delay_prec = TIMEARR_CUSTOM_DELAY_PRECISION)

◆ TimeArr() [2/5]

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 delay_precision, and time_arr_map.

◆ TimeArr() [3/5]

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

TimeArr constructor. Needed for Pressure to TimeArr conversion

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

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

Here is the call graph for this function:

◆ TimeArr() [4/5]

woss::TimeArr::TimeArr ( const TimeArr & copy)
default

References TimeArr().

Here is the call graph for this function:

◆ TimeArr() [5/5]

woss::TimeArr::TimeArr ( TimeArr && tmp)
default

References TimeArr().

Here is the call graph for this function:

◆ ~TimeArr()

virtual woss::TimeArr::~TimeArr ( )
virtualdefault

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 operator<<.

◆ 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()

void woss::TimeArr::clear ( )
inline

Erase all values of Pressure

References time_arr_map.

◆ clone()

virtual std::unique_ptr< TimeArr > woss::TimeArr::clone ( ) const
inlinevirtual

TimeArr virtual factory method

Returns
a std::unique_ptr to a heap-created copy of this instance

Referenced by woss::ResTimeArrTxtDb::insertValue(), and ChannelEstimator::updateEstimation().

◆ coherentSumSample()

std::unique_ptr< TimeArr > TimeArr::coherentSumSample ( double time_delay) const
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 std::unique_ptr to a heap allocated woss::TimeArr object

References create(), delay_precision, and time_arr_map.

Here is the call graph for this function:

◆ create() [1/3]

virtual std::unique_ptr< 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 std::unique_ptr to a heap allocated woss::TimeArr object

◆ create() [2/3]

virtual std::unique_ptr< 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 std::unique_ptr to a heap allocated woss::TimeArr object

Referenced by coherentSumSample(), crop(), and incoherentSumSample().

◆ create() [3/3]

virtual std::unique_ptr< 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 std::unique_ptr to a heap allocated woss::TimeArr object

◆ createArray()

virtual std::unique_ptr< TimeArr[]> woss::TimeArr::createArray ( unsigned int array_size) const
inlinevirtual

TimeArr virtual factory method

Parameters
array_sizesize of array
Returns
a std::unique_ptr to 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::WossManager::getWossTimeArr(), woss::WossManager::getWossTimeArr(), woss::WossManagerResDb::getWossTimeArr(), woss::WossManagerResDbMT::getWossTimeArr(), and woss::WossManagerResDbMT::getWossTimeArr().

◆ createNotValid()

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

◆ crop()

std::unique_ptr< TimeArr > TimeArr::crop ( double time_start,
double time_end ) const
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 std::unique_ptr to a heap allocated woss::TimeArr object

References create(), debug, 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.

◆ 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, and TimeArr().

Here is the call graph for this function:

◆ 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()

std::unique_ptr< TimeArr > TimeArr::incoherentSumSample ( double time_delay) const
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 std::unique_ptr to a heap allocated woss::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(), time_arr_map, and TimeArr().

Referenced by WossUnitTest::testPressure().

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::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 debug, woss::Pressure::getTxLossDb(), 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

References time_arr_map.

◆ operator=() [1/2]

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

References TimeArr().

Here is the call graph for this function:

◆ operator=() [2/2]

TimeArr & woss::TimeArr::operator= ( TimeArr && tmp)
default

References TimeArr().

Here is the call graph for this function:

◆ 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()

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::ResTimeArrTxtDb::printScreenMap(), woss::ResTimeArrBinDb::writeMap(), and woss::ResTimeArrTxtDb::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.

Here is the call graph for this function:

◆ 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

References time_arr_map, and TimeArr().

◆ 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

References TimeArr().

◆ 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

References TimeArr().

◆ 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

References TimeArr().

◆ 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

References TimeArr().

◆ 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

References TimeArr().

◆ 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

References TimeArr().

◆ 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

References TimeArr().

◆ 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

References TimeArr().

◆ 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

References TimeArr().

◆ 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

References TimeArr().

◆ 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

References TimeArr().

◆ 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

References TimeArr().

◆ 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

References TimeArr().

◆ 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

References TimeArr().

◆ 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

References TimeArr().

◆ 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

References TimeArr().

◆ 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

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

◆ 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

References time_arr_map, and TimeArr().

Member Data Documentation

◆ debug

bool TimeArr::debug = false
staticprotected

Debug flag

Referenced by crop(), lowerBoundTxLoss(), and 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(), TimeArr(), TimeArr(), and TimeArr().

◆ time_arr_map


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