diff --git a/include/tudat/simulation/estimation_setup/observations.h b/include/tudat/simulation/estimation_setup/observations.h index 1029b1829..5f8af3a6c 100644 --- a/include/tudat/simulation/estimation_setup/observations.h +++ b/include/tudat/simulation/estimation_setup/observations.h @@ -576,7 +576,7 @@ class SingleObservationSet return computedObservationsVector; } - int getNumberOfFilteredObservations( ) const + unsigned int getNumberOfFilteredObservations( ) const { int numberFilteredObservations = 0; if ( filteredObservationSet_ != nullptr ) @@ -661,12 +661,12 @@ class SingleObservationSet residualCutOff = std::dynamic_pointer_cast< ObservationFilter< Eigen::VectorXd > >( observationFilter )->getFilterValue( ); } - for ( int j = 0 ; j < nbObservationsToTest ; j++ ) + for ( unsigned int j = 0 ; j < nbObservationsToTest ; j++ ) { Eigen::Matrix< ObservationScalarType, Eigen::Dynamic, 1 > singleObservationResidual = ( observationFilter->filterOut( ) ? residuals_.at( j ) : filteredObservationSet_->getResidual( j ) ); bool removeObservation = false; - for( int k = 0 ; k < singleObservationSize_ ; k++ ) + for( unsigned int k = 0 ; k < singleObservationSize_ ; k++ ) { if( ( !useOppositeCondition && ( std::fabs( singleObservationResidual[ k ] ) > residualCutOff[ k ] ) ) || ( useOppositeCondition && ( std::fabs( singleObservationResidual[ k ] ) <= residualCutOff[ k ] ) ) ) @@ -697,12 +697,12 @@ class SingleObservationSet absoluteValueCutOff = std::dynamic_pointer_cast< ObservationFilter< Eigen::VectorXd > >( observationFilter )->getFilterValue( ); } - for ( int j = 0 ; j < nbObservationsToTest ; j++ ) + for ( unsigned int j = 0 ; j < nbObservationsToTest ; j++ ) { Eigen::Matrix< ObservationScalarType, Eigen::Dynamic, 1 > singleObservation = ( observationFilter->filterOut( ) ? observations_.at( j ) : filteredObservationSet_->getObservation( j ) ); bool removeObservation = false; - for( int k = 0 ; k < singleObservationSize_ ; k++ ) + for( unsigned int k = 0 ; k < singleObservationSize_ ; k++ ) { if ( ( !useOppositeCondition && ( singleObservation[ k ] > absoluteValueCutOff[ k ] ) ) || ( useOppositeCondition && ( singleObservation[ k ] <= absoluteValueCutOff[ k ] ) ) ) @@ -720,7 +720,7 @@ class SingleObservationSet case epochs_filtering: { std::vector< double > filterEpochs = std::dynamic_pointer_cast< ObservationFilter< std::vector< double > > >( observationFilter )->getFilterValue( ); - for ( int j = 0 ; j < nbObservationsToTest ; j++ ) + for ( unsigned int j = 0 ; j < nbObservationsToTest ; j++ ) { TimeType singleObservationTime = ( observationFilter->filterOut( ) ? observationTimes_.at( j ) : filteredObservationSet_->getObservationTime( j ) ); if ( ( !useOppositeCondition && ( std::count( filterEpochs.begin( ), filterEpochs.end( ), singleObservationTime ) > 0 ) ) || @@ -734,7 +734,7 @@ class SingleObservationSet case time_bounds_filtering: { std::pair< double, double > timeBounds = std::dynamic_pointer_cast< ObservationFilter< std::pair< double, double > > >( observationFilter )->getFilterValue( ); - for ( int j = 0 ; j < nbObservationsToTest ; j++ ) + for ( unsigned int j = 0 ; j < nbObservationsToTest ; j++ ) { TimeType singleObservationTime = ( observationFilter->filterOut( ) ? observationTimes_.at( j ) : filteredObservationSet_->getObservationTime( j ) ); if ( ( !useOppositeCondition && ( ( singleObservationTime >= timeBounds.first ) && ( singleObservationTime <= timeBounds.second ) ) ) || @@ -774,10 +774,10 @@ class SingleObservationSet } // Check dependent variable values against cut-off value - for ( int j = 0 ; j < nbObservationsToTest ; j++ ) + for ( unsigned int j = 0 ; j < nbObservationsToTest ; j++ ) { bool removeObservation = false; - for( int k = 0 ; k < dependentVariableSize ; k++ ) + for( unsigned int k = 0 ; k < dependentVariableSize ; k++ ) { if( ( !useOppositeCondition && ( singleDependentVariableValues( j, k ) ) > dependentVariableCutOff[ k ] ) || ( useOppositeCondition && ( singleDependentVariableValues( j, k ) ) <= dependentVariableCutOff[ k ] ) ) @@ -1130,7 +1130,7 @@ std::vector< std::shared_ptr< SingleObservationSet< ObservationScalarType, TimeT { bool detectedStartSet = false; int indexObs = rawStartIndicesNewSets.at( rawStartIndicesNewSets.size( ) - 1 ); - while ( !detectedStartSet && indexObs < observationTimes.size( ) ) + while ( !detectedStartSet && indexObs < static_cast< int >( observationTimes.size( ) ) ) { if ( observationTimes.at( indexObs ) > currentTimeTag ) { diff --git a/tests/src/astro/orbit_determination/unitTestObservationsProcessing.cpp b/tests/src/astro/orbit_determination/unitTestObservationsProcessing.cpp index 70770f7bf..d12a64333 100644 --- a/tests/src/astro/orbit_determination/unitTestObservationsProcessing.cpp +++ b/tests/src/astro/orbit_determination/unitTestObservationsProcessing.cpp @@ -745,8 +745,8 @@ BOOST_AUTO_TEST_CASE( test_ObservationsFiltering ) Eigen::Matrix< double, Eigen::Dynamic, 1 > residualsStation2 = ( residualCutOffValue - 0.05 ) * Eigen::Matrix< double, Eigen::Dynamic, 1 >::Ones( nbRangeStation2, 1 ); unsigned int nbRangeStation3 = rangeObservationSets.at( 2 )->getNumberOfObservables( ); Eigen::Matrix< double, Eigen::Dynamic, 1 > residualsStation3 = ( residualCutOffValue - 0.05 ) * Eigen::Matrix< double, Eigen::Dynamic, 1 >::Ones( nbRangeStation3, 1 ); - int nbLargeResidualsStation3 = 0; - for ( int i = 0 ; i < nbRangeStation3 ; i++ ) + unsigned int nbLargeResidualsStation3 = 0; + for ( unsigned int i = 0 ; i < nbRangeStation3 ; i++ ) { if ( i%2 ) { @@ -845,7 +845,7 @@ BOOST_AUTO_TEST_CASE( test_ObservationsSplitting ) // Test splitting based on time tags - int indexSplitEpoch = int(numberOfObservations/3); + unsigned int indexSplitEpoch = static_cast< unsigned int >(numberOfObservations/3); std::vector< double > rangeObsTimes = baseTimeList.at( one_way_range ); double splitEpoch = rangeObsTimes.at( indexSplitEpoch ); std::vector< double > timeTags = { rangeObsTimes.at( 0 ), splitEpoch, rangeObsTimes.back( ) }; diff --git a/tests/src/io/unitTestTrackingTxtFileReader.cpp b/tests/src/io/unitTestTrackingTxtFileReader.cpp index a4e0e8294..d8f1db41c 100644 --- a/tests/src/io/unitTestTrackingTxtFileReader.cpp +++ b/tests/src/io/unitTestTrackingTxtFileReader.cpp @@ -392,13 +392,13 @@ std::map stationPositionMap = getVlbiStationPositi std::cout< stationPositionMap2 = getVlbiStationPositions( ); std::cout<