/*=============================================================================

    This file is part of FLINT.

    FLINT is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    FLINT is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with FLINT; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA

=============================================================================*/
/******************************************************************************

    Copyright (C) 2010 William Hart
    Copyright (C) 2010 Andy Novocin

******************************************************************************/

*******************************************************************************

    Memory management

*******************************************************************************

void mpfr_mat_init(mpfr_mat_t mat, slong rows, slong cols, mpfr_prec_t prec)

    Initialises a matrix with the given number of rows and columns and the
    given precision for use. The precision is the exact precision of the
    entries.

void mpfr_mat_clear(mpfr_mat_t mat)
 
    Clears the given matrix.

*******************************************************************************

    Basic manipulation

*******************************************************************************

__mpfr_struct * mpfr_mat_entry(const mpfr_mat_t mat, slong i, slong j)

    Return a reference to the entry at row $i$ and column $j$ of the given
    matrix. The values $i$ and $j$ must be within the bounds for the matrix.
    The reference can be used to either return or set the given entry.

void mpfr_mat_swap(mpfr_mat_t mat1, mpfr_mat_t mat2)

    Efficiently swap matrices \code{mat1} and \code{mat2}.

void mpfr_mat_set(mpfr_mat_t mat1, const mpfr_mat_t mat2)

    Set \code{mat1} to the value of \code{mat2}.

void mpfr_mat_zero(mpfr_mat_t mat)

    Set \code{mat} to the zero matrix.

*******************************************************************************

    Comparison

*******************************************************************************

int mpfr_mat_equal(const mpfr_mat_t mat1, const mpfr_mat_t mat2)

    Return $1$ if the two given matrices are equal, otherwise return $0$.

*******************************************************************************

    Randomisation

*******************************************************************************

void mpfr_mat_randtest(mpfr_mat_t mat, flint_rand_t state)

    Generate a random matrix with random number of rows and columns and random
    entries for use in test code.

*******************************************************************************

    Basic arithmetic

*******************************************************************************

void mpfr_mat_mul_classical(mpfr_mat_t C, const mpfr_mat_t A, 
                                            const mpfr_mat_t B, mpfr_rnd_t rnd)

    Set $C$ to the product of $A$ and $B$ with the given rounding mode, using
    the classical algorithm.
