source: git/factory/FLINTconvert.h @ 08a955

spielwiese
Last change on this file since 08a955 was 3c702a, checked in by Oleksandr Motsak <motsak@…>, 11 years ago
Public headers should not include private config.h
  • Property mode set to 100644
File size: 5.7 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 <flint/fmpz.h>
30#include <flint/fmpq.h>
31#include <flint/fmpz_poly.h>
32#include <flint/fmpz_mod_poly.h>
33#include <flint/fmpq_poly.h>
34#include <flint/nmod_poly.h>
35#include <flint/nmod_mat.h>
36#include <flint/fmpz_mat.h>
37#ifdef __cplusplus
38}
39#endif
40
41#include <factory/cf_gmp.h>
42
43/// conversion of a factory integer to fmpz_t
44void
45convertCF2Fmpz (fmpz_t result,         ///< [in,out] an fmpz_t
46                const CanonicalForm& f ///< [in] a CanonicalForm wrapping an
47                                       ///< integer
48               );
49
50/// conversion of a factory univariate polynomial over Z to a fmpz_poly_t
51void
52convertFacCF2Fmpz_poly_t (fmpz_poly_t result,    ///< [in,out] an fmpz_poly_t
53                          const CanonicalForm& f ///< [in] univariate poly over
54                                                 ///< Z
55                         );
56
57/// conversion of a FLINT integer to CanonicalForm
58CanonicalForm
59convertFmpz2CF (fmpz_t coefficient ///< [in] a FLINT integer
60               );
61
62/// conversion of a FLINT poly over Z to CanonicalForm
63CanonicalForm
64convertFmpz_poly_t2FacCF (fmpz_poly_t poly, ///< [in] an fmpz_poly_t
65                          const Variable& x ///< [in] variable the result should
66                                            ///< have
67                         );
68
69/// conversion of a factory univariate polynomials over Z/p (for word size p)
70/// to nmod_poly_t
71void
72convertFacCF2nmod_poly_t (nmod_poly_t result,    ///< [in, out] a nmod_poly_t
73                          const CanonicalForm& f ///< [in] univariate poly over
74                                                 ///< Z/p
75                         );
76
77/// conversion of a FLINT poly over Z/p to CanonicalForm
78CanonicalForm
79convertnmod_poly_t2FacCF (nmod_poly_t poly, ///< [in] a nmod_poly_t
80                          const Variable& x ///< [in] variable the result should
81                                            ///< have
82                         );
83
84/// conversion of a factory rationals to fmpq_t
85void
86convertCF2Fmpq (fmpq_t result,         ///< [in,out] an fmpq_t
87                const CanonicalForm& f ///< [in] a CanonicalForm wrapping a
88                                       ///< rational
89               );
90
91/// conversion of a factory univariate polynomials over Q to fmpq_poly_t
92void
93convertFacCF2Fmpq_poly_t (fmpq_poly_t result,    ///< [in,out] an fmpq_poly_t
94                          const CanonicalForm& f ///< [in] univariate poly over
95                                                 ///< Q
96                         );
97
98/// conversion of a FLINT poly over Q to CanonicalForm
99CanonicalForm
100convertFmpq_poly_t2FacCF (fmpq_poly_t p,    ///< [in] an fmpq_poly_t
101                          const Variable& x ///< [in] variable the result should
102                                            ///< have
103                         );
104
105/// conversion of a FLINT factorization over Z/p (for word size p) to a
106/// CFFList
107CFFList
108convertFLINTnmod_poly_factor2FacCFFList (
109                   nmod_poly_factor_t fac, ///< [in] a nmod_poly_factor_t
110                   mp_limb_t leadingCoeff, ///< [in] leading coefficient
111                   const Variable& x       ///< [in] variable the result should
112                                           ///< have
113                                        );
114
115/// conversion of a factory univariate poly over Z to a FLINT poly over
116/// Z/p (for non word size p)
117void
118convertFacCF2Fmpz_mod_poly_t (
119                          fmpz_mod_poly_t result, ///< [in,out] fmpz_mod_poly_t
120                          const CanonicalForm& f, ///< [in] univariate poly over
121                                                  ///< Z
122                          const fmpz_t p          ///< [in] some integer p
123                             );
124
125/// conversion of a FLINT poly over Z/p (for non word size p) to a CanonicalForm
126/// over Z
127CanonicalForm
128convertFmpz_mod_poly_t2FacCF (
129                          fmpz_mod_poly_t poly, ///< [in] fmpz_mod_poly_t
130                          const Variable& x,    ///< [in] variable the result
131                                                ///< should have
132                          const modpk& b        ///< [in] coeff bound to map
133                                                ///< coeffs in (-p/2,p/2)
134                             );
135
136/// conversion of a factory matrix over Z to a fmpz_mat_t
137void convertFacCFMatrix2Fmpz_mat_t (fmpz_mat_t M, ///<[in,out] fmpz_mat_t
138                                    CFMatrix &m   ///<[in] matrix over Z
139                                   );
140
141/// conversion of a FLINT matrix over Z to a factory matrix
142CFMatrix* convertFmpz_mat_t2FacCFMatrix(fmpz_mat_t m ///<[in] fmpz_mat_t
143                                       );
144
145/// conversion of a factory matrix over Z/p to a nmod_mat_t
146void convertFacCFMatrix2nmod_mat_t (nmod_mat_t M, ///<[in,out] nmod_mat_t
147                                    CFMatrix &m   ///<[in] matrix over Z/p
148                                   );
149
150/// conversion of a FLINT matrix over Z/p to a factory matrix
151CFMatrix* convertNmod_mat_t2FacCFMatrix(nmod_mat_t m ///<[in] nmod_mat_t
152                                       );
153
154#endif
155#endif
Note: See TracBrowser for help on using the repository browser.