OpenWalnut  1.4.0
Classes | Public Member Functions | Static Public Member Functions | Static Protected Attributes | Private Attributes
WDataSetDipoles Class Reference

Represents a dipole dataset. More...

#include <WDataSetDipoles.h>

+ Inheritance diagram for WDataSetDipoles:

List of all members.

Classes

class  Dipole
 Internal class representing one dipole. More...

Public Member Functions

 WDataSetDipoles ()
 Creates a new dipole dataset.
 WDataSetDipoles (WPosition dipPos, std::vector< float > mags, std::vector< float > times, size_t firstTimeStep, size_t lastTimeStep)
 Creates a new dipole data set containing one dipole with the given information and checks consistency of the information.
 ~WDataSetDipoles ()
 Destructs this dataset.
size_t addDipole (WPosition dipPos, std::vector< float > mags, std::vector< float > times, size_t firstTimeStep, size_t lastTimeStep)
 Adds a new dipole with given information and checks consistency of the information.
WPosition getPosition (size_t dipoleId=0)
 Return position of dipole.
float getMagnitude (float time, size_t dipoleId=0)
 Return magnitude of dipole for a given time.
float getStartTime (size_t dipoleId=0u) const
 Return first time where the magnitude is not 0.
float getEndTime (size_t dipoleId=0u) const
 Return last time where the magnitude is not 0.
std::vector< float > getTimes (size_t dipoleId=0u) const
 Return the times where the magnitude is not 0.
std::vector< float > getMagnitudes (size_t dipoleId=0u) const
 Return the magnitudes where the magnitude is not 0.
size_t getNumberOfDipoles ()
 Return number of dipoles in this dataset.
float getMaxMagnitude () const
 Return the biggest magnitude of all dipoles.

Static Public Member Functions

static boost::shared_ptr
< WPrototyped
getPrototype ()
 Returns a prototype instantiated with the true type of the deriving class.

Static Protected Attributes

static boost::shared_ptr
< WPrototyped
m_prototype = boost::shared_ptr< WPrototyped >()
 The prototype as singleton.

Private Attributes

std::vector< Dipolem_dipoles
 List of dipoles representeing this dipoles dataset.
float m_maxMagnitude
 Biggest magnitude of all dipoles.

Detailed Description

Represents a dipole dataset.

Definition at line 37 of file WDataSetDipoles.h.


Constructor & Destructor Documentation

Creates a new dipole dataset.

Definition at line 33 of file WDataSetDipoles.cpp.

Referenced by getPrototype().

WDataSetDipoles::WDataSetDipoles ( WPosition  dipPos,
std::vector< float >  mags,
std::vector< float >  times,
size_t  firstTimeStep,
size_t  lastTimeStep 
) [explicit]

Creates a new dipole data set containing one dipole with the given information and checks consistency of the information.

Parameters:
dipPosSpatial location of the dipole
magsMagnitudes of dipole over time
timesTimes for the dipole activity
firstTimeStepFirst time where the magnitude is not 0
lastTimeStepLast time where the magnitude is not 0

Definition at line 38 of file WDataSetDipoles.cpp.

References addDipole().

Destructs this dataset.

Definition at line 50 of file WDataSetDipoles.cpp.


Member Function Documentation

size_t WDataSetDipoles::addDipole ( WPosition  dipPos,
std::vector< float >  mags,
std::vector< float >  times,
size_t  firstTimeStep,
size_t  lastTimeStep 
)

Adds a new dipole with given information and checks consistency of the information.

Parameters:
dipPosSpatial location of the dipole
magsMagnitudes of dipole over time
timesTimes for the dipole activity
firstTimeStepFirst time where the magnitude is not 0
lastTimeStepLast time where the magnitude is not 0
Returns:
Id of the added dipole.

Definition at line 64 of file WDataSetDipoles.cpp.

