Fixed signed/unsigned warnings

release/4.3a0
Richard Roberts 2013-08-08 16:30:05 +00:00
parent 0726a5ffbc
commit 2925995d25
3 changed files with 6 additions and 6 deletions

View File

@ -26,7 +26,7 @@ namespace gtsam {
GaussianFactor(keys), info_(augmentedInformation) GaussianFactor(keys), info_(augmentedInformation)
{ {
// Check number of variables // Check number of variables
if(Base::keys_.size() != augmentedInformation.nBlocks() - 1) if((DenseIndex)Base::keys_.size() != augmentedInformation.nBlocks() - 1)
throw std::invalid_argument( throw std::invalid_argument(
"Error in HessianFactor constructor input. Number of provided keys plus\n" "Error in HessianFactor constructor input. Number of provided keys plus\n"
"one for the information vector must equal the number of provided matrix blocks."); "one for the information vector must equal the number of provided matrix blocks.");

View File

@ -387,9 +387,9 @@ void HessianFactor::updateATA(const HessianFactor& update, const Scatter& scatte
// Apply updates to the upper triangle // Apply updates to the upper triangle
gttic(update); gttic(update);
for(DenseIndex j2=0; j2<update.info_.nBlocks(); ++j2) { for(DenseIndex j2=0; j2<update.info_.nBlocks(); ++j2) {
DenseIndex slot2 = (j2 == update.size()) ? this->info_.nBlocks()-1 : slots[j2]; DenseIndex slot2 = (j2 == (DenseIndex)update.size()) ? this->info_.nBlocks()-1 : slots[j2];
for(DenseIndex j1=0; j1<=j2; ++j1) { for(DenseIndex j1=0; j1<=j2; ++j1) {
DenseIndex slot1 = (j1 == update.size()) ? this->info_.nBlocks()-1 : slots[j1]; DenseIndex slot1 = (j1 == (DenseIndex)update.size()) ? this->info_.nBlocks()-1 : slots[j1];
if(slot2 > slot1) if(slot2 > slot1)
info_(slot1, slot2).noalias() += update.info_(j1, j2); info_(slot1, slot2).noalias() += update.info_(j1, j2);
else if(slot1 > slot2) else if(slot1 > slot2)

View File

@ -39,11 +39,11 @@ namespace gtsam {
Base(keys), Ab_(augmentedMatrix) Base(keys), Ab_(augmentedMatrix)
{ {
// Check noise model dimension // Check noise model dimension
if(model && model->dim() != augmentedMatrix.rows()) if(model && (DenseIndex)model->dim() != augmentedMatrix.rows())
throw InvalidNoiseModel(augmentedMatrix.rows(), model->dim()); throw InvalidNoiseModel(augmentedMatrix.rows(), model->dim());
// Check number of variables // Check number of variables
if(Base::keys_.size() != augmentedMatrix.nBlocks() - 1) if((DenseIndex)Base::keys_.size() != augmentedMatrix.nBlocks() - 1)
throw std::invalid_argument( throw std::invalid_argument(
"Error in JacobianFactor constructor input. Number of provided keys plus\n" "Error in JacobianFactor constructor input. Number of provided keys plus\n"
"one for the RHS vector must equal the number of provided matrix blocks."); "one for the RHS vector must equal the number of provided matrix blocks.");