Diffpack Documentation


Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

Interval(Type) Class Reference

interval [a,b], where a and b are of type Type. More...

#include <Interval_Type.h>

List of all members.

Public Methods

 Interval(Type) (Type a, Type b)
 Interval(Type) ()
 Interval(Type) (const Interval(Type) &i)
void scan (Is is)
void print (Os os) const
void get (Type &a, Type &b) const
Type getLower () const
Type getUpper () const
void set (Type a, Type b)
bool in (Type x, real tolerance=0) const
bool ok () const

Friends

Osoperator<< (Os &os, const Interval(Type) &i)
Isoperator>> (Is &is, Interval(Type) &i)
Interval(Type) operator+ (Type m, Interval(Type) i)
Interval(Type) operator+ (Interval(Type) i, Type m)
Interval(Type) operator+ (Interval(Type) i1, Interval(Type) i2)
Interval(Type) operator * (Interval(Type) i, Type s)


Detailed Description

interval [a,b], where a and b are of type Type.

NAME: Interval(Type) - interval [a,b], where a and b are of type Type

DESCRIPTION:

The class represents an interval `$`[a,b]`$` where `$`a`$` and `$`b`$` are of type "Type". Usually "Type" will be "real" or "int". The class can perform some simple arithmetic operations on the intervals, see the examples below.


Constructor & Destructor Documentation

Interval(Type)::Interval_Type ( Type a,
Type b )
 

There is an empty constructor that declares the interval `$`[0,0]`$`. A proper interval must then be set bye the "scan" function. "scan" reads a string, for example, ""[3,5]"" and declares an interval `$`[3,5]`$`. The other constructor takes the end points of the interval as arguments.

Interval(Type)::Interval_Type ( )
 

See documentation of one of the overloaded constructor.

Interval(Type)::Interval_Type ( const Interval(Type) & i )
 

See documentation of one of the overloaded constructor.


Member Function Documentation

void Interval(Type)::get ( Type & a,
Type & b ) const
 

returns the lower and upper interval limits.

Type Interval(Type)::getLower ( ) const
 

returns the lower interval limit.

Type Interval(Type)::getUpper ( ) const
 

returns the upper interval limit.

bool Interval(Type)::in ( Type x,
real tolerance = 0 ) const
 

returns "true" if `$`x`\in` [a,b]`$`, where `$`x`$` is the argument "x" to the function.

bool Interval(Type)::ok ( ) const
 

checks whether `$`a<b`$`, if so, "true" is returned, otherwise "false" is returned.

void Interval(Type)::print ( Os os ) const
 

prints the interval in a "scan"-readable syntax. The end points are formatted according to the format state of the "Os" object that is sent to "print" as argument.

void Interval(Type)::scan ( Is is )
 

reads the interval. The syntax is ""[a,b]"".

void Interval(Type)::set ( Type a,
Type b )
 

sets the lower ("a") and upper ("b") interval limits.


Friends And Related Function Documentation

Interval(Type) operator * ( Interval(Type) i,
Type s ) [friend]
 

Interval(Type) operator+ ( Interval(Type) i1,
Interval(Type) i2 ) [friend]
 

Interval(Type) operator+ ( Interval(Type) i,
Type m ) [friend]
 

Interval(Type) operator+ ( Type m,
Interval(Type) i ) [friend]
 

Os & operator<< ( Os & os,
const Interval(Type) & i ) [friend]
 

Is & operator>> ( Is & is,
Interval(Type) & i ) [friend]
 


The documentation for this class was generated from the following file:
Copyright © 2003 inuTech GmbH. All rights reserved.