#include <iostream>
#include <fstream>
#include <CGAL/OSM/OSM.h>
typedef typename Sparse_matrix_structure::template Sparse_chain_type<int, CGAL::OSM::COLUMN> Column_chain;
typedef typename Sparse_matrix_structure::template Sparse_matrix_type<int, CGAL::OSM::COLUMN> Column_matrix;
int main ()
{
Column_matrix M(5,4) ;
CGAL::OSM::set_coefficient(M, 0, 1, 1) ;
CGAL::OSM::set_coefficient(M, 0, 2, -1) ;
CGAL::OSM::set_coefficient(M, 2, 1, 2) ;
for(CGAL::OSM::Bitboard::iterator it_col = M.begin(); it_col != M.end(); ++it_col)
{
std::cout << "col: " << *it_col << std::endl ;
const Column_chain& col(CGAL::OSM::cget_column(M, *it_col));
for (Column_chain::const_iterator it = col.begin(); it != col.end(); ++it)
{
std::cout << "row: " << it->first << " - coef: " << it->second << std::endl ;
}
}
std::cout << "M: " << M << std::endl;
return 0 ;
}
The structure Sparse_matrix_structure provides a user friendly interface for sparse matrices built ov...
Definition Sparse_matrix.h:53