f2c
which is free software), writing a small
interface routine in PROFIL that calls the converted FORTRAN routine.
All interval operations of PROFIL are based on BIAS with the advantage that PROFIL is independent of the internal representation and the implementation of the interval types.
PROFIL and BIAS have currently been tested for IBM RS/6000 and Sparc architectures as well as for PCs.
This documentation is structured as follows. First we give a short description how to install PROFIL/BIAS and how to run the test programs. After that the description of all supported data types and operations follows. In this reference part the operations are listed under the name of the header file in which they are defined. It is assumed that the reader is a little bit familiar with C programming, but no special C++ knowledge is required.
dmake
utility, which is free software and available from many anonymous ftp
servers.
To install PROFIL/BIAS, change to the directory in which you want to install and copy
the file profil.tar.Z into this directory. Unpack the compressed archive by
zcat profil.tar | tar xf -
After that, you may delete the file profil.tar.Z to save disk space.
tar
and gzip
which are free software under the terms of the
GNU Public License. Additionally, wou need the dmake
utility, which is
also free software and available from many anonymous ftp servers.
As C/C++ compiler we recommend the gcc
from the GNU Software Foundation.
All needed utilities must be properly installed before installing PROFIL/BIAS.
To install PROFIL/BIAS, change to the directory in which you want to install and copy the file profil.tgz into this directory, Unpack the compressed archive by
gzip -cd profil.tgz | tar xf -
After that, you may delete the file profil.tgz to save disk space.
For PCs running DOS or OS/2 replace / by \ in the following text. The BIAS package is not automatically built prior PROFIL. Therefore type
cd Profil/BIAS
to change to the BIAS directory. To build the BIAS package type
dmake architecture
where the value of architecture depends on your system and your compiler. Possible values of architecture are currently:
xlc
xlc
compiler on IBM RS/6000 architectures.
ibmgcc
gcc
.
hppa
hppagcc
gcc
.
sun4acc
acc
compiler on Sparc architectures.
sun4gcc
gcc
.
sun3gcc
gcc
on SUN 3 architectures (680x0).
x86bsd
x86sysv
pcgcc
gcc
on PCs (80386/387 or higher) running under DOS or OS/2.
After the BIAS package has been built successfully, change to the PROFIL directory by typing
cd ..
(assuming that you have been in the BIAS directory). In the PROFIL directory, you again have to type
dmake architecture
where the following values are currently valid for architecture:
xlC
xlC
compiler on IBM RS/6000 architectures.
ibmgcc
gcc
.
hppaCC
CC
compiler on HP 9000/700 architectures.
hppagcc
gcc
.
sun4CC
CC
compiler on Sparc architectures.
sun4gcc
gcc
.
sun3gcc
gcc
on SUN 3 architectures (680x0).
x86bsd
x86sysv
pcgcc
gcc
on PCs (80386/387 or higher) running under DOS or OS/2.
Additionally, a small test program Test.C can also be built during this process, if _test is appended to any of the above values for architecture. For example
dmake xlC_test
builds the whole library and the test program for IBM RS/6000 architectures by using
the IBM xlC
compiler.
Assuming that you develop your own programs, you have two choices:
CC -O -o myprog -I. -IBIAS myprog.C -L. -lProfil -LBIAS -lBias -lm
where CC denotes the name of your C++ compiler.
cp *.h /home/incl cp BIAS/*.h /home/incl cp libProfil.a /home/lib cp BIAS/libBias.a /home/lib ranlib /home/lib/libProfil.a ranlib /home/lib/libBias.a
On non-BSD systems, you probably have to replace the ranlib
command
by ar rvs. Under DOS or OS/2 you have to replace the cp
by
copy
and the ranlib
command by ar rvs.
Again assuming that your program is called myprog.C, you compile
and link as follows:
CC -O -o myprog -I/home/incl myprog.C -L/home/lib -lProfil -lBias -lm
where CC denotes again the name of your C++ compiler.
If you use the gcc
, you might have to precede the -lm by
-lg++ or -lgpp.
Due to limitations in file name length on some systems, some of the
file names mentioned below are different on your system. If any differences
occur, they can be found in the file names where the first name
in each line is the name mentioned in this documentation and the second name
is the file name on your system. On such systems the library Profil
is
called prof
instead (i.e. the file name is libprof.a).
#define __INDEXCHECK__
is contained in the file Configuration.h. Otherwise the line has to be deleted or commented out.
VECTOR x = a + b;
If at least one of the above cases can't be avoided, either the improved memory management should not be used or an explicit
MakePermanent(x);
must be used prior any access to the variable. x
denotes the name of
the appropriate parameter or initialized vector or matrix variable.
In the developement phase, the improved memory management should be
switched off. If switching the new memory management on, care should
be taken, if the above assumptions are met.
The improved memory management is performed, when a line
#define __DONTCOPY__
is contained in the file Configuration.h. Otherwise the line has to be deleted or commented out.
INT
REAL
BOOL
COMPLEX
INTERVAL
INTEGER_VECTOR
VECTOR
BOOL_VECTOR
INTERVAL_VECTOR
INTEGER_MATRIX
MATRIX
BOOL_MATRIX
INTERVAL_MATRIX
Any data type can be written to output via the C++ streams. If a
is a
variable of any type above, it can be written to output by typing
cout << a;
A new line in output can be achieved by
cout << endl;
The input can be performed quite the same way:
cin >> a;
reads the contents of the variable a
from input.
It may look surprising that there is no way to assign a value to the infimum or to the supremum of an interval type. This is due to the fact that all interval operations are performed by BIAS which hides the original interval representation. An explicit assignment would be possible, if C++ allows to make a difference between the left and the right side of an assignment. Unfortunately, this is not possible. If you really need to assign a value to a bound of an interval, e.g. you want to have
Inf(x) = 1.0;
use the following construct instead:
x = Hull(1.0, Sup(x));
Note that there is a slight difference: The first case would allow
intervals with a lower bound larger than the upper bound, which is
impossible in the second case.