AdvancedMathematics CATMathInterval

Usage: you must use this class as is. You should never derive it.


public class CATMathInterval

Class representing a closed bounded interval of R.

A CATMathInterval is the set of the reals x lying between two real bounds Low and High: Low <= x <= High. If Low > High, the interval is empty.


Constructor and Destructor Index


o CATMathInterval()
Constructs a CATMathInterval with Low = High = 0.
o CATMathInterval(CATMathInterval&)
Copy Constructor.
o CATMathInterval(double&,double&)
Constructs a CATMathInterval.

Method Index


o Center()
Returns the center of this CATMathInterval.
o ClosestPeriodicEndpoint(double&,double)
Retrieves the closest external point of this CATMathInterval among those obtained by all the successive translations of length + or -iPeriod.
o DistanceTo(double&)
o DistanceTo(double&)
Return the distance between this CATMathInterval and a point.
o GetMax()
Returns the high limitation of this CATMathInterval.
o GetMin()
Returns the low limitation of this CATMathInterval.
o InPeriodicTrim(double,double,double)
Tests whether a point belongs to this CATMathInterval after a given number of translation of length + or -iPeriod+iTolerance.
o IsEmpty()
Tests if this CATMathInterval is empty.
o IsIncludedIn(CATMathInterval&)
Tests if this CATMathInterval is included into an other one.
o IsIncludedIn(CATMathInterval&,double)
Tests if this CATMathInterval is included into an other one at a given absolute tolerance.
o Norm()
o Norm()
Returns the norm of this CATMathInterval.
o PeriodicResidue(double&)
Translates a point to locate it at this CATMathInterval point such that the distance between these two points is a multiple of this CATMathInterval width.
o SetMax(double&)
Modifies the high limitation of this CATMathInterval.
o SetMin(double&)
Modifies the low limitation of this CATMathInterval.
o Sign()
Tests the relative position of this CATMathInterval with regards to 0.
o Width()
Returns the width of this CATMathInterval.
o operator &&(CATMathInterval&,CATMathInterval&)
Returns the interval resulting of the intersection of two CATMathIntervals.
o operator *(double&,CATMathInterval&)
Defines the multiplication of a CATMathInterval with a scalar.
o operator *(CATMathInterval&,double&)
Defines the multiplication of a scalar with a CATMathInterval.
o operator *=(CATMathInterval&,double)
Defines the *= operator of a CATMathInterval with a scalar.
o operator +(double&,CATMathInterval&)
Defines the scalar addition with a CATMathInterval.
o operator +(CATMathInterval&,double&)
Defines the addition of a CATMathInterval with a scalar.
o operator +(CATMathInterval&,CATMathInterval&)
Unary plus operator.
o operator +=(CATMathInterval&,double&)
Defines the += operator of a CATMathInterval with a scalar.
o operator +=(CATMathInterval&,CATMathInterval&)
Addition assignment operator.
o operator -(CATMathInterval&)
Defines the opposite of a CATMathInterval.
o operator -(double&,CATMathInterval&)
Defines the scalar substraction with a CATMathInterval.
o operator -(CATMathInterval&,double&)
Defines the scalar substraction with a CATMathInterval.
o operator -(CATMathInterval&,CATMathInterval&)
Subtraction operator.
o operator -=(CATMathInterval&,double&)
Defines the -= operator of a CATMathInterval with a scalar.
o operator -=(CATMathInterval&,CATMathInterval&)
Subtraction assignment operator.
o operator /(CATMathInterval&,double&)
Defines the division of a CATMathInterval by a scalar.
o operator /(CATMathInterval&,CATMathInterval&)
Defines the dividion of a CATMathInterval by another one.
o operator ||(CATMathInterval&,CATMathInterval&)
Returns the interval resulting of the union of two CATMathIntervals.

Constructor and Destructor


o CATMathInterval
public CATMathInterval()
Constructs a CATMathInterval with Low = High = 0.
o CATMathInterval
public CATMathInterval( const iToCopy)
Copy Constructor.
o CATMathInterval
public CATMathInterval( const iLow,
const iHigh)
Constructs a CATMathInterval.
If iLow > iHigh, the interval is empty.

