Stimfit  0.13.15
Public Member Functions

Represents a continuously sampled sweep of data points. More...

#include <section.h>

List of all members.

Public Member Functions

 Section ()
 Default constructor.
 Section (const Vector_double &valA, const std::string &label="\0")
 Constructor.
 Section (std::size_t size, const std::string &label="\0")
 Yet another constructor.
 ~Section ()
 Destructor.
double & operator[] (std::size_t at)
 Unchecked access. Returns a non-const reference.
double operator[] (std::size_t at) const
 Unchecked access. Returns a copy.
double at (std::size_t at_) const
 Range-checked access. Returns a copy.
double & at (std::size_t at_)
 Range-checked access. Returns a non-const reference.
const Vector_double & get () const
 Low-level access to the valarray (read-only).
Vector_double & get_w ()
 Low-level access to the valarray (read and write).
void resize (std::size_t new_size)
 Resize the Section to a new number of data points; deletes all previously stored data when gcc is used.
size_t size () const
 Retrieve the number of data points.
void SetXScale (double value)
 Sets the x scaling.
double GetXScale () const
 Retrieves the x scaling.
const std::string & GetSectionDescription () const
 Retrieves a section description.
void SetSectionDescription (const std::string &value)
 Sets a section description.

Detailed Description

Represents a continuously sampled sweep of data points.

Definition at line 35 of file section.h.


Constructor & Destructor Documentation

Section::Section ( const Vector_double &  valA,
const std::string &  label = "\0" 
) [explicit]

Constructor.

Parameters:
valAA vector of values that will make up the section.
labelAn optional section label string.
Section::Section ( std::size_t  size,
const std::string &  label = "\0" 
) [explicit]

Yet another constructor.

Parameters:
sizeNumber of data points.
labelAn optional section label string.

Member Function Documentation

double Section::at ( std::size_t  at_) const

Range-checked access. Returns a copy.

Throws std::out_of_range if out of range.

Parameters:
at_Data point index.
Returns:
Copy of the data point at index at_
double& Section::at ( std::size_t  at_)

Range-checked access. Returns a non-const reference.

Throws std::out_of_range if out of range.

Parameters:
at_Data point index.
Returns:
Reference to the data point at index at_
const Vector_double& Section::get ( ) const [inline]

Low-level access to the valarray (read-only).

An explicit function is used instead of implicit type conversion to access the valarray.

Returns:
The valarray containing the data points.

Definition at line 96 of file section.h.

Vector_double& Section::get_w ( ) [inline]

Low-level access to the valarray (read and write).

An explicit function is used instead of implicit type conversion to access the valarray.

Returns:
The valarray containing the data points.

Definition at line 103 of file section.h.

const std::string& Section::GetSectionDescription ( ) const [inline]

Retrieves a section description.

Returns:
A string describing this section.

Definition at line 130 of file section.h.

double Section::GetXScale ( ) const [inline]

Retrieves the x scaling.

Returns:
The x scaling.

Definition at line 125 of file section.h.

double& Section::operator[] ( std::size_t  at) [inline]

Unchecked access. Returns a non-const reference.

Parameters:
atData point index.
Returns:
Copy of the data point with index at.

Definition at line 67 of file section.h.

double Section::operator[] ( std::size_t  at) const [inline]

Unchecked access. Returns a copy.

Parameters:
atData point index.
Returns:
Reference to the data point with index at.

Definition at line 73 of file section.h.

void Section::resize ( std::size_t  new_size) [inline]

Resize the Section to a new number of data points; deletes all previously stored data when gcc is used.

Note that in the gcc implementation of std::vector, resizing will delete all the original data. This is different from std::vector::resize().

Parameters:
new_sizeThe new number of data points.

Definition at line 110 of file section.h.

void Section::SetSectionDescription ( const std::string &  value) [inline]

Sets a section description.

Parameters:
valueA string describing this section.

Definition at line 135 of file section.h.

void Section::SetXScale ( double  value)

Sets the x scaling.

Parameters:
valueThe x scaling.
size_t Section::size ( ) const [inline]

Retrieve the number of data points.

Returns:
The number of data points.

Definition at line 115 of file section.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines