ContRap-Libraries
Public Member Functions | Protected Attributes

crp::RealStepFunction Class Reference

Class RealStepFunction represents a step function over the reals. More...

#include <functions.h>

Inheritance diagram for crp::RealStepFunction:
crp::RealFunction crp::Function< double >

Public Member Functions

 RealStepFunction ()
 Default constructor.
 RealStepFunction (const std::vector< double > &breakpoints, const std::vector< double > &values, RealInterval support=RealInterval())
 Creates a step from the breakpoints and the corresponding values.
virtual ~RealStepFunction ()
 Virtual destructor.
virtual double operator() (double x)
 Evaluates the function at a given point.
void set_data (const std::vector< double > &breakpoints, const std::vector< double > &values, RealInterval support=RealInterval())
 Sets the function data.
const std::vector< double > & get_breakpoints ()
 Returns the breakpoints.
const std::vector< double > & get_values ()
 Returns the value at the breakpoints.
RealInterval & get_support ()
 Returns the support of the function.

Protected Attributes

std::vector< double > breakpoints
 Breakpoints in the ascending order.
std::vector< double > values
 Values for the break points.
RealInterval support
 Minimum and maximum value.

Detailed Description

Class RealStepFunction represents a step function over the reals.


Constructor & Destructor Documentation

crp::RealStepFunction::RealStepFunction ( ) [inline]

Default constructor.

crp::RealStepFunction::RealStepFunction ( const std::vector< double > &  breakpoints,
const std::vector< double > &  values,
RealInterval  support = RealInterval() 
)

Creates a step from the breakpoints and the corresponding values.

Parameters:
breakpointsBreak points where the steps occur
valuesLeft associative values for the steps
supportSupport of the function
virtual crp::RealStepFunction::~RealStepFunction ( ) [inline, virtual]

Virtual destructor.


Member Function Documentation

const std::vector<double>& crp::RealStepFunction::get_breakpoints ( ) [inline]

Returns the breakpoints.

Returns:
Breakpoints
RealInterval& crp::RealStepFunction::get_support ( ) [inline]

Returns the support of the function.

Returns:
Support of the function
const std::vector<double>& crp::RealStepFunction::get_values ( ) [inline]

Returns the value at the breakpoints.

Returns:
Values
virtual double crp::RealStepFunction::operator() ( double  x) [virtual]

Evaluates the function at a given point.

Parameters:
xEvaluation point

Implements crp::RealFunction.

void crp::RealStepFunction::set_data ( const std::vector< double > &  breakpoints,
const std::vector< double > &  values,
RealInterval  support = RealInterval() 
)

Sets the function data.

Parameters:
breakpointsBreak points where the steps occur
valuesLeft associative values for the steps
supportSupport of the function

Field Documentation

std::vector<double> crp::RealStepFunction::breakpoints [protected]

Breakpoints in the ascending order.

RealInterval crp::RealStepFunction::support [protected]

Minimum and maximum value.

std::vector<double> crp::RealStepFunction::values [protected]

Values for the break points.


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