Skip to content

Commit f4af61a

Browse files
add test for spatio ssm
rebase with master and conflict fix
1 parent f8d9c06 commit f4af61a

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

Testing/OptimizeTests/OptimizeTests.cpp

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,10 +696,38 @@ TEST(OptimizeTests, vtk_output) {
696696
for (int i = 0; i < values.size(); i++) {
697697
std::cerr << "Eigenvalue " << i << " : " << values[i] << "\n";
698698
}
699-
700699
// check the first mode of variation.
701700
// If Procrustes scaling is working, this should be small.
702701
// Otherwise it is quite large (>4000).
703702
double value = values[values.size() - 1];
704703
ASSERT_LT(value, 100);
705704
}
705+
706+
//---------------------------------------------------------------------------
707+
TEST(OptimizeTests, disentangled_spatiotemporal_test) {
708+
prep_temp("/optimize/disentangled_spatiotemporal", "disentangled_spatiotemporal_test");
709+
710+
std::remove("test1_particles/ID01_TIME01_world.particles");
711+
712+
Optimize app;
713+
ProjectHandle project = std::make_shared<Project>();
714+
ASSERT_TRUE(project->load("test1.xlsx"));
715+
OptimizeParameters params(project);
716+
ASSERT_TRUE(params.set_up_optimize(&app));
717+
bool runStatus = app.Run();
718+
719+
ASSERT_TRUE(runStatus);
720+
721+
// compute and test stats
722+
ParticleShapeStatistics stats;
723+
stats.ReadPointFiles("test1_analyze.xml");
724+
stats.ComputeModes();
725+
stats.PrincipalComponentProjections();
726+
727+
auto values = stats.Eigenvalues();
728+
for (int i = 0; i < values.size(); i++) {
729+
std::cerr << "Eigenvalue " << i << " : " << values[i] << "\n";
730+
}
731+
ASSERT_GT(values[values.size() - 1], 80000);
732+
ASSERT_LT(values[values.size() - 2], 200);
733+
}

0 commit comments

Comments
 (0)