source: git/factory/FLINTconvert.h @ 6ce030f

spielwiese
Last change on this file since 6ce030f was a03496, checked in by Martin Lee <martinlee84@…>, 12 years ago
fix: gmp 5.x does not define __GMP_BITS_PER_MP_LIMB any more which is needed in FLINT's longlong.h
  • Property mode set to 100644
File size: 4.8 KB
Line 
1/*****************************************************************************\
2 * Computer Algebra System SINGULAR
3\*****************************************************************************/
4/** @file FLINTconvert.h
5 *
6 * This file defines functions for conversion to FLINT (www.flintlib.org)
7 * and back.
8 *
9 * @author Martin Lee
10 *
11 **/
12/*****************************************************************************/
13
14#ifndef FLINT_CONVERT_H
15#define FLINT_CONVERT_H
16
17#include <config.h>
18#include "canonicalform.h"
19#include "fac_util.h"
20
21#ifdef HAVE_FLINT
22#ifdef __cplusplus
23extern "C"
24{
25#endif
26#ifndef __GMP_BITS_PER_MP_LIMB
27#define __GMP_BITS_PER_MP_LIMB GMP_LIMB_BITS
28#endif
29#include <fmpz.h>
30#include <fmpq.h>
31#include <fmpz_poly.h>
32#include <fmpz_mod_poly.h>
33#include <fmpq_poly.h>
34#include <nmod_poly.h>
35#ifdef __cplusplus
36}
37#endif
38
39#include <factory/cf_gmp.h>
40
41/// conversion of a factory integer to fmpz_t
42void
43convertCF2Fmpz (fmpz_t result,         ///< [in,out] an fmpz_t
44                const CanonicalForm& f ///< [in] a CanonicalForm wrapping an
45                                       ///< integer
46               );
47
48/// conversion of a factory univariate polynomial over Z to a fmpz_poly_t
49void
50convertFacCF2Fmpz_poly_t (fmpz_poly_t result,    ///< [in,out] an fmpz_poly_t
51                          const CanonicalForm& f ///< [in] univariate poly over
52                                                 ///< Z
53                         );
54
55/// conversion of a FLINT integer to CanonicalForm
56CanonicalForm
57convertFmpz2CF (fmpz_t coefficient ///< [in] a FLINT integer
58               );
59
60/// conversion of a FLINT poly over Z to CanonicalForm
61CanonicalForm
62convertFmpz_poly_t2FacCF (fmpz_poly_t poly, ///< [in] an fmpz_poly_t
63                          const Variable& x ///< [in] variable the result should
64                                            ///< have
65                         );
66
67/// conversion of a factory univariate polynomials over Z/p (for word size p)
68/// to nmod_poly_t
69void
70convertFacCF2nmod_poly_t (nmod_poly_t result,    ///< [in, out] a nmod_poly_t
71                          const CanonicalForm& f ///< [in] univariate poly over
72                                                 ///< Z/p
73                         );
74
75/// conversion of a FLINT poly over Z/p to CanonicalForm
76CanonicalForm
77convertnmod_poly_t2FacCF (nmod_poly_t poly, ///< [in] a nmod_poly_t
78                          const Variable& x ///< [in] variable the result should
79                                            ///< have
80                         );
81
82/// conversion of a factory rationals to fmpq_t
83void
84convertCF2Fmpq (fmpq_t result,         ///< [in,out] an fmpq_t
85                const CanonicalForm& f ///< [in] a CanonicalForm wrapping a
86                                       ///< rational
87               );
88
89/// conversion of a factory univariate polynomials over Q to fmpq_poly_t
90void
91convertFacCF2Fmpq_poly_t (fmpq_poly_t result,    ///< [in,out] an fmpq_poly_t
92                          const CanonicalForm& f ///< [in] univariate poly over
93                                                 ///< Q
94                         );
95
96/// conversion of a FLINT poly over Q to CanonicalForm
97CanonicalForm
98convertFmpq_poly_t2FacCF (fmpq_poly_t p,    ///< [in] an fmpq_poly_t
99                          const Variable& x ///< [in] variable the result should
100                                            ///< have
101                         );
102
103/// conversion of a FLINT factorization over Z/p (for word size p) to a
104/// CFFList
105CFFList
106convertFLINTnmod_poly_factor2FacCFFList (
107                   nmod_poly_factor_t fac, ///< [in] a nmod_poly_factor_t
108                   mp_limb_t leadingCoeff, ///< [in] leading coefficient
109                   const Variable& x       ///< [in] variable the result should
110                                           ///< have
111                                        );
112
113/// conversion of a factory univariate poly over Z to a FLINT poly over
114/// Z/p (for non word size p)
115void
116convertFacCF2Fmpz_mod_poly_t (
117                          fmpz_mod_poly_t result, ///< [in,out] fmpz_mod_poly_t
118                          const CanonicalForm& f, ///< [in] univariate poly over
119                                                  ///< Z
120                          const fmpz_t p          ///< [in] some integer p
121                             );
122
123/// conversion of a FLINT poly over Z/p (for non word size p) to a CanonicalForm
124/// over Z
125CanonicalForm
126convertFmpz_mod_poly_t2FacCF (
127                          fmpz_mod_poly_t poly, ///< [in] fmpz_mod_poly_t
128                          const Variable& x,    ///< [in] variable the result
129                                                ///< should have
130                          const modpk& b        ///< [in] coeff bound to map
131                                                ///< coeffs in (-p/2,p/2)
132                             );
133
134#endif
135#endif
Note: See TracBrowser for help on using the repository browser.