CACAO
Public Member Functions | Static Public Member Functions | Private Attributes
Scalar Class Reference

An integral value of the form Constant + NumericInstruction. More...

Public Member Functions

 Scalar ()
 Creates a scalar which equals zero. More...
 
 Scalar (s4 constant)
 
 Scalar (const NumericInstruction &instruction)
 
 Scalar (s4 constant, const NumericInstruction &instruction)
 Creates a scalar which equals constant + instruction. More...
 
s4 constant () const
 
NumericInstruction instruction () const
 
s4 lower () const
 
s4 upper () const
 
void upperBoundOfMinimumWith (const Scalar &)
 Computes an upper bound of the minimum of this and the specified scalar. More...
 
void lowerBoundOfMaximumWith (const Scalar &)
 Computes a lower bound of the maximum of this and the specified scalar. More...
 
void upperBoundOfMaximumWith (const Scalar &)
 Computes an upper bound of the maximum of this and the specified scalar. More...
 
void lowerBoundOfMinimumWith (const Scalar &)
 Computes a lower bound of the minimum of this and the specified scalar. More...
 
bool tryAdd (const Scalar &)
 Tries to add a scalar to this scalar. More...
 
bool trySubtract (const Scalar &)
 Tries to subtract a scalar from this scalar. More...
 

Static Public Member Functions

static s4 min ()
 
static s4 max ()
 

Private Attributes

s4 _constant
 
NumericInstruction _instruction
 

Detailed Description

An integral value of the form Constant + NumericInstruction.

Definition at line 40 of file Scalar.hpp.

Constructor & Destructor Documentation

Scalar::Scalar ( )
inline

Creates a scalar which equals zero.

Definition at line 53 of file Scalar.hpp.

Scalar::Scalar ( s4  constant)
inlineexplicit

Definition at line 58 of file Scalar.hpp.

Scalar::Scalar ( const NumericInstruction instruction)
inlineexplicit

Definition at line 63 of file Scalar.hpp.

Scalar::Scalar ( s4  constant,
const NumericInstruction instruction 
)
inline

Creates a scalar which equals constant + instruction.

The expression must not over- or underflow!

Definition at line 72 of file Scalar.hpp.

Member Function Documentation

s4 Scalar::constant ( ) const
inline

Definition at line 86 of file Scalar.hpp.

NumericInstruction Scalar::instruction ( ) const
inline

Definition at line 87 of file Scalar.hpp.

s4 Scalar::lower ( ) const
inline

Definition at line 89 of file Scalar.hpp.

void Scalar::lowerBoundOfMaximumWith ( const Scalar other)
inline

Computes a lower bound of the maximum of this and the specified scalar.

The result is stored in this object.

Definition at line 140 of file Scalar.hpp.

void Scalar::lowerBoundOfMinimumWith ( const Scalar other)

Computes a lower bound of the minimum of this and the specified scalar.

The result is stored in this object.

Definition at line 59 of file Scalar.cpp.

static s4 Scalar::max ( )
inlinestatic

Definition at line 48 of file Scalar.hpp.

static s4 Scalar::min ( )
inlinestatic

Definition at line 47 of file Scalar.hpp.

bool Scalar::tryAdd ( const Scalar other)

Tries to add a scalar to this scalar.

If an overflow can happen or the result is not representable as a scalar, this scalar will not be changed and false will be returned. Otherwise the return value is true.

Definition at line 88 of file Scalar.cpp.

bool Scalar::trySubtract ( const Scalar other)

Tries to subtract a scalar from this scalar.

If an overflow can happen or the result is not representable as a scalar, this scalar will not be changed and false will be returned. Otherwise the return value is true.

Definition at line 118 of file Scalar.cpp.

s4 Scalar::upper ( ) const
inline

Definition at line 90 of file Scalar.hpp.

void Scalar::upperBoundOfMaximumWith ( const Scalar other)

Computes an upper bound of the maximum of this and the specified scalar.

The result is stored in this object.

Definition at line 30 of file Scalar.cpp.

void Scalar::upperBoundOfMinimumWith ( const Scalar other)
inline

Computes an upper bound of the minimum of this and the specified scalar.

The result is stored in this object.

Definition at line 134 of file Scalar.hpp.

Field Documentation

s4 Scalar::_constant
private

Definition at line 42 of file Scalar.hpp.

NumericInstruction Scalar::_instruction
private

Definition at line 43 of file Scalar.hpp.


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