Changeset 9c98c2 in git


Ignore:
Timestamp:
Feb 17, 2012, 11:12:16 AM (11 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
Children:
e785e9081044da918572223fdfab379044387182
Parents:
c2aeb9aa4f5b5bc845c3d83ce3c7ab67db049358
git-author:
Martin Lee <martinlee84@web.de>2012-02-17 11:12:16+01:00
git-committer:
Martin Lee <martinlee84@web.de>2012-04-04 14:42:26+02:00
Message:
chg: added conversion for univariate polys over Z/p for non word size p
Location:
factory
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • factory/FLINTconvert.cc

    rc2aeb9 r9c98c2  
    1616
    1717#include "canonicalform.h"
     18#include "fac_util.h"
    1819#include "cf_iter.h"
    1920#include "cf_factory.h"
     
    3536#include <fmpq.h>
    3637#include <fmpz_poly.h>
     38#include <fmpz_mod_poly.h>
    3739#include <nmod_poly.h>
    3840#include <fmpq_poly.h>
     
    270272}
    271273
    272 #endif
    273 
    274 
     274void
     275convertFacCF2Fmpz_mod_poly_t (fmpz_mod_poly_t result, const CanonicalForm& f,
     276                              const fmpz_t p)
     277{
     278  fmpz_mod_poly_init2 (result, p, degree (f) + 1);
     279  fmpz_poly_t buf;
     280  convertFacCF2Fmpz_poly_t (buf, f);
     281  fmpz_mod_poly_set_fmpz_poly (result, buf);
     282  fmpz_poly_clear (buf);
     283}
     284
     285CanonicalForm
     286convertFmpz_mod_poly_t2FacCF (fmpz_mod_poly_t poly, const Variable& x,
     287                              const modpk& b)
     288{
     289  fmpz_poly_t buf;
     290  fmpz_poly_init (buf);
     291  fmpz_mod_poly_get_fmpz_poly (buf, poly);
     292  CanonicalForm result= convertFmpz_poly_t2FacCF (buf, x);
     293  fmpz_poly_clear (buf);
     294  return b (result);
     295}
     296
     297#endif
     298
     299
  • factory/FLINTconvert.h

    rc2aeb9 r9c98c2  
    1717#include <config.h>
    1818#include "canonicalform.h"
     19#include "fac_util.h"
    1920
    2021#ifdef HAVE_FLINT
     
    2627#include <fmpq.h>
    2728#include <fmpz_poly.h>
     29#include <fmpz_mod_poly.h>
    2830#include <fmpq_poly.h>
    2931#include <nmod_poly.h>
     
    104106                                        );
    105107
     108/// conversion of a factory univariate poly over Z to a FLINT poly over
     109/// Z/p (for non word size p)
     110void
     111convertFacCF2Fmpz_mod_poly_t (
     112                          fmpz_mod_poly_t result, ///< [in,out] fmpz_mod_poly_t
     113                          const CanonicalForm& f, ///< [in] univariate poly over
     114                                                  ///< Z
     115                          const fmpz_t p          ///< [in] some integer p
     116                             );
     117
     118/// conversion of a FLINT poly over Z/p (for non word size p) to a CanonicalForm
     119/// over Z
     120CanonicalForm
     121convertFmpz_mod_poly_t2FacCF (
     122                          fmpz_mod_poly_t poly, ///< [in] fmpz_mod_poly_t
     123                          const Variable& x,    ///< [in] variable the result
     124                                                ///< should have
     125                          const modpk& b        ///< [in] coeff bound to map
     126                                                ///< coeffs in (-p/2,p/2)
     127                             );
     128
    106129#endif
    107130#endif
Note: See TracChangeset for help on using the changeset viewer.