Navigation: Up, Table of Contents, Bibliography, Index, Title Page

An Adaptor for Adding Dynamic Operations to Matrix Classes

#include <CGAL/Dynamic_matrix.h>

Definition

The class Dynamic_matrix<M> can be used as an adaptor for an arbitrary matrix class M to provide the dynamic operations needed for monotone matrix search (see section reference). The template argument class has to fulfill some requirements as stated in section reference.

Creation

Dynamic_matrix<M> d ( M m);
initializes d to m. m is not copied, we only store a reference.

Operations

int d.number_of_columns ()
returns the number of columns.

int d.number_of_rows ()
returns the number of rows.

Entry d ( int row, int column)
returns the entry at position (row, column).
Precondition:
0 row < number_of_rows() and
0 column < number_of_columns().

void d.replace_column ( int old, int new)
replace column old with column number new.
Precondition:
0 old, new < number_of_columns().

Matrix* d.extract_all_even_rows ()
returns a new Matrix consisting of all rows of d with even index, (i.e. first row is row 0 of d, second row is row 2 of d etc.).
Precondition: number_of_rows() > 0.

void d.shrink_to_quadratic_size ()
deletes the rightmost columns, such that d becomes quadratic.
Precondition:
number_of_columns() number_of_rows().
Postcondition:
number_of_rows() == number_of_columns().

Implementation

All operations take constant time except for extract_all_even_rows which needs time linear in the number of rows.


Next: Class declaration of BasicMatrix
Navigation: Up, Table of Contents, Bibliography, Index, Title Page
The GALIA project. Jan 18, 2000.