Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
more accurate version of fmprb_poly_mullow_block (two full poly muls …
…for error bounds)
  • Loading branch information
fredrik-johansson committed Apr 15, 2014
1 parent bd46964 commit 8c71a3c
Show file tree
Hide file tree
Showing 7 changed files with 748 additions and 6 deletions.
6 changes: 6 additions & 0 deletions fmprb_poly.h
Expand Up @@ -223,6 +223,12 @@ void _fmprb_poly_mullow_block_scaled(fmprb_ptr z, fmprb_srcptr x, long xlen, fmp

void fmprb_poly_mullow_block_scaled(fmprb_poly_t res, const fmprb_poly_t poly1, const fmprb_poly_t poly2, long len, long prec);

void _fmprb_poly_mullow_block2(fmprb_ptr z, fmprb_srcptr x, long xlen,
fmprb_srcptr y, long ylen, long n, long prec);

void fmprb_poly_mullow_block2(fmprb_poly_t res, const fmprb_poly_t poly1,
const fmprb_poly_t poly2, long n, long prec);

void _fmprb_poly_mullow(fmprb_ptr C,
fmprb_srcptr A, long lenA,
fmprb_srcptr B, long lenB, long n, long prec);
Expand Down
9 changes: 9 additions & 0 deletions fmprb_poly/mullow.c
Expand Up @@ -28,6 +28,8 @@
#define BLOCK_CUTOFF 5
#define SCALE_CUTOFF 50

#define BLOCK2_CUTOFF 7

void
_fmprb_poly_mullow(fmprb_ptr res,
fmprb_srcptr poly1, long len1,
Expand All @@ -39,12 +41,19 @@ _fmprb_poly_mullow(fmprb_ptr res,
}
else
{
#if 0
if (n < BLOCK_CUTOFF || len1 < BLOCK_CUTOFF || len2 < BLOCK_CUTOFF)
_fmprb_poly_mullow_classical(res, poly1, len1, poly2, len2, n, prec);
else if (n < SCALE_CUTOFF || len1 < SCALE_CUTOFF || len2 < SCALE_CUTOFF)
_fmprb_poly_mullow_block(res, poly1, len1, poly2, len2, n, prec);
else
_fmprb_poly_mullow_block_scaled(res, poly1, len1, poly2, len2, n, prec);
#else
if (n < BLOCK2_CUTOFF || len1 < BLOCK2_CUTOFF || len2 < BLOCK2_CUTOFF)
_fmprb_poly_mullow_classical(res, poly1, len1, poly2, len2, n, prec);
else
_fmprb_poly_mullow_block2(res, poly1, len1, poly2, len2, n, prec);
#endif
}
}

Expand Down

0 comments on commit 8c71a3c

Please sign in to comment.