Fixed unit tests compiling on windows

release/4.3a0
Richard Roberts 2013-08-12 16:25:13 +00:00
parent 87a7c56c88
commit 7a027be7e5
4 changed files with 31 additions and 31 deletions

View File

@ -73,7 +73,7 @@ Values BatchOptimize(const NonlinearFactorGraph& graph, const Values& theta, int
/* ************************************************************************* */ /* ************************************************************************* */
TEST( ConcurrentIncrementalSmoother, equals ) TEST( ConcurrentIncrementalSmootherDL, equals )
{ {
// TODO: Test 'equals' more vigorously // TODO: Test 'equals' more vigorously
@ -99,7 +99,7 @@ TEST( ConcurrentIncrementalSmoother, equals )
} }
/* ************************************************************************* */ /* ************************************************************************* */
TEST( ConcurrentIncrementalSmoother, getFactors ) TEST( ConcurrentIncrementalSmootherDL, getFactors )
{ {
// Create a Concurrent Batch Smoother // Create a Concurrent Batch Smoother
ISAM2Params parameters; ISAM2Params parameters;
@ -150,7 +150,7 @@ TEST( ConcurrentIncrementalSmoother, getFactors )
} }
/* ************************************************************************* */ /* ************************************************************************* */
TEST( ConcurrentIncrementalSmoother, getLinearizationPoint ) TEST( ConcurrentIncrementalSmootherDL, getLinearizationPoint )
{ {
// Create a Concurrent Batch Smoother // Create a Concurrent Batch Smoother
ISAM2Params parameters; ISAM2Params parameters;
@ -201,19 +201,19 @@ TEST( ConcurrentIncrementalSmoother, getLinearizationPoint )
} }
/* ************************************************************************* */ /* ************************************************************************* */
TEST( ConcurrentIncrementalSmoother, getOrdering ) TEST( ConcurrentIncrementalSmootherDL, getOrdering )
{ {
// TODO: Think about how to check ordering... // TODO: Think about how to check ordering...
} }
/* ************************************************************************* */ /* ************************************************************************* */
TEST( ConcurrentIncrementalSmoother, getDelta ) TEST( ConcurrentIncrementalSmootherDL, getDelta )
{ {
// TODO: Think about how to check ordering... // TODO: Think about how to check ordering...
} }
/* ************************************************************************* */ /* ************************************************************************* */
TEST( ConcurrentIncrementalSmoother, calculateEstimate ) TEST( ConcurrentIncrementalSmootherDL, calculateEstimate )
{ {
// Create a Concurrent Batch Smoother // Create a Concurrent Batch Smoother
ISAM2Params parameters; ISAM2Params parameters;
@ -287,7 +287,7 @@ TEST( ConcurrentIncrementalSmoother, calculateEstimate )
} }
/* ************************************************************************* */ /* ************************************************************************* */
TEST( ConcurrentIncrementalSmoother, update_empty ) TEST( ConcurrentIncrementalSmootherDL, update_empty )
{ {
// Create a set of optimizer parameters // Create a set of optimizer parameters
ISAM2Params parameters; ISAM2Params parameters;
@ -300,7 +300,7 @@ TEST( ConcurrentIncrementalSmoother, update_empty )
} }
/* ************************************************************************* */ /* ************************************************************************* */
TEST( ConcurrentIncrementalSmoother, update_multiple ) TEST( ConcurrentIncrementalSmootherDL, update_multiple )
{ {
// Create a Concurrent Batch Smoother // Create a Concurrent Batch Smoother
ISAM2Params parameters; ISAM2Params parameters;
@ -358,7 +358,7 @@ TEST( ConcurrentIncrementalSmoother, update_multiple )
} }
/* ************************************************************************* */ /* ************************************************************************* */
TEST( ConcurrentIncrementalSmoother, synchronize_empty ) TEST( ConcurrentIncrementalSmootherDL, synchronize_empty )
{ {
// Create a set of optimizer parameters // Create a set of optimizer parameters
ISAM2Params parameters; ISAM2Params parameters;
@ -388,7 +388,7 @@ TEST( ConcurrentIncrementalSmoother, synchronize_empty )
} }
/* ************************************************************************* */ /* ************************************************************************* */
TEST( ConcurrentIncrementalSmoother, synchronize_1 ) TEST( ConcurrentIncrementalSmootherDL, synchronize_1 )
{ {
// Create a set of optimizer parameters // Create a set of optimizer parameters
ISAM2Params parameters; ISAM2Params parameters;
@ -450,7 +450,7 @@ TEST( ConcurrentIncrementalSmoother, synchronize_1 )
/* ************************************************************************* */ /* ************************************************************************* */
TEST( ConcurrentIncrementalSmoother, synchronize_2 ) TEST( ConcurrentIncrementalSmootherDL, synchronize_2 )
{ {
// Create a set of optimizer parameters // Create a set of optimizer parameters
ISAM2Params parameters; ISAM2Params parameters;
@ -531,7 +531,7 @@ TEST( ConcurrentIncrementalSmoother, synchronize_2 )
/* ************************************************************************* */ /* ************************************************************************* */
TEST( ConcurrentIncrementalSmoother, synchronize_3 ) TEST( ConcurrentIncrementalSmootherDL, synchronize_3 )
{ {
// Create a set of optimizer parameters // Create a set of optimizer parameters
ISAM2Params parameters; ISAM2Params parameters;

View File

@ -73,7 +73,7 @@ Values BatchOptimize(const NonlinearFactorGraph& graph, const Values& theta, int
/* ************************************************************************* */ /* ************************************************************************* */
TEST( ConcurrentIncrementalSmoother, equals ) TEST( ConcurrentIncrementalSmootherGN, equals )
{ {
// TODO: Test 'equals' more vigorously // TODO: Test 'equals' more vigorously
@ -99,7 +99,7 @@ TEST( ConcurrentIncrementalSmoother, equals )
} }
/* ************************************************************************* */ /* ************************************************************************* */
TEST( ConcurrentIncrementalSmoother, getFactors ) TEST( ConcurrentIncrementalSmootherGN, getFactors )
{ {
// Create a Concurrent Batch Smoother // Create a Concurrent Batch Smoother
ISAM2Params parameters; ISAM2Params parameters;
@ -150,7 +150,7 @@ TEST( ConcurrentIncrementalSmoother, getFactors )
} }
/* ************************************************************************* */ /* ************************************************************************* */
TEST( ConcurrentIncrementalSmoother, getLinearizationPoint ) TEST( ConcurrentIncrementalSmootherGN, getLinearizationPoint )
{ {
// Create a Concurrent Batch Smoother // Create a Concurrent Batch Smoother
ISAM2Params parameters; ISAM2Params parameters;
@ -201,19 +201,19 @@ TEST( ConcurrentIncrementalSmoother, getLinearizationPoint )
} }
/* ************************************************************************* */ /* ************************************************************************* */
TEST( ConcurrentIncrementalSmoother, getOrdering ) TEST( ConcurrentIncrementalSmootherGN, getOrdering )
{ {
// TODO: Think about how to check ordering... // TODO: Think about how to check ordering...
} }
/* ************************************************************************* */ /* ************************************************************************* */
TEST( ConcurrentIncrementalSmoother, getDelta ) TEST( ConcurrentIncrementalSmootherGN, getDelta )
{ {
// TODO: Think about how to check ordering... // TODO: Think about how to check ordering...
} }
/* ************************************************************************* */ /* ************************************************************************* */
TEST( ConcurrentIncrementalSmoother, calculateEstimate ) TEST( ConcurrentIncrementalSmootherGN, calculateEstimate )
{ {
// Create a Concurrent Batch Smoother // Create a Concurrent Batch Smoother
ISAM2Params parameters; ISAM2Params parameters;
@ -287,7 +287,7 @@ TEST( ConcurrentIncrementalSmoother, calculateEstimate )
} }
/* ************************************************************************* */ /* ************************************************************************* */
TEST( ConcurrentIncrementalSmoother, update_empty ) TEST( ConcurrentIncrementalSmootherGN, update_empty )
{ {
// Create a set of optimizer parameters // Create a set of optimizer parameters
ISAM2Params parameters; ISAM2Params parameters;
@ -300,7 +300,7 @@ TEST( ConcurrentIncrementalSmoother, update_empty )
} }
/* ************************************************************************* */ /* ************************************************************************* */
TEST( ConcurrentIncrementalSmoother, update_multiple ) TEST( ConcurrentIncrementalSmootherGN, update_multiple )
{ {
// Create a Concurrent Batch Smoother // Create a Concurrent Batch Smoother
ISAM2Params parameters; ISAM2Params parameters;
@ -358,7 +358,7 @@ TEST( ConcurrentIncrementalSmoother, update_multiple )
} }
/* ************************************************************************* */ /* ************************************************************************* */
TEST( ConcurrentIncrementalSmoother, synchronize_empty ) TEST( ConcurrentIncrementalSmootherGN, synchronize_empty )
{ {
// Create a set of optimizer parameters // Create a set of optimizer parameters
ISAM2Params parameters; ISAM2Params parameters;
@ -388,7 +388,7 @@ TEST( ConcurrentIncrementalSmoother, synchronize_empty )
} }
/* ************************************************************************* */ /* ************************************************************************* */
TEST( ConcurrentIncrementalSmoother, synchronize_1 ) TEST( ConcurrentIncrementalSmootherGN, synchronize_1 )
{ {
// Create a set of optimizer parameters // Create a set of optimizer parameters
ISAM2Params parameters; ISAM2Params parameters;
@ -450,7 +450,7 @@ TEST( ConcurrentIncrementalSmoother, synchronize_1 )
/* ************************************************************************* */ /* ************************************************************************* */
TEST( ConcurrentIncrementalSmoother, synchronize_2 ) TEST( ConcurrentIncrementalSmootherGN, synchronize_2 )
{ {
// Create a set of optimizer parameters // Create a set of optimizer parameters
ISAM2Params parameters; ISAM2Params parameters;
@ -531,7 +531,7 @@ TEST( ConcurrentIncrementalSmoother, synchronize_2 )
/* ************************************************************************* */ /* ************************************************************************* */
TEST( ConcurrentIncrementalSmoother, synchronize_3 ) TEST( ConcurrentIncrementalSmootherGN, synchronize_3 )
{ {
// Create a set of optimizer parameters // Create a set of optimizer parameters
ISAM2Params parameters; ISAM2Params parameters;

View File

@ -165,17 +165,17 @@ namespace gtsam {
Vector err_wh_eq; Vector err_wh_eq;
err_wh_eq.resize(err_wh_inlier.rows()*2); err_wh_eq.resize(err_wh_inlier.rows()*2);
err_wh_eq << sqrt(p_inlier) * err_wh_inlier.array() , sqrt(p_outlier) * err_wh_outlier.array(); err_wh_eq << std::sqrt(p_inlier) * err_wh_inlier.array() , std::sqrt(p_outlier) * err_wh_outlier.array();
if (H){ if (H){
// stack Jacobians for the two indicators for each of the key // stack Jacobians for the two indicators for each of the key
Matrix H1_inlier = sqrt(p_inlier)*model_inlier_->Whiten(H1); Matrix H1_inlier = std::sqrt(p_inlier)*model_inlier_->Whiten(H1);
Matrix H1_outlier = sqrt(p_outlier)*model_outlier_->Whiten(H1); Matrix H1_outlier = std::sqrt(p_outlier)*model_outlier_->Whiten(H1);
Matrix H1_aug = gtsam::stack(2, &H1_inlier, &H1_outlier); Matrix H1_aug = gtsam::stack(2, &H1_inlier, &H1_outlier);
Matrix H2_inlier = sqrt(p_inlier)*model_inlier_->Whiten(H2); Matrix H2_inlier = std::sqrt(p_inlier)*model_inlier_->Whiten(H2);
Matrix H2_outlier = sqrt(p_outlier)*model_outlier_->Whiten(H2); Matrix H2_outlier = std::sqrt(p_outlier)*model_outlier_->Whiten(H2);
Matrix H2_aug = gtsam::stack(2, &H2_inlier, &H2_outlier); Matrix H2_aug = gtsam::stack(2, &H2_inlier, &H2_outlier);
(*H)[0].resize(H1_aug.rows(),H1_aug.cols()); (*H)[0].resize(H1_aug.rows(),H1_aug.cols());

View File

@ -104,7 +104,7 @@ TEST( BetweenFactorEM, EvaluateError)
Vector actual_err_wh_outlier = Vector_(3, actual_err_wh[3], actual_err_wh[4], actual_err_wh[5]); Vector actual_err_wh_outlier = Vector_(3, actual_err_wh[3], actual_err_wh[4], actual_err_wh[5]);
// in case of inlier, inlier-mode whitented error should be dominant // in case of inlier, inlier-mode whitented error should be dominant
assert(actual_err_wh_inlier.norm() > 1000.0*actual_err_wh_outlier.norm()); CHECK(actual_err_wh_inlier.norm() > 1000.0*actual_err_wh_outlier.norm());
cout << "Inlier test. norm of actual_err_wh_inlier, actual_err_wh_outlier: "<<actual_err_wh_inlier.norm()<<","<<actual_err_wh_outlier.norm()<<endl; cout << "Inlier test. norm of actual_err_wh_inlier, actual_err_wh_outlier: "<<actual_err_wh_inlier.norm()<<","<<actual_err_wh_outlier.norm()<<endl;
cout<<actual_err_wh[0]<<" "<<actual_err_wh[1]<<" "<<actual_err_wh[2]<<actual_err_wh[3]<<" "<<actual_err_wh[4]<<" "<<actual_err_wh[5]<<endl; cout<<actual_err_wh[0]<<" "<<actual_err_wh[1]<<" "<<actual_err_wh[2]<<actual_err_wh[3]<<" "<<actual_err_wh[4]<<" "<<actual_err_wh[5]<<endl;
@ -123,7 +123,7 @@ TEST( BetweenFactorEM, EvaluateError)
actual_err_wh_outlier = Vector_(3, actual_err_wh[3], actual_err_wh[4], actual_err_wh[5]); actual_err_wh_outlier = Vector_(3, actual_err_wh[3], actual_err_wh[4], actual_err_wh[5]);
// in case of outlier, outlier-mode whitented error should be dominant // in case of outlier, outlier-mode whitented error should be dominant
assert(actual_err_wh_inlier.norm() < 1000.0*actual_err_wh_outlier.norm()); CHECK(actual_err_wh_inlier.norm() < 1000.0*actual_err_wh_outlier.norm());
cout << "Outlier test. norm of actual_err_wh_inlier, actual_err_wh_outlier: "<<actual_err_wh_inlier.norm()<<","<<actual_err_wh_outlier<<endl; cout << "Outlier test. norm of actual_err_wh_inlier, actual_err_wh_outlier: "<<actual_err_wh_inlier.norm()<<","<<actual_err_wh_outlier<<endl;
cout<<actual_err_wh[0]<<" "<<actual_err_wh[1]<<" "<<actual_err_wh[2]<<actual_err_wh[3]<<" "<<actual_err_wh[4]<<" "<<actual_err_wh[5]<<endl; cout<<actual_err_wh[0]<<" "<<actual_err_wh[1]<<" "<<actual_err_wh[2]<<actual_err_wh[3]<<" "<<actual_err_wh[4]<<" "<<actual_err_wh[5]<<endl;