References WDataSetDipoles::Dipole::m_dipolePosition, m_dipoles, WDataSetDipoles::Dipole::m_firstTimeStep, WDataSetDipoles::Dipole::m_lastTimeStep, WDataSetDipoles::Dipole::m_magnitudes, m_maxMagnitude, and WDataSetDipoles::Dipole::m_times.

Referenced by WDataSetDipoles().

float WDataSetDipoles::getEndTime ( size_t  dipoleId = 0u) const

Return last time where the magnitude is not 0.

Parameters:
dipoleIdId number of dipole
Returns:
Last time where the magnitude is not 0.

Definition at line 96 of file WDataSetDipoles.cpp.

References m_dipoles.

float WDataSetDipoles::getMagnitude ( float  time,
size_t  dipoleId = 0 
)

Return magnitude of dipole for a given time.

Parameters:
timeThe selected time.
dipoleIdId number of dipole
Returns:
Magnitude of the dipole.

Definition at line 127 of file WDataSetDipoles.cpp.

References m_dipoles.

std::vector< float > WDataSetDipoles::getMagnitudes ( size_t  dipoleId = 0u) const

Return the magnitudes where the magnitude is not 0.

Parameters:
dipoleIdId number of dipole
Returns:
Magnitudes where the magnitude is not 0.

Definition at line 109 of file WDataSetDipoles.cpp.

References m_dipoles, WDataSetDipoles::Dipole::m_firstTimeStep, WDataSetDipoles::Dipole::m_lastTimeStep, and WDataSetDipoles::Dipole::m_magnitudes.

Return the biggest magnitude of all dipoles.

Returns:
Biggest magnitude of all dipoles.

Definition at line 122 of file WDataSetDipoles.cpp.

References m_maxMagnitude.

Return number of dipoles in this dataset.

Returns:
number of dipoles in this dataset.

Definition at line 117 of file WDataSetDipoles.cpp.

References m_dipoles.

Return position of dipole.

Parameters:
dipoleIdId number of dipole
Returns:
Position of the dipole.

Definition at line 86 of file WDataSetDipoles.cpp.

References m_dipoles.

boost::shared_ptr< WPrototyped > WDataSetDipoles::getPrototype ( ) [static]

Returns a prototype instantiated with the true type of the deriving class.

Returns:
the prototype.

Reimplemented from WDataSet.

Definition at line 54 of file WDataSetDipoles.cpp.

References m_prototype, and WDataSetDipoles().

float WDataSetDipoles::getStartTime ( size_t  dipoleId = 0u) const

Return first time where the magnitude is not 0.

Parameters:
dipoleIdId number of dipole
Returns:
First time where the magnitude is not 0.

Definition at line 91 of file WDataSetDipoles.cpp.

References m_dipoles.

std::vector< float > WDataSetDipoles::getTimes ( size_t  dipoleId = 0u) const

Return the times where the magnitude is not 0.

Parameters:
dipoleIdId number of dipole
Returns:
Times where the magnitude is not 0.

Definition at line 101 of file WDataSetDipoles.cpp.

References m_dipoles, WDataSetDipoles::Dipole::m_firstTimeStep, WDataSetDipoles::Dipole::m_lastTimeStep, and WDataSetDipoles::Dipole::m_times.


Member Data Documentation

std::vector< Dipole > WDataSetDipoles::m_dipoles [private]

List of dipoles representeing this dipoles dataset.

Definition at line 167 of file WDataSetDipoles.h.

Referenced by addDipole(), getEndTime(), getMagnitude(), getMagnitudes(), getNumberOfDipoles(), getPosition(), getStartTime(), and getTimes().

Biggest magnitude of all dipoles.

Definition at line 168 of file WDataSetDipoles.h.

Referenced by addDipole(), and getMaxMagnitude().

boost::shared_ptr< WPrototyped > WDataSetDipoles::m_prototype = boost::shared_ptr< WPrototyped >() [static, protected]

The prototype as singleton.

Reimplemented from WDataSet.

Definition at line 151 of file WDataSetDipoles.h.

Referenced by getPrototype().


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