// ============================================================================ // // Copyright (c) 2000 The CGAL Consortium // // This software and related documentation is part of an INTERNAL release // of the Computational Geometry Algorithms Library (CGAL). It is not // intended for general use. // // ---------------------------------------------------------------------------- // // release : $CGAL_Revision $ // release_date : $CGAL_Date $ // // file : include/CGAL/Matrix.h // package : $CGAL_Package: Partition_2 $ // maintainer : Susan Hert // chapter : Planar Polygon Partitioning // // revision : $Revision$ // revision_date : $Date$ // // author(s) : Susan Hert // // coordinator : MPI (Susan Hert ) // // implementation: 2D Matrix // ============================================================================ #ifndef CGAL_MATRIX_H #define CGAL_MATRIX_H #include #include #include namespace CGAL { template class Matrix : public std::vector< std::vector > { public: Matrix(size_t x = 0, size_t y = 0) : std::vector< std::vector > (x, std::vector(y)), _rows(x), _columns(y) {} size_t rows() const { return _rows; } size_t columns() const { return _columns; } protected: size_t _rows; size_t _columns; }; template std::ostream& operator<<(std::ostream& os, const Matrix& m) { typedef typename Matrix::size_type size_type; for (size_type i = 0; i < m.rows(); i++) { os << std::endl << i << " : "; for (size_type j = 0; j < m.columns(); j++) { os << m[i][j] << " "; } } return os; } } #endif // CGAL_MATRIX_H