UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
Trace Class Reference

#include <trace.hpp>

Classes

class  Header
 
struct  Window
 

Public Types

typedef float AmplT
 
typedef float TimeT
 
typedef float OffsetT
 
typedef std::vector< AmplTAmplsStorageT
 
typedef AmplsStorageT::iterator iterator
 
typedef
AmplsStorageT::const_iterator 
const_iterator
 

Public Member Functions

const AmplToperator[] (size_t n) const
 
AmplToperator[] (size_t n)
 
Traceoperator= (const Trace &tr)
 
bool operator== (const Trace &tr) const
 
Trace operator+ (const Trace &tr) const
 
Trace operator- (const Trace &tr) const
 
Traceoperator+= (const Trace &that)
 
Traceoperator-= (const Trace &that)
 
Traceoperator*= (AmplT value)
 
Traceoperator/= (AmplT value)
 
 Trace ()
 
 Trace (const Header &hdr)
 
 Trace (const Header &hdr, size_t size, AmplT ampl)
 
template<typename Iterator >
 Trace (const Header &hdr, Iterator first, Iterator last)
 
 Trace (const Trace &tr)
 
Traceclone () const
 
virtual ~Trace ()
 
const Headerheader () const
 
const_iterator begin () const
 
const_iterator end () const
 
const AmplTat (size_t n) const
 
size_t size () const
 
TimeT duration () const
 
Headerheader ()
 
iterator begin ()
 
iterator end ()
 
AmplTat (size_t n)
 
void clear ()
 
void resize (size_t n, AmplT ampl=0.)
 
void erase (iterator first, iterator last)
 
void shift (TimeT s)
 
void shift_old (TimeT s)
 
void fill (const AmplT &ampl)
 
const Traceset_window (TimeT start, TimeT duration) const
 
TimeT get_window_start () const
 
TimeT get_window_duration () const
 
void remove_window () const
 
bool is_windowed () const
 
bool hasNAN ()
 
bool hasInf ()
 
bool hasNANInf ()
 

Static Public Member Functions

static void applyKin (Trace &trace, const std::vector< AmplT > &tsrc, const std::vector< AmplT > &tres, const double &max_shift_ratio=10e+6)
 
static void expand (Trace &trace, size_t n1, size_t n2, Trace::AmplT ampl=0.)
 
static void reduce (Trace &trace, size_t n1, size_t n2)
 

Protected Attributes

Header m_hdr
 
AmplsStorageT m_ampls
 
std::vector< Windowm_win_stack
 

Detailed Description

Trace class contains array of amplitudes and header.

Member Typedef Documentation

typedef std::vector<AmplT> Trace::AmplsStorageT

Type for amplitudes storage.

typedef float Trace::AmplT

Type for amplitudes.

typedef AmplsStorageT::const_iterator Trace::const_iterator

Constant iterator to amplitude of the trace.

typedef AmplsStorageT::iterator Trace::iterator

Iterator to amplitude of the trace.

typedef float Trace::OffsetT

Type for offsets.

typedef float Trace::TimeT

Type for times.

Constructor & Destructor Documentation

Trace::Trace ( )

Default constructor for empty trace with default header.

Trace::Trace ( const Header hdr)
explicit

Constructs empty trace with provided header.

Trace::Trace ( const Header hdr,
size_t  size,
AmplT  ampl 
)

Constructs trace with provided header and size. All amplitudes will be as provided ampl.

template<typename Iterator >
Trace::Trace ( const Header hdr,
Iterator  first,
Iterator  last 
)
inline

Constructs trace from provided header and set of amplitudes.

Trace::Trace ( const Trace tr)

Copy constructor.

virtual Trace::~Trace ( )
virtual

Just a destructor.

Member Function Documentation

static void Trace::applyKin ( Trace trace,
const std::vector< AmplT > &  tsrc,
const std::vector< AmplT > &  tres,
const double &  max_shift_ratio = 10e+6 
)
static

Apply kinematic for provided initial trace. -—tsrc[k]=>tres[k]----------------—>

Parameters
traceInitial trace
tsrcSource times array
tresResult times array
max_shift_ratioMaximal permissible neighbouring shifts ratio.
const AmplT& Trace::at ( size_t  n) const

Access to the n-th amplitude.

AmplT& Trace::at ( size_t  n)

n-th amplitude modificators.

const_iterator Trace::begin ( ) const

Accesors with iterator.

iterator Trace::begin ( )

Modificators with iterator.

void Trace::clear ( )

Clear all the amplitudes in the trace. Also remove all windows if defined.

Trace* Trace::clone ( ) const

Clones this trace to new object should be consequently deleted.

TimeT Trace::duration ( ) const

Size of the trace in terms of time.

void Trace::erase ( iterator  first,
iterator  last 
)

Erase set of amplitudes provided by the iterators.

static void Trace::expand ( Trace trace,
size_t  n1,
size_t  n2,
Trace::AmplT  ampl = 0. 
)
static

Expand trace.

void Trace::fill ( const AmplT ampl)

Fill all amplitudes with provided one.

TimeT Trace::get_window_duration ( ) const

Get current window duration. Return duration of full trace if window not defined.

TimeT Trace::get_window_start ( ) const

Get current window start time value. Return start time of trace if window not defined.

bool Trace::hasInf ( )

True if has any Inf sample.

bool Trace::hasNAN ( )

True if has any NAN sample.

bool Trace::hasNANInf ( )

True if has any NAN or Inf sample.

const Header& Trace::header ( ) const
inline

Header accessor.

Header& Trace::header ( )
inline

Header modificator.

bool Trace::is_windowed ( ) const

True if trace has window.

Trace Trace::operator+ ( const Trace tr) const

Addition of samples.

Trace& Trace::operator+= ( const Trace that)

Useful operations.

Trace Trace::operator- ( const Trace tr) const

Subtraction of samples.

Trace& Trace::operator= ( const Trace tr)

Replaces this trace and header with provided one.

bool Trace::operator== ( const Trace tr) const

Equality of traces.

const AmplT& Trace::operator[] ( size_t  n) const
inline

Access to n-th element.

AmplT& Trace::operator[] ( size_t  n)
inline

Access to n-th element for modification.

static void Trace::reduce ( Trace trace,
size_t  n1,
size_t  n2 
)
static

Reduce trace.

void Trace::remove_window ( ) const

Remove last added window if defined.

void Trace::resize ( size_t  n,
AmplT  ampl = 0. 
)

Resize trace for provided number of samples.

const Trace& Trace::set_window ( TimeT  start,
TimeT  duration 
) const

Set window with provided start time and duration.

void Trace::shift ( TimeT  s)

Shifts trace to specified amount of time units (s, ms). For positive s shift will be done to the right, otherwise to the left.

void Trace::shift_old ( TimeT  s)

The same as shift, but old algorithm is used. DEPRECATED.

size_t Trace::size ( ) const

Size of the trace.

Member Data Documentation

Header Trace::m_hdr
protected

< Header of the trace. Amplitudes of the trace.

std::vector<Window> Trace::m_win_stack
mutableprotected

Stack of windows of the trace.


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