Update reconstructArt and unittest.
Fix buildMatrix bug.
This commit is contained in:
@@ -39,6 +39,23 @@ protected:
|
||||
}
|
||||
};
|
||||
|
||||
TEST_F(Reconstruction_Test, reconstructArt) {
|
||||
MatlabReader m("/home/sun/testData/reconstructArt.mat");
|
||||
auto data = m.read("data");
|
||||
auto dataAtt = m.read("dataAtt");
|
||||
auto dims = m.read("dims");
|
||||
auto receiverList = m.read("receiverList");
|
||||
auto res = m.read("res");
|
||||
auto senderList = m.read("senderList");
|
||||
auto SOS_IN_WATER = m.read("SOS_IN_WATER");
|
||||
auto f1 = m.read("f1");
|
||||
auto result = Recon::reconstructArt(data, dataAtt, dims, senderList, receiverList, res, SOS_IN_WATER[0]);
|
||||
for(size_t i=0; i<f1.getDataSize(); ++i)
|
||||
{
|
||||
EXPECT_DOUBLE_AE(f1[i], result.outSOS[i]);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(Reconstruction_Test, checkAndScale) {
|
||||
MatlabReader m("/home/sun/testData/buildMatrix.mat");
|
||||
auto i = m.read("i1");
|
||||
@@ -51,6 +68,34 @@ TEST_F(Reconstruction_Test, checkAndScale) {
|
||||
Recon::checkAndScale(sparse,b,1196032);
|
||||
}
|
||||
|
||||
TEST_F(Reconstruction_Test, buildMatrix) {
|
||||
MatlabReader m("/home/sun/testData/buildMatrix.mat");
|
||||
auto j1 = m.read("j1");
|
||||
auto i1 = m.read("i1");
|
||||
auto s1 = m.read("s1");
|
||||
auto dims = m.read("dims");
|
||||
auto receiverList = m.read("receiverList");
|
||||
auto potentialMap = m.read("potentialMap");
|
||||
auto senderList = m.read("senderList");
|
||||
auto res = m.read("res");
|
||||
auto result = Recon::buildMatrix(senderList, receiverList, res, dims, false, potentialMap);
|
||||
for(size_t i=0; i<i1.getDataSize(); ++i)
|
||||
{
|
||||
EXPECT_DOUBLE_AE(i1[i] - 1, result.M.getColVector()[i]);
|
||||
}
|
||||
|
||||
for(size_t i=0; i<j1.getDataSize(); ++i)
|
||||
{
|
||||
EXPECT_DOUBLE_AE(j1[i]- 1, result.M.getRowVector()[i]);
|
||||
}
|
||||
|
||||
for(size_t i=0; i<s1.getDataSize(); ++i)
|
||||
{
|
||||
EXPECT_DOUBLE_AE(s1[i], result.M.getValVector()[i]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
TEST_F(Reconstruction_Test, calculateMinimalMaximalTransducerPositions) {
|
||||
auto senderList = Aurora::Matrix::fromRawData(new double[6]{1, 2, 3, 1, 2, 4}, 3, 2);
|
||||
auto receiverList = Aurora::Matrix::fromRawData(new double[6]{1, 8, 3, 1, 2, 1}, 3, 2);
|
||||
|
||||
Reference in New Issue
Block a user