Methods


o Center
public Center()
Returns the center of this CATMathInterval.
Returns:
The center ((High + Low)*0.5).
o ClosestPeriodicEndpoint
public ClosestPeriodicEndpoint( ioPoint,
const iPeriod)
Retrieves the closest external point of this CATMathInterval among those obtained by all the successive translations of length + or -iPeriod.
Parameters:
iPoint
The initial point (input) and the resulting one (output).
iPeriod
The period.
Returns:
The distance between this point and the initial one.
o DistanceTo
public DistanceTo( const iPoint)
o DistanceTo
public DistanceTo( const iPoint)
Return the distance between this CATMathInterval and a point.
Parameters:
iPoint
The value to which the distance is computed.
Returns:
0
if the point is included into this.
iPoint-High
if the point does not belong to this and iPoint >= High
Low-iPoint
if the point does not belong to this and Low>=iPoint
.
Returns:
o GetMax
public GetMax()
Returns the high limitation of this CATMathInterval.
Returns:
The high limitation.
o GetMin
public GetMin()
Returns the low limitation of this CATMathInterval.
Returns:
The low limitation.
o InPeriodicTrim
public InPeriodicTrim( const iPoint,
const iPeriod,
const iTolerance= 0.0)
Tests whether a point belongs to this CATMathInterval after a given number of translation of length + or -iPeriod+iTolerance.
The difference with the preceding method, is that iPeriod is greater than the width of the CATMathInterval (the CATMathInterval may be seen as a trimmed interval of the [0,iPeriod] one.)
Parameters:
iPoint
The tested point.
iPeriod
A value greater than the with of this CATMathInterval.
iTol
The tolerance at which the tests is run.
Returns:
TRUE if iPoint is in the interval with regards to iPeriod, FALSE otherwise.
o IsEmpty
public IsEmpty()
Tests if this CATMathInterval is empty.
Returns:
The result of the test.
Legal values: 1 if Low > High, 0 otherwise.
o IsIncludedIn
public IsIncludedIn( const iOther)
Tests if this CATMathInterval is included into an other one.
Parameters:
iOther
The other interval.
Returns:
The result of the test.
Legal values:
1
if this is included.
0
otherwise
.
An empty interval is always included into another one, except if this other one is empty too.
o IsIncludedIn
public IsIncludedIn( const iOther,
const iTol)
Tests if this CATMathInterval is included into an other one at a given absolute tolerance.
Parameters:
iOther
The other interval
iTol
The tolerance at which the tests is run.
Returns:
The result of the test.
Legal values:
1
if this is included.
0
otherwise
.
An empty interval is always included into another one, except if this other one is empty too.
o Norm
public Norm()
o Norm
public Norm()
Returns the norm of this CATMathInterval.
This norm may be negative if the interval is empty.
Returns:
The norm.
High
if Low > 0.
-Low
if High < 0.
High
if High >= -Low(and the interval is not empty)
-Low
High < -Low(and the interval is not empty)
Returns:
The norm.
o PeriodicResidue
public PeriodicResidue( ioToTranslate)
Translates a point to locate it at this CATMathInterval point such that the distance between these two points is a multiple of this CATMathInterval width.
This is useful in case of periodic functions to find the parameter of the fundamental interval corresponding to a given point.
Parameters:
ioToTranslate
The point to translate (in input), and the resulting one (in output).
o SetMax
public SetMax( const iNewHigh)
Modifies the high limitation of this CATMathInterval.
Parameters:
iNewHigh
The new value of the high limitation.
o SetMin
public SetMin( const iNewLow)
Modifies the low limitation of this CATMathInterval.
Parameters:
iNewLow
The new value of the low limitation.
o Sign
public Sign()
Tests the relative position of this CATMathInterval with regards to 0.
Returns:
The result of the test.
Legal values:
1
if Low > 0 or the interval is empty.
-1
if Low < 0 and the interval is not empty.
0
otherwise. In this case, 0 belongs to the interval, which is not empty
o Width
public Width()
Returns the width of this CATMathInterval.
Returns:
The width ((High - Low)).
o operator &&
public operator &&( const i1,
const i2)
Returns the interval resulting of the intersection of two CATMathIntervals.
o operator *
public operator *( const iScalar,
const i)
Defines the multiplication of a CATMathInterval with a scalar.
Returns:
[i.GetMin()*iScalar,i.GetMax()*iScalar]
if iScalar>0
[i.GetMax()*iScalar,i.GetMin()*iScalar]
if iScalar<=0
o operator *
public operator *( const i,
const iScalar)
Defines the multiplication of a scalar with a CATMathInterval.
Returns:
[i.GetMin()*iScalar,i.GetMax()*iScalar]
if iScalar>0
[i.GetMax()*iScalar,i.GetMin()*iScalar]
if iScalar<=0
o operator *=
public operator *=( io,
const iScalar)
Defines the *= operator of a CATMathInterval with a scalar.
Returns:
[io.GetMin()*=iScalar,io.GetMax()*=iScalar]
if iScalar>0
[io.GetMax()*=iScalar,io.GetMin()*=iScalar]
if iScalar<=0
o operator +
public operator +( const iScalar,
const i)
Defines the scalar addition with a CATMathInterval.
Returns:
[i.GetMin()+iScalar,i.GetMax()+iScalar]
o operator +
public operator +( const i,
const iScalar)
Defines the addition of a CATMathInterval with a scalar.
Returns:
[i.GetMin()+iScalar,i.GetMax()+iScalar]
o operator +
public operator +( const i1,
const i2)
Unary plus operator.
Returns:
[i1.GetMin()+i2.GetMin(),i1.GetMax()+i2.GetMax()]
o operator +=
public operator +=( io,
const iScalar)
Defines the += operator of a CATMathInterval with a scalar.
Returns:
io = [io.GetMin()+=iScalar,io.GetMax()+=iScalar]
o operator +=
public operator +=( io1,
const i2)
Addition assignment operator.
Returns:
io1 = [io1.GetMin()+=i2.GetMin(),io1.GetMax()+=i2.GetMax()]
o operator -
public operator -( const i)
Defines the opposite of a CATMathInterval.
Returns:
[-i.GetMax(),-i.GetMin()]
o operator -
public operator -( const iScalar,
const i)
Defines the scalar substraction with a CATMathInterval.
Returns:
[iScalar-i.GetMin(),iScalar-i.GetMax()]
o operator -
public operator -( const i,
const iScalar)
Defines the scalar substraction with a CATMathInterval.
Returns:
[i.GetMin()-iScalar,i.GetMax()-iScalar]
o operator -
public operator -( const i1,
const i2)
Subtraction operator.
Returns:
[i1.GetMin()-i2.GetMin(),i1.GetMax()-i2.GetMax()]
o operator -=
public operator -=( io,
const iScalar)
Defines the -= operator of a CATMathInterval with a scalar.
Returns:
io = [io.GetMin()-=iScalar,io.GetMax()-=iScalar]
o operator -=
public operator -=( io1,
const i2)
Subtraction assignment operator.
Returns:
io1= [i1.GetMin()-=i2.GetMax(),i1.GetMax()-=i2.GetMin()]
o operator /
public operator /( const i,
const iScalar)
Defines the division of a CATMathInterval by a scalar.
Returns:
[i.GetMin()/iScalar,i.GetMax()/iScalar]
if iScalar>0
[i.GetMax()/iScalar,i.GetMin()/iScalar]
if iScalar<=0
o operator /
public operator /( const i1,
const i2)
Defines the dividion of a CATMathInterval by another one.
Returns:
i1*[1/i2.GetMax(), 1/i2.GetMin()]
if i2.GetMax()*i2.GetMin() >0
[-CATMathInfinite,CATMathInfinite]
if i2.GetMax()*i2.GetMin() <=0
o operator ||
public operator ||( const i1,
const i2)
Returns the interval resulting of the union of two CATMathIntervals.

This object is included in the file: CATMathInterval.h
If needed, your Imakefile.mk should include the module: CATAdvancedMathematics

Copyright © 1999-2014, Dassault Systèmes. All rights reserved.