Skip to content

Commit

Permalink
fix p*RankProfile API
Browse files Browse the repository at this point in the history
  • Loading branch information
ClementPernet committed Jun 11, 2019
1 parent 0b6d2b5 commit b7e4bc2
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 38 deletions.
48 changes: 24 additions & 24 deletions fflas-ffpack/interfaces/libs/ffpack.C
Original file line number Diff line number Diff line change
Expand Up @@ -593,10 +593,10 @@ pColumnEchelonForm_modular_double (const double p, const size_t M, const size_t
{
if (positive) {
Modular<double> F(p);
return pColumnEchelonForm(F,M,N,A,lda,P,Qt,transform,(enum FFPACK::FFPACK_LU_TAG)LuTag);
return pColumnEchelonForm(F,M,N,A,lda,P,Qt,transform,0,(enum FFPACK::FFPACK_LU_TAG)LuTag);
} else {
ModularBalanced<double> F(p);
return pColumnEchelonForm(F,M,N,A,lda,P,Qt,transform,(enum FFPACK::FFPACK_LU_TAG)LuTag);
return pColumnEchelonForm(F,M,N,A,lda,P,Qt,transform,0,(enum FFPACK::FFPACK_LU_TAG)LuTag);
}
}

Expand All @@ -610,10 +610,10 @@ pRowEchelonForm_modular_double (const double p, const size_t M, const size_t N,
{
if (positive) {
Modular<double> F(p);
return pRowEchelonForm(F,M,N,A,lda,P,Qt,transform,(enum FFPACK::FFPACK_LU_TAG)LuTag);
return pRowEchelonForm(F,M,N,A,lda,P,Qt,transform,0,(enum FFPACK::FFPACK_LU_TAG)LuTag);
} else {
ModularBalanced<double> F(p);
return pRowEchelonForm(F,M,N,A,lda,P,Qt,transform,(enum FFPACK::FFPACK_LU_TAG)LuTag);
return pRowEchelonForm(F,M,N,A,lda,P,Qt,transform,0,(enum FFPACK::FFPACK_LU_TAG)LuTag);
}
}

Expand All @@ -628,10 +628,10 @@ pReducedColumnEchelonForm_modular_double (const double p, const size_t M, const
{
if (positive) {
Modular<double> F(p);
return pReducedColumnEchelonForm(F,M,N,A,lda,P,Qt,transform,(enum FFPACK::FFPACK_LU_TAG)LuTag);
return pReducedColumnEchelonForm(F,M,N,A,lda,P,Qt,transform,0,(enum FFPACK::FFPACK_LU_TAG)LuTag);
} else {
ModularBalanced<double> F(p);
return pReducedColumnEchelonForm(F,M,N,A,lda,P,Qt,transform,(enum FFPACK::FFPACK_LU_TAG)LuTag);
return pReducedColumnEchelonForm(F,M,N,A,lda,P,Qt,transform,0,(enum FFPACK::FFPACK_LU_TAG)LuTag);
}
}

Expand All @@ -646,10 +646,10 @@ pReducedRowEchelonForm_modular_double (const double p, const size_t M, const siz
{
if (positive) {
Modular<double> F(p);
return pReducedRowEchelonForm(F,M,N,A,lda,P,Qt,transform,(enum FFPACK::FFPACK_LU_TAG)LuTag);
return pReducedRowEchelonForm(F,M,N,A,lda,P,Qt,transform,0,(enum FFPACK::FFPACK_LU_TAG)LuTag);
} else {
ModularBalanced<double> F(p);
return pReducedRowEchelonForm(F,M,N,A,lda,P,Qt,transform,(enum FFPACK::FFPACK_LU_TAG)LuTag);
return pReducedRowEchelonForm(F,M,N,A,lda,P,Qt,transform,0,(enum FFPACK::FFPACK_LU_TAG)LuTag);
}
}

Expand All @@ -662,10 +662,10 @@ pColumnEchelonForm_modular_float (const float p, const size_t M, const size_t N,
{
if (positive) {
Modular<float> F(p);
return pColumnEchelonForm(F,M,N,A,lda,P,Qt,transform,(enum FFPACK::FFPACK_LU_TAG)LuTag);
return pColumnEchelonForm(F,M,N,A,lda,P,Qt,transform,0,(enum FFPACK::FFPACK_LU_TAG)LuTag);
} else {
ModularBalanced<float> F(p);
return pColumnEchelonForm(F,M,N,A,lda,P,Qt,transform,(enum FFPACK::FFPACK_LU_TAG)LuTag);
return pColumnEchelonForm(F,M,N,A,lda,P,Qt,transform,0,(enum FFPACK::FFPACK_LU_TAG)LuTag);
}
}

Expand All @@ -679,10 +679,10 @@ pRowEchelonForm_modular_float (const float p, const size_t M, const size_t N,
{
if (positive) {
Modular<float> F(p);
return pRowEchelonForm(F,M,N,A,lda,P,Qt,transform,(enum FFPACK::FFPACK_LU_TAG)LuTag);
return pRowEchelonForm(F,M,N,A,lda,P,Qt,transform,0,(enum FFPACK::FFPACK_LU_TAG)LuTag);
} else {
ModularBalanced<float> F(p);
return pRowEchelonForm(F,M,N,A,lda,P,Qt,transform,(enum FFPACK::FFPACK_LU_TAG)LuTag);
return pRowEchelonForm(F,M,N,A,lda,P,Qt,transform,0,(enum FFPACK::FFPACK_LU_TAG)LuTag);
}
}

Expand All @@ -697,10 +697,10 @@ pReducedColumnEchelonForm_modular_float (const float p, const size_t M, const si
{
if (positive) {
Modular<float> F(p);
return pReducedColumnEchelonForm(F,M,N,A,lda,P,Qt,transform,(enum FFPACK::FFPACK_LU_TAG)LuTag);
return pReducedColumnEchelonForm(F,M,N,A,lda,P,Qt,0,transform,(enum FFPACK::FFPACK_LU_TAG)LuTag);
} else {
ModularBalanced<float> F(p);
return pReducedColumnEchelonForm(F,M,N,A,lda,P,Qt,transform,(enum FFPACK::FFPACK_LU_TAG)LuTag);
return pReducedColumnEchelonForm(F,M,N,A,lda,P,Qt,0,transform,(enum FFPACK::FFPACK_LU_TAG)LuTag);
}
}

Expand All @@ -715,10 +715,10 @@ pReducedRowEchelonForm_modular_float (const float p, const size_t M, const size_
{
if (positive) {
Modular<float> F(p);
return pReducedRowEchelonForm(F,M,N,A,lda,P,Qt,transform,(enum FFPACK::FFPACK_LU_TAG)LuTag);
return pReducedRowEchelonForm(F,M,N,A,lda,P,Qt,0,transform,(enum FFPACK::FFPACK_LU_TAG)LuTag);
} else {
ModularBalanced<float> F(p);
return pReducedRowEchelonForm(F,M,N,A,lda,P,Qt,transform,(enum FFPACK::FFPACK_LU_TAG)LuTag);
return pReducedRowEchelonForm(F,M,N,A,lda,P,Qt,0,transform,(enum FFPACK::FFPACK_LU_TAG)LuTag);
}
}

Expand All @@ -731,10 +731,10 @@ pColumnEchelonForm_modular_int32_t (const int32_t p, const size_t M, const size_
{
if (positive) {
Modular<int32_t> F(p);
return pColumnEchelonForm(F,M,N,A,lda,P,Qt,transform,(enum FFPACK::FFPACK_LU_TAG)LuTag);
return pColumnEchelonForm(F,M,N,A,lda,P,Qt,0,transform,(enum FFPACK::FFPACK_LU_TAG)LuTag);
} else {
ModularBalanced<int32_t> F(p);
return pColumnEchelonForm(F,M,N,A,lda,P,Qt,transform,(enum FFPACK::FFPACK_LU_TAG)LuTag);
return pColumnEchelonForm(F,M,N,A,lda,P,Qt,0,transform,(enum FFPACK::FFPACK_LU_TAG)LuTag);
}
}

Expand All @@ -748,10 +748,10 @@ pRowEchelonForm_modular_int32_t (const int32_t p, const size_t M, const size_t N
{
if (positive) {
Modular<int32_t> F(p);
return pRowEchelonForm(F,M,N,A,lda,P,Qt,transform,(enum FFPACK::FFPACK_LU_TAG)LuTag);
return pRowEchelonForm(F,M,N,A,lda,P,Qt,0,transform,(enum FFPACK::FFPACK_LU_TAG)LuTag);
} else {
ModularBalanced<int32_t> F(p);
return pRowEchelonForm(F,M,N,A,lda,P,Qt,transform,(enum FFPACK::FFPACK_LU_TAG)LuTag);
return pRowEchelonForm(F,M,N,A,lda,P,Qt,0,transform,(enum FFPACK::FFPACK_LU_TAG)LuTag);
}
}

Expand All @@ -766,10 +766,10 @@ pReducedColumnEchelonForm_modular_int32_t (const int32_t p, const size_t M, cons
{
if (positive) {
Modular<int32_t> F(p);
return pReducedColumnEchelonForm(F,M,N,A,lda,P,Qt,transform,(enum FFPACK::FFPACK_LU_TAG)LuTag);
return pReducedColumnEchelonForm(F,M,N,A,lda,P,Qt,0,transform,(enum FFPACK::FFPACK_LU_TAG)LuTag);
} else {
ModularBalanced<int32_t> F(p);
return pReducedColumnEchelonForm(F,M,N,A,lda,P,Qt,transform,(enum FFPACK::FFPACK_LU_TAG)LuTag);
return pReducedColumnEchelonForm(F,M,N,A,lda,P,Qt,0,transform,(enum FFPACK::FFPACK_LU_TAG)LuTag);
}
}

Expand All @@ -784,10 +784,10 @@ pReducedRowEchelonForm_modular_int32_t (const int32_t p, const size_t M, const s
{
if (positive) {
Modular<int32_t> F(p);
return pReducedRowEchelonForm(F,M,N,A,lda,P,Qt,transform,(enum FFPACK::FFPACK_LU_TAG)LuTag);
return pReducedRowEchelonForm(F,M,N,A,lda,P,Qt,0,transform,(enum FFPACK::FFPACK_LU_TAG)LuTag);
} else {
ModularBalanced<int32_t> F(p);
return pReducedRowEchelonForm(F,M,N,A,lda,P,Qt,transform,(enum FFPACK::FFPACK_LU_TAG)LuTag);
return pReducedRowEchelonForm(F,M,N,A,lda,P,Qt,0,transform,(enum FFPACK::FFPACK_LU_TAG)LuTag);
}
}

Expand Down
28 changes: 14 additions & 14 deletions tests/test-rankprofiles.C
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ bool run_with_field(Givaro::Integer q, uint64_t b, size_t m, size_t n, size_t r,
if(!par)
FFPACK::RowRankProfile (*F, m, n, A, lda, RP1, FFPACK::FfpackSlabRecursive);
else
FFPACK::pRowRankProfile (*F, m, n, A, lda, RP1, FFPACK::FfpackSlabRecursive);
FFPACK::pRowRankProfile (*F, m, n, A, lda, RP1, 0, FFPACK::FfpackSlabRecursive);
fassign (*F, m, n, B, lda, A, lda);
if(!par)
FFPACK::RowRankProfile (*F, m, n, A, lda, RP2, FFPACK::FfpackTileRecursive);
else
FFPACK::pRowRankProfile (*F, m, n, A, lda, RP2, FFPACK::FfpackTileRecursive);
FFPACK::pRowRankProfile (*F, m, n, A, lda, RP2, 0, FFPACK::FfpackTileRecursive);
for (size_t i=0; i<r; i++)
ok = ok && (RP1[i] == RP2[i]);
fflas_delete(RP1);
Expand All @@ -91,12 +91,12 @@ bool run_with_field(Givaro::Integer q, uint64_t b, size_t m, size_t n, size_t r,
if(!par)
FFPACK::ColumnRankProfile (*F, m, n, A, lda, RP1, FFPACK::FfpackSlabRecursive);
else
FFPACK::pColumnRankProfile (*F, m, n, A, lda, RP1, FFPACK::FfpackSlabRecursive);
FFPACK::pColumnRankProfile (*F, m, n, A, lda, RP1, 0, FFPACK::FfpackSlabRecursive);
fassign (*F, m, n, B, lda, A, lda);
if(!par)
FFPACK::ColumnRankProfile (*F, m, n, A, lda, RP2, FFPACK::FfpackTileRecursive);
else
FFPACK::pColumnRankProfile (*F, m, n, A, lda, RP2, FFPACK::FfpackTileRecursive);
FFPACK::pColumnRankProfile (*F, m, n, A, lda, RP2, 0, FFPACK::FfpackTileRecursive);

for (size_t i=0; i<r; i++)
ok = ok && (RP1[i] == RP2[i]);
Expand All @@ -119,12 +119,12 @@ bool run_with_field(Givaro::Integer q, uint64_t b, size_t m, size_t n, size_t r,
if(!par)
rr = FFPACK::ColumnRankProfile (*F, mm, nn, A, lda, RP1, FFPACK::FfpackSlabRecursive);
else
rr = FFPACK::pColumnRankProfile (*F, mm, nn, A, lda, RP1, FFPACK::FfpackSlabRecursive);
rr = FFPACK::pColumnRankProfile (*F, mm, nn, A, lda, RP1, 0, FFPACK::FfpackSlabRecursive);
fassign (*F, m, n, B, lda, A, lda);
if(!par)
FFPACK::RowRankProfile (*F, mm, nn, A, lda, RP2, FFPACK::FfpackSlabRecursive);
else
FFPACK::pRowRankProfile (*F, mm, nn, A, lda, RP2, FFPACK::FfpackSlabRecursive);
FFPACK::pRowRankProfile (*F, mm, nn, A, lda, RP2, 0, FFPACK::FfpackSlabRecursive);
size_t* RRP = fflas_new<size_t>(r);
size_t* CRP = fflas_new<size_t>(r);

Expand Down Expand Up @@ -154,23 +154,23 @@ bool run_with_field(Givaro::Integer q, uint64_t b, size_t m, size_t n, size_t r,
if(!par)
cs = FFPACK::ColumnRankProfile (*F, m, n, A, lda, CRPLUD, FFPACK::FfpackSlabRecursive);
else
cs = FFPACK::pColumnRankProfile (*F, m, n, A, lda, CRPLUD, FFPACK::FfpackSlabRecursive);
cs = FFPACK::pColumnRankProfile (*F, m, n, A, lda, CRPLUD, 0, FFPACK::FfpackSlabRecursive);
fassign (*F, m, n, B, lda, A, lda);
if(!par)
ct = FFPACK::ColumnRankProfile (*F, m, n, A, lda, CRPPLUQ, FFPACK::FfpackTileRecursive);
else
ct = FFPACK::pColumnRankProfile (*F, m, n, A, lda, CRPPLUQ, FFPACK::FfpackTileRecursive);
ct = FFPACK::pColumnRankProfile (*F, m, n, A, lda, CRPPLUQ, 0, FFPACK::FfpackTileRecursive);
fassign (*F, m, n, B, lda, A, lda);
size_t rs, rt;
if(!par)
rs = FFPACK::RowRankProfile (*F, m, n, A, lda, RRPLUD, FFPACK::FfpackSlabRecursive);
else
rs = FFPACK::pRowRankProfile (*F, m, n, A, lda, RRPLUD, FFPACK::FfpackSlabRecursive);
rs = FFPACK::pRowRankProfile (*F, m, n, A, lda, RRPLUD, 0, FFPACK::FfpackSlabRecursive);
fassign (*F, m, n, B, lda, A, lda);
if(!par)
rt = FFPACK::RowRankProfile (*F, m, n, A, lda, RRPPLUQ, FFPACK::FfpackTileRecursive);
else
rt = FFPACK::pRowRankProfile (*F, m, n, A, lda, RRPPLUQ, FFPACK::FfpackTileRecursive);
rt = FFPACK::pRowRankProfile (*F, m, n, A, lda, RRPPLUQ, 0, FFPACK::FfpackTileRecursive);
std::sort(CRP,CRP+r);
std::sort(RRP,RRP+r);
ok = ok && (cs==ct)&&(cs==rs)&&(cs==rt)&&(cs==r);
Expand Down Expand Up @@ -205,23 +205,23 @@ bool run_with_field(Givaro::Integer q, uint64_t b, size_t m, size_t n, size_t r,
if(!par)
cs= FFPACK::ColumnRankProfile (*F, n, n, A, lda, CRPLUD, FFPACK::FfpackSlabRecursive);
else
cs = FFPACK::pColumnRankProfile (*F, n, n, A, lda, CRPLUD, FFPACK::FfpackSlabRecursive);
cs = FFPACK::pColumnRankProfile (*F, n, n, A, lda, CRPLUD, 0, FFPACK::FfpackSlabRecursive);
fassign (*F, n, n, B, lda, A, lda);
if(!par)
ct = FFPACK::ColumnRankProfile (*F, n, n, A, lda, CRPPLUQ, FFPACK::FfpackTileRecursive);
else
ct = FFPACK::pColumnRankProfile (*F, n, n, A, lda, CRPPLUQ, FFPACK::FfpackTileRecursive);
ct = FFPACK::pColumnRankProfile (*F, n, n, A, lda, CRPPLUQ, 0, FFPACK::FfpackTileRecursive);
size_t rs, rt;
fassign (*F, n, n, B, lda, A, lda);
if(!par)
rs = FFPACK::RowRankProfile (*F, n, n, A, lda, RRPLUD, FFPACK::FfpackSlabRecursive);
else
rs = FFPACK::pRowRankProfile (*F, n, n, A, lda, RRPLUD, FFPACK::FfpackSlabRecursive);
rs = FFPACK::pRowRankProfile (*F, n, n, A, lda, RRPLUD, 0, FFPACK::FfpackSlabRecursive);
fassign (*F, n, n, B, lda, A, lda);
if(!par)
rt = FFPACK::RowRankProfile (*F, n, n, A, lda, RRPPLUQ, FFPACK::FfpackTileRecursive);
else
rt = FFPACK::pRowRankProfile (*F, n, n, A, lda, RRPPLUQ, FFPACK::FfpackTileRecursive);
rt = FFPACK::pRowRankProfile (*F, n, n, A, lda, RRPPLUQ, 0, FFPACK::FfpackTileRecursive);
std::sort(CRP,CRP+r);
std::sort(RRP,RRP+r);
ok = ok && (cs==ct) && (cs==rs) && (cs==rt) && (cs==r);
Expand Down

0 comments on commit b7e4bc2

Please sign in to comment.