Skip to content

Commit

Permalink
Replaced some missing prototypes, added FLINT_DLL on some that were m…
Browse files Browse the repository at this point in the history
…issed and

added div_series for fq_poly*.
  • Loading branch information
wbhart committed Aug 31, 2014
1 parent 129a02b commit 9d15504
Show file tree
Hide file tree
Showing 17 changed files with 568 additions and 21 deletions.
40 changes: 34 additions & 6 deletions fmpz_mod_poly.h
Expand Up @@ -639,15 +639,15 @@ void fmpz_mod_poly_rem_f(fmpz_t f, fmpz_mod_poly_t R,
fmpz_mod_poly_clear(Q);
}

void _fmpz_mod_poly_div_newton_n_preinv (fmpz *Q, const fmpz* A, slong lenA,
FLINT_DLL void _fmpz_mod_poly_div_newton_n_preinv (fmpz *Q, const fmpz* A, slong lenA,
const fmpz* B, slong lenB, const fmpz* Binv,
slong lenBinv, const fmpz_t p);

void fmpz_mod_poly_div_newton_n_preinv (fmpz_mod_poly_t Q, const fmpz_mod_poly_t A,
FLINT_DLL void fmpz_mod_poly_div_newton_n_preinv (fmpz_mod_poly_t Q, const fmpz_mod_poly_t A,
const fmpz_mod_poly_t B, const fmpz_mod_poly_t Binv);


void _fmpz_mod_poly_divrem_newton_n_preinv (fmpz* Q, fmpz* R, const fmpz* A,
FLINT_DLL void _fmpz_mod_poly_divrem_newton_n_preinv (fmpz* Q, fmpz* R, const fmpz* A,
slong lenA, const fmpz* B, slong lenB,
const fmpz* Binv, slong lenBinv, const fmpz_t p);

Expand All @@ -656,9 +656,8 @@ FLINT_DLL void fmpz_mod_poly_divrem_newton_n_preinv(fmpz_mod_poly_t Q, fmpz_mod_
const fmpz_mod_poly_t Binv);

/* Power series inversion ***************************************************/

void
FLINT_DLL _fmpz_mod_poly_inv_series_newton(fmpz * Qinv, const fmpz * Q, slong n,

FLINT_DLL void _fmpz_mod_poly_inv_series_newton(fmpz * Qinv, const fmpz * Q, slong n,
const fmpz_t cinv, const fmpz_t p);

FLINT_DLL void fmpz_mod_poly_inv_series_newton(fmpz_mod_poly_t Qinv,
Expand All @@ -667,6 +666,35 @@ FLINT_DLL void fmpz_mod_poly_inv_series_newton(fmpz_mod_poly_t Qinv,
FLINT_DLL void fmpz_mod_poly_inv_series_newton_f(fmpz_t f, fmpz_mod_poly_t Qinv,
const fmpz_mod_poly_t Q, slong n);

FMPZ_MOD_POLY_INLINE void
_fmpz_mod_poly_inv_series(fmpz * Qinv, const fmpz * Q, slong n,
const fmpz_t cinv, const fmpz_t p)
{
_fmpz_mod_poly_inv_series_newton(Qinv, Q, n, cinv, p);
}

FMPZ_MOD_POLY_INLINE void
fmpz_mod_poly_inv_series(fmpz_mod_poly_t Qinv,
const fmpz_mod_poly_t Q, slong n)
{
fmpz_mod_poly_inv_series_newton(Qinv, Q, n);
}

FMPZ_MOD_POLY_INLINE void
fmpz_mod_poly_inv_series_f(fmpz_t f, fmpz_mod_poly_t Qinv,
const fmpz_mod_poly_t Q, slong n)
{
fmpz_mod_poly_inv_series_newton_f(f, Qinv, Q, n);
}

/* Power series division ***************************************************/

FLINT_DLL void _fmpz_mod_poly_div_series(fmpz * Q, const fmpz * A, slong Alen,
const fmpz * B, slong Blen, const fmpz_t p, slong n);

FLINT_DLL void fmpz_mod_poly_div_series(fmpz_mod_poly_t Q, const fmpz_mod_poly_t A,
const fmpz_mod_poly_t B, slong n);

/* Greatest common divisor **************************************************/

FLINT_DLL void fmpz_mod_poly_make_monic(fmpz_mod_poly_t res, const fmpz_mod_poly_t poly);
Expand Down
36 changes: 36 additions & 0 deletions fq_nmod_poly/div_series.c
@@ -0,0 +1,36 @@
/*=============================================================================
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) 2013 Mike Hansen
******************************************************************************/

#include "fq_nmod_poly.h"

#ifdef T
#undef T
#endif

#define T fq_nmod
#define CAP_T FQ_NMOD
#include "fq_poly_templates/div_series.c"
#undef CAP_T
#undef T
14 changes: 14 additions & 0 deletions fq_nmod_poly/doc/fq_nmod_poly.txt
Expand Up @@ -1177,6 +1177,20 @@ fq_nmod_poly_inv_series(fq_nmod_poly_t Qinv, const fq_nmod_poly_t Q, slong n,
be invertible modulo the modulus of \code{Q}. An exception is
raised if this is not the case or if \code{n = 0}.

void _fq_nmod_poly_div_series(fmpz * Q, const fmpz * A, slong Alen,
const fmpz * B, slong Blen, slong n, fq_ctx_t ctx)

Set \code{(Q, n)} to the quotient of the series \code{(A, Alen}) and
\code{(B, Blen)} assuming \code{Alen, Blen <= n}. We assume the bottom
coefficient of \code{B} is invertible.

void fq_nmod_poly_div_series(fmpz_mod_poly_t Q, const fmpz_mod_poly_t A,
const fmpz_mod_poly_t B, slong n, fq_ctx_t ctx)

Set $Q$ to the quotient of the series $A$ by $B$, thinking of the series as
though they were of length $n$. We assume that the bottom coefficient of
$B$ is invertible.

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

Greatest common divisor
Expand Down
36 changes: 36 additions & 0 deletions fq_nmod_poly/test/t-div_series.c
@@ -0,0 +1,36 @@
/*=============================================================================
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) 2013 Mike Hansen
******************************************************************************/

#include "fq_nmod_poly.h"

#ifdef T
#undef T
#endif

#define T fq_nmod
#define CAP_T FQ_NMOD
#include "fq_poly_templates/test/t-div_series.c"
#undef CAP_T
#undef T
39 changes: 39 additions & 0 deletions fq_poly/div_series.c
@@ -0,0 +1,39 @@
/*=============================================================================
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, 2011 Sebastian Pancratz
Copyright (C) 2013 Mike Hansen
******************************************************************************/

#include "fq_poly.h"



#ifdef T
#undef T
#endif

#define T fq
#define CAP_T FQ
#include "fq_poly_templates/div_series.c"
#undef CAP_T
#undef T
14 changes: 14 additions & 0 deletions fq_poly/doc/fq_poly.txt
Expand Up @@ -1145,6 +1145,20 @@ fq_poly_inv_series(fq_poly_t Qinv, const fq_poly_t Q, slong n,
be invertible modulo the modulus of \code{Q}. An exception is
raised if this is not the case or if \code{n = 0}.

void _fq_poly_div_series(fmpz * Q, const fmpz * A, slong Alen,
const fmpz * B, slong Blen, slong n, fq_ctx_t ctx)

Set \code{(Q, n)} to the quotient of the series \code{(A, Alen}) and
\code{(B, Blen)} assuming \code{Alen, Blen <= n}. We assume the bottom
coefficient of \code{B} is invertible.

void fq_poly_div_series(fmpz_mod_poly_t Q, const fmpz_mod_poly_t A,
const fmpz_mod_poly_t B, slong n, fq_ctx_t ctx)

Set $Q$ to the quotient of the series $A$ by $B$, thinking of the series as
though they were of length $n$. We assume that the bottom coefficient of
$B$ is invertible.

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

Greatest common divisor
Expand Down
38 changes: 38 additions & 0 deletions fq_poly/test/t-div_series.c
@@ -0,0 +1,38 @@
/*=============================================================================
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) 2009 William Hart
Copyright (C) 2011 Sebastian Pancratz
Copyright (C) 2013 Mike Hansen
******************************************************************************/

#include "fq_poly.h"

#ifdef T
#undef T
#endif

#define T fq
#define CAP_T FQ
#include "fq_poly_templates/test/t-div_series.c"
#undef CAP_T
#undef T
9 changes: 9 additions & 0 deletions fq_poly_templates.h
Expand Up @@ -863,6 +863,15 @@ TEMPLATE(T, poly_inv_series)(TEMPLATE(T, poly_t) Qinv,
TEMPLATE(T, poly_inv_series_newton) (Qinv, Q, n, ctx);
}

FLINT_DLL void _TEMPLATE(T, poly_div_series) (TEMPLATE(T, struct) * Q,
const TEMPLATE(T, struct) * A, slong Alen,
const TEMPLATE(T, struct) * B, slong Blen,
slong n, const TEMPLATE(T, ctx_t) ctx);

FLINT_DLL void TEMPLATE(T, poly_div_series)(TEMPLATE(T, poly_t) Q,
const TEMPLATE(T, poly_t) A, const TEMPLATE(T, poly_t) B,
slong n, const TEMPLATE(T, ctx_t) ctx);

FLINT_DLL void _TEMPLATE(T, poly_div_newton_n_preinv) (
TEMPLATE(T, struct) *Q,
const TEMPLATE(T, struct) *A, slong lenA,
Expand Down

0 comments on commit 9d15504

Please sign in to comment.