My Project
|
This file implements functions for conversion to FLINT (www.flintlib.org) and back. More...
#include <config.h>
#include "canonicalform.h"
#include "fac_util.h"
#include "cf_iter.h"
#include "cf_factory.h"
#include "gmpext.h"
#include "singext.h"
#include "cf_algorithm.h"
#include <cstdio>
#include <flint/fmpz.h>
#include <flint/fmpq.h>
#include <flint/fmpz_poly.h>
#include <flint/fmpz_mod_poly.h>
#include <flint/nmod_poly.h>
#include <flint/fmpq_poly.h>
#include <flint/nmod_mat.h>
#include <flint/fmpz_mat.h>
#include <flint/fq.h>
#include <flint/fq_poly.h>
#include <flint/fq_nmod.h>
#include <flint/fq_nmod_poly.h>
#include <flint/fq_nmod_mat.h>
#include "FLINTconvert.h"
Go to the source code of this file.
Macros | |
#define | Alloc(L) omAlloc(L) |
#define | Free(A, L) omFreeSize(A,L) |
Functions | |
void | convertCF2Fmpz (fmpz_t result, const CanonicalForm &f) |
conversion of a factory integer to fmpz_t More... | |
void | convertCF2initFmpz (fmpz_t result, const CanonicalForm &f) |
conversion of a factory integer to fmpz_t(init.) More... | |
void | convertFacCF2Fmpz_poly_t (fmpz_poly_t result, const CanonicalForm &f) |
conversion of a factory univariate polynomial over Z to a fmpz_poly_t More... | |
CanonicalForm | convertFmpz2CF (const fmpz_t coefficient) |
conversion of a FLINT integer to CanonicalForm More... | |
CanonicalForm | convertFmpz_poly_t2FacCF (const fmpz_poly_t poly, const Variable &x) |
conversion of a FLINT poly over Z to CanonicalForm More... | |
void | convertFacCF2nmod_poly_t (nmod_poly_t result, const CanonicalForm &f) |
conversion of a factory univariate polynomials over Z/p (for word size p) to nmod_poly_t More... | |
CanonicalForm | convertnmod_poly_t2FacCF (const nmod_poly_t poly, const Variable &x) |
conversion of a FLINT poly over Z/p to CanonicalForm More... | |
void | convertCF2Fmpq (fmpq_t result, const CanonicalForm &f) |
conversion of a factory rationals to fmpq_t More... | |
CanonicalForm | convertFmpq2CF (const fmpq_t q) |
conversion of a FLINT rational to CanonicalForm More... | |
CanonicalForm | convertFmpq_poly_t2FacCF (const fmpq_poly_t p, const Variable &x) |
conversion of a FLINT poly over Q to CanonicalForm More... | |
void | convertFacCF2Fmpz_array (fmpz *result, const CanonicalForm &f) |
void | convertFacCF2Fmpq_poly_t (fmpq_poly_t result, const CanonicalForm &f) |
conversion of a factory univariate polynomials over Q to fmpq_poly_t More... | |
CFFList | convertFLINTnmod_poly_factor2FacCFFList (const nmod_poly_factor_t fac, const mp_limb_t leadingCoeff, const Variable &x) |
conversion of a FLINT factorization over Z/p (for word size p) to a CFFList More... | |
CFFList | convertFLINTFq_nmod_poly_factor2FacCFFList (const fq_nmod_poly_factor_t fac, const Variable &x, const Variable &alpha, const fq_nmod_ctx_t fq_con) |
conversion of a FLINT factorization over Fq (for word size p) to a CFFList More... | |
void | convertFacCF2Fmpz_mod_poly_t (fmpz_mod_poly_t result, const CanonicalForm &f, const fmpz_t p) |
conversion of a factory univariate poly over Z to a FLINT poly over Z/p (for non word size p) More... | |
CanonicalForm | convertFmpz_mod_poly_t2FacCF (const fmpz_mod_poly_t poly, const Variable &x, const modpk &b) |
conversion of a FLINT poly over Z/p (for non word size p) to a CanonicalForm over Z More... | |
void | convertFacCF2Fq_nmod_t (fq_nmod_t result, const CanonicalForm &f, const fq_nmod_ctx_t ctx) |
conversion of a factory element of F_q to a FLINT fq_nmod_t, does not do any memory allocation for poly More... | |
CanonicalForm | convertFq_nmod_t2FacCF (const fq_nmod_t poly, const Variable &alpha, const fq_nmod_ctx_t) |
conversion of a FLINT element of F_q to a CanonicalForm with alg. variable alpha More... | |
void | convertFacCF2Fq_t (fq_t result, const CanonicalForm &f, const fq_ctx_t ctx) |
conversion of a factory element of F_q (for non-word size p) to a FLINT fq_t More... | |
CanonicalForm | convertFq_t2FacCF (const fq_t poly, const Variable &alpha) |
conversion of a FLINT element of F_q with non-word size p to a CanonicalForm with alg. variable alpha More... | |
void | convertFacCF2Fq_poly_t (fq_poly_t result, const CanonicalForm &f, const fq_ctx_t ctx) |
conversion of a factory univariate poly over F_q (for non-word size p) to a FLINT fq_poly_t More... | |
void | convertFacCF2Fq_nmod_poly_t (fq_nmod_poly_t result, const CanonicalForm &f, const fq_nmod_ctx_t ctx) |
conversion of a factory univariate poly over F_q to a FLINT fq_nmod_poly_t More... | |
CanonicalForm | convertFq_poly_t2FacCF (const fq_poly_t p, const Variable &x, const Variable &alpha, const fq_ctx_t ctx) |
conversion of a FLINT poly over Fq (for non-word size p) to a CanonicalForm with alg. variable alpha and polynomial variable x More... | |
CanonicalForm | convertFq_nmod_poly_t2FacCF (const fq_nmod_poly_t p, const Variable &x, const Variable &alpha, const fq_nmod_ctx_t ctx) |
conversion of a FLINT poly over Fq to a CanonicalForm with alg. variable alpha and polynomial variable x More... | |
void | convertFacCFMatrix2Fmpz_mat_t (fmpz_mat_t M, const CFMatrix &m) |
conversion of a factory matrix over Z to a fmpz_mat_t More... | |
CFMatrix * | convertFmpz_mat_t2FacCFMatrix (const fmpz_mat_t m) |
conversion of a FLINT matrix over Z to a factory matrix More... | |
void | convertFacCFMatrix2nmod_mat_t (nmod_mat_t M, const CFMatrix &m) |
conversion of a factory matrix over Z/p to a nmod_mat_t More... | |
CFMatrix * | convertNmod_mat_t2FacCFMatrix (const nmod_mat_t m) |
conversion of a FLINT matrix over Z/p to a factory matrix More... | |
void | convertFacCFMatrix2Fq_nmod_mat_t (fq_nmod_mat_t M, const fq_nmod_ctx_t fq_con, const CFMatrix &m) |
conversion of a factory matrix over F_q to a fq_nmod_mat_t More... | |
CFMatrix * | convertFq_nmod_mat_t2FacCFMatrix (const fq_nmod_mat_t m, const fq_nmod_ctx_t &fq_con, const Variable &alpha) |
conversion of a FLINT matrix over F_q to a factory matrix More... | |
This file implements functions for conversion to FLINT (www.flintlib.org) and back.
Definition in file FLINTconvert.cc.
#define Alloc | ( | L | ) | omAlloc(L) |
Definition at line 28 of file FLINTconvert.cc.
#define Free | ( | A, | |
L | |||
) | omFreeSize(A,L) |
Definition at line 29 of file FLINTconvert.cc.
void convertCF2Fmpq | ( | fmpq_t | result, |
const CanonicalForm & | f | ||
) |
conversion of a factory rationals to fmpq_t
[in,out] | result | an fmpq_t |
[in] | f | a CanonicalForm wrapping a rational |
Definition at line 223 of file FLINTconvert.cc.
void convertCF2Fmpz | ( | fmpz_t | result, |
const CanonicalForm & | f | ||
) |
conversion of a factory integer to fmpz_t
[out] | result | an fmpz_t |
[in] | f | a CanonicalForm wrapping an integer |
Definition at line 116 of file FLINTconvert.cc.
void convertCF2initFmpz | ( | fmpz_t | result, |
const CanonicalForm & | f | ||
) |
conversion of a factory integer to fmpz_t(init.)
[in,out] | result | an fmpz_t |
[in] | f | a CanonicalForm wrapping an integer |
Definition at line 131 of file FLINTconvert.cc.
void convertFacCF2Fmpq_poly_t | ( | fmpq_poly_t | result, |
const CanonicalForm & | f | ||
) |
conversion of a factory univariate polynomials over Q to fmpq_poly_t
[in,out] | result | an fmpq_poly_t |
[in] | f | univariate poly over Q |
Definition at line 322 of file FLINTconvert.cc.
void convertFacCF2Fmpz_array | ( | fmpz * | result, |
const CanonicalForm & | f | ||
) |
Definition at line 316 of file FLINTconvert.cc.
void convertFacCF2Fmpz_mod_poly_t | ( | fmpz_mod_poly_t | result, |
const CanonicalForm & | f, | ||
const fmpz_t | p | ||
) |
conversion of a factory univariate poly over Z to a FLINT poly over Z/p (for non word size p)
[in,out] | result | fmpz_mod_poly_t |
[in] | f | univariate poly over Z |
[in] | p | some integer p |
Definition at line 399 of file FLINTconvert.cc.
void convertFacCF2Fmpz_poly_t | ( | fmpz_poly_t | result, |
const CanonicalForm & | f | ||
) |
conversion of a factory univariate polynomial over Z to a fmpz_poly_t
[in,out] | result | an fmpz_poly_t |
[in] | f | univariate poly over Z |
Definition at line 147 of file FLINTconvert.cc.
void convertFacCF2Fq_nmod_poly_t | ( | fq_nmod_poly_t | result, |
const CanonicalForm & | f, | ||
const fq_nmod_ctx_t | ctx | ||
) |
conversion of a factory univariate poly over F_q to a FLINT fq_nmod_poly_t
[in,out] | result | fq_nmod_poly_t |
[in] | f | univariate poly over Fq |
[in] | ctx | Fq context |
Definition at line 528 of file FLINTconvert.cc.
void convertFacCF2Fq_nmod_t | ( | fq_nmod_t | result, |
const CanonicalForm & | f, | ||
const fq_nmod_ctx_t | ctx | ||
) |
conversion of a factory element of F_q to a FLINT fq_nmod_t, does not do any memory allocation for poly
[in,out] | result | fq_nmod_t |
[in] | f | element of Fq |
[in] | ctx | Fq context |
Definition at line 444 of file FLINTconvert.cc.
void convertFacCF2Fq_poly_t | ( | fq_poly_t | result, |
const CanonicalForm & | f, | ||
const fq_ctx_t | ctx | ||
) |
conversion of a factory univariate poly over F_q (for non-word size p) to a FLINT fq_poly_t
[in,out] | result | fq_poly_t |
[in] | f | univariate poly over Fq |
[in] | ctx | Fq context |
Definition at line 511 of file FLINTconvert.cc.
void convertFacCF2Fq_t | ( | fq_t | result, |
const CanonicalForm & | f, | ||
const fq_ctx_t | ctx | ||
) |
conversion of a factory element of F_q (for non-word size p) to a FLINT fq_t
[in,out] | result | fq_t |
[in] | f | element of Fq |
[in] | ctx | Fq context |
Definition at line 487 of file FLINTconvert.cc.
void convertFacCF2nmod_poly_t | ( | nmod_poly_t | result, |
const CanonicalForm & | f | ||
) |
conversion of a factory univariate polynomials over Z/p (for word size p) to nmod_poly_t
[in,out] | result | a nmod_poly_t |
[in] | f | univariate poly over Z/p |
Definition at line 189 of file FLINTconvert.cc.
conversion of a factory matrix over Z to a fmpz_mat_t
[in,out] | M | fmpz_mat_t |
[in] | m | matrix over Z |
Definition at line 587 of file FLINTconvert.cc.
void convertFacCFMatrix2Fq_nmod_mat_t | ( | fq_nmod_mat_t | M, |
const fq_nmod_ctx_t | fq_con, | ||
const CFMatrix & | m | ||
) |
conversion of a factory matrix over F_q to a fq_nmod_mat_t
[in,out] | M | fq_nmod_mat_t |
[in] | fq_con | Fq context |
[in] | m | matrix over Fq |
Definition at line 648 of file FLINTconvert.cc.
conversion of a factory matrix over Z/p to a nmod_mat_t
[in,out] | M | nmod_mat_t |
[in] | m | matrix over Z/p |
Definition at line 614 of file FLINTconvert.cc.
CFFList convertFLINTFq_nmod_poly_factor2FacCFFList | ( | const fq_nmod_poly_factor_t | fac, |
const Variable & | x, | ||
const Variable & | alpha, | ||
const fq_nmod_ctx_t | fq_con | ||
) |
conversion of a FLINT factorization over Fq (for word size p) to a CFFList
[in] | fac | fq_nmod_poly_factor_t |
[in] | x | polynomial variable |
[in] | alpha | algebraic variable |
[in] | fq_con | Fq context |
Definition at line 381 of file FLINTconvert.cc.
CFFList convertFLINTnmod_poly_factor2FacCFFList | ( | const nmod_poly_factor_t | fac, |
const mp_limb_t | leadingCoeff, | ||
const Variable & | x | ||
) |
conversion of a FLINT factorization over Z/p (for word size p) to a CFFList
[in] | fac | a nmod_poly_factor_t |
[in] | leadingCoeff | leading coefficient |
[in] | x | variable the result should have |
Definition at line 339 of file FLINTconvert.cc.
CanonicalForm convertFmpq2CF | ( | const fmpq_t | q | ) |
conversion of a FLINT rational to CanonicalForm
Definition at line 254 of file FLINTconvert.cc.
CanonicalForm convertFmpq_poly_t2FacCF | ( | const fmpq_poly_t | p, |
const Variable & | x | ||
) |
conversion of a FLINT poly over Q to CanonicalForm
[in] | p | an fmpq_poly_t |
[in] | x | variable the result should have |
Definition at line 296 of file FLINTconvert.cc.
CanonicalForm convertFmpz2CF | ( | const fmpz_t | coefficient | ) |
conversion of a FLINT integer to CanonicalForm
[in] | coefficient | a FLINT integer |
Definition at line 155 of file FLINTconvert.cc.
conversion of a FLINT matrix over Z to a factory matrix
[in] | m | fmpz_mat_t |
Definition at line 600 of file FLINTconvert.cc.
CanonicalForm convertFmpz_mod_poly_t2FacCF | ( | const fmpz_mod_poly_t | poly, |
const Variable & | x, | ||
const modpk & | b | ||
) |
conversion of a FLINT poly over Z/p (for non word size p) to a CanonicalForm over Z
[in] | poly | fmpz_mod_poly_t |
[in] | x | variable the result should have |
[in] | b | coeff bound to map coeffs in (-p/2,p/2) |
Definition at line 421 of file FLINTconvert.cc.
CanonicalForm convertFmpz_poly_t2FacCF | ( | const fmpz_poly_t | poly, |
const Variable & | x | ||
) |
conversion of a FLINT poly over Z to CanonicalForm
[in] | poly | an fmpz_poly_t |
[in] | x | variable the result should have |
Definition at line 175 of file FLINTconvert.cc.
CFMatrix * convertFq_nmod_mat_t2FacCFMatrix | ( | const fq_nmod_mat_t | m, |
const fq_nmod_ctx_t & | fq_con, | ||
const Variable & | alpha | ||
) |
conversion of a FLINT matrix over F_q to a factory matrix
[in] | m | fq_nmod_mat_t |
[in] | fq_con | Fq context |
[in] | alpha | algebraic variable |
Definition at line 663 of file FLINTconvert.cc.
CanonicalForm convertFq_nmod_poly_t2FacCF | ( | const fq_nmod_poly_t | p, |
const Variable & | x, | ||
const Variable & | alpha, | ||
const fq_nmod_ctx_t | ctx | ||
) |
conversion of a FLINT poly over Fq to a CanonicalForm with alg. variable alpha and polynomial variable x
[in] | p | fq_nmod_poly_t |
[in] | x | polynomial var. |
[in] | alpha | algebraic var. |
[in] | ctx | Fq context |
Definition at line 566 of file FLINTconvert.cc.
CanonicalForm convertFq_nmod_t2FacCF | ( | const fq_nmod_t | poly, |
const Variable & | alpha, | ||
const | fq_nmod_ctx_t | ||
) |
conversion of a FLINT element of F_q to a CanonicalForm with alg. variable alpha
[in] | poly | fq_nmod_t |
[in] | alpha | algebraic variable |
[in] | fq_nmod_ctx_t | context |
Definition at line 481 of file FLINTconvert.cc.
CanonicalForm convertFq_poly_t2FacCF | ( | const fq_poly_t | p, |
const Variable & | x, | ||
const Variable & | alpha, | ||
const fq_ctx_t | ctx | ||
) |
conversion of a FLINT poly over Fq (for non-word size p) to a CanonicalForm with alg. variable alpha and polynomial variable x
[in] | p | fq_poly_t |
[in] | x | polynomial variable |
[in] | alpha | algebraic variable |
[in] | ctx | Fq context |
Definition at line 545 of file FLINTconvert.cc.
CanonicalForm convertFq_t2FacCF | ( | const fq_t | poly, |
const Variable & | alpha | ||
) |
conversion of a FLINT element of F_q with non-word size p to a CanonicalForm with alg. variable alpha
[in] | poly | fq_t |
[in] | alpha | algebraic variable |
Definition at line 505 of file FLINTconvert.cc.
conversion of a FLINT matrix over Z/p to a factory matrix
[in] | m | nmod_mat_t |
Definition at line 632 of file FLINTconvert.cc.
CanonicalForm convertnmod_poly_t2FacCF | ( | const nmod_poly_t | poly, |
const Variable & | x | ||
) |
conversion of a FLINT poly over Z/p to CanonicalForm
[in] | poly | a nmod_poly_t |
[in] | x | variable the result should have |
Definition at line 211 of file FLINTconvert.cc.