30 lines
713 B
Plaintext
30 lines
713 B
Plaintext
#include <gtest/gtest.h>
|
|
#include "test_header.cuh"
|
|
|
|
using namespace gfp;
|
|
|
|
bool test_gfp_elim(size_t rank, size_t rank_col, size_t nrows, size_t ncols, uint_fast32_t seed)
|
|
{
|
|
MatGFP rdc(rank, ncols);
|
|
rdc.randomize(rank_col, seed);
|
|
MatGFP mix(nrows, rank);
|
|
mix.randomize(seed);
|
|
MatGFP a = mix * rdc;
|
|
ElimResult res = a.gpu_elim();
|
|
MatGFP win(a, 0, 0, res.rank, a.width);
|
|
return rdc == win;
|
|
}
|
|
|
|
TEST(TestGFPMul, Small)
|
|
{
|
|
uint_fast32_t seed = 41921095;
|
|
EXPECT_TRUE(test_gfp_elim(5, 6, 7, 8, seed));
|
|
}
|
|
|
|
TEST(TestGFPMul, Mediem)
|
|
{
|
|
uint_fast32_t seed = 41921095;
|
|
EXPECT_TRUE(test_gfp_elim(50, 60, 70, 80, seed));
|
|
EXPECT_TRUE(test_gfp_elim(500, 600, 700, 800, seed));
|
|
}
|