change few function parameters to const reference to improve preformance of TransformBtwRobot factors

release/4.3a0
Jing Dong 2014-07-18 15:59:14 -04:00
parent f4dc6a3a95
commit e06c2cfacc
2 changed files with 4 additions and 4 deletions

View File

@ -68,7 +68,7 @@ namespace gtsam {
/** Constructor */
TransformBtwRobotsUnaryFactor(Key key, const VALUE& measured, Key keyA, Key keyB,
const gtsam::Values valA, const gtsam::Values valB,
const gtsam::Values& valA, const gtsam::Values& valB,
const SharedGaussian& model) :
Base(cref_list_of<1>(key)), key_(key), measured_(measured), keyA_(keyA), keyB_(keyB),
model_(model){
@ -111,7 +111,7 @@ namespace gtsam {
/** implement functions needed to derive from Factor */
/* ************************************************************************* */
void setValAValB(const gtsam::Values valA, const gtsam::Values valB){
void setValAValB(const gtsam::Values& valA, const gtsam::Values& valB){
if ( (!valA.exists(keyA_)) && (!valB.exists(keyA_)) && (!valA.exists(keyB_)) && (!valB.exists(keyB_)) )
throw("something is wrong!");

View File

@ -77,7 +77,7 @@ namespace gtsam {
/** Constructor */
TransformBtwRobotsUnaryFactorEM(Key key, const VALUE& measured, Key keyA, Key keyB,
const gtsam::Values valA, const gtsam::Values valB,
const gtsam::Values& valA, const gtsam::Values& valB,
const SharedGaussian& model_inlier, const SharedGaussian& model_outlier,
const double prior_inlier, const double prior_outlier,
const bool flag_bump_up_near_zero_probs = false,
@ -132,7 +132,7 @@ namespace gtsam {
/** implement functions needed to derive from Factor */
/* ************************************************************************* */
void setValAValB(const gtsam::Values valA, const gtsam::Values valB){
void setValAValB(const gtsam::Values& valA, const gtsam::Values& valB){
if ( (!valA.exists(keyA_)) && (!valB.exists(keyA_)) && (!valA.exists(keyB_)) && (!valB.exists(keyB_)) )
throw("something is wrong!");