Go to the previous, next chapter.

Introduction

This is a compact overview of PROFIL, a portable C++ class library. It introduces new data types as vectors, matrices, intervals, interval vectors and matrices, integer vectors and matrices, and lots of operations between them. Additionally, several commonly used routines as linear interval system solver, etc. are also included. Routines written in FORTRAN can also be included by using a FORTRAN to C converter (e.g. 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.

Installation

Unix Systems

As prerequisites for the installation of PROFIL/BIAS you will need the 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.

PCs under DOS or OS/2

As prerequisites for the installation of PROFIL/BIAS you will need the utilities 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.

Common Installation Steps

The following installation steps are the same for all supported architectures and operating systems except when you intend to use the C compilers from Borland (see file README.bcc for details).

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
Uses the IBM xlc compiler on IBM RS/6000 architectures.

ibmgcc
Same as above, but using the gcc.

hppa
Uses the HP C compiler on HP 9000/700 architectures.

hppagcc
Same as above, but using the gcc.

sun4acc
Uses the SUN acc compiler on Sparc architectures.

sun4gcc
Same as above, but using the gcc.

sun3gcc
Uses the gcc on SUN 3 architectures (680x0).

x86bsd
For Linux or PCs (80386/387 or higher) running a BSD based Unix.

x86sysv
For PCs (80386/387 or higher) running a System V Unix.

pcgcc
Uses the 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
Uses the IBM xlC compiler on IBM RS/6000 architectures.

ibmgcc
Same as above, but using the gcc.

hppaCC
Uses the HP CC compiler on HP 9000/700 architectures.

hppagcc
Same as above, but using the gcc.

sun4CC
Uses the SUN CC compiler on Sparc architectures.

sun4gcc
Same as above, but using the gcc.

sun3gcc
Uses the gcc on SUN 3 architectures (680x0).

x86bsd
For Linux or PCs (80386/387 or higher) running a BSD based Unix.

x86sysv
For PCs (80386/387 or higher) running a System V Unix.

pcgcc
Uses the 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:

  1. You develop your programs in the PROFIL directory, then you compile and link your programm (assumed it is called myprog.C) the following way:

    CC -O -o myprog -I. -IBIAS myprog.C -L. -lProfil -LBIAS -lBias -lm
    

    where CC denotes the name of your C++ compiler.

  2. Your develop your programs in a separate directory and want to move the libraries and the include files to a common place. If this place is not in your home directory you probably have to ask your system administrator to do the appropriate steps for you including the setting of the correct file modes). Assuming that you library directory is /home/lib and your include directory is /home/incl then under Unix you type the following to move the files to their places, if your current directory is the PROFIL directory:

    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).

Configuration

Some parts of PROFIL can be reconfigured by changing the appropriate definitions in the file Configuration.h and rebuilding the library. Currently, the following settings are possible (see also the description in the file Configuration.h):

Supported Data Types

The following data types are currently supported by PROFIL/BIAS:
INT
REAL
Defined by any PROFIL/BIAS header file.

BOOL
Defined in Boolean.h.

COMPLEX
Defined in Complex.h.

INTERVAL
Defined in Interval.h.

INTEGER_VECTOR
Defined in IntegerVector.h.

VECTOR
Defined in Vector.h.

BOOL_VECTOR
Defined in Boolean.h.

INTERVAL_VECTOR
Defined in IntervalVector.h.

INTEGER_MATRIX
Defined in IntegerMatrix.h.

MATRIX
Defined in Matrix.h.

BOOL_MATRIX
Defined in Boolean.h.

INTERVAL_MATRIX
Defined in IntervalMatrix.h.

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.

Further Remarks

The indexing of all vector and matrix types starts with 1.

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.