virtual bool get_entry(size_t r, size_t c, ring_elem &result) const // Returns false if (r,c) is out of range or if result is 0. No error // is returned. result <-- this(r,c), and is set to zero if false is returned. { if (r >= 0 && r < n_rows() && c >= 0 && c < n_cols()) { elem a; mat.get_CoeffRing()->set_zero(a); if (mat.get_entry(r,c,a)) { mat.get_CoeffRing()->to_ring_elem(result,a); return true; } } result = mat.get_ring()->zero(); return false; }
// Make a zero matrix, using the same ring and density taken from 'mat'. MutableMat* makeZeroMatrix(size_t nrows, size_t ncols) const { return zero_matrix(mat.get_ring(), &mat.ring(), nrows, ncols); }
virtual const Ring * get_ring() const { return mat.get_ring(); }