adjust some matrix cutoffs

This commit is contained in:
fredrik 2018-09-04 15:27:37 +02:00
parent ba9497c28d
commit 0a56d139e1
6 changed files with 20 additions and 11 deletions

View file

@ -68,7 +68,7 @@ acb_mat_mul(acb_mat_t C, const acb_mat_t A, const acb_mat_t B, slong prec)
n = FLINT_MIN(ar, ac);
n = FLINT_MIN(ac, bc);
if (n >= 5)
if (n >= 20)
{
abits = acb_mat_bits(A);
bbits = acb_mat_bits(B);

View file

@ -99,7 +99,7 @@ void
acb_mat_solve_tril(acb_mat_t X, const acb_mat_t L,
const acb_mat_t B, int unit, slong prec)
{
if (B->r < 8 || B->c < 8)
if (B->r < 40 || B->c < 40)
acb_mat_solve_tril_classical(X, L, B, unit, prec);
else
acb_mat_solve_tril_recursive(X, L, B, unit, prec);

View file

@ -99,7 +99,7 @@ void
acb_mat_solve_triu(acb_mat_t X, const acb_mat_t U,
const acb_mat_t B, int unit, slong prec)
{
if (B->r < 8 || B->c < 8)
if (B->r < 40 || B->c < 40)
acb_mat_solve_triu_classical(X, U, B, unit, prec);
else
acb_mat_solve_triu_recursive(X, U, B, unit, prec);

View file

@ -14,12 +14,18 @@
void
arb_mat_mul(arb_mat_t C, const arb_mat_t A, const arb_mat_t B, slong prec)
{
if (arb_mat_nrows(A) >= 8 && arb_mat_ncols(A) >= 8 &&
arb_mat_ncols(B) >= 8)
{
arb_mat_mul_block(C, A, B, prec);
}
slong cutoff;
/* todo: detect small-integer matrices */
if (prec <= 2 * FLINT_BITS)
cutoff = 60;
else if (prec <= 8 * FLINT_BITS)
cutoff = 50;
else
cutoff = 40;
if (arb_mat_nrows(A) <= cutoff || arb_mat_ncols(A) <= cutoff ||
arb_mat_ncols(B) <= cutoff)
{
if (flint_get_num_threads() > 1 &&
((double) arb_mat_nrows(A) *
@ -34,5 +40,8 @@ arb_mat_mul(arb_mat_t C, const arb_mat_t A, const arb_mat_t B, slong prec)
arb_mat_mul_classical(C, A, B, prec);
}
}
else
{
arb_mat_mul_block(C, A, B, prec);
}
}

View file

@ -99,7 +99,7 @@ void
arb_mat_solve_tril(arb_mat_t X, const arb_mat_t L,
const arb_mat_t B, int unit, slong prec)
{
if (B->r < 8 || B->c < 8)
if (B->r < 40 || B->c < 40)
arb_mat_solve_tril_classical(X, L, B, unit, prec);
else
arb_mat_solve_tril_recursive(X, L, B, unit, prec);

View file

@ -99,7 +99,7 @@ void
arb_mat_solve_triu(arb_mat_t X, const arb_mat_t U,
const arb_mat_t B, int unit, slong prec)
{
if (B->r < 8 || B->c < 8)
if (B->r < 40 || B->c < 40)
arb_mat_solve_triu_classical(X, U, B, unit, prec);
else
arb_mat_solve_triu_recursive(X, U, B, unit, prec);