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

    Copyright (C) 2011 Sebastian Pancratz

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

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

    Functions

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

void gmde_convert_gmc_fmpq(fmpq_mat_struct **B, long *lenB, fmpz_poly_t denB, 
                           const mat_t M, const ctx_t ctxM)

    Takes a matrix $M$ over \code{fmpz_poly_q} and splits it up as $B/r$ 
    where $B$ is a matrix over $\mathbf{Z}[t]$ and $r$ is an integer 
    polynomial, all implemented via the module \code{fmpz_poly}.
    Finally, the matrix $B$ is then re-written as 
    $B = B_0 + B_1 t + B_2 t^2 + \dotsb$, an array of matrices over 
    $\mathbf{Q}$ of length \code{lenB}.

void gmde_solve_fmpq(fmpq_mat_struct *C, long N, 
                     const mat_t M, const ctx_t ctxM)

    Given an $n \times n$ matrix $M$ defined over elements of the module 
    \code{fmpz_poly_q}, finds the matrices $C_i$ over $\mathbf{Q}$, where 
    $C = C_0 + C_1 t + \dotsb$ satisfies
    \begin{equation*}
    \bigl( \frac{d}{dt} + M \bigr) C = 0 \pmod{t^N}.
    \end{equation*}

void gmde_convert_soln_fmpq(mat_t A, const ctx_t ctxA, 
                            const fmpq_mat_struct *C, long N)

    Converts an array of length $N$ of $n \times n$ matrices over 
    the rationals to an $n \times n$ matrix of rational polynomials.

    The matrix $A$ is expected to be a matrix over objects of type 
    \code{fmpq_poly_t}.

