Next: Types of constraints and
Up: BAC : A BCP
Previous: Compilation and execution
Data structures
A few data structures are available within BCP and COIN.
Two of them will appear in the example: a class implementing vectors
and a class implementing matrices.
The class BCP_vec is an
implementation of an array with elements of generic type T
with facilities
for resizing. If V is a BCP_vecT, the following
functions are used:
See the documentation (file COIN/Bcp/include/BCP_vector.hpp)
for the full description of this class.
The class CoinPackedMatrix implements a two dimensional matrix
stored either
by rows or by columns. For a CoinPackedMatrix M stored by rows,
the following functions are used in the examples:
- M = new CoinPackedMatrix(false, , ) :
creates a matrix stored by rows
(first boolean parameter ``false''). Roughly speaking,
the parameter
is a percentage of extra space to be allocated
when a reallocation of the matrix occur:
When trying to insert new rows in a matrix having rows and
allocated space for rows, with , the matrix will be
reallocated to store
rows. The parameter is similar,
for reallocation when columns are added.
Note that if a matrix stored by columns is created using
CoinPackedMatrix(true, , ), then is used for the reallocation
of columns and for the reallocation of rows.
- submatrixOf(M, nb_ind, v_ind) :
extracts from M the submatrix formed
by the rows of M with indices in the vector v_ind
(having nb_ind entries).
- M.times(v, v_res) :
Computes the matrix-vector product (M v) and puts the result in
v_res.
See the documentation (file COIN/Coin/include/coinPackedMatrix.hpp)
for the full description of this class.
Next: Types of constraints and
Up: BAC : A BCP
Previous: Compilation and execution
IP Seminar Series
2003-12-01