Add hilbert unittest

This commit is contained in:
kradchen
2023-12-20 15:23:20 +08:00
parent cf247e7299
commit a89637fc44

View File

@@ -984,3 +984,16 @@ TEST_F(Function2D_Cuda_Test, std){
EXPECT_FLOAT_EQ(1.7321, fourDecimalRound(D.getValue(2))); EXPECT_FLOAT_EQ(1.7321, fourDecimalRound(D.getValue(2)));
} }
TEST_F(Function2D_Cuda_Test, hilbert) {
float* dataB = Aurora::random(2500);
B = Aurora::Matrix::fromRawData(dataB, 500, 5);
auto dD = B.toDeviceMatrix();
auto ret1 = Aurora::hilbert(B);
auto ret2 = Aurora::hilbert(dD);
for(unsigned int i=0; i<ret1.getDataSize(); ++i)
{
EXPECT_NEAR(ret1[i], ret2.getValue(i), 0.01);
}
}