From aef1534b26e4040b42fa84f92bf1a50213cb967f Mon Sep 17 00:00:00 2001 From: Emmanuel Christophe <emmanuel.christophe@orfeo-toolbox.org> Date: Fri, 22 Jul 2011 12:08:19 -0700 Subject: [PATCH] BUG: prefer prefix operators over postfix --- .../otbAngularProjectionBinaryImageFilter.txx | 8 ++-- .../otbBCOInterpolateImageFunction.txx | 22 ++++----- Code/BasicFilters/otbBandMathImageFilter.txx | 18 ++++---- .../otbBoxAndWhiskerImageFilter.txx | 4 +- .../otbComplexToVectorImageCastFilter.h | 2 +- .../otbConcatenateScalarValueImageFilter.h | 2 +- .../otbConcatenateVectorDataFilter.txx | 2 +- .../otbConnectedComponentMuParserFunctor.h | 4 +- .../otbDBOverlapDataNodeFeatureFunction.txx | 6 +-- Code/BasicFilters/otbDotProductImageFilter.h | 2 +- ...bEuclideanDistanceWithMissingValuePow2.txx | 4 +- Code/BasicFilters/otbFastICAImageFilter.txx | 6 +-- ...tICAInternalOptimizerVectorImageFilter.txx | 2 +- .../otbFlexibleDistanceWithMissingValue.txx | 4 +- .../otbHorizontalSobelVectorImageFilter.h | 2 +- .../otbImageAndVectorImageOperationFilter.h | 2 +- .../otbLabelObjectOpeningMuParserFilter.txx | 6 +-- .../otbLocalActivityVectorImageFilter.h | 6 +-- .../otbLocalGradientVectorImageFilter.h | 2 +- Code/BasicFilters/otbMNFImageFilter.txx | 18 ++++---- Code/BasicFilters/otbMaskMuParserFunctor.txx | 4 +- Code/BasicFilters/otbMatrixImageFilter.txx | 4 +- Code/BasicFilters/otbNAPCAImageFilter.txx | 2 +- .../otbNormalizeVectorImageFilter.h | 8 ++-- .../otbNormalizeVectorImageFilter.txx | 2 +- Code/BasicFilters/otbOBIAMuParserFunctor.h | 10 ++-- Code/BasicFilters/otbPCAImageFilter.txx | 18 ++++---- Code/BasicFilters/otbPrintableImageFilter.h | 2 +- Code/BasicFilters/otbPrintableImageFilter.txx | 2 +- .../otbProjectiveProjectionImageFilter.h | 4 +- ...ithNeighborhoodDataNodeFeatureFunction.txx | 8 ++-- .../BasicFilters/otbReliefColormapFunctor.txx | 2 +- Code/BasicFilters/otbSobelVectorImageFilter.h | 2 +- ...tbSpectralAngleDataNodeFeatureFunction.txx | 4 +- ...ryFunctorNeighborhoodVectorImageFilter.txx | 2 +- .../otbVectorDataToRandomLineGenerator.txx | 2 +- .../otbVerticalSobelVectorImageFilter.h | 2 +- Code/Common/otbCommandLineArgumentParser.cxx | 6 +-- Code/Common/otbDataNodeImageFunction.h | 4 +- Code/Common/otbDataNodeImageFunction.txx | 2 +- Code/Common/otbGamma.h | 4 +- .../otbGenericInterpolateImageFunction.txx | 2 +- Code/Common/otbLineSpatialObject.txx | 8 ++-- .../otbPolyLineParametricPathWithValue.txx | 6 +-- Code/Common/otbPolygon.txx | 8 ++-- Code/Common/otbPostGISTable.txx | 6 +-- .../otbSubsampledImageRegionConstIterator.txx | 12 ++--- .../otbVariableLengthVectorConverter.txx | 16 +++---- Code/Common/otbVectorDataExtractROI.txx | 4 +- Code/Common/otbVectorDataToImageFilter.txx | 4 +- .../otbImageToPathListAlignFilter.txx | 2 +- .../otbImageToSURFKeyPointSetFilter.txx | 10 ++-- .../otbLineSegmentDetector.txx | 2 +- .../Fuzzy/otbFuzzyDescriptorsModelManager.cxx | 6 +-- Code/Fuzzy/otbStandardDSCostFunction.txx | 4 +- ...ectorDataToDSValidatedVectorDataFilter.txx | 10 ++-- .../otbEigenvalueLikelihoodMaximisation.txx | 2 +- .../otbFCLSUnmixingImageFilter.txx | 4 +- .../otbISRAUnmixingImageFilter.txx | 4 +- .../otbLocalRxDetectorFilter.txx | 4 +- .../otbLocalRxDetectorNonThreadFilter.txx | 4 +- .../otbNCLSUnmixingImageFilter.txx | 4 +- .../otbSparseUnmixingImageFilter.txx | 4 +- .../otbUnConstrainedLeastSquareImageFilter.h | 4 +- Code/Hyperspectral/otbVcaImageFilter.txx | 2 +- Code/IO/otbGDALImageIO.cxx | 12 ++--- Code/IO/otbImageFileReader.txx | 2 +- Code/IO/otbImageToOSMVectorDataGenerator.txx | 4 +- Code/IO/otbKmzProductWriter.txx | 8 ++-- Code/IO/otbOGRIOHelper.cxx | 6 +-- Code/IO/otbOSMDataToVectorDataGenerator.cxx | 6 +-- Code/IO/otbScalarBufferToImageFileWriter.txx | 6 +-- Code/IO/otbSpectralSensitivityReader.cxx | 6 +-- Code/IO/otbTerraSarImageMetadataInterface.cxx | 22 ++++----- Code/IO/otbTileMapImageIO.cxx | 4 +- Code/IO/otbVectorDataAdapter.txx | 4 +- .../Learning/otbConfusionMatrixCalculator.txx | 2 +- .../otbExhaustiveExponentialOptimizer.cxx | 8 ++-- ...bGaussianAdditiveNoiseSampleListFilter.txx | 2 +- Code/Learning/otbSOMWithMissingValue.txx | 8 ++-- Code/Learning/otbSVMModel.txx | 4 +- .../otbMorphologicalPyramidSegmenter.txx | 2 +- Code/MultiScale/otbSubsampleImageFilter.txx | 10 ++-- Code/MultiScale/otbWaveletFilterBank.txx | 44 +++++++++--------- Code/MultiScale/otbWaveletOperatorBase.h | 2 +- Code/MultiScale/otbWaveletOperatorBase.txx | 8 ++-- Code/MultiScale/otbWaveletPacketTransform.txx | 8 ++-- Code/MultiScale/otbWaveletTransform.txx | 14 +++--- ...andsStatisticsAttributesLabelMapFilter.txx | 2 +- ...abelImageToLabelMapWithAdjacencyFilter.txx | 6 +-- Code/OBIA/otbLabelMapToGISTableFilter.txx | 2 +- Code/OBIA/otbLabelMapToVectorDataFilter.txx | 2 +- ...pWithClassLabelToClassLabelImageFilter.txx | 2 +- .../OBIA/otbShapeAttributesLabelMapFilter.txx | 46 +++++++++---------- .../otbStatisticsAttributesLabelMapFilter.txx | 22 ++++----- .../otbDescriptorsListSampleGenerator.h | 2 +- .../otbLabeledSampleLocalizationGenerator.txx | 6 +-- .../otbMultiChannelIFFactory.h | 2 +- .../otbObjectDetectionClassifier.h | 2 +- .../otbStatisticsXMLFileReader.txx | 4 +- .../otbStatisticsXMLFileWriter.txx | 4 +- .../otbGCPsToRPCSensorModelImageFilter.txx | 4 +- .../otbImageToGenericRSOutputParameters.txx | 4 +- .../otbVectorDataProjectionFilter.txx | 4 +- .../otbVectorDataTransformFilter.txx | 4 +- ...djacencyEffect6SCorrectionSchemeFilter.txx | 2 +- .../otbReciprocalHAlphaImageFilter.h | 6 +-- Code/Simulation/otbImageSimulationMethod.txx | 4 +- .../otbLabelMapToSimulatedImageFilter.txx | 6 +-- Code/Simulation/otbProspectModel.cxx | 2 +- Code/Simulation/otbSailModel.cxx | 10 ++-- Code/Simulation/otbSatelliteRSR.txx | 2 +- Code/Simulation/otbSpatialisationFilter.txx | 2 +- Code/Simulation/otbSpectralResponse.txx | 2 +- ...bSurfaceReflectanceToReflectanceFilter.txx | 2 +- Code/Testing/otbTestDriver.cxx | 2 +- Code/Testing/otbTestHelper.cxx | 8 ++-- .../OssimAdapters/otbAeronetFileReader.cxx | 2 +- Code/Visualization/otbCircleGlComponent.cxx | 2 +- Code/Visualization/otbCrossGlComponent.cxx | 2 +- Code/Visualization/otbCurves2DWidget.cxx | 4 +- .../otbGaussianRenderingFunction.h | 4 +- Code/Visualization/otbVectorDataModel.cxx | 2 +- .../BayesianPluginClassifier.cxx | 2 +- ...ationMaximizationMixtureModelEstimator.cxx | 6 +-- .../KdTreeBasedKMeansClustering.cxx | 4 +- .../ScalarImageKmeansClassifier.cxx | 2 +- .../ScalarImageMarkovRandomField1.cxx | 2 +- .../Mesh/PointSetWithVectors.cxx | 2 +- .../ExtractSegmentsByStepsExample.cxx | 2 +- .../ExtractSegmentsExample.cxx | 2 +- .../FlusserMomentsImageFunctionExample.cxx | 2 +- .../HuMomentsImageFunctionExample.cxx | 2 +- .../FeatureExtraction/SeamCarvingExample.cxx | 2 +- .../SeamCarvingOtherExample.cxx | 2 +- Examples/IO/ImageSeriesIOExample.cxx | 2 +- Examples/IO/MetadataExample.cxx | 10 ++-- .../ImageLinearIteratorWithIndex2.cxx | 2 +- Examples/Iterators/ImageRegionIterator.cxx | 2 +- .../Iterators/ImageSliceIteratorWithIndex.cxx | 2 +- Examples/Iterators/NeighborhoodIterators6.cxx | 2 +- .../Learning/SEMModelEstimatorExample.cxx | 2 +- Examples/Projections/SensorModelExample.cxx | 4 +- .../AtmosphericCorrectionSequencement.cxx | 8 ++-- .../otbAngularProjectionBinaryImageFilter.cxx | 2 +- .../BasicFilters/otbBandMathImageFilter.cxx | 2 +- .../otbBoxAndWhiskerImageFilter.cxx | 2 +- .../otbChangeLabelImageFilter.cxx | 2 +- .../otbConcatenateVectorDataFilter.cxx | 2 +- .../otbImagePCAShapeModelEstimatorTest.cxx | 8 ++-- .../otbInnerProductPCAImageFilter.cxx | 2 +- .../BasicFilters/otbMatrixImageFilterTest.cxx | 4 +- .../otbVectorImageToMatrixImageFilter.cxx | 4 +- .../Common/otbDrawLineSpatialObjectList.cxx | 2 +- Testing/Code/Common/otbDrawPathFilter.cxx | 4 +- Testing/Code/Common/otbDrawPathListFilter.cxx | 4 +- .../Common/otbDrawPathListFilterWithValue.cxx | 4 +- .../Code/Common/otbLineSpatialObjectList.cxx | 2 +- .../Code/Common/otbMultiChannelExtractROI.cxx | 18 ++++---- .../otbMultiToMonoChannelExtractROI.cxx | 12 ++--- .../otbPathListToHistogramGenerator.cxx | 2 +- .../Common/otbPolyLineImageConstIterator.cxx | 4 +- .../Code/Common/otbPolyLineImageIterator.cxx | 4 +- .../otbTestCommandLineArgumentParserList.cxx | 2 +- .../FeatureExtraction/otbAlignImageToPath.cxx | 2 +- .../otbBreakAngularPathListFilter.cxx | 6 +-- .../otbComplexMomentsImageFunction.cxx | 8 ++-- .../otbFlusserMomentsImageFunction.cxx | 6 +-- .../otbFourierMellinDescriptors.cxx | 12 ++--- .../FeatureExtraction/otbHarrisToPointSet.cxx | 2 +- .../otbHuMomentsImageFunction.cxx | 6 +-- .../otbImageFunctionAdaptor.cxx | 24 +++++----- .../otbImageToEdgePathFilter.cxx | 2 +- .../otbLikelihoodPathListFilter.cxx | 2 +- ...alObjectListToRightAnglePointSetFilter.cxx | 2 +- ...tAnglePointSetFilterByStepsOutputAscii.cxx | 2 +- .../otbLinkPathListFilter.cxx | 2 +- .../otbRadiometricMomentsImageFunction.cxx | 2 +- .../otbRealMomentsImageFunction.cxx | 4 +- .../otbRemoveTortuousPathListFilter.cxx | 2 +- .../otbSimplePointCountStrategyTest.cxx | 2 +- .../otbSimplifyPathListFilter.cxx | 2 +- .../otbThresholdImageToPointSetTest.cxx | 2 +- .../Code/Fuzzy/otbFuzzyVariableDSApplied.cxx | 2 +- .../Code/Fuzzy/otbJointMassOfBeliefFilter.cxx | 2 +- .../otbSparseUnmixingImageFilter.cxx | 2 +- .../IO/otbComplexImageManipulationTest.cxx | 2 +- .../IO/otbGDALImageIOTestWriteMetadata.cxx | 4 +- Testing/Code/IO/otbImageFileReaderMSTAR.cxx | 2 +- Testing/Code/IO/otbImageSeriesFileReader.cxx | 2 +- Testing/Code/IO/otbImageTest.cxx | 10 ++-- .../otbScalarBufferToImageFileWriterTest.cxx | 2 +- ...bVectorImageFileWriterTestWithoutInput.cxx | 8 ++-- ...ageStreamingFileWriterTestWithoutInput.cxx | 8 ++-- Testing/Code/IO/otbVectorImageTest.cxx | 10 ++-- .../otbConfusionMatrixCalculatorTest.cxx | 10 ++-- .../Learning/otbListSampleGeneratorTest.cxx | 4 +- ...otbSVMImageModelEstimatorModelAccessor.cxx | 12 ++--- Testing/Code/Learning/otbSVMModelAccessor.cxx | 10 ++-- .../otbSVMModelGenericKernelsTest.cxx | 2 +- .../Code/MultiScale/otbWaveletFilterBank.cxx | 2 +- ...imeSeriesLeastSquareFittingFunctorTest.cxx | 6 +-- ...esLeastSquareFittingFunctorWeightsTest.cxx | 6 +-- .../Projections/otbOssimElevManagerTest2.cxx | 2 +- ...arametersTo6SAtmosphericRadiativeTerms.cxx | 6 +-- .../otbAtmosphericCorrectionSequencement.cxx | 8 ++-- .../Radiometry/otbFilterFunctionValues.cxx | 14 +++--- .../otbImageToLuminanceImageFilter.cxx | 2 +- .../otbImageToReflectanceImageFilter.cxx | 2 +- ...nceToSurfaceReflectanceImageFilterTest.cxx | 2 +- ...ToRomaniaSurfaceReflectanceImageFilter.cxx | 4 +- ...SIXSTraitsComputeAtmosphericParameters.cxx | 4 +- ...djacencyEffect6SCorrectionSchemeFilter.cxx | 4 +- .../otbHermitianEigenAnalysisTest.cxx | 8 ++-- ...tbMuellerToReciprocalCovarianceFunctor.cxx | 2 +- ...AtmosphericCorrectionsRSRSVMClassifier.cxx | 18 ++++---- .../otbImageSimulationMethodKMeansClassif.cxx | 2 +- .../Code/Simulation/otbProspectReflTest.cxx | 2 +- .../Code/Simulation/otbProspectTransTest.cxx | 2 +- ...otbReduceSpectralResponseSVMClassifier.cxx | 18 ++++---- Testing/Code/Simulation/otbSailReflHTest.cxx | 2 +- Testing/Code/Simulation/otbSailReflVTest.cxx | 2 +- Testing/Code/Simulation/otbSatelliteRSR.cxx | 2 +- ...rfaceReflectanceToReflectanceFilterNew.cxx | 2 +- ...mageMultiSegmentationToRCC8GraphFilter.cxx | 2 +- .../otbImageToImageRCC8Calculator.cxx | 4 +- .../otbPolygonToPolygonRCC8Calculator.cxx | 4 +- ...tbCompareAsciiTestsEpsilon3_WhiteSpace.cxx | 2 +- Testing/Fa/MapActivation.cxx | 10 ++-- Testing/Fa/PolygonsVectorization.cxx | 4 +- 230 files changed, 601 insertions(+), 601 deletions(-) diff --git a/Code/BasicFilters/otbAngularProjectionBinaryImageFilter.txx b/Code/BasicFilters/otbAngularProjectionBinaryImageFilter.txx index 394150524f..d4a768bc27 100644 --- a/Code/BasicFilters/otbAngularProjectionBinaryImageFilter.txx +++ b/Code/BasicFilters/otbAngularProjectionBinaryImageFilter.txx @@ -82,7 +82,7 @@ AngularProjectionBinaryImageFilter< TInputImage, TOutputImage, TPrecision > { m_AngleSet = angle; this->SetNumberOfOutputs( angle.size() ); - for ( unsigned int i = 0; i < this->GetNumberOfOutputs(); i++ ) + for ( unsigned int i = 0; i < this->GetNumberOfOutputs(); ++i ) { this->SetNthOutput(i, OutputImageType::New()); } @@ -95,7 +95,7 @@ AngularProjectionBinaryImageFilter< TInputImage, TOutputImage, TPrecision > ::GenerateOutputInformation() { Superclass::GenerateOutputInformation(); - for (unsigned int i = 0; i < this->GetNumberOfOutputs(); i++) + for (unsigned int i = 0; i < this->GetNumberOfOutputs(); ++i) { this->GetOutput(i)->SetRegions( this->GetInput()->GetRequestedRegion()); @@ -124,7 +124,7 @@ AngularProjectionBinaryImageFilter< TInputImage, TOutputImage, TPrecision > std::vector< itk::ImageRegionIterator<OutputImageType> > outIter ( this->GetNumberOfOutputs() ); - for ( unsigned int i = 0; i < outIter.size(); i++ ) + for ( unsigned int i = 0; i < outIter.size(); ++i ) { outIter[i] = itk::ImageRegionIterator<OutputImageType> ( this->GetOutput(i), outputRegionForThread ); @@ -133,7 +133,7 @@ AngularProjectionBinaryImageFilter< TInputImage, TOutputImage, TPrecision > while ( !iter1.IsAtEnd() && !iter2.IsAtEnd() ) { - for ( unsigned int i = 0; i < outIter.size(); i++ ) + for ( unsigned int i = 0; i < outIter.size(); ++i ) { outIter[i].Set( vcl_cos( m_AngleSet[i] ) * iter1.Get() + vcl_sin( m_AngleSet[i] ) * iter2.Get() ); diff --git a/Code/BasicFilters/otbBCOInterpolateImageFunction.txx b/Code/BasicFilters/otbBCOInterpolateImageFunction.txx index 13abf1ed36..5ffd15d8f8 100644 --- a/Code/BasicFilters/otbBCOInterpolateImageFunction.txx +++ b/Code/BasicFilters/otbBCOInterpolateImageFunction.txx @@ -87,7 +87,7 @@ BCOInterpolateImageFunctionBase<TInputImage, TCoordRep> step = 4./static_cast<double>(2*radius); position = - double(radius) * step; - for ( int i = -radius; i <= radius; i++) + for ( int i = -radius; i <= radius; ++i) { // Compute the BCO coefficients according to alpha. dist = vcl_abs(position - offset*step); @@ -149,9 +149,9 @@ BCOInterpolateImageFunction<TInputImage, TCoordRep> baseIndex[dim] = itk::Math::Floor< IndexValueType >( index[dim]+0.5 ); } - for( int i = -radius; i <= radius; i++ ) + for( int i = -radius; i <= radius; ++i ) { - for( int j = -radius; j <= radius; j++ ) + for( int j = -radius; j <= radius; ++j ) { // get neighbor index neighIndex[0] = baseIndex[0] + i; @@ -214,10 +214,10 @@ BCOInterpolateImageFunction< otb::VectorImage<TPixel, VImageDimension> , TCoordR std::vector< std::vector< ScalarRealType > > lineRes; lineRes.resize(winSize); - for( unsigned int i = 0; i<winSize; i++) + for( unsigned int i = 0; i<winSize; ++i) { lineRes.at(i).resize(componentNumber); - for( unsigned int j = 0; j<componentNumber; j++) + for( unsigned int j = 0; j<componentNumber; ++j) { lineRes.at(i).at(j) = itk::NumericTraits<ScalarRealType>::Zero; } @@ -226,7 +226,7 @@ BCOInterpolateImageFunction< otb::VectorImage<TPixel, VImageDimension> , TCoordR std::vector< ScalarRealType > value; value.resize(componentNumber); - for( unsigned int j = 0; j<componentNumber; j++) + for( unsigned int j = 0; j<componentNumber; ++j) { value.at(j) = itk::NumericTraits<ScalarRealType>::Zero; } @@ -244,9 +244,9 @@ BCOInterpolateImageFunction< otb::VectorImage<TPixel, VImageDimension> , TCoordR baseIndex[dim] = itk::Math::Floor< IndexValueType >( index[dim]+0.5 ); } - for( int i = -radius; i <= radius; i++ ) + for( int i = -radius; i <= radius; ++i ) { - for( int j = -radius; j <= radius; j++ ) + for( int j = -radius; j <= radius; ++j ) { // get neighbor index neighIndex[0] = baseIndex[0] + i; @@ -270,13 +270,13 @@ BCOInterpolateImageFunction< otb::VectorImage<TPixel, VImageDimension> , TCoordR } #endif - for( unsigned int k = 0; k<componentNumber; k++) + for( unsigned int k = 0; k<componentNumber; ++k) { lineRes[i+radius].at(k) = lineRes[i+radius].at(k) + this->GetInputImage()->GetPixel( neighIndex ).GetElement(k) * BCOCoefY[j+radius]; } } - for( unsigned int k = 0; k<componentNumber; k++) + for( unsigned int k = 0; k<componentNumber; ++k) { value.at(k) += lineRes[i+radius].at(k)*BCOCoefX[i+radius]; } @@ -285,7 +285,7 @@ BCOInterpolateImageFunction< otb::VectorImage<TPixel, VImageDimension> , TCoordR norma = (vcl_log(static_cast<double>(radius))/vcl_log(2.0)); norma = norma * norma; - for( unsigned int k = 0; k<componentNumber; k++) + for( unsigned int k = 0; k<componentNumber; ++k) { output.SetElement(k, value.at(k)/norma); } diff --git a/Code/BasicFilters/otbBandMathImageFilter.txx b/Code/BasicFilters/otbBandMathImageFilter.txx index a831c7d173..1e7db97852 100644 --- a/Code/BasicFilters/otbBandMathImageFilter.txx +++ b/Code/BasicFilters/otbBandMathImageFilter.txx @@ -197,17 +197,17 @@ void BandMathImageFilter<TImage> *itParser = ParserType::New(); } - for(i = 0; i < nbThreads; i++) + for(i = 0; i < nbThreads; ++i) { m_AImage.at(i).resize(m_NbVar); m_VParser.at(i)->SetExpr(m_Expression); - for(j=0; j < nbInputImages; j++) + for(j=0; j < nbInputImages; ++j) { m_VParser.at(i)->DefineVar(m_VVarName.at(j), &(m_AImage.at(i).at(j))); } - for(j=nbInputImages; j < nbInputImages+nbAccessIndex; j++) + for(j=nbInputImages; j < nbInputImages+nbAccessIndex; ++j) { m_VVarName.at(j) = tmpIdxVarNames.at(j-nbInputImages); m_VParser.at(i)->DefineVar(m_VVarName.at(j), &(m_AImage.at(i).at(j))); @@ -226,7 +226,7 @@ void BandMathImageFilter<TImage> m_OverflowCount = 0; // Accumulate counts for each thread - for(i = 0; i < nbThreads; i++) + for(i = 0; i < nbThreads; ++i) { m_UnderflowCount += m_ThreadUnderflow[i]; m_OverflowCount += m_ThreadOverflow[i]; @@ -255,7 +255,7 @@ void BandMathImageFilter<TImage> std::vector< ImageRegionConstIteratorType > Vit; Vit.resize(nbInputImages); - for(j=0; j < nbInputImages; j++) + for(j=0; j < nbInputImages; ++j) { Vit[j] = ImageRegionConstIteratorType (this->GetNthInput(j), outputRegionForThread); } @@ -267,17 +267,17 @@ void BandMathImageFilter<TImage> while(!Vit.at(0).IsAtEnd()) { - for(j=0; j < nbInputImages; j++) + for(j=0; j < nbInputImages; ++j) { m_AImage.at(threadId).at(j) = static_cast<double>(Vit.at(j).Get()); } // Image Indexes - for(j=0; j < 2; j++) + for(j=0; j < 2; ++j) { m_AImage.at(threadId).at(nbInputImages+j) = static_cast<double>(Vit.at(0).GetIndex()[j]); } - for(j=0; j < 2; j++) + for(j=0; j < 2; ++j) { m_AImage.at(threadId).at(nbInputImages+2+j) = static_cast<double>(m_Origin[j]) +static_cast<double>(Vit.at(0).GetIndex()[j]) * static_cast<double>(m_Spacing[j]); @@ -311,7 +311,7 @@ void BandMathImageFilter<TImage> ot.Set(static_cast<PixelType>(value)); } - for(j=0; j < nbInputImages; j++) + for(j=0; j < nbInputImages; ++j) { ++(Vit.at(j)); } diff --git a/Code/BasicFilters/otbBoxAndWhiskerImageFilter.txx b/Code/BasicFilters/otbBoxAndWhiskerImageFilter.txx index 83d38a590d..7963719673 100644 --- a/Code/BasicFilters/otbBoxAndWhiskerImageFilter.txx +++ b/Code/BasicFilters/otbBoxAndWhiskerImageFilter.txx @@ -114,7 +114,7 @@ BoxAndWhiskerImageFilter <TInputImage> const unsigned int thirdQuartilePosition = (3 * vectorSize) / 4; VectorType data(vectorSize); - for (i = 0; i < vectorSize; i++) + for (i = 0; i < vectorSize; ++i) data[i] = pixel[i]; std::sort(data.begin(), data.end()); @@ -123,7 +123,7 @@ BoxAndWhiskerImageFilter <TInputImage> double median = ::fabs(static_cast<double>(data[medianPosition])); PixelType outputPixel(pixel); - for (i = 0; i < vectorSize; i++) + for (i = 0; i < vectorSize; ++i) { if (::fabs(static_cast<double>(outputPixel[i]) - box) > median) { diff --git a/Code/BasicFilters/otbComplexToVectorImageCastFilter.h b/Code/BasicFilters/otbComplexToVectorImageCastFilter.h index 8cc58abe71..b604c3d05f 100644 --- a/Code/BasicFilters/otbComplexToVectorImageCastFilter.h +++ b/Code/BasicFilters/otbComplexToVectorImageCastFilter.h @@ -74,7 +74,7 @@ public: TOutput output; output.SetSize( 2*A.Size() ); - for(unsigned int i=0; i<A.Size(); i++) + for(unsigned int i=0; i<A.Size(); ++i) { output[2*i] = static_cast<OutputValueType>(A[i].real()); output[2*i+1] = static_cast<OutputValueType>(A[i].imag()); diff --git a/Code/BasicFilters/otbConcatenateScalarValueImageFilter.h b/Code/BasicFilters/otbConcatenateScalarValueImageFilter.h index 50a6d2b9ff..e6424e46b2 100644 --- a/Code/BasicFilters/otbConcatenateScalarValueImageFilter.h +++ b/Code/BasicFilters/otbConcatenateScalarValueImageFilter.h @@ -66,7 +66,7 @@ public: OutputType operator ()(const InputType& in) { OutputType out(in.Size() + 1); - for (unsigned int j = 0; j < in.Size(); j++) + for (unsigned int j = 0; j < in.Size(); ++j) { out[j] = in[j]; } diff --git a/Code/BasicFilters/otbConcatenateVectorDataFilter.txx b/Code/BasicFilters/otbConcatenateVectorDataFilter.txx index 6be967140b..efe82d04e6 100644 --- a/Code/BasicFilters/otbConcatenateVectorDataFilter.txx +++ b/Code/BasicFilters/otbConcatenateVectorDataFilter.txx @@ -89,7 +89,7 @@ ConcatenateVectorDataFilter<TVectorData> this->GetOutput()->GetDataTree()->Add(m_Document , m_Folder); // Retrieve all the inputs - for(unsigned int idx = 0; idx < this->GetNumberOfInputs(); idx++) + for(unsigned int idx = 0; idx < this->GetNumberOfInputs(); ++idx) { // Add the current vectordata TreeNodeType * diff --git a/Code/BasicFilters/otbConnectedComponentMuParserFunctor.h b/Code/BasicFilters/otbConnectedComponentMuParserFunctor.h index 51bb09e430..4bba1de888 100644 --- a/Code/BasicFilters/otbConnectedComponentMuParserFunctor.h +++ b/Code/BasicFilters/otbConnectedComponentMuParserFunctor.h @@ -89,7 +89,7 @@ public: } // we fill the buffer - for (unsigned int i = 0; i < m_NbOfBands; i++) + for (unsigned int i = 0; i < m_NbOfBands; ++i) { m_AImageP1[i] = static_cast<double> (p1[i]); m_AImageP2[i] = static_cast<double> (p2[i]); @@ -168,7 +168,7 @@ public: m_AImageP1.resize(NbOfBands, 0.0); m_AImageP2.resize(NbOfBands, 0.0); - for (unsigned int i = 0; i < NbOfBands; i++) + for (unsigned int i = 0; i < NbOfBands; ++i) { varName << "p1b" << i + 1; m_Parser->DefineVar(varName.str(), &(m_AImageP1[i])); diff --git a/Code/BasicFilters/otbDBOverlapDataNodeFeatureFunction.txx b/Code/BasicFilters/otbDBOverlapDataNodeFeatureFunction.txx index 73b8679aa7..d5b43c7786 100644 --- a/Code/BasicFilters/otbDBOverlapDataNodeFeatureFunction.txx +++ b/Code/BasicFilters/otbDBOverlapDataNodeFeatureFunction.txx @@ -115,9 +115,9 @@ DBOverlapDataNodeFeatureFunction<TCoordRep, TPrecision> j = node.GetLine()->GetVertexList()->Size(); i = currentGeometry->GetPolygonExteriorRing()->GetVertexList()->Size(); } - j++; + ++j; } - i++; + ++i; } } ++itVector; @@ -138,7 +138,7 @@ DBOverlapDataNodeFeatureFunction<TCoordRep, TPrecision> { typename DataNodeType::Pointer currentGeometry = it.Get(); nbBuildings ++; - for (unsigned int i=0; i<node.GetLine()->GetVertexList()->Size()-1; i++) + for (unsigned int i=0; i<node.GetLine()->GetVertexList()->Size()-1; ++i) { if(currentGeometry->GetPolygonExteriorRing()->NbCrossing(node.GetLine()->GetVertexList()->GetElement(i), diff --git a/Code/BasicFilters/otbDotProductImageFilter.h b/Code/BasicFilters/otbDotProductImageFilter.h index 45e7d5422f..4aba646478 100644 --- a/Code/BasicFilters/otbDotProductImageFilter.h +++ b/Code/BasicFilters/otbDotProductImageFilter.h @@ -64,7 +64,7 @@ public: OutputType operator ()(const InputType& in) { OutputType result = 0; - for(unsigned int i = 0; i < in.Size(); i++) + for(unsigned int i = 0; i < in.Size(); ++i) { result += in[i] * m_Vector[i]; } diff --git a/Code/BasicFilters/otbEuclideanDistanceWithMissingValuePow2.txx b/Code/BasicFilters/otbEuclideanDistanceWithMissingValuePow2.txx index 51ef3406a6..1e573fe6d0 100644 --- a/Code/BasicFilters/otbEuclideanDistanceWithMissingValuePow2.txx +++ b/Code/BasicFilters/otbEuclideanDistanceWithMissingValuePow2.txx @@ -40,7 +40,7 @@ EuclideanDistanceWithMissingValuePow2<TVector> double temp, distance = itk::NumericTraits<double>::Zero; - for (unsigned int i = 0; i < x1.Size(); i++) + for (unsigned int i = 0; i < x1.Size(); ++i) { if (!IsMissingValue(x1[i]) && !IsMissingValue(x2[i])) { @@ -68,7 +68,7 @@ EuclideanDistanceWithMissingValuePow2<TVector> double temp, distance = itk::NumericTraits<double>::Zero; - for (unsigned int i = 0; i < measurementVectorSize; i++) + for (unsigned int i = 0; i < measurementVectorSize; ++i) { if (!IsMissingValue(this->GetOrigin()[i]) && !IsMissingValue(x[i])) { diff --git a/Code/BasicFilters/otbFastICAImageFilter.txx b/Code/BasicFilters/otbFastICAImageFilter.txx index 3c5f57af0c..0a202ad188 100644 --- a/Code/BasicFilters/otbFastICAImageFilter.txx +++ b/Code/BasicFilters/otbFastICAImageFilter.txx @@ -270,7 +270,7 @@ FastICAImageFilter< TInputImage, TOutputImage, TDirectionOfTransformation > InternalMatrixType W_tmp = W * W.transpose(); vnl_svd< MatrixElementType > solver ( W_tmp ); InternalMatrixType valP = solver.W(); - for ( unsigned int i = 0; i < valP.rows(); i++ ) + for ( unsigned int i = 0; i < valP.rows(); ++i ) valP(i, i) = 1. / vcl_sqrt( static_cast<double>( valP(i, i) ) ); // Watch for 0 or neg InternalMatrixType transf = solver.U(); W_tmp = transf * valP * transf.transpose(); @@ -278,8 +278,8 @@ FastICAImageFilter< TInputImage, TOutputImage, TDirectionOfTransformation > // Convergence evaluation convergence = 0.; - for ( unsigned int i = 0; i < W.rows(); i++ ) - for ( unsigned int j = 0; j < W.cols(); j++ ) + for ( unsigned int i = 0; i < W.rows(); ++i ) + for ( unsigned int j = 0; j < W.cols(); ++j ) convergence += vcl_abs( W(i, j) - W_old(i, j) ); reporter.CompletedPixel(); diff --git a/Code/BasicFilters/otbFastICAInternalOptimizerVectorImageFilter.txx b/Code/BasicFilters/otbFastICAInternalOptimizerVectorImageFilter.txx index 89060da33e..0b79275e11 100644 --- a/Code/BasicFilters/otbFastICAInternalOptimizerVectorImageFilter.txx +++ b/Code/BasicFilters/otbFastICAInternalOptimizerVectorImageFilter.txx @@ -132,7 +132,7 @@ FastICAInternalOptimizerVectorImageFilter< TInputImage, TOutputImage > double den = 0.; double nbSample = 0; - for ( int i = 0; i < this->GetNumberOfThreads(); i++ ) + for ( int i = 0; i < this->GetNumberOfThreads(); ++i ) { beta += m_BetaVector[i]; den += m_DenVector[i]; diff --git a/Code/BasicFilters/otbFlexibleDistanceWithMissingValue.txx b/Code/BasicFilters/otbFlexibleDistanceWithMissingValue.txx index e3744a5276..6955508cc7 100644 --- a/Code/BasicFilters/otbFlexibleDistanceWithMissingValue.txx +++ b/Code/BasicFilters/otbFlexibleDistanceWithMissingValue.txx @@ -42,7 +42,7 @@ FlexibleDistanceWithMissingValue<TVector> double temp, distance = itk::NumericTraits<double>::Zero; - for (unsigned int i = 0; i < x1.Size(); i++) + for (unsigned int i = 0; i < x1.Size(); ++i) { if (!this->IsMissingValue(x1[i]) && !this->IsMissingValue(x2[i])) { @@ -74,7 +74,7 @@ FlexibleDistanceWithMissingValue<TVector> double temp, distance = itk::NumericTraits<double>::Zero; - for (unsigned int i = 0; i < measurementVectorSize; i++) + for (unsigned int i = 0; i < measurementVectorSize; ++i) { if (!this->IsMissingValue(this->GetOrigin()[i]) && !this->IsMissingValue(x[i])) { diff --git a/Code/BasicFilters/otbHorizontalSobelVectorImageFilter.h b/Code/BasicFilters/otbHorizontalSobelVectorImageFilter.h index 45f59337d1..5594904cbc 100644 --- a/Code/BasicFilters/otbHorizontalSobelVectorImageFilter.h +++ b/Code/BasicFilters/otbHorizontalSobelVectorImageFilter.h @@ -39,7 +39,7 @@ public: { unsigned int length = input.GetPixel(0).Size(); TOutput output ( length ); - for ( unsigned int i = 0; i < length; i++ ) + for ( unsigned int i = 0; i < length; ++i ) { output[i] = static_cast<typename TOutput::ValueType>( ( input.GetPixel(0)[i] - input.GetPixel(2)[i] ) diff --git a/Code/BasicFilters/otbImageAndVectorImageOperationFilter.h b/Code/BasicFilters/otbImageAndVectorImageOperationFilter.h index d3fdee6a0d..3056b212eb 100644 --- a/Code/BasicFilters/otbImageAndVectorImageOperationFilter.h +++ b/Code/BasicFilters/otbImageAndVectorImageOperationFilter.h @@ -89,7 +89,7 @@ public: } } - for (unsigned int i = 0; i < vInTmp.Size(); i++) + for (unsigned int i = 0; i < vInTmp.Size(); ++i) { out[i] = static_cast<InternalInputPixelType>(vInTmp[i]); } diff --git a/Code/BasicFilters/otbLabelObjectOpeningMuParserFilter.txx b/Code/BasicFilters/otbLabelObjectOpeningMuParserFilter.txx index b4df469a7c..a089ce4859 100644 --- a/Code/BasicFilters/otbLabelObjectOpeningMuParserFilter.txx +++ b/Code/BasicFilters/otbLabelObjectOpeningMuParserFilter.txx @@ -131,7 +131,7 @@ void LabelObjectOpeningMuParserFilter<TImage, TFunction>::AllocateOutputs() } // If there are more than one outputs, allocate the remaining outputs - for (unsigned int i = 1; i < this->GetNumberOfOutputs(); i++) + for (unsigned int i = 1; i < this->GetNumberOfOutputs(); ++i) { ImagePointer outputPtr; @@ -185,13 +185,13 @@ void LabelObjectOpeningMuParserFilter<TImage, TFunction>::GenerateData() if (!m_Functor(*labelObject)) { // must increment the iterator before removing the object to avoid invalidating the iterator - it++; + ++it; output2->AddLabelObject(labelObject); output->RemoveLabel(label); } else { - it++; + ++it; } progress.CompletedPixel(); diff --git a/Code/BasicFilters/otbLocalActivityVectorImageFilter.h b/Code/BasicFilters/otbLocalActivityVectorImageFilter.h index 8e08cc2104..a42227743d 100644 --- a/Code/BasicFilters/otbLocalActivityVectorImageFilter.h +++ b/Code/BasicFilters/otbLocalActivityVectorImageFilter.h @@ -52,15 +52,15 @@ public: TOutput output ( vectorSize ); - for ( unsigned int i = 0; i < vectorSize; i++ ) + for ( unsigned int i = 0; i < vectorSize; ++i ) { typename TOutput::ValueType out = itk::NumericTraits< typename TOutput::ValueType >::Zero; - for ( unsigned int j = 0; j < neighborSize/2; j++ ) + for ( unsigned int j = 0; j < neighborSize/2; ++j ) { out += input.GetPixel(j)[i]; } - for ( unsigned int j = neighborSize/2+1; j < neighborSize; j++ ) + for ( unsigned int j = neighborSize/2+1; j < neighborSize; ++j ) { out += input.GetPixel(j)[i]; } diff --git a/Code/BasicFilters/otbLocalGradientVectorImageFilter.h b/Code/BasicFilters/otbLocalGradientVectorImageFilter.h index 1018208011..aa506342ff 100644 --- a/Code/BasicFilters/otbLocalGradientVectorImageFilter.h +++ b/Code/BasicFilters/otbLocalGradientVectorImageFilter.h @@ -44,7 +44,7 @@ public: */ unsigned int length = input.GetPixel(0).Size(); TOutput output ( length ); - for ( unsigned int i = 0; i < length; i++ ) + for ( unsigned int i = 0; i < length; ++i ) { output[i] = static_cast<typename TOutput::ValueType>( input.GetCenterPixel()[i] diff --git a/Code/BasicFilters/otbMNFImageFilter.txx b/Code/BasicFilters/otbMNFImageFilter.txx index 9e5d52fdca..5522be4f7f 100644 --- a/Code/BasicFilters/otbMNFImageFilter.txx +++ b/Code/BasicFilters/otbMNFImageFilter.txx @@ -295,19 +295,19 @@ MNFImageFilter< TInputImage, TOutputImage, TNoiseImageFilter, TDirectionOfTransf } VectorType revStdDev ( m_StdDevValues.Size() ); - for ( unsigned int i = 0; i < m_StdDevValues.Size(); i++ ) + for ( unsigned int i = 0; i < m_StdDevValues.Size(); ++i ) revStdDev[i] = 1. / m_StdDevValues[i]; m_Normalizer->SetStdDev( revStdDev ); VectorType revMean ( m_MeanValues.Size() ); - for ( unsigned int i = 0; i < m_MeanValues.Size(); i++ ) + for ( unsigned int i = 0; i < m_MeanValues.Size(); ++i ) revMean[i] = - m_MeanValues[i] / m_StdDevValues[i]; m_Normalizer->SetMean( revMean ); } else { VectorType revMean ( m_MeanValues.Size() ); - for ( unsigned int i = 0; i < m_MeanValues.Size(); i++ ) + for ( unsigned int i = 0; i < m_MeanValues.Size(); ++i ) revMean[i] = - m_MeanValues[i]; m_Normalizer->SetMean( revMean ); m_Normalizer->SetUseStdDev( false ); @@ -338,10 +338,10 @@ MNFImageFilter< TInputImage, TOutputImage, TNoiseImageFilter, TDirectionOfTransf InternalMatrixType normMat //= transf.transpose() * An * transf; = transf.transpose() * Ax_inv * transf; - for ( unsigned int i = 0; i < transf.rows(); i++ ) + for ( unsigned int i = 0; i < transf.rows(); ++i ) { double norm = 1. / vcl_sqrt( normMat.get(i, i) ); - for ( unsigned int j = 0; j < transf.cols(); j++ ) + for ( unsigned int j = 0; j < transf.cols(); ++j ) transf.put( j, i, transf.get(j, i) * norm ); } @@ -354,7 +354,7 @@ MNFImageFilter< TInputImage, TOutputImage, TNoiseImageFilter, TDirectionOfTransf m_TransformationMatrix = transf; m_EigenValues.SetSize( m_NumberOfPrincipalComponentsRequired ); - for ( unsigned int i = 0; i < m_NumberOfPrincipalComponentsRequired; i++ ) + for ( unsigned int i = 0; i < m_NumberOfPrincipalComponentsRequired; ++i ) m_EigenValues[i] = static_cast< RealType >( valP(i, i) ); } @@ -370,10 +370,10 @@ MNFImageFilter< TInputImage, TOutputImage, TNoiseImageFilter, TDirectionOfTransf if ( m_UseNormalization ) { os << indent << "Normalisation with :\n" << indent << "Mean: "; - for ( unsigned int i = 0; i < m_MeanValues.Size(); i++ ) + for ( unsigned int i = 0; i < m_MeanValues.Size(); ++i ) os << m_MeanValues[i] << " "; os << "\n" << indent << "StdDev: "; - for ( unsigned int i = 0; i < m_StdDevValues.Size(); i++ ) + for ( unsigned int i = 0; i < m_StdDevValues.Size(); ++i ) os << m_StdDevValues[i] << " "; os << "\n"; } @@ -413,7 +413,7 @@ MNFImageFilter< TInputImage, TOutputImage, TNoiseImageFilter, TDirectionOfTransf if ( m_EigenValues.Size() > 0 ) { os << indent << "RMS value :"; - for ( unsigned int i = 0; i < m_EigenValues.Size(); i++ ) + for ( unsigned int i = 0; i < m_EigenValues.Size(); ++i ) os << " " << m_EigenValues[i]; os << "\n"; } diff --git a/Code/BasicFilters/otbMaskMuParserFunctor.txx b/Code/BasicFilters/otbMaskMuParserFunctor.txx index fd95725afb..dc6a43b3cf 100644 --- a/Code/BasicFilters/otbMaskMuParserFunctor.txx +++ b/Code/BasicFilters/otbMaskMuParserFunctor.txx @@ -52,7 +52,7 @@ bool MaskMuParserFunctor<TInputPixel>::operator()(const PixelType &p) } // we fill the buffer - for (unsigned int i = 0; i < m_NbOfBands; i++) + for (unsigned int i = 0; i < m_NbOfBands; ++i) { m_AImage[i] = static_cast<double> (p[i]); } @@ -113,7 +113,7 @@ MaskMuParserFunctor<TInputPixel>::SetNumberOfBands(unsigned int NbOfBands) m_AImage.resize(NbOfBands, 0.0); - for (unsigned int i = 0; i < NbOfBands; i++) + for (unsigned int i = 0; i < NbOfBands; ++i) { varName << "b" << i + 1; m_Parser->DefineVar(varName.str(), &(m_AImage[i])); diff --git a/Code/BasicFilters/otbMatrixImageFilter.txx b/Code/BasicFilters/otbMatrixImageFilter.txx index 25d51b818a..26ab6f1563 100644 --- a/Code/BasicFilters/otbMatrixImageFilter.txx +++ b/Code/BasicFilters/otbMatrixImageFilter.txx @@ -101,14 +101,14 @@ void MatrixImageFilter<TInputImage, TOutputImage, TMatrix>::ThreadedGenerateData OutputPixelType outPix; outPix.SetSize(outSize); - for(unsigned int i=0; i<inSize; i++) + for(unsigned int i=0; i<inSize; ++i) { inVect[i] = static_cast<InputRealType>(inPix[i]); } outVect = m_MatrixByVector ? m_Matrix*inVect : inVect*m_Matrix; - for(unsigned int i=0; i<outSize; i++) + for(unsigned int i=0; i<outSize; ++i) { outPix[i] = static_cast<OutputInternalPixelType>(outVect[i]); } diff --git a/Code/BasicFilters/otbNAPCAImageFilter.txx b/Code/BasicFilters/otbNAPCAImageFilter.txx index 8ec1f50247..090282ebe8 100644 --- a/Code/BasicFilters/otbNAPCAImageFilter.txx +++ b/Code/BasicFilters/otbNAPCAImageFilter.txx @@ -59,7 +59,7 @@ NAPCAImageFilter< TInputImage, TOutputImage, TNoiseImageFilter, TDirectionOfTran this->m_TransformationMatrix = transf; this->m_EigenValues.SetSize( this->GetNumberOfPrincipalComponentsRequired() ); - for ( unsigned int i = 0; i < this->GetNumberOfPrincipalComponentsRequired(); i++ ) + for ( unsigned int i = 0; i < this->GetNumberOfPrincipalComponentsRequired(); ++i ) this->m_EigenValues[this->GetNumberOfPrincipalComponentsRequired()-1-i] = static_cast< RealType >( vectValPadj[i] ); } diff --git a/Code/BasicFilters/otbNormalizeVectorImageFilter.h b/Code/BasicFilters/otbNormalizeVectorImageFilter.h index 077da0a103..6bb4d7cdaf 100644 --- a/Code/BasicFilters/otbNormalizeVectorImageFilter.h +++ b/Code/BasicFilters/otbNormalizeVectorImageFilter.h @@ -49,7 +49,7 @@ public: { unsigned int length = input.Size(); TOutput output ( length ); - for ( unsigned int i = 0; i < length; i++ ) + for ( unsigned int i = 0; i < length; ++i ) { output[i] = static_cast<typename TOutput::ValueType>( ( static_cast< RealType >( input[i] ) - m_Mean[i] ) @@ -62,7 +62,7 @@ public: void SetMean ( const itk::VariableLengthVector<T> & m ) { m_Mean.SetSize( m.Size() ); - for ( unsigned int i = 0; i < m_Mean.Size(); i++ ) + for ( unsigned int i = 0; i < m_Mean.Size(); ++i ) m_Mean[i] = static_cast< RealType >( m[i] ); } @@ -75,7 +75,7 @@ public: void SetStdDev ( const itk::VariableLengthVector<T> & sigma ) { m_StdDev.SetSize( sigma.Size() ); - for ( unsigned int i = 0; i < m_StdDev.Size(); i++ ) + for ( unsigned int i = 0; i < m_StdDev.Size(); ++i ) { m_StdDev[i] = static_cast< RealType >( sigma[i] ); if ( m_StdDev[i] == itk::NumericTraits< RealType >::Zero ) @@ -90,7 +90,7 @@ public: void SetVariance ( const itk::VariableLengthVector<T> & var ) { m_StdDev.SetSize( var.Size() ); - for ( unsigned int i = 0; i < m_StdDev.Size(); i++ ) + for ( unsigned int i = 0; i < m_StdDev.Size(); ++i ) { m_StdDev[i] = vcl_sqrt( static_cast< RealType >( var[i] ) ); if ( m_StdDev[i] == itk::NumericTraits< RealType >::Zero ) diff --git a/Code/BasicFilters/otbNormalizeVectorImageFilter.txx b/Code/BasicFilters/otbNormalizeVectorImageFilter.txx index b59ba8c147..ba395638cd 100644 --- a/Code/BasicFilters/otbNormalizeVectorImageFilter.txx +++ b/Code/BasicFilters/otbNormalizeVectorImageFilter.txx @@ -65,7 +65,7 @@ NormalizeVectorImageFilter< TInputImage, TOutputImage > { typename StreamingStatisticsVectorImageFilter< InputImageType >::RealPixelType sigma ( this->GetInput()->GetNumberOfComponentsPerPixel() ); - for ( unsigned int i = 0; i < sigma.Size(); i++ ) + for ( unsigned int i = 0; i < sigma.Size(); ++i ) sigma[i] = vcl_sqrt( m_CovarianceEstimator->GetCovariance()(i, i) ); this->GetFunctor().SetStdDev( sigma ); diff --git a/Code/BasicFilters/otbOBIAMuParserFunctor.h b/Code/BasicFilters/otbOBIAMuParserFunctor.h index f2da073206..2f6fb20dcd 100644 --- a/Code/BasicFilters/otbOBIAMuParserFunctor.h +++ b/Code/BasicFilters/otbOBIAMuParserFunctor.h @@ -78,7 +78,7 @@ public: this->SetAttributes(a); } - for (unsigned int i = 0; i < m_AAttributes.size(); i++) + for (unsigned int i = 0; i < m_AAttributes.size(); ++i) { std::string name = (m_AttributesName[i]); @@ -112,7 +112,7 @@ public: void ParseAttributeName(std::string &attributeName) { - for (unsigned int i = 0; i < attributeName.size(); i++) + for (unsigned int i = 0; i < attributeName.size(); ++i) { if (attributeName[i] == ':') { @@ -133,7 +133,7 @@ public: m_AAttributes.resize(nbOfAttributes, 0.0); m_AttributesName.resize(nbOfAttributes, ""); m_AttributesName = a.GetAvailableAttributes(); - for (unsigned int i = 0; i < nbOfAttributes; i++) + for (unsigned int i = 0; i < nbOfAttributes; ++i) { std::string attributeName = m_AttributesName.at(i); ParseAttributeName(attributeName); //eliminate '::' from string name @@ -151,7 +151,7 @@ public: m_AAttributes.resize(nbOfAttributes, 0.0); m_AttributesName.resize(nbOfAttributes, ""); std::ostringstream varName; - for (unsigned int i = 0; i < shapeAttributes.size(); i++) + for (unsigned int i = 0; i < shapeAttributes.size(); ++i) { varName << "SHAPE::" << shapeAttributes.at(i); @@ -163,7 +163,7 @@ public: varName.str(""); index++; } - for (unsigned int i = 0; i < statAttributes.size(); i++) + for (unsigned int i = 0; i < statAttributes.size(); ++i) { for (unsigned int bandIndex = 1; bandIndex <= nbOfBands; bandIndex++) { diff --git a/Code/BasicFilters/otbPCAImageFilter.txx b/Code/BasicFilters/otbPCAImageFilter.txx index b5cc741d45..a333a70d67 100644 --- a/Code/BasicFilters/otbPCAImageFilter.txx +++ b/Code/BasicFilters/otbPCAImageFilter.txx @@ -267,7 +267,7 @@ PCAImageFilter< TInputImage, TOutputImage, TDirectionOfTransformation > if ( m_GivenStdDevValues ) { VectorType revStdDev ( m_StdDevValues.Size() ); - for ( unsigned int i = 0; i < m_StdDevValues.Size(); i++ ) + for ( unsigned int i = 0; i < m_StdDevValues.Size(); ++i ) revStdDev[i] = 1. / m_StdDevValues[i]; m_Normalizer->SetStdDev( revStdDev ); } @@ -277,13 +277,13 @@ PCAImageFilter< TInputImage, TOutputImage, TDirectionOfTransformation > VectorType revMean ( m_MeanValues.Size() ); if ( m_GivenStdDevValues ) { - for ( unsigned int i = 0; i < m_MeanValues.Size(); i++ ) + for ( unsigned int i = 0; i < m_MeanValues.Size(); ++i ) revMean[i] = - m_MeanValues[i] / m_StdDevValues[i]; m_Normalizer->SetUseStdDev( true ); } else { - for ( unsigned int i = 0; i < m_MeanValues.Size(); i++ ) + for ( unsigned int i = 0; i < m_MeanValues.Size(); ++i ) revMean[i] = -m_MeanValues[i]; m_Normalizer->SetUseStdDev( false ); } @@ -331,7 +331,7 @@ PCAImageFilter< TInputImage, TOutputImage, TDirectionOfTransformation > /* * We used normalized PCA */ - for ( unsigned int i = 0; i < valP.size(); i++ ) + for ( unsigned int i = 0; i < valP.size(); ++i ) { if ( valP[i] != 0. ) valP[i] = 1. / vcl_sqrt( vcl_abs( valP[i] ) ); @@ -349,7 +349,7 @@ PCAImageFilter< TInputImage, TOutputImage, TDirectionOfTransformation > m_EigenValues.SetSize( m_NumberOfPrincipalComponentsRequired ); - for ( unsigned int i = 0; i < m_NumberOfPrincipalComponentsRequired; i++ ) + for ( unsigned int i = 0; i < m_NumberOfPrincipalComponentsRequired; ++i ) m_EigenValues[i] = static_cast< RealType >( valP[i] ); #else InternalMatrixType transf; @@ -357,11 +357,11 @@ PCAImageFilter< TInputImage, TOutputImage, TDirectionOfTransformation > vnl_symmetric_eigensystem_compute( m_CovarianceMatrix.GetVnlMatrix(), transf, vectValP ); InternalMatrixType valP ( vectValP.size(), vectValP.size(), vnl_matrix_null ); - for ( unsigned int i = 0; i < vectValP.size(); i++ ) + for ( unsigned int i = 0; i < vectValP.size(); ++i ) valP(i, i) = vectValP[i]; /* We used normalized PCA */ - for ( unsigned int i = 0; i < valP.rows(); i++ ) + for ( unsigned int i = 0; i < valP.rows(); ++i ) { if ( valP(i, i) > 0. ) { @@ -388,7 +388,7 @@ PCAImageFilter< TInputImage, TOutputImage, TDirectionOfTransformation > m_TransformationMatrix = transf; m_EigenValues.SetSize( m_NumberOfPrincipalComponentsRequired ); - for ( unsigned int i = 0; i < m_NumberOfPrincipalComponentsRequired; i++ ) + for ( unsigned int i = 0; i < m_NumberOfPrincipalComponentsRequired; ++i ) m_EigenValues[i] = static_cast< RealType >( valP(i, i) ); #endif @@ -444,7 +444,7 @@ PCAImageFilter< TInputImage, TOutputImage, TDirectionOfTransformation > if ( m_EigenValues.Size() > 0 ) { os << indent << "Eigen value :"; - for ( unsigned int i = 0; i < m_NumberOfPrincipalComponentsRequired; i++ ) + for ( unsigned int i = 0; i < m_NumberOfPrincipalComponentsRequired; ++i ) os << " " << m_EigenValues[i]; os << "\n"; } diff --git a/Code/BasicFilters/otbPrintableImageFilter.h b/Code/BasicFilters/otbPrintableImageFilter.h index e1217b5ac8..8715963f00 100644 --- a/Code/BasicFilters/otbPrintableImageFilter.h +++ b/Code/BasicFilters/otbPrintableImageFilter.h @@ -79,7 +79,7 @@ public: if (maskPix == m_BackgroundValue) { outPix.SetSize(inPix.Size()); - for (unsigned int i = 0; i < outPix.Size(); i++) + for (unsigned int i = 0; i < outPix.Size(); ++i) { outPix[i] = static_cast<OutputInternalPixelType>(inPix[i]); } diff --git a/Code/BasicFilters/otbPrintableImageFilter.txx b/Code/BasicFilters/otbPrintableImageFilter.txx index c8f75397ea..146c65fd02 100644 --- a/Code/BasicFilters/otbPrintableImageFilter.txx +++ b/Code/BasicFilters/otbPrintableImageFilter.txx @@ -147,7 +147,7 @@ PrintableImageFilter<TInputImage, TMaskImage> // let this loop to be compliant with previous version of the class where m_ChannelList didn't exist... if (m_Extractor->GetNbChannels() == 0) { - for (unsigned int i = 0; i < m_ChannelList.size(); i++) + for (unsigned int i = 0; i < m_ChannelList.size(); ++i) m_Extractor->SetChannel(m_ChannelList[i]); } diff --git a/Code/BasicFilters/otbProjectiveProjectionImageFilter.h b/Code/BasicFilters/otbProjectiveProjectionImageFilter.h index d91ce928a8..abb54f0959 100644 --- a/Code/BasicFilters/otbProjectiveProjectionImageFilter.h +++ b/Code/BasicFilters/otbProjectiveProjectionImageFilter.h @@ -71,13 +71,13 @@ public: OutputType operator ()(const InputType& in) { PrecisionType dotProduct = 0; - for (unsigned int i = 0; i < in.Size(); i++) + for (unsigned int i = 0; i < in.Size(); ++i) { dotProduct += in[i] * m_ProjectionDirection[i]; } OutputType projected(in.Size()); - for (unsigned int j = 0; j < in.Size(); j++) + for (unsigned int j = 0; j < in.Size(); ++j) { projected[j] = in[j] / dotProduct; } diff --git a/Code/BasicFilters/otbRadiometryHomogenousWithNeighborhoodDataNodeFeatureFunction.txx b/Code/BasicFilters/otbRadiometryHomogenousWithNeighborhoodDataNodeFeatureFunction.txx index 57253a51ac..617912c67c 100644 --- a/Code/BasicFilters/otbRadiometryHomogenousWithNeighborhoodDataNodeFeatureFunction.txx +++ b/Code/BasicFilters/otbRadiometryHomogenousWithNeighborhoodDataNodeFeatureFunction.txx @@ -108,7 +108,7 @@ typename RadiometryHomogenousWithNeighborhoodDataNodeFeatureFunction<TImage, TCo orthogonalDirection[1] = -direction[0]; splitedLineIdCentral.push_back(IndexPairType(id1, id2)); - for (unsigned int j = 1; j <= m_CenterRadius; j++) + for (unsigned int j = 1; j <= m_CenterRadius; ++j) { IndexType shift11, shift12; shift11[0] = id1[0] - j * orthogonalDirection[0]; @@ -125,7 +125,7 @@ typename RadiometryHomogenousWithNeighborhoodDataNodeFeatureFunction<TImage, TCo splitedLineIdCentral.push_back(IndexPairType(shift12, shift22)); } - for (unsigned int j = m_NeighborhoodBeginRadius; j <= m_NeighborhoodEndRadius; j++) + for (unsigned int j = m_NeighborhoodBeginRadius; j <= m_NeighborhoodEndRadius; ++j) { IndexType shift11, shift12; shift11[0] = id1[0] - j * orthogonalDirection[0]; @@ -158,7 +158,7 @@ typename RadiometryHomogenousWithNeighborhoodDataNodeFeatureFunction<TImage, TCo PixelType centralRadiomAcc(this->GetInputImage()->GetNumberOfComponentsPerPixel()); centralRadiomAcc.Fill(0); - for (unsigned int i = 0; i < splitedLineIdCentral.size(); i++) + for (unsigned int i = 0; i < splitedLineIdCentral.size(); ++i) { LineIteratorType lineIt(this->GetInputImage(), splitedLineIdCentral[i].first, splitedLineIdCentral[i].second); lineIt.GoToBegin(); @@ -179,7 +179,7 @@ typename RadiometryHomogenousWithNeighborhoodDataNodeFeatureFunction<TImage, TCo PixelType neighborRadiomAcc(this->GetInputImage()->GetNumberOfComponentsPerPixel()); neighborRadiomAcc.Fill(0); - for (unsigned int i = 0; i < splitedLineIdNeigh.size(); i++) + for (unsigned int i = 0; i < splitedLineIdNeigh.size(); ++i) { LineIteratorType lineIt(this->GetInputImage(), splitedLineIdNeigh[i].first, splitedLineIdNeigh[i].second); lineIt.GoToBegin(); diff --git a/Code/BasicFilters/otbReliefColormapFunctor.txx b/Code/BasicFilters/otbReliefColormapFunctor.txx index b381f39abd..fc7958c969 100644 --- a/Code/BasicFilters/otbReliefColormapFunctor.txx +++ b/Code/BasicFilters/otbReliefColormapFunctor.txx @@ -40,7 +40,7 @@ ReliefColormapFunctor<TScalar, TRGBPixel> int i = 1; while (value > m_Borders[i]) - i++; + ++i; float factor = (value - m_Borders[i - 1]) / (m_Borders[i] - m_Borders[i - 1]); diff --git a/Code/BasicFilters/otbSobelVectorImageFilter.h b/Code/BasicFilters/otbSobelVectorImageFilter.h index 936800629b..6931c00669 100644 --- a/Code/BasicFilters/otbSobelVectorImageFilter.h +++ b/Code/BasicFilters/otbSobelVectorImageFilter.h @@ -41,7 +41,7 @@ public: { unsigned int length = input.GetPixel(0).Size(); TOutput output ( length ); - for ( unsigned int i = 0; i < length; i++ ) + for ( unsigned int i = 0; i < length; ++i ) { double hori = static_cast<double>( ( input.GetPixel(0)[i] - input.GetPixel(2)[i] ) diff --git a/Code/BasicFilters/otbSpectralAngleDataNodeFeatureFunction.txx b/Code/BasicFilters/otbSpectralAngleDataNodeFeatureFunction.txx index 743e157b4b..1982f3c57a 100644 --- a/Code/BasicFilters/otbSpectralAngleDataNodeFeatureFunction.txx +++ b/Code/BasicFilters/otbSpectralAngleDataNodeFeatureFunction.txx @@ -116,7 +116,7 @@ typename SpectralAngleDataNodeFeatureFunction<TImage, TCoordRep, TPrecision>::Ou splitedLineIdCentral.push_back(IndexPairType(id1, id2)); - for (unsigned int j = 1; j <= m_Radius; j++) + for (unsigned int j = 1; j <= m_Radius; ++j) { IndexType shift11, shift12; shift11[0] = id1[0] - j * orthogonalDirection[0]; @@ -147,7 +147,7 @@ typename SpectralAngleDataNodeFeatureFunction<TImage, TCoordRep, TPrecision>::Ou //double centralAccSpectralAngleSecondOrder = 0.; double centralNbVisitedPixel = 0.; - for (unsigned int i = 0; i < splitedLineIdCentral.size(); i++) + for (unsigned int i = 0; i < splitedLineIdCentral.size(); ++i) { LineIteratorType lineIt(this->GetInputImage(), splitedLineIdCentral[i].first, splitedLineIdCentral[i].second); lineIt.GoToBegin(); diff --git a/Code/BasicFilters/otbUnaryFunctorNeighborhoodVectorImageFilter.txx b/Code/BasicFilters/otbUnaryFunctorNeighborhoodVectorImageFilter.txx index 5f79d7c942..7709d13146 100644 --- a/Code/BasicFilters/otbUnaryFunctorNeighborhoodVectorImageFilter.txx +++ b/Code/BasicFilters/otbUnaryFunctorNeighborhoodVectorImageFilter.txx @@ -36,7 +36,7 @@ UnaryFunctorNeighborhoodVectorImageFilter<TInputImage, TOutputImage, TFunction> { this->SetNumberOfRequiredInputs(1); this->InPlaceOff(); - for ( unsigned int i = 0; i < InputImageDimension; i++ ) + for ( unsigned int i = 0; i < InputImageDimension; ++i ) m_Radius[i] = 3; } diff --git a/Code/BasicFilters/otbVectorDataToRandomLineGenerator.txx b/Code/BasicFilters/otbVectorDataToRandomLineGenerator.txx index ebaecfb96e..a2ed84a223 100644 --- a/Code/BasicFilters/otbVectorDataToRandomLineGenerator.txx +++ b/Code/BasicFilters/otbVectorDataToRandomLineGenerator.txx @@ -135,7 +135,7 @@ VectorDataToRandomLineGenerator<TVectorData> if (itVector.Get()->IsPolygonFeature()) { - for(unsigned int i=0; i<this->GetNumberOfOutputLine(); i++) + for(unsigned int i=0; i<this->GetNumberOfOutputLine(); ++i) { typename DataNodeType::Pointer currentGeometry = DataNodeType::New(); currentGeometry->SetNodeId(this->GetNextID()); diff --git a/Code/BasicFilters/otbVerticalSobelVectorImageFilter.h b/Code/BasicFilters/otbVerticalSobelVectorImageFilter.h index 455d25559d..e5b541d000 100644 --- a/Code/BasicFilters/otbVerticalSobelVectorImageFilter.h +++ b/Code/BasicFilters/otbVerticalSobelVectorImageFilter.h @@ -39,7 +39,7 @@ public: { unsigned int length = input.GetPixel(0).Size(); TOutput output ( length ); - for ( unsigned int i = 0; i < length; i++ ) + for ( unsigned int i = 0; i < length; ++i ) { output[i] = static_cast<typename TOutput::ValueType>( ( input.GetPixel(0)[i] - input.GetPixel(6)[i] ) diff --git a/Code/Common/otbCommandLineArgumentParser.cxx b/Code/Common/otbCommandLineArgumentParser.cxx index 2801de83ba..98e92a44c8 100644 --- a/Code/Common/otbCommandLineArgumentParser.cxx +++ b/Code/Common/otbCommandLineArgumentParser.cxx @@ -310,7 +310,7 @@ bool CommandLineArgumentParser::TryParseCommandLine(int argc, char *argv[], } // Check that all required arguments are specified - for (unsigned int cpt = 0; cpt < m_OptionList.size(); cpt++) + for (unsigned int cpt = 0; cpt < m_OptionList.size(); ++cpt) { if ((m_OptionList[cpt].Obligatory == true) && (m_OptionList[cpt].Finded == false)) { @@ -344,7 +344,7 @@ bool CommandLineArgumentParser::IsNumber(const std::string& text) return false; } } - i++; + ++i; } return true; } @@ -364,7 +364,7 @@ bool CommandLineArgumentParser::FindOption(const std::string& option, int& index goOnFlag = false; optionFoundFlag = true; } - cpt++; + ++cpt; if (cpt >= m_OptionList.size()) { goOnFlag = false; diff --git a/Code/Common/otbDataNodeImageFunction.h b/Code/Common/otbDataNodeImageFunction.h index b141c1c442..bed4bf7a26 100644 --- a/Code/Common/otbDataNodeImageFunction.h +++ b/Code/Common/otbDataNodeImageFunction.h @@ -114,7 +114,7 @@ public: * the input image is done. */ virtual bool IsInsideBuffer( const IndexType & index ) const { - for( unsigned int j = 0; j < ImageDimension; j++ ) + for( unsigned int j = 0; j < ImageDimension; ++j ) { if( index[j] < m_StartIndex[j] ) { @@ -133,7 +133,7 @@ public: * the input image is done. */ virtual bool IsInsideBuffer( const ContinuousIndexType & index ) const { - for( unsigned int j = 0; j < ImageDimension; j++ ) + for( unsigned int j = 0; j < ImageDimension; ++j ) { if( index[j] < m_StartContinuousIndex[j] ) { diff --git a/Code/Common/otbDataNodeImageFunction.txx b/Code/Common/otbDataNodeImageFunction.txx index c6bb0e380e..e4c77ebf03 100644 --- a/Code/Common/otbDataNodeImageFunction.txx +++ b/Code/Common/otbDataNodeImageFunction.txx @@ -74,7 +74,7 @@ DataNodeImageFunction<TImage, TOutput, TCoordRep, TPrecision> typename InputImageType::SizeType size = ptr->GetBufferedRegion().GetSize(); m_StartIndex = ptr->GetBufferedRegion().GetIndex(); - for ( unsigned int j = 0; j < ImageDimension; j++ ) + for ( unsigned int j = 0; j < ImageDimension; ++j ) { m_EndIndex[j] = m_StartIndex[j] + static_cast<IndexValueType>( size[j] ) - 1; #ifdef ITK_USE_CENTERED_PIXEL_COORDINATES_CONSISTENTLY diff --git a/Code/Common/otbGamma.h b/Code/Common/otbGamma.h index 998a6822f3..83f89c3c2f 100644 --- a/Code/Common/otbGamma.h +++ b/Code/Common/otbGamma.h @@ -68,7 +68,7 @@ public: if (x > 0.0) { ga = 1.0; // use factorial - for (int i = 2; i < x; i++) + for (int i = 2; i < x; ++i) { ga *= i; } @@ -82,7 +82,7 @@ public: z = vcl_abs(x); m = (int)z; r = 1.0; - for (int k = 1; k <= m; k++) + for (int k = 1; k <= m; ++k) { r *= (z-k); } diff --git a/Code/Common/otbGenericInterpolateImageFunction.txx b/Code/Common/otbGenericInterpolateImageFunction.txx index 99e97e4977..0dfcceb9a8 100644 --- a/Code/Common/otbGenericInterpolateImageFunction.txx +++ b/Code/Common/otbGenericInterpolateImageFunction.txx @@ -233,7 +233,7 @@ GenericInterpolateImageFunction<TInputImage, TFunction, TBoundaryCondition, TCoo /* double xWeight[ImageDimension][ twiceRadius]; */ std::vector<std::vector<double> > xWeight; xWeight.resize(ImageDimension); - for (unsigned int cpt = 0; cpt < xWeight.size(); cpt++) + for (unsigned int cpt = 0; cpt < xWeight.size(); ++cpt) { xWeight[cpt].resize(twiceRadius); } diff --git a/Code/Common/otbLineSpatialObject.txx b/Code/Common/otbLineSpatialObject.txx index a9a163980c..b413417a9d 100644 --- a/Code/Common/otbLineSpatialObject.txx +++ b/Code/Common/otbLineSpatialObject.txx @@ -70,7 +70,7 @@ LineSpatialObject<VDimension> while (it != end) { m_Points.push_back(*it); - it++; + ++it; } this->ComputeBoundingBox(); @@ -117,13 +117,13 @@ LineSpatialObject<VDimension> ptmax[1] = pt[1] + 1; const_cast<BoundingBoxType *>(this->GetBounds())->SetMinimum(ptmin); const_cast<BoundingBoxType *>(this->GetBounds())->SetMaximum(ptmax); - it++; + ++it; while (it != end) { PointType pt = this->GetIndexToWorldTransform()->TransformPoint((*it).GetPosition()); const_cast<BoundingBoxType *>(this->GetBounds())->ConsiderPoint(pt); - it++; + ++it; } } @@ -207,7 +207,7 @@ LineSpatialObject<VDimension> } } it1++; - it2++; + ++it2; } } diff --git a/Code/Common/otbPolyLineParametricPathWithValue.txx b/Code/Common/otbPolyLineParametricPathWithValue.txx index 165cf07013..1877346e77 100644 --- a/Code/Common/otbPolyLineParametricPathWithValue.txx +++ b/Code/Common/otbPolyLineParametricPathWithValue.txx @@ -68,7 +68,7 @@ PolyLineParametricPathWithValue<TValue, VDimension> VertexType pt1 = it.Value(); //just init, won't be used like that VertexType pt2 = it.Value(); - it++; + ++it; while (it != this->GetVertexList()->End()) { pt1 = pt2; @@ -79,7 +79,7 @@ PolyLineParametricPathWithValue<TValue, VDimension> accum += (pt1[i] - pt2[i]) * (pt1[i] - pt2[i]); } length += vcl_sqrt(accum); - it++; + ++it; } } @@ -105,7 +105,7 @@ PolyLineParametricPathWithValue<TValue, VDimension> while (it != this->GetVertexList()->End()) { os << it.Value() << " - "; - it++; + ++it; } os << std::endl; } diff --git a/Code/Common/otbPolygon.txx b/Code/Common/otbPolygon.txx index 824cf8f255..b17ffe1e16 100644 --- a/Code/Common/otbPolygon.txx +++ b/Code/Common/otbPolygon.txx @@ -432,7 +432,7 @@ Polygon<TValue> { double area = 0.0; VertexType origin = it.Value(); - it++; + ++it; VertexType pt1 = it.Value(); VertexType pt2 = it.Value(); @@ -447,7 +447,7 @@ Polygon<TValue> double vector2y = pt2[1] - origin[1]; double crossProdduct = vector1x * vector2y - vector2x * vector1y; area += crossProdduct; - it++; + ++it; } m_Area = fabs(area / 2.0); @@ -493,7 +493,7 @@ double Polygon<TValue> VertexType pt1 = it.Value(); //just init, won't be used like that VertexType pt2 = it.Value(); - it++; + ++it; while (it != this->GetVertexList()->End()) { pt1 = pt2; @@ -504,7 +504,7 @@ double Polygon<TValue> accum += (pt1[i] - pt2[i]) * (pt1[i] - pt2[i]); } length += vcl_sqrt(accum); - it++; + ++it; } //Adding the last segment (between first and last point) diff --git a/Code/Common/otbPostGISTable.txx b/Code/Common/otbPostGISTable.txx index f445b28e8a..247db098be 100644 --- a/Code/Common/otbPostGISTable.txx +++ b/Code/Common/otbPostGISTable.txx @@ -78,7 +78,7 @@ PostGISTable<TConnectionImplementation, TPrecision, TSpatialDimension> std::stringstream sqlCmd; this->InsertBegin(sqlCmd); sqlCmd << "POINT( "; - for (unsigned int i = 0; i < TSpatialDimension; i++) + for (unsigned int i = 0; i < TSpatialDimension; ++i) { sqlCmd << pt[i] << " "; } @@ -103,7 +103,7 @@ PostGISTable<TConnectionImplementation, TPrecision, TSpatialDimension> VertexIterator itVertex = l->GetVertexList()->Begin(); while (itVertex != l->GetVertexList()->End()) { - for (unsigned int i = 0; i < TSpatialDimension; i++) + for (unsigned int i = 0; i < TSpatialDimension; ++i) { sqlCmd << itVertex.Value()[i] << " "; ++itVertex; @@ -181,7 +181,7 @@ PostGISTable<TConnectionImplementation, TPrecision, TSpatialDimension> while (itVertex != correctCurrentPolygonIntRing->GetVertexList()->End()) { //polygon->line_to(itVertex.Value()[0], m_SensorModelFlip*itVertex.Value()[1]); - for (unsigned int i = 0; i < TSpatialDimension; i++) + for (unsigned int i = 0; i < TSpatialDimension; ++i) { sqlCmd << itVertex.Value()[i] << " "; ++itVertex; diff --git a/Code/Common/otbSubsampledImageRegionConstIterator.txx b/Code/Common/otbSubsampledImageRegionConstIterator.txx index 7feeff2e31..6a9f14f292 100644 --- a/Code/Common/otbSubsampledImageRegionConstIterator.txx +++ b/Code/Common/otbSubsampledImageRegionConstIterator.txx @@ -234,29 +234,29 @@ SubsampledImageRegionConstIterator<TImage> #if 0 // #ifndef NDEBUG std::cerr << "InitialImageSize ("; - for (unsigned int i = 0; i < ImageIteratorDimension - 1; i++) + for (unsigned int i = 0; i < ImageIteratorDimension - 1; ++i) std::cerr << this->m_Region.GetSize()[i] << ", "; std::cerr << this->m_Region.GetSize()[ImageIteratorDimension - 1] << ") with index ("; - for (unsigned int i = 0; i < ImageIteratorDimension - 1; i++) + for (unsigned int i = 0; i < ImageIteratorDimension - 1; ++i) std::cerr << this->m_Region.GetIndex()[i] << ", "; std::cerr << this->m_Region.GetIndex()[ImageIteratorDimension - 1] << ")\n"; std::cerr << "NewRegionSize ("; - for (unsigned int i = 0; i < ImageIteratorDimension - 1; i++) + for (unsigned int i = 0; i < ImageIteratorDimension - 1; ++i) std::cerr << size[i] << ", "; std::cerr << size[ImageIteratorDimension - 1] << ") with index ("; - for (unsigned int i = 0; i < ImageIteratorDimension - 1; i++) + for (unsigned int i = 0; i < ImageIteratorDimension - 1; ++i) std::cerr << startIndex[i] << ", "; std::cerr << startIndex[ImageIteratorDimension - 1] << ")\n"; std::cerr << "FirstIndex ("; - for (unsigned int i = 0; i < ImageIteratorDimension - 1; i++) + for (unsigned int i = 0; i < ImageIteratorDimension - 1; ++i) std::cerr << m_FirstUsableIndex[i] << ", "; std::cerr << m_FirstUsableIndex[ImageIteratorDimension - 1] << ") offset="; std::cerr << m_SubSampledBeginOffset << "\n"; std::cerr << "LastIndex ("; - for (unsigned int i = 0; i < ImageIteratorDimension - 1; i++) + for (unsigned int i = 0; i < ImageIteratorDimension - 1; ++i) std::cerr << m_LastUsableIndex[i] << ", "; std::cerr << m_LastUsableIndex[ImageIteratorDimension - 1] << ") offset="; std::cerr << m_SubSampledEndOffset << "\n"; diff --git a/Code/Common/otbVariableLengthVectorConverter.txx b/Code/Common/otbVariableLengthVectorConverter.txx index bfb43dbe67..df2860116e 100644 --- a/Code/Common/otbVariableLengthVectorConverter.txx +++ b/Code/Common/otbVariableLengthVectorConverter.txx @@ -41,17 +41,17 @@ VariableLengthVectorConverter< std::vector<std::vector<TInternalInputType> >, TP p = input.size(); - for (unsigned int l=0; l<p; l++) + for (unsigned int l=0; l<p; ++l) { count+=input.at(l).size(); } result.SetSize(count); - for (unsigned int i=0; i<p; i++) + for (unsigned int i=0; i<p; ++i) { q = input.at(i).size(); - for (unsigned int j=0; j<q; j++) + for (unsigned int j=0; j<q; ++j) { result[rsltIdx] = static_cast<OutputPrecisionType>(input.at(i).at(j)); rsltIdx ++; @@ -77,17 +77,17 @@ VariableLengthVectorConverter< std::vector<std::vector<std::complex<TInternalInp p = input.size(); - for (unsigned int l=0; l<p; l++) + for (unsigned int l=0; l<p; ++l) { count+=input.at(l).size(); } result.SetSize(count*2); - for (unsigned int i=0; i<p; i++) + for (unsigned int i=0; i<p; ++i) { q = input.at(i).size(); - for (unsigned int j=0; j<q; j++) + for (unsigned int j=0; j<q; ++j) { result[rsltIdx] = static_cast<OutputPrecisionType>(input.at(i).at(j).real()); rsltIdx ++; @@ -110,7 +110,7 @@ VariableLengthVectorConverter< itk::FixedArray<TInternalInputType, VArrayDimensi result.SetSize(VArrayDimension); - for (unsigned int i=0; i<VArrayDimension; i++) + for (unsigned int i=0; i<VArrayDimension; ++i) { result[rsltIdx] = static_cast<OutputPrecisionType>(input[i]); rsltIdx ++; @@ -135,7 +135,7 @@ VariableLengthVectorConverter< itk::SmartPointer< itk::Statistics::Histogram<TPi result.SetSize(nbBins[0]); - for (unsigned int i=0; i<nbBins[0]; i++) + for (unsigned int i=0; i<nbBins[0]; ++i) { result[rsltIdx] = static_cast<OutputPrecisionType>(input->GetFrequency(i)); rsltIdx ++; diff --git a/Code/Common/otbVectorDataExtractROI.txx b/Code/Common/otbVectorDataExtractROI.txx index 5f3071d8e0..71b88dd3d6 100644 --- a/Code/Common/otbVectorDataExtractROI.txx +++ b/Code/Common/otbVectorDataExtractROI.txx @@ -252,7 +252,7 @@ VectorDataExtractROI<TVectorData> // Get the VertexList // -2 cause we don't want the last point // wich is the same as the first one (closed Ring) - for (unsigned int i = 0; i<polygon->GetVertexList()->Size() - 2; i++ ) + for (unsigned int i = 0; i<polygon->GetVertexList()->Size() - 2; ++i ) { // Get the components of the polygon 2 by 2 VertexType firstVertex; @@ -291,7 +291,7 @@ VectorDataExtractROI<TVectorData> else { // Get the VertexList - for (unsigned int i = 0; i<line->GetVertexList()->Size() -1; i++ ) + for (unsigned int i = 0; i<line->GetVertexList()->Size() -1; ++i ) { // Get the components of the line 2 by 2 VertexType firstVertex; diff --git a/Code/Common/otbVectorDataToImageFilter.txx b/Code/Common/otbVectorDataToImageFilter.txx index f475d44410..1e45a4f58b 100644 --- a/Code/Common/otbVectorDataToImageFilter.txx +++ b/Code/Common/otbVectorDataToImageFilter.txx @@ -274,9 +274,9 @@ VectorDataToImageFilter<TVectorData, TImage> stdXOffset = vcl_floor((double)requestedRegion.GetSize()[0]/ (m_NbTile/2))+1; stdYOffset = vcl_floor((double)requestedRegion.GetSize()[1]/ (m_NbTile/2))+1; - for(unsigned int i=0; i < vcl_floor((double)(m_NbTile)/2 + 0.5); i++) + for(unsigned int i=0; i < vcl_floor((double)(m_NbTile)/2 + 0.5); ++i) { - for(unsigned int j=0; j < vcl_floor((double)(m_NbTile)/2 + 0.5); j++) + for(unsigned int j=0; j < vcl_floor((double)(m_NbTile)/2 + 0.5); ++j) { //Set Regions SizeType size; diff --git a/Code/FeatureExtraction/otbImageToPathListAlignFilter.txx b/Code/FeatureExtraction/otbImageToPathListAlignFilter.txx index bbcd9711bd..ae5fe59dcc 100644 --- a/Code/FeatureExtraction/otbImageToPathListAlignFilter.txx +++ b/Code/FeatureExtraction/otbImageToPathListAlignFilter.txx @@ -460,7 +460,7 @@ ImageToPathListAlignFilter<TInputImage, TOutputPath> } } /* compute next point */ - l++; + ++l; xx = ox + pos * mx + (int) (dx * (double) (l * 2 + lphase)); yy = oy + pos * my + (int) (dy * (double) (l * 2 + lphase)); } diff --git a/Code/FeatureExtraction/otbImageToSURFKeyPointSetFilter.txx b/Code/FeatureExtraction/otbImageToSURFKeyPointSetFilter.txx index 559f20ef27..cc8e50df7e 100644 --- a/Code/FeatureExtraction/otbImageToSURFKeyPointSetFilter.txx +++ b/Code/FeatureExtraction/otbImageToSURFKeyPointSetFilter.txx @@ -88,7 +88,7 @@ ImageToSURFKeyPointSetFilter<TInputImage, TOutputPointSet> else k = 3; /* Computation loop over octaves*/ - for (int i = 0; i < m_OctavesNumber; i++) + for (int i = 0; i < m_OctavesNumber; ++i) { sigma_in = 2.; @@ -126,7 +126,7 @@ ImageToSURFKeyPointSetFilter<TInputImage, TOutputPointSet> } - for (int j = 0; j < m_ScalesNumber; j++) + for (int j = 0; j < m_ScalesNumber; ++j) { /** Incrementation of the gaussian width * the width of the gaussian have to be doubled for @@ -682,14 +682,14 @@ ImageToSURFKeyPointSetFilter<TInputImage, TOutputPointSet> } } } - i++; + ++i; } double accu = 0; - for (int i = 0; i < 64; i++) + for (int i = 0; i < 64; ++i) accu += descriptorVector[i] * descriptorVector[i]; - for (int j = 0; j < 64; j++) + for (int j = 0; j < 64; ++j) descriptorVector[j] /= vcl_sqrt(accu); return descriptorVector; diff --git a/Code/FeatureExtraction/otbLineSegmentDetector.txx b/Code/FeatureExtraction/otbLineSegmentDetector.txx index fc9eb39b0e..233b8e1373 100644 --- a/Code/FeatureExtraction/otbLineSegmentDetector.txx +++ b/Code/FeatureExtraction/otbLineSegmentDetector.txx @@ -660,7 +660,7 @@ LineSegmentDetector<TInputImage, TPrecision> /** * Loop for searching regions */ - for (unsigned int cpt = 0; cpt < region.size(); cpt++) + for (unsigned int cpt = 0; cpt < region.size(); ++cpt) { itNeigh.SetLocation(region[cpt]); itNeighDir.SetLocation(region[cpt]); diff --git a/Code/Fuzzy/otbFuzzyDescriptorsModelManager.cxx b/Code/Fuzzy/otbFuzzyDescriptorsModelManager.cxx index d137c8dc46..91adc636e3 100644 --- a/Code/Fuzzy/otbFuzzyDescriptorsModelManager.cxx +++ b/Code/Fuzzy/otbFuzzyDescriptorsModelManager.cxx @@ -76,12 +76,12 @@ void FuzzyDescriptorsModelManager ::Print( const DescriptorsModelType & descModel ) { - for(unsigned int i=0; i<descModel.size(); i++) + for(unsigned int i=0; i<descModel.size(); ++i) { std::cout<<"Descriptor "<<descModel[i].first<<" parameters:" <<std::endl; const ParameterType & param = descModel[i].second; - for(unsigned int j=0; j<param.size(); j++) + for(unsigned int j=0; j<param.size(); ++j) { std::cout<<param[j]<<" "; } @@ -182,7 +182,7 @@ FuzzyDescriptorsModelManager doc.LinkEndChild( root ); // Iterate through the input - for (unsigned int i = 0; i < model.size(); i++) + for (unsigned int i = 0; i < model.size(); ++i) { // The current statistic TiXmlElement * desc = new TiXmlElement("Descriptor"); diff --git a/Code/Fuzzy/otbStandardDSCostFunction.txx b/Code/Fuzzy/otbStandardDSCostFunction.txx index 2cf37dd9fe..bc58a1f481 100644 --- a/Code/Fuzzy/otbStandardDSCostFunction.txx +++ b/Code/Fuzzy/otbStandardDSCostFunction.txx @@ -57,10 +57,10 @@ typename StandardDSCostFunction<TDSValidationFilter> m_Parser->SetExpr(m_CriterionFormula); DescriptorsModelType descModel; - for (unsigned int i = 0; i < m_DescriptorList.size(); i++) + for (unsigned int i = 0; i < m_DescriptorList.size(); ++i) { std::vector<double> tmp; - for (unsigned int j = 0; j < 4; j++) + for (unsigned int j = 0; j < 4; ++j) { tmp.push_back(parameters[4*i+j]); } diff --git a/Code/Fuzzy/otbVectorDataToDSValidatedVectorDataFilter.txx b/Code/Fuzzy/otbVectorDataToDSValidatedVectorDataFilter.txx index 3d88dba6e5..139bd2f782 100644 --- a/Code/Fuzzy/otbVectorDataToDSValidatedVectorDataFilter.txx +++ b/Code/Fuzzy/otbVectorDataToDSValidatedVectorDataFilter.txx @@ -60,11 +60,11 @@ VectorDataToDSValidatedVectorDataFilter<TVectorData, TPrecision> } else { - for (unsigned int i=0; i<m_DescriptorModels.size(); i++) + for (unsigned int i=0; i<m_DescriptorModels.size(); ++i) { if (m_DescriptorModels[i].first.compare(key) == 0) { - for (unsigned int j=0; j<4; j++) + for (unsigned int j=0; j<4; ++j) { m_DescriptorModels[i].second.at(j) = model[j]; } @@ -94,7 +94,7 @@ void VectorDataToDSValidatedVectorDataFilter<TVectorData, TPrecision> ::SetDescriptorModels(DescriptorModelsType model) { - for (unsigned int i=0; i<model.size(); i++) + for (unsigned int i=0; i<model.size(); ++i) { this->AddDescriptor(model[i].first, model[i].second); } @@ -112,7 +112,7 @@ VectorDataToDSValidatedVectorDataFilter<TVectorData, TPrecision> itkExceptionMacro(<< "No defined Descriptor. Please add a descriptor model."); } - for (unsigned int i=0; i<m_DescriptorModels.size(); i++) + for (unsigned int i=0; i<m_DescriptorModels.size(); ++i) { typename FuzzyVarType::Pointer fuz = FuzzyVarType::New(); std::string fuzName, fuzName_; @@ -170,7 +170,7 @@ VectorDataToDSValidatedVectorDataFilter<TVectorData, TPrecision> typename DataNodeType::Pointer currentGeometry = itVector.Get(); typename JointMassOfBeliefFilterType::Pointer jointMassFilter = JointMassOfBeliefFilterType::New(); - for (unsigned int i=0; i<m_DescriptorModels.size(); i++) + for (unsigned int i=0; i<m_DescriptorModels.size(); ++i) { if (currentGeometry->HasField(m_DescriptorModels[i].first)) { diff --git a/Code/Hyperspectral/otbEigenvalueLikelihoodMaximisation.txx b/Code/Hyperspectral/otbEigenvalueLikelihoodMaximisation.txx index 765bf5f8f2..3087b39c0d 100644 --- a/Code/Hyperspectral/otbEigenvalueLikelihoodMaximisation.txx +++ b/Code/Hyperspectral/otbEigenvalueLikelihoodMaximisation.txx @@ -81,7 +81,7 @@ EigenvalueLikelihoodMaximisation<TInputImage> // Extract first local maximum double max = m_Likelihood[0]; unsigned int iMax = 0; - for (unsigned int i = 1; i < m_Likelihood.size() - 1; i++) + for (unsigned int i = 1; i < m_Likelihood.size() - 1; ++i) { if ( (m_Likelihood[i] > m_Likelihood[i - 1]) && (m_Likelihood[i] > m_Likelihood[i + 1]) ) diff --git a/Code/Hyperspectral/otbFCLSUnmixingImageFilter.txx b/Code/Hyperspectral/otbFCLSUnmixingImageFilter.txx index 8de826ce3c..8a6885feab 100644 --- a/Code/Hyperspectral/otbFCLSUnmixingImageFilter.txx +++ b/Code/Hyperspectral/otbFCLSUnmixingImageFilter.txx @@ -104,7 +104,7 @@ FCLSUnmixingFunctor<TInput, TOutput, TPrecision> { // TODO : support different types between input and output ? VectorType inVector(in.Size()); - for (unsigned int i = 0; i < in.GetSize(); i++ ) + for (unsigned int i = 0; i < in.GetSize(); ++i ) { inVector[i] = in[i]; } @@ -137,7 +137,7 @@ FCLSUnmixingFunctor<TInput, TOutput, TPrecision> } OutputType out(fclsVector.size()); - for (unsigned int i = 0; i < out.GetSize(); i++ ) + for (unsigned int i = 0; i < out.GetSize(); ++i ) { out[i] = fclsVector[i]; } diff --git a/Code/Hyperspectral/otbISRAUnmixingImageFilter.txx b/Code/Hyperspectral/otbISRAUnmixingImageFilter.txx index 6fa00eebea..4b1bb48a1c 100644 --- a/Code/Hyperspectral/otbISRAUnmixingImageFilter.txx +++ b/Code/Hyperspectral/otbISRAUnmixingImageFilter.txx @@ -91,7 +91,7 @@ ISRAUnmixingFunctor<TInput, TOutput, TPrecision> { // TODO : support different types between input and output ? VectorType inVector(in.Size()); - for (unsigned int i = 0; i < in.GetSize(); i++ ) + for (unsigned int i = 0; i < in.GetSize(); ++i ) { inVector[i] = in[i]; } @@ -135,7 +135,7 @@ ISRAUnmixingFunctor<TInput, TOutput, TPrecision> } OutputType out(outVector.size()); - for (unsigned int i = 0; i < out.GetSize(); i++ ) + for (unsigned int i = 0; i < out.GetSize(); ++i ) { out[i] = outVector[i]; } diff --git a/Code/Hyperspectral/otbLocalRxDetectorFilter.txx b/Code/Hyperspectral/otbLocalRxDetectorFilter.txx index 7c9118b86a..f97e5cedff 100644 --- a/Code/Hyperspectral/otbLocalRxDetectorFilter.txx +++ b/Code/Hyperspectral/otbLocalRxDetectorFilter.txx @@ -171,13 +171,13 @@ LocalRxDetectorFilter<TInputImage, TOutputImage> testPixVec = inputPtr->GetPixel(inputIt.GetIndex()); VectorMeasurementType meanVec(meanVector->GetNumberOfElements()); - for(unsigned int i = 0; i < meanVector->GetNumberOfElements(); i++) + for(unsigned int i = 0; i < meanVector->GetNumberOfElements(); ++i) { meanVec.SetElement(i, meanVector->GetElement(i)); } typename MatrixType::InternalMatrixType centeredTestPixMat(meanVector->GetNumberOfElements(), 1); - for (unsigned int i = 0; i < centeredTestPixMat.rows(); i++) + for (unsigned int i = 0; i < centeredTestPixMat.rows(); ++i) { centeredTestPixMat.put(i, 0, (testPixVec.GetElement(i) - meanVector->GetElement(i))); } diff --git a/Code/Hyperspectral/otbLocalRxDetectorNonThreadFilter.txx b/Code/Hyperspectral/otbLocalRxDetectorNonThreadFilter.txx index a61ce9917f..35a383d25f 100644 --- a/Code/Hyperspectral/otbLocalRxDetectorNonThreadFilter.txx +++ b/Code/Hyperspectral/otbLocalRxDetectorNonThreadFilter.txx @@ -151,13 +151,13 @@ LocalRxDetectorNonThreadFilter<TInputImage, TOutputImage> testPixVec = inputPtr->GetPixel(inputIt.GetIndex()); VectorMeasurementType meanVec(meanVector->GetNumberOfElements()); - for(unsigned int i = 0; i < meanVector->GetNumberOfElements(); i++) + for(unsigned int i = 0; i < meanVector->GetNumberOfElements(); ++i) { meanVec.SetElement(i, meanVector->GetElement(i)); } typename MatrixType::InternalMatrixType centeredTestPixMat(meanVector->GetNumberOfElements(), 1); - for (unsigned int i = 0; i < centeredTestPixMat.rows(); i++) + for (unsigned int i = 0; i < centeredTestPixMat.rows(); ++i) { centeredTestPixMat.put(i, 0, (testPixVec.GetElement(i) - meanVector->GetElement(i))); } diff --git a/Code/Hyperspectral/otbNCLSUnmixingImageFilter.txx b/Code/Hyperspectral/otbNCLSUnmixingImageFilter.txx index 4d62702dfb..50bd43b675 100644 --- a/Code/Hyperspectral/otbNCLSUnmixingImageFilter.txx +++ b/Code/Hyperspectral/otbNCLSUnmixingImageFilter.txx @@ -93,7 +93,7 @@ NCLSUnmixingFunctor<TInput, TOutput, TPrecision> { // TODO : support different types between input and output ? VectorType inVector(in.Size()); - for (unsigned int i = 0; i < in.GetSize(); i++ ) + for (unsigned int i = 0; i < in.GetSize(); ++i ) { inVector[i] = in[i]; } @@ -119,7 +119,7 @@ NCLSUnmixingFunctor<TInput, TOutput, TPrecision> } OutputType out(nclsVector.size()); - for (unsigned int i = 0; i < out.GetSize(); i++ ) + for (unsigned int i = 0; i < out.GetSize(); ++i ) { out[i] = nclsVector[i]; } diff --git a/Code/Hyperspectral/otbSparseUnmixingImageFilter.txx b/Code/Hyperspectral/otbSparseUnmixingImageFilter.txx index b92ce4fe87..ca29a89498 100644 --- a/Code/Hyperspectral/otbSparseUnmixingImageFilter.txx +++ b/Code/Hyperspectral/otbSparseUnmixingImageFilter.txx @@ -147,7 +147,7 @@ SparseUnmixingImageFilter< TInputImage, TOutputImage, TPrecision, TMotherWavelet progress->RegisterInternalFilter(m_Transformer, 0.25f); this->SetNumberOfOutputs( m_Transformer->GetNumberOfOutputs() ); - for ( unsigned int i = 0; i < this->GetNumberOfOutputs(); i++ ) + for ( unsigned int i = 0; i < this->GetNumberOfOutputs(); ++i ) { this->SetNthOutput(i, OutputImageType::New()); m_Transformer->GraftNthOutput( i, this->GetOutput(i) ); @@ -155,7 +155,7 @@ SparseUnmixingImageFilter< TInputImage, TOutputImage, TPrecision, TMotherWavelet m_Transformer->Update(); - for ( unsigned int i = 0; i < this->GetNumberOfOutputs(); i++ ) + for ( unsigned int i = 0; i < this->GetNumberOfOutputs(); ++i ) { this->GraftNthOutput( i, m_Transformer->GetOutput(i) ); } diff --git a/Code/Hyperspectral/otbUnConstrainedLeastSquareImageFilter.h b/Code/Hyperspectral/otbUnConstrainedLeastSquareImageFilter.h index 177fe5acdf..8bbf95254c 100644 --- a/Code/Hyperspectral/otbUnConstrainedLeastSquareImageFilter.h +++ b/Code/Hyperspectral/otbUnConstrainedLeastSquareImageFilter.h @@ -74,7 +74,7 @@ public: { // TODO : support different types between input and output ? VectorType inVector(in.Size()); - for (unsigned int i = 0; i < in.GetSize(); i++ ) + for (unsigned int i = 0; i < in.GetSize(); ++i ) { inVector[i] = in[i]; } @@ -82,7 +82,7 @@ public: VectorType outVector = m_Inv * inVector; OutputType out(outVector.size()); - for (unsigned int i = 0; i < out.GetSize(); i++ ) + for (unsigned int i = 0; i < out.GetSize(); ++i ) { out[i] = outVector[i]; } diff --git a/Code/Hyperspectral/otbVcaImageFilter.txx b/Code/Hyperspectral/otbVcaImageFilter.txx index f2a9c2654e..43e0bcfcb4 100644 --- a/Code/Hyperspectral/otbVcaImageFilter.txx +++ b/Code/Hyperspectral/otbVcaImageFilter.txx @@ -368,7 +368,7 @@ void VCAImageFilter<TImage>::GenerateData() { vnl_vector<PrecisionType> e = E.get_column(i); typename VectorImageType::PixelType pixel(input->GetNumberOfComponentsPerPixel()); - for (unsigned int j = 0; j < e.size(); j++) + for (unsigned int j = 0; j < e.size(); ++j) { pixel[j] = E(j, i); } diff --git a/Code/IO/otbGDALImageIO.cxx b/Code/IO/otbGDALImageIO.cxx index e5f1950313..8c2ceee0fd 100644 --- a/Code/IO/otbGDALImageIO.cxx +++ b/Code/IO/otbGDALImageIO.cxx @@ -529,7 +529,7 @@ bool GDALImageIO::GetSubDatasetInfo(std::vector<std::string> &names, std::vector ( (strcmp(m_Dataset->GetDataSet()->GetDriver()->GetDescription(),"HDF4") == 0) || (strcmp(m_Dataset->GetDataSet()->GetDriver()->GetDescription(),"HDF5") == 0) ) ) { - for (int cpt = 0; papszMetadata[cpt] != NULL; cpt++) + for (int cpt = 0; papszMetadata[cpt] != NULL; ++cpt) { std::string key, name; if (System::ParseHdfSubsetName(papszMetadata[cpt], key, name)) @@ -587,7 +587,7 @@ void GDALImageIO::InternalReadImageInformation() std::vector<std::string> names; if( CSLCount(papszMetadata) > 0 ) { - for( int cpt = 0; papszMetadata[cpt] != NULL; cpt++ ) + for( int cpt = 0; papszMetadata[cpt] != NULL; ++cpt ) { std::string key, name; if (System::ParseHdfSubsetName(papszMetadata[cpt], key, name)) @@ -874,7 +874,7 @@ void GDALImageIO::InternalReadImageInformation() itk::EncapsulateMetaData<unsigned int>(dict, MetaDataKey::GCPCountKey, gcpCount); - for (unsigned int cpt = 0; cpt < gcpCount; cpt++) + for (unsigned int cpt = 0; cpt < gcpCount; ++cpt) { const GDAL_GCP *psGCP; @@ -909,7 +909,7 @@ void GDALImageIO::InternalReadImageInformation() if (dataset->GetGeoTransform(adfGeoTransform) == CE_None) { - for (int cpt = 0; cpt < 6; cpt++) + for (int cpt = 0; cpt < 6; ++cpt) VadfGeoTransform.push_back(adfGeoTransform[cpt]); itk::EncapsulateMetaData<MetaDataKey::VectorType>(dict, MetaDataKey::GeoTransformKey, VadfGeoTransform); @@ -948,7 +948,7 @@ void GDALImageIO::InternalReadImageInformation() { std::string key; - for (int cpt = 0; papszMetadata[cpt] != NULL; cpt++) + for (int cpt = 0; papszMetadata[cpt] != NULL; ++cpt) { std::ostringstream lStream; lStream << MetaDataKey::MetadataKey << cpt; @@ -968,7 +968,7 @@ void GDALImageIO::InternalReadImageInformation() { std::string key; - for (int cpt = 0; papszMetadata[cpt] != NULL; cpt++) + for (int cpt = 0; papszMetadata[cpt] != NULL; ++cpt) { std::ostringstream lStream; lStream << MetaDataKey::SubMetadataKey << cpt; diff --git a/Code/IO/otbImageFileReader.txx b/Code/IO/otbImageFileReader.txx index 82c4539516..b29af061f8 100644 --- a/Code/IO/otbImageFileReader.txx +++ b/Code/IO/otbImageFileReader.txx @@ -545,7 +545,7 @@ ImageFileReader<TOutputImage> fic_trouve = true; } } - cpt++; + ++cpt; } } else diff --git a/Code/IO/otbImageToOSMVectorDataGenerator.txx b/Code/IO/otbImageToOSMVectorDataGenerator.txx index 3945954082..c86a524c63 100644 --- a/Code/IO/otbImageToOSMVectorDataGenerator.txx +++ b/Code/IO/otbImageToOSMVectorDataGenerator.txx @@ -118,7 +118,7 @@ ImageToOSMVectorDataGenerator<TImage> vindex.push_back(index3); vindex.push_back(index4); - for (unsigned int i = 0; i < vindex.size(); i++) + for (unsigned int i = 0; i < vindex.size(); ++i) { PointType physicalPoint; input->TransformIndexToPhysicalPoint(vindex[i], physicalPoint); @@ -133,7 +133,7 @@ ImageToOSMVectorDataGenerator<TImage> double minY = voutput[0][1]; double maxY = voutput[0][1]; - for (unsigned int i = 0; i < voutput.size(); i++) + for (unsigned int i = 0; i < voutput.size(); ++i) { // Origins if (minX > voutput[i][0]) diff --git a/Code/IO/otbKmzProductWriter.txx b/Code/IO/otbKmzProductWriter.txx index 194528185f..80984554d1 100644 --- a/Code/IO/otbKmzProductWriter.txx +++ b/Code/IO/otbKmzProductWriter.txx @@ -211,7 +211,7 @@ void KmzProductWriter<TInputImage> ::ProcessLegends() { - for (unsigned int idx = 0; idx < m_LegendVector.size(); idx++) + for (unsigned int idx = 0; idx < m_LegendVector.size(); ++idx) { std::ostringstream legendName; legendName << m_Path; @@ -283,7 +283,7 @@ KmzProductWriter<TInputImage> // Compute nbTile int nbTile = 0; - for (int i = 0; i <= maxDepth; i++) + for (int i = 0; i <= maxDepth; ++i) { int ratio = static_cast<int>(vcl_pow(2., (maxDepth - i))); nbTile += (((sizeX / ratio) / m_TileSize) + 1) * (((sizeY / ratio) / m_TileSize) + 1); @@ -861,7 +861,7 @@ KmzProductWriter<TInputImage> m_RootKmlFile << "\t\t\t\t\t<description>" << std::endl; m_RootKmlFile << "\t\t\t\t\t\t<![CDATA[ Legend of the product " << m_FileName << std::endl; - for(unsigned int idx = 0; idx < m_LegendVector.size(); idx++) + for(unsigned int idx = 0; idx < m_LegendVector.size(); ++idx) m_RootKmlFile << "\t\t\t\t\t\t<img src=\"legends/legend_"<< idx <<".jpeg\" width=\"215\" height=\"175\" >"; m_RootKmlFile << "\t\t\t\t\t\t ]]>" << std::endl; @@ -1410,7 +1410,7 @@ KmzProductWriter<TInputImage> while (i < tempName.length()) { if (tempName[i] != ' ') currentImageName += tempName[i]; - i++; + ++i; } return currentImageName; diff --git a/Code/IO/otbOGRIOHelper.cxx b/Code/IO/otbOGRIOHelper.cxx index ffb99c79f2..fb3b6becb5 100644 --- a/Code/IO/otbOGRIOHelper.cxx +++ b/Code/IO/otbOGRIOHelper.cxx @@ -731,7 +731,7 @@ unsigned int OGRIOHelper ogrFeature = OGRFeature::CreateFeature(ogrCurrentLayer->GetLayerDefn()); // Add the fields to the features - for (unsigned int i = 0; i < kwl.GetNumberOfFields(); i++) + for (unsigned int i = 0; i < kwl.GetNumberOfFields(); ++i) { // Get the key of the Nth OGRFieldRefn const char * key = kwl.GetNthField(i).first->GetNameRef(); @@ -789,7 +789,7 @@ unsigned int OGRIOHelper ogrFeature = OGRFeature::CreateFeature(ogrCurrentLayer->GetLayerDefn()); // Add the fields to the features - for (unsigned int i = 0; i < kwl.GetNumberOfFields(); i++) + for (unsigned int i = 0; i < kwl.GetNumberOfFields(); ++i) { // Get the key of the Nth OGRFieldRefn const char * key = kwl.GetNthField(i).first->GetNameRef(); @@ -874,7 +874,7 @@ unsigned int OGRIOHelper ogrFeature = OGRFeature::CreateFeature(ogrCurrentLayer->GetLayerDefn()); // Add the fields to the features - for (unsigned int i = 0; i < kwl.GetNumberOfFields(); i++) + for (unsigned int i = 0; i < kwl.GetNumberOfFields(); ++i) { // Get the key of the Nth OGRFieldRefn const char * key = kwl.GetNthField(i).first->GetNameRef(); diff --git a/Code/IO/otbOSMDataToVectorDataGenerator.cxx b/Code/IO/otbOSMDataToVectorDataGenerator.cxx index 96a1a7e553..f0f9c6c333 100644 --- a/Code/IO/otbOSMDataToVectorDataGenerator.cxx +++ b/Code/IO/otbOSMDataToVectorDataGenerator.cxx @@ -249,7 +249,7 @@ OSMDataToVectorDataGenerator::AddKeyTypeToMap(const std::string& key, const std: bool found = false; // Add the type if not present - for(unsigned int i = 0; i < currentTypes.size(); i++) + for(unsigned int i = 0; i < currentTypes.size(); ++i) { if(currentTypes[i].compare(value) == 0) found = true; @@ -291,7 +291,7 @@ OSMDataToVectorDataGenerator::ProcessVectorData(const std::string& key, const st m_OutputVectorData->GetDataTree()->Add(folder, document); // Form the vector data with the values parsed - for(unsigned int idx = 0; idx < m_VectorDataElementList.size(); idx++) + for(unsigned int idx = 0; idx < m_VectorDataElementList.size(); ++idx) { // Instanciate a datanode DataNodeType::Pointer currentDataNode = DataNodeType::New(); @@ -396,7 +396,7 @@ OSMDataToVectorDataGenerator::GetVectorDataByName(const std::string& key, const bool OSMDataToVectorDataGenerator::IsKeyPresent(const std::string& key) { - for(unsigned int i = 0; i < m_KeyList.size(); i++) + for(unsigned int i = 0; i < m_KeyList.size(); ++i) if(m_KeyList[i].compare(key) == 0) return true; diff --git a/Code/IO/otbScalarBufferToImageFileWriter.txx b/Code/IO/otbScalarBufferToImageFileWriter.txx index cd317451cb..3692da51b8 100644 --- a/Code/IO/otbScalarBufferToImageFileWriter.txx +++ b/Code/IO/otbScalarBufferToImageFileWriter.txx @@ -74,10 +74,10 @@ ScalarBufferToImageFileWriter<TBufferType, TOutputPixelType>::GenerateData() unsigned int cpt(0); while( it.IsAtEnd()==false ) { - for(unsigned int i=0; i<m_NumberOfChannels; i++) + for(unsigned int i=0; i<m_NumberOfChannels; ++i) { lPix[i] = static_cast<OutputPixelType>(m_Buffer[cpt]); - cpt++; + ++cpt; } it.Set( lPix ); @@ -95,7 +95,7 @@ ScalarBufferToImageFileWriter<TBufferType, TOutputPixelType>::GenerateData() IndexType index = it.GetIndex(); cpt = (m_ImageSize[1] - 1 - index[1]) * m_NumberOfChannels * m_ImageSize[0] + m_NumberOfChannels * index[0]; - for(unsigned int i=0; i<m_NumberOfChannels; i++) + for(unsigned int i=0; i<m_NumberOfChannels; ++i) { lPix[i] = static_cast<OutputPixelType>(m_Buffer[cpt+i]); } diff --git a/Code/IO/otbSpectralSensitivityReader.cxx b/Code/IO/otbSpectralSensitivityReader.cxx index b29cd84335..acf52c95a5 100644 --- a/Code/IO/otbSpectralSensitivityReader.cxx +++ b/Code/IO/otbSpectralSensitivityReader.cxx @@ -152,7 +152,7 @@ SpectralSensitivityReader { mini = atof(keywordStrings[0].c_str()); nbBands = keywordStrings.size() - 2; - for (unsigned int j = 0; j < nbBands; j++) + for (unsigned int j = 0; j < nbBands; ++j) { wavelengthSpectralBand->PushBack(FilterFunctionValues::New()); ValuesVectorType temp; @@ -163,7 +163,7 @@ SpectralSensitivityReader if (nbBands != keywordStrings.size() - 2) itkExceptionMacro(<< "Invalid file format"); - for (unsigned int i = 0; i < nbBands; i++) + for (unsigned int i = 0; i < nbBands; ++i) { valuesVector[i].push_back(atof(keywordStrings[i + 2].c_str())); } @@ -171,7 +171,7 @@ SpectralSensitivityReader maxi = atof(keywordStrings[0].c_str()); } //while ( std::getline( file, line ) ) - for (unsigned int j = 0; j < nbBands; j++) + for (unsigned int j = 0; j < nbBands; ++j) { wavelengthSpectralBand->GetNthElement(j)->SetFilterFunctionValues(valuesVector[j]); wavelengthSpectralBand->GetNthElement(j)->SetMinSpectralValue(mini); diff --git a/Code/IO/otbTerraSarImageMetadataInterface.cxx b/Code/IO/otbTerraSarImageMetadataInterface.cxx index fa9f2a6481..dd06873cf4 100644 --- a/Code/IO/otbTerraSarImageMetadataInterface.cxx +++ b/Code/IO/otbTerraSarImageMetadataInterface.cxx @@ -409,7 +409,7 @@ TerraSarImageMetadataInterface::GetNoisePolynomialDegrees() const std::ostringstream oss; unsigned int nbRec = this->GetNumberOfNoiseRecords(); - for (unsigned int i = 0; i < nbRec; i++) + for (unsigned int i = 0; i < nbRec; ++i) { oss.str(""); oss << "noise[" << i << "]imageNoise.noiseEstimate.polynomialDegree"; @@ -447,7 +447,7 @@ TerraSarImageMetadataInterface polCoef.clear(); // set <= condition because degree N means N+1 coeff - for (unsigned int j = 0; j <= polDegs; j++) + for (unsigned int j = 0; j <= polDegs; ++j) { oss.str(""); oss << "noise[" << noiseRecord << "]imageNoise.noiseEstimate.coefficient[" << j << "]"; @@ -484,11 +484,11 @@ TerraSarImageMetadataInterface::GetNoisePolynomialCoefficientsList() const DoubleVectorType polCoef; std::ostringstream oss; - for (unsigned int i = 0; i < nbRec; i++) + for (unsigned int i = 0; i < nbRec; ++i) { polCoef.clear(); // set <= condition because degree N means N+1 coeff - for (unsigned int j = 0; j <= polDegs.size(); j++) + for (unsigned int j = 0; j <= polDegs.size(); ++j) { oss.str(""); oss << "noise[" << i << "]imageNoise.noiseEstimate.coefficient[" << j << "]"; @@ -585,7 +585,7 @@ TerraSarImageMetadataInterface::GetNoiseTimeUTCList() const std::ostringstream oss; unsigned int nbRec = this->GetNumberOfNoiseRecords(); - for (unsigned int i = 0; i < nbRec; i++) + for (unsigned int i = 0; i < nbRec; ++i) { oss.str(""); oss << "noise[" << i << "]imageNoise.timeUTC"; @@ -618,7 +618,7 @@ TerraSarImageMetadataInterface::GetNoiseValidityRangeMaxList() const std::ostringstream oss; unsigned int nbRec = this->GetNumberOfNoiseRecords(); - for (unsigned int i = 0; i < nbRec; i++) + for (unsigned int i = 0; i < nbRec; ++i) { oss.str(""); oss << "noise[" << i << "]imageNoise.noiseEstimate.validityRangeMax"; @@ -649,7 +649,7 @@ TerraSarImageMetadataInterface::GetNoiseValidityRangeMinList() const std::ostringstream oss; unsigned int nbRec = this->GetNumberOfNoiseRecords(); - for (unsigned int i = 0; i < nbRec; i++) + for (unsigned int i = 0; i < nbRec; ++i) { oss.str(""); oss << "noise[" << i << "]imageNoise.noiseEstimate.validityRangeMin"; @@ -710,7 +710,7 @@ TerraSarImageMetadataInterface::GetNoiseReferencePointList() const std::ostringstream oss; unsigned int nbRec = this->GetNumberOfNoiseRecords(); - for (unsigned int i = 0; i < nbRec; i++) + for (unsigned int i = 0; i < nbRec; ++i) { oss.str(""); oss << "noise[" << i << "]imageNoise.noiseEstimate.referencePoint"; @@ -825,7 +825,7 @@ TerraSarImageMetadataInterface::GetMeanIncidenceAngles() const unsigned int nbAngles = this->GetNumberOfCornerIncidenceAngles(); std::ostringstream oss; - for (unsigned int i = 0; i < nbAngles; i++) + for (unsigned int i = 0; i < nbAngles; ++i) { oss.str(""); oss << "sceneCoord.sceneCornerCoord[" << i << "].incidenceAngle"; @@ -895,7 +895,7 @@ TerraSarImageMetadataInterface::GetCornersIncidenceAngles() const std::ostringstream oss; unsigned int nbAngles = this->GetNumberOfCornerIncidenceAngles(); - for (unsigned int i = 0; i < nbAngles; i++) + for (unsigned int i = 0; i < nbAngles; ++i) { oss.str(""); oss << "sceneCoord.sceneCornerCoord[" << i << "].incidenceAngle"; @@ -926,7 +926,7 @@ TerraSarImageMetadataInterface::GetCornersIncidenceAnglesIndex() const std::ostringstream oss2; unsigned int nbAngles = this->GetNumberOfCornerIncidenceAngles(); - for (unsigned int i = 0; i < nbAngles; i++) + for (unsigned int i = 0; i < nbAngles; ++i) { TerraSarImageMetadataInterface::IndexType it; diff --git a/Code/IO/otbTileMapImageIO.cxx b/Code/IO/otbTileMapImageIO.cxx index 11f25e511a..a9f4d1bfff 100644 --- a/Code/IO/otbTileMapImageIO.cxx +++ b/Code/IO/otbTileMapImageIO.cxx @@ -389,7 +389,7 @@ void TileMapImageIO::BuildFileName(const std::ostringstream& quad, std::ostrings { directory << "/"; directory << (quad.str().c_str())[i]; - i++; + ++i; } itksys::SystemTools::MakeDirectory(directory.str().c_str()); @@ -677,7 +677,7 @@ void TileMapImageIO::InternalWrite(double x, double y, const void* buffer) imageIO->WriteImageInformation(); itk::ImageIORegion ioRegion(2); - for (unsigned int i = 0; i < 2; i++) + for (unsigned int i = 0; i < 2; ++i) { ioRegion.SetSize(i, m_TileSize); ioRegion.SetIndex(i, 0); diff --git a/Code/IO/otbVectorDataAdapter.txx b/Code/IO/otbVectorDataAdapter.txx index b0bc4287fe..a7ad11ccfb 100644 --- a/Code/IO/otbVectorDataAdapter.txx +++ b/Code/IO/otbVectorDataAdapter.txx @@ -65,7 +65,7 @@ VectorDataAdapter<TInputVectorData, TOutputVectorData> // fixme handle 2.5D ? newLine->AddVertex(index); - it++; + ++it; } return newLine; @@ -94,7 +94,7 @@ VectorDataAdapter<TInputVectorData, TOutputVectorData> // fixme handle 2.5D ? newPolygon->AddVertex(index); - it++; + ++it; } return newPolygon; } diff --git a/Code/Learning/otbConfusionMatrixCalculator.txx b/Code/Learning/otbConfusionMatrixCalculator.txx index 3c83b37447..5a8b9bbf71 100644 --- a/Code/Learning/otbConfusionMatrixCalculator.txx +++ b/Code/Learning/otbConfusionMatrixCalculator.txx @@ -92,7 +92,7 @@ ConfusionMatrixCalculator<TRefListLabel, TProdListLabel> std::vector<long int> samplesPerClass; - for (unsigned int i = 0; i < m_NumberOfClasses; i++) + for (unsigned int i = 0; i < m_NumberOfClasses; ++i) samplesPerClass.push_back(0); m_ConfusionMatrix = ConfusionMatrixType(m_NumberOfClasses, m_NumberOfClasses); diff --git a/Code/Learning/otbExhaustiveExponentialOptimizer.cxx b/Code/Learning/otbExhaustiveExponentialOptimizer.cxx index 56268718aa..9dcbc5b3aa 100644 --- a/Code/Learning/otbExhaustiveExponentialOptimizer.cxx +++ b/Code/Learning/otbExhaustiveExponentialOptimizer.cxx @@ -69,7 +69,7 @@ ExhaustiveExponentialOptimizer const unsigned int spaceDimension = this->GetInitialPosition().GetSize(); - for (unsigned int i = 0; i < spaceDimension; i++) + for (unsigned int i = 0; i < spaceDimension; ++i) { m_MaximumNumberOfIterations *= (2 * m_NumberOfSteps[i] + 1); } @@ -91,7 +91,7 @@ ExhaustiveExponentialOptimizer // Setup first grid position. ParametersType position(spaceDimension); - for (unsigned int i = 0; i < spaceDimension; i++) + for (unsigned int i = 0; i < spaceDimension; ++i) { position[i] = this->GetInitialPosition()[i] * vcl_pow(m_GeometricProgression, -static_cast<double>(m_NumberOfSteps[i]) * m_StepLength) * scales[i]; @@ -188,7 +188,7 @@ ExhaustiveExponentialOptimizer if (m_CurrentIndex[idx] > (2 * m_NumberOfSteps[idx])) { m_CurrentIndex[idx] = 0; - idx++; + ++idx; } else { @@ -201,7 +201,7 @@ ExhaustiveExponentialOptimizer m_Stop = true; } - for (unsigned int i = 0; i < spaceDimension; i++) + for (unsigned int i = 0; i < spaceDimension; ++i) { newPosition[i] = this->GetInitialPosition()[i] * this->GetScales()[i] diff --git a/Code/Learning/otbGaussianAdditiveNoiseSampleListFilter.txx b/Code/Learning/otbGaussianAdditiveNoiseSampleListFilter.txx index 9cffcc89ef..36e60e3f3b 100644 --- a/Code/Learning/otbGaussianAdditiveNoiseSampleListFilter.txx +++ b/Code/Learning/otbGaussianAdditiveNoiseSampleListFilter.txx @@ -52,7 +52,7 @@ GaussianAdditiveNoiseSampleListFilter<TInputSampleList, TOutputSampleList> itkExceptionMacro(<< "MeasurementVector size is "<<size << " , expected non null size " ); } else - for(unsigned int i = 0; i <size; i++) + for(unsigned int i = 0; i <size; ++i) { double ran = generator->GetNormalVariate(m_Mean, m_Variance); m_WhiteGaussianNoiseCoefficients.push_back(ran); diff --git a/Code/Learning/otbSOMWithMissingValue.txx b/Code/Learning/otbSOMWithMissingValue.txx index 6b154a26ae..806295094c 100644 --- a/Code/Learning/otbSOMWithMissingValue.txx +++ b/Code/Learning/otbSOMWithMissingValue.txx @@ -82,19 +82,19 @@ SOMWithMissingValue<TListSample, TMap, TSOMLearningBehaviorFunctor, TSOMNeighbor // Iterate over the neighborhood ot the winner neuron it.SetLocation(position); - for (unsigned int i = 0; i < it.Size(); i++) + for (unsigned int i = 0; i < it.Size(); ++i) { typename NeighborhoodIteratorType::OffsetType offset = it.GetOffset(i); // The neighborhood is of elliptic shape double theDistance = itk::NumericTraits<double>::Zero; - for (int j = 0; j < MapType::ImageDimension; j++) + for (int j = 0; j < MapType::ImageDimension; ++j) theDistance += pow(static_cast<double>(offset[j]), 2.0) / pow(static_cast<double>(radius[j]), 2.0); if (theDistance <= 1.0) { - for (int j = 0; j < MapType::ImageDimension; j++) + for (int j = 0; j < MapType::ImageDimension; ++j) { int pos = offset[j] + position[j]; positionToUpdate[j] = (pos >= 0) ? @@ -106,7 +106,7 @@ SOMWithMissingValue<TListSample, TMap, TSOMLearningBehaviorFunctor, TSOMNeighbor NeuronType newNeuron(tempNeuron); double tempBeta = beta / (1.0 + theDistance); - for (unsigned int j = 0; j < newNeuron.Size(); j++) + for (unsigned int j = 0; j < newNeuron.Size(); ++j) { if (!DistanceType::IsMissingValue(sample[j])) newNeuron[j] += static_cast<typename NeuronType::ValueType>( diff --git a/Code/Learning/otbSVMModel.txx b/Code/Learning/otbSVMModel.txx index 0a2bf4964d..581d401192 100644 --- a/Code/Learning/otbSVMModel.txx +++ b/Code/Learning/otbSVMModel.txx @@ -274,7 +274,7 @@ SVMModel<TValue, TLabel>::CrossValidation(unsigned int nbFolders) int i; double total_correct = 0.; - for (i = 0; i < length; i++) + for (i = 0; i < length; ++i) { if (target[i] == m_Problem.y[i]) { @@ -496,7 +496,7 @@ SVMModel<TValue, TLabel>::EvaluateProbabilities(const MeasurementType& measure) std::sort(orderedLabels.begin(), orderedLabels.end()); ProbabilitiesVectorType probabilities(nr_class); - for (int i = 0; i < nr_class; i++) + for (int i = 0; i < nr_class; ++i) { // svm_predict_probability is such that "dec_values[i]" corresponds to label "labels[i]" std::vector<int>::iterator it = std::find(orderedLabels.begin(), orderedLabels.end(), labels[i]); diff --git a/Code/MultiScale/otbMorphologicalPyramidSegmenter.txx b/Code/MultiScale/otbMorphologicalPyramidSegmenter.txx index 308157edf4..cc6c1bd11e 100644 --- a/Code/MultiScale/otbMorphologicalPyramidSegmenter.txx +++ b/Code/MultiScale/otbMorphologicalPyramidSegmenter.txx @@ -257,7 +257,7 @@ Segmenter<TInputImage, TOutputImage> index[0] = static_cast<long int>(it.Value()[0]); index[1] = static_cast<long int>(it.Value()[1]); connectedThreshold->AddSeed(index); - it++; + ++it; } // segmentation diff --git a/Code/MultiScale/otbSubsampleImageFilter.txx b/Code/MultiScale/otbSubsampleImageFilter.txx index 13304674d8..cdcb7b7b17 100644 --- a/Code/MultiScale/otbSubsampleImageFilter.txx +++ b/Code/MultiScale/otbSubsampleImageFilter.txx @@ -39,7 +39,7 @@ SubsampleImageFilter<TInputImage, TOutputImage, TDirectionOfTransformation> { Superclass::PrintSelf(os, indent); os << indent << "SubsampleFactor = [" << m_SubsampleFactor[0]; - for (unsigned int i = 1; i < InputImageDimension; i++) + for (unsigned int i = 1; i < InputImageDimension; ++i) { os << ", " << m_SubsampleFactor[i]; } @@ -52,7 +52,7 @@ bool SubsampleImageFilter<TInputImage, TOutputImage, TDirectionOfTransformation> ::IsSubsampleFactorOne() const { - for (unsigned int i = 0; i < InputImageDimension; i++) + for (unsigned int i = 0; i < InputImageDimension; ++i) { if (m_SubsampleFactor[i] != 1) return false; } @@ -93,7 +93,7 @@ SubsampleImageFilter<TInputImage, TOutputImage, TDirectionOfTransformation> typename InputImageRegionType::IndexType destIndex; typename InputImageRegionType::SizeType destSize; - for (unsigned int i = 0; i < InputImageDimension; i++) + for (unsigned int i = 0; i < InputImageDimension; ++i) { // TODO: This seems not right in odd index cases destIndex[i] = srcIndex[i] / m_SubsampleFactor[i]; @@ -122,7 +122,7 @@ SubsampleImageFilter<TInputImage, TOutputImage, TDirectionOfTransformation> typename OutputImageRegionType::IndexType destIndex; typename OutputImageRegionType::SizeType destSize; - for (unsigned int i = 0; i < InputImageDimension; i++) + for (unsigned int i = 0; i < InputImageDimension; ++i) { destIndex[i] = srcIndex[i] * m_SubsampleFactor[i]; destSize[i] = srcSize[i] * m_SubsampleFactor[i]; @@ -187,7 +187,7 @@ SubsampleImageFilter<TInputImage, TOutputImage, TDirectionOfTransformation> { InputImageIndexType inputIndex = inputIter.GetIndex(); OutputImageIndexType outputIndex; - for (unsigned int i = 0; i < OutputImageDimension; i++) + for (unsigned int i = 0; i < OutputImageDimension; ++i) { outputIndex[i] = inputIndex[i] * m_SubsampleFactor[i]; } diff --git a/Code/MultiScale/otbWaveletFilterBank.txx b/Code/MultiScale/otbWaveletFilterBank.txx index b5806fb972..1c151dedbf 100644 --- a/Code/MultiScale/otbWaveletFilterBank.txx +++ b/Code/MultiScale/otbWaveletFilterBank.txx @@ -51,7 +51,7 @@ WaveletFilterBank<TInputImage, TOutputImage, TWaveletOperator, Wavelet::FORWARD> unsigned int numOfOutputs = 1 << InputImageDimension; this->SetNumberOfOutputs(numOfOutputs); - for (unsigned int i = 0; i < numOfOutputs; i++) + for (unsigned int i = 0; i < numOfOutputs; ++i) { this->SetNthOutput(i, OutputImageType::New()); } @@ -80,7 +80,7 @@ WaveletFilterBank<TInputImage, TOutputImage, TWaveletOperator, Wavelet::FORWARD> OutputImageRegionType newRegion; this->CallCopyInputRegionToOutputRegion(newRegion, this->GetInput()->GetLargestPossibleRegion()); - for (unsigned int i = 0; i < this->GetNumberOfOutputs(); i++) + for (unsigned int i = 0; i < this->GetNumberOfOutputs(); ++i) { this->GetOutput(i)->SetRegions(newRegion); } @@ -141,7 +141,7 @@ WaveletFilterBank<TInputImage, TOutputImage, TWaveletOperator, Wavelet::FORWARD> if (m_SubsampleImageFactor > 1) { // Check the dimension - for (unsigned int i = 0; i < InputImageDimension; i++) + for (unsigned int i = 0; i < InputImageDimension; ++i) { if ((m_SubsampleImageFactor * (this->GetInput()->GetRequestedRegion().GetSize()[i] / m_SubsampleImageFactor)) @@ -159,7 +159,7 @@ WaveletFilterBank<TInputImage, TOutputImage, TWaveletOperator, Wavelet::FORWARD> { // Internal images will be used only if m_SubsampledInputImages != 1 m_InternalImages.resize(InputImageDimension - 1); - for (unsigned int i = 0; i < m_InternalImages.size(); i++) + for (unsigned int i = 0; i < m_InternalImages.size(); ++i) { // the size is linked to the SubsampleImageFactor that is assume to be 2!!! m_InternalImages[InputImageDimension - 2 - i].resize(1 << (i + 1)); @@ -188,7 +188,7 @@ WaveletFilterBank<TInputImage, TOutputImage, TWaveletOperator, Wavelet::FORWARD> this->CallCopyInputRegionToOutputRegion(InputImageDimension - 1 - direction, smallerRegion, largerRegion); - for (unsigned int i = 0; i < m_InternalImages[direction].size(); i++) + for (unsigned int i = 0; i < m_InternalImages[direction].size(); ++i) { m_InternalImages[InputImageDimension - 2 - direction][i] = OutputImageType::New(); m_InternalImages[InputImageDimension - 2 - direction][i]->SetRegions(smallerRegion); @@ -227,7 +227,7 @@ WaveletFilterBank<TInputImage, TOutputImage, TWaveletOperator, Wavelet::FORWARD> InputIndexType destIndex; InputSizeType destSize; - for (unsigned int i = 0; i < InputImageDimension; i++) + for (unsigned int i = 0; i < InputImageDimension; ++i) { destIndex[i] = srcIndex[i] * GetSubsampleImageFactor(); destSize[i] = srcSize[i] * GetSubsampleImageFactor(); @@ -255,7 +255,7 @@ WaveletFilterBank<TInputImage, TOutputImage, TWaveletOperator, Wavelet::FORWARD> if (radius[0] < highPassOperator.GetRadius()[0]) radius[0] = highPassOperator.GetRadius()[0]; - for (unsigned int i = 1; i < InputImageDimension; i++) + for (unsigned int i = 1; i < InputImageDimension; ++i) radius[i] = 0; InputImageRegionType paddedRegion = destRegion; @@ -287,7 +287,7 @@ WaveletFilterBank<TInputImage, TOutputImage, TWaveletOperator, Wavelet::FORWARD> InputIndexType destIndex; InputSizeType destSize; - for (unsigned int i = 0; i < InputImageDimension; i++) + for (unsigned int i = 0; i < InputImageDimension; ++i) { if (i == direction) { @@ -322,7 +322,7 @@ WaveletFilterBank<TInputImage, TOutputImage, TWaveletOperator, Wavelet::FORWARD> typename OutputImageRegionType::IndexType destIndex; typename OutputImageRegionType::SizeType destSize; - for (unsigned int i = 0; i < InputImageDimension; i++) + for (unsigned int i = 0; i < InputImageDimension; ++i) { // TODO: This seems not right in odd index cases destIndex[i] = srcIndex[i] / GetSubsampleImageFactor(); @@ -351,7 +351,7 @@ WaveletFilterBank<TInputImage, TOutputImage, TWaveletOperator, Wavelet::FORWARD> typename OutputImageRegionType::IndexType destIndex; typename OutputImageRegionType::SizeType destSize; - for (unsigned int i = 0; i < InputImageDimension; i++) + for (unsigned int i = 0; i < InputImageDimension; ++i) { if (i == direction) { @@ -636,7 +636,7 @@ WaveletFilterBank<TInputImage, TOutputImage, TWaveletOperator, Wavelet::INVERSE> { Superclass::GenerateOutputInformation(); - for (unsigned int i = 1; i < this->GetNumberOfInputs(); i++) + for (unsigned int i = 1; i < this->GetNumberOfInputs(); ++i) { for (unsigned int dim = 0; dim < InputImageDimension; dim++) { @@ -690,7 +690,7 @@ throw (itk::InvalidRequestedRegionError) if (radius < highPassOperator.GetRadius()[0]) radius = highPassOperator.GetRadius()[0]; // Get the requested regionand pad it - for (unsigned int idx = 0; idx < this->GetNumberOfInputs(); idx++) + for (unsigned int idx = 0; idx < this->GetNumberOfInputs(); ++idx) { InputImagePointerType input = const_cast<InputImageType*>(this->GetInput(idx)); InputImageRegionType inputRegion = input->GetRequestedRegion(); @@ -721,7 +721,7 @@ WaveletFilterBank<TInputImage, TOutputImage, TWaveletOperator, Wavelet::INVERSE> { // Internal images will be used only if m_SubsampleImageFactor != 1 m_InternalImages.resize(InputImageDimension - 1); - for (unsigned int i = 0; i < m_InternalImages.size(); i++) + for (unsigned int i = 0; i < m_InternalImages.size(); ++i) { // the size is linked to the SubsampleImageFactor that is assume to be 2!!! m_InternalImages[i].resize(1 << (i + 1)); @@ -749,7 +749,7 @@ WaveletFilterBank<TInputImage, TOutputImage, TWaveletOperator, Wavelet::INVERSE> this->CallCopyInputRegionToOutputRegion(direction, largerRegion, smallerRegion); - for (unsigned int i = 0; i < m_InternalImages[direction].size(); i++) + for (unsigned int i = 0; i < m_InternalImages[direction].size(); ++i) { m_InternalImages[direction][i] = OutputImageType::New(); m_InternalImages[direction][i]->SetRegions(largerRegion); @@ -788,7 +788,7 @@ WaveletFilterBank<TInputImage, TOutputImage, TWaveletOperator, Wavelet::INVERSE> InputIndexType destIndex; InputSizeType destSize; - for (unsigned int i = 0; i < InputImageDimension; i++) + for (unsigned int i = 0; i < InputImageDimension; ++i) { // TODO: This seems not right in odd index cases destIndex[i] = srcIndex[i] / GetSubsampleImageFactor(); @@ -815,10 +815,10 @@ WaveletFilterBank<TInputImage, TOutputImage, TWaveletOperator, Wavelet::INVERSE> if (radius[0] < highPassOperator.GetRadius()[0]) radius[0] = highPassOperator.GetRadius()[0]; - for (unsigned int i = 1; i < InputImageDimension; i++) + for (unsigned int i = 1; i < InputImageDimension; ++i) radius[i] = 0; -// for ( unsigned int i = 0; i < InputImageDimension; i++ ) +// for ( unsigned int i = 0; i < InputImageDimension; ++i ) // { // radius[i] = lowPassOperator.GetRadius()[i]; // if ( radius[i] < highPassOperator.GetRadius()[i] ) @@ -852,7 +852,7 @@ WaveletFilterBank<TInputImage, TOutputImage, TWaveletOperator, Wavelet::INVERSE> InputIndexType destIndex; InputSizeType destSize; - for (unsigned int i = 0; i < InputImageDimension; i++) + for (unsigned int i = 0; i < InputImageDimension; ++i) { destIndex[i] = srcIndex[i] * GetSubsampleImageFactor(); destSize[i] = srcSize[i] * GetSubsampleImageFactor(); @@ -880,7 +880,7 @@ WaveletFilterBank<TInputImage, TOutputImage, TWaveletOperator, Wavelet::INVERSE> InputIndexType destIndex; InputSizeType destSize; - for (unsigned int i = 0; i < InputImageDimension; i++) + for (unsigned int i = 0; i < InputImageDimension; ++i) { if (i == direction) { @@ -917,7 +917,7 @@ WaveletFilterBank<TInputImage, TOutputImage, TWaveletOperator, Wavelet::INVERSE> typename OutputImageRegionType::IndexType destIndex; typename OutputImageRegionType::SizeType destSize; - for (unsigned int i = 0; i < InputImageDimension; i++) + for (unsigned int i = 0; i < InputImageDimension; ++i) { if (i == direction) { @@ -969,7 +969,7 @@ WaveletFilterBank<TInputImage, TOutputImage, TWaveletOperator, Wavelet::INVERSE> // Faces iterations typename NeighborhoodIteratorType::RadiusType radiusMax; - for (unsigned int idx = 0; idx < OutputImageDimension; idx++) + for (unsigned int idx = 0; idx < OutputImageDimension; ++idx) { radiusMax[idx] = lowPassOperator.GetRadius(idx); if (radiusMax[idx] < highPassOperator.GetRadius(idx)) radiusMax[idx] = highPassOperator.GetRadius(idx); @@ -1148,7 +1148,7 @@ WaveletFilterBank<TInputImage, TOutputImage, TWaveletOperator, Wavelet::INVERSE> // Faces iterations typename NeighborhoodIteratorType::RadiusType radiusMax; - for (unsigned int i = 0; i < InputImageDimension; i++) + for (unsigned int i = 0; i < InputImageDimension; ++i) { radiusMax[i] = lowPassOperator.GetRadius(i); if (radiusMax[i] < highPassOperator.GetRadius(i)) radiusMax[i] = highPassOperator.GetRadius(i); diff --git a/Code/MultiScale/otbWaveletOperatorBase.h b/Code/MultiScale/otbWaveletOperatorBase.h index c8e5b94311..e197a486a3 100644 --- a/Code/MultiScale/otbWaveletOperatorBase.h +++ b/Code/MultiScale/otbWaveletOperatorBase.h @@ -204,7 +204,7 @@ protected: highPassCoeff[medianPosition] = -coeff[medianPosition]; double sign = 1.; - for (int i = 1; i <= medianPosition; i++) + for (int i = 1; i <= medianPosition; ++i) { highPassCoeff[medianPosition + i] = sign * coeff[medianPosition - i]; highPassCoeff[medianPosition - i] = sign * coeff[medianPosition + i]; diff --git a/Code/MultiScale/otbWaveletOperatorBase.txx b/Code/MultiScale/otbWaveletOperatorBase.txx index c493047d25..2270f2300c 100644 --- a/Code/MultiScale/otbWaveletOperatorBase.txx +++ b/Code/MultiScale/otbWaveletOperatorBase.txx @@ -80,7 +80,7 @@ WaveletOperatorBase<TMotherWaveletOperator, TPixel, VDimension, TAllocator> CoefficientVector newCoeff(length); newCoeff[medianPosition] = coeff[medianPosition]; - for (unsigned int i = 1; i <= medianPosition; i++) + for (unsigned int i = 1; i <= medianPosition; ++i) { newCoeff[medianPosition + i] = coeff[medianPosition - i]; newCoeff[medianPosition - i] = coeff[medianPosition + i]; @@ -100,7 +100,7 @@ WaveletOperatorBase<TMotherWaveletOperator, TPixel, VDimension, TAllocator> CoefficientVector highPassCoeff(length + 2); double sign = -1; - for (unsigned int i = 0; i < length; i++) + for (unsigned int i = 0; i < length; ++i) { highPassCoeff[i] = sign * coeff[i]; sign *= -1.; @@ -129,7 +129,7 @@ WaveletOperatorBase<TMotherWaveletOperator, TPixel, VDimension, TAllocator> CoefficientVector highPassCoeff(length + 2); double sign = 1; - for (unsigned int i = 0; i < length; i++) + for (unsigned int i = 0; i < length; ++i) { highPassCoeff[i] = sign * coeff[i]; sign *= -1.; @@ -157,7 +157,7 @@ WaveletOperatorBase<TMotherWaveletOperator, TPixel, VDimension, TAllocator> const unsigned int length = coeff.size(); assert(length >= 2); CoefficientVector newFilter(length - 2); - for (unsigned int i = 0; i < newFilter.size(); i++) + for (unsigned int i = 0; i < newFilter.size(); ++i) { newFilter[i] = coeff[i + 1]; } diff --git a/Code/MultiScale/otbWaveletPacketTransform.txx b/Code/MultiScale/otbWaveletPacketTransform.txx index 13ecf3d7ce..73c5cfbdd8 100644 --- a/Code/MultiScale/otbWaveletPacketTransform.txx +++ b/Code/MultiScale/otbWaveletPacketTransform.txx @@ -95,7 +95,7 @@ WaveletPacketTransform<TInputImage, TOutputImage, TFilter, Wavelet::FORWARD, TCo filter->Update(); - for (unsigned int idx = 0; idx < filter->GetNumberOfOutputs(); idx++) + for (unsigned int idx = 0; idx < filter->GetNumberOfOutputs(); ++idx) { GenerateData(depth + 1, filter->GetOutput(idx), progress); } @@ -142,7 +142,7 @@ WaveletPacketTransform<TInputImage, TOutputImage, TFilter, Wavelet::INVERSE, OutputImageSizeType outputSize; OutputImageIndexType outputIndex; - for (unsigned int i = 0; i < InputImageDimension; i++) + for (unsigned int i = 0; i < InputImageDimension; ++i) { outputIndex[i] = inputIndex[i] * GetSubsampleImageFactor() * GetDepthOfDecomposition(); outputSize[i] = inputSize[i] * GetSubsampleImageFactor() * GetDepthOfDecomposition(); @@ -220,7 +220,7 @@ WaveletPacketTransform<TInputImage, TOutputImage, TFilter, Wavelet::INVERSE, if (ruleID == m_WaveletPacketRule.size()) return m_FilterList->Size(); - for (unsigned int i = 0; i < m_FilterList->GetNthElement(filterID)->GetNumberOfInputs(); i++) + for (unsigned int i = 0; i < m_FilterList->GetNthElement(filterID)->GetNumberOfInputs(); ++i) { if (m_WaveletPacketRule[ruleID++] == true) { @@ -275,7 +275,7 @@ WaveletPacketTransform<TInputImage, TOutputImage, TFilter, Wavelet::INVERSE, m_NumberOfFilters++; - for (unsigned int i = 0; i < filter->GetNumberOfInputs(); i++) + for (unsigned int i = 0; i < filter->GetNumberOfInputs(); ++i) { ruleID++; InterpretRule(ruleID, curDepth + 1); diff --git a/Code/MultiScale/otbWaveletTransform.txx b/Code/MultiScale/otbWaveletTransform.txx index a6de4b39a2..41cec67f34 100644 --- a/Code/MultiScale/otbWaveletTransform.txx +++ b/Code/MultiScale/otbWaveletTransform.txx @@ -65,7 +65,7 @@ WaveletTransform<TInputImage, TOutputImage, TFilter, Wavelet::FORWARD> 1 + GetNumberOfDecompositions() * (filter->GetNumberOfOutputs() - 1)); std::cerr << "Using " << this->GetOutput()->Size() << " outputs...\n"; - for (unsigned int idx = 0; idx < this->GetOutput()->Size(); idx++) + for (unsigned int idx = 0; idx < this->GetOutput()->Size(); ++idx) { this->GetOutput()->SetNthElement(idx, OutputImageType::New()); } @@ -74,7 +74,7 @@ WaveletTransform<TInputImage, TOutputImage, TFilter, Wavelet::FORWARD> 1.f / static_cast<float>(GetNumberOfDecompositions())); filter->Update(); - for (unsigned int idx = 1; idx < filter->GetNumberOfOutputs(); idx++) + for (unsigned int idx = 1; idx < filter->GetNumberOfOutputs(); ++idx) { this->GetOutput()->SetNthElement( this->GetOutput()->Size() - filter->GetNumberOfOutputs() + idx, @@ -93,7 +93,7 @@ WaveletTransform<TInputImage, TOutputImage, TFilter, Wavelet::FORWARD> 1.f / static_cast<float>(GetNumberOfDecompositions())); filter->Update(); - for (unsigned int idx = 1; idx < filter->GetNumberOfOutputs(); idx++) + for (unsigned int idx = 1; idx < filter->GetNumberOfOutputs(); ++idx) { this->GetOutput()->SetNthElement( this->GetOutput()->Size() - 1 - (nbDecomp + 1) * (filter->GetNumberOfOutputs() - 1) + idx, @@ -137,7 +137,7 @@ WaveletTransform<TInputImage, TOutputImage, TFilter, Wavelet::INVERSE> OutputImageSizeType outputSize; OutputImageIndexType outputIndex; - for (unsigned int i = 0; i < InputImageDimension; i++) + for (unsigned int i = 0; i < InputImageDimension; ++i) { outputIndex[i] = inputIndex[i] * GetSubsampleImageFactor() * GetNumberOfDecompositions(); outputSize[i] = inputSize[i] * GetSubsampleImageFactor() * GetNumberOfDecompositions(); @@ -171,7 +171,7 @@ WaveletTransform<TInputImage, TOutputImage, TFilter, Wavelet::INVERSE> this->GetFilterList()->SetNthElement(0, FilterType::New()); filter = this->GetNthFilter(0); - for (unsigned int i = 0; i < filter->GetNumberOfInputs(); i++) + for (unsigned int i = 0; i < filter->GetNumberOfInputs(); ++i) { filter->SetInput(i, inputIterator.Get()); ++inputIterator; @@ -187,13 +187,13 @@ WaveletTransform<TInputImage, TOutputImage, TFilter, Wavelet::INVERSE> 1.f / static_cast<float>(GetNumberOfDecompositions())); filter->Update(); - for (unsigned int idx = 1; idx < GetNumberOfDecompositions(); idx++) + for (unsigned int idx = 1; idx < GetNumberOfDecompositions(); ++idx) { this->GetFilterList()->SetNthElement(idx, FilterType::New()); filter = this->GetNthFilter(idx); filter->SetInput(0, this->GetNthFilter(idx - 1)->GetOutput()); - for (unsigned int i = 1; i < filter->GetNumberOfInputs(); i++) + for (unsigned int i = 1; i < filter->GetNumberOfInputs(); ++i) { filter->SetInput(i, inputIterator.Get()); ++inputIterator; diff --git a/Code/OBIA/otbBandsStatisticsAttributesLabelMapFilter.txx b/Code/OBIA/otbBandsStatisticsAttributesLabelMapFilter.txx index 0ff176abb5..4ae3e99d63 100644 --- a/Code/OBIA/otbBandsStatisticsAttributesLabelMapFilter.txx +++ b/Code/OBIA/otbBandsStatisticsAttributesLabelMapFilter.txx @@ -235,7 +235,7 @@ BandsStatisticsAttributesLabelMapFilter<TImage, TFeatureImage> } // If there are more than one outputs, allocate the remaining outputs - for (unsigned int i=1; i < this->GetNumberOfOutputs(); i++) + for (unsigned int i=1; i < this->GetNumberOfOutputs(); ++i) { ImagePointer outputPtr; diff --git a/Code/OBIA/otbLabelImageToLabelMapWithAdjacencyFilter.txx b/Code/OBIA/otbLabelImageToLabelMapWithAdjacencyFilter.txx index a44b0aaedd..740e80c925 100644 --- a/Code/OBIA/otbLabelImageToLabelMapWithAdjacencyFilter.txx +++ b/Code/OBIA/otbLabelImageToLabelMapWithAdjacencyFilter.txx @@ -84,7 +84,7 @@ LabelImageToLabelMapWithAdjacencyFilter<TInputImage, TOutputImage> // Clear previous adjacency map m_TemporaryAdjacencyMaps.resize( this->GetNumberOfThreads() ); - for( int i=0; i<this->GetNumberOfThreads(); i++ ) + for( int i=0; i<this->GetNumberOfThreads(); ++i ) { if( i == 0 ) { @@ -320,14 +320,14 @@ LabelImageToLabelMapWithAdjacencyFilter<TInputImage, TOutputImage> // merge the lines from the temporary images in the output image // don't use the first image - that's the output image - for( int i=1; i<this->GetNumberOfThreads(); i++ ) + for( int i=1; i<this->GetNumberOfThreads(); ++i ) { typedef typename OutputImageType::LabelObjectContainerType LabelObjectContainerType; const LabelObjectContainerType & labelObjectContainer = m_TemporaryImages[i]->GetLabelObjectContainer(); for( typename LabelObjectContainerType::const_iterator it = labelObjectContainer.begin(); it != labelObjectContainer.end(); - it++ ) + ++it ) { LabelObjectType * labelObject = it->second; if( output->HasLabel( labelObject->GetLabel() ) ) diff --git a/Code/OBIA/otbLabelMapToGISTableFilter.txx b/Code/OBIA/otbLabelMapToGISTableFilter.txx index 8a694c6768..92dac6ff29 100644 --- a/Code/OBIA/otbLabelMapToGISTableFilter.txx +++ b/Code/OBIA/otbLabelMapToGISTableFilter.txx @@ -138,7 +138,7 @@ LabelMapToGISTableFilter<TLabelMap, TGISTable> typename InputLabelMapType::LabelObjectContainerType::const_iterator it; // And get the object container to reuse it later const typename InputLabelMapType::LabelObjectContainerType& labelObjectContainer = input->GetLabelObjectContainer(); - for (it = labelObjectContainer.begin(); it != labelObjectContainer.end(); it++) + for (it = labelObjectContainer.begin(); it != labelObjectContainer.end(); ++it) { // the label is there if we need it, but it can also be found at labelObject->GetLabel(). // const PType & label = it->first; diff --git a/Code/OBIA/otbLabelMapToVectorDataFilter.txx b/Code/OBIA/otbLabelMapToVectorDataFilter.txx index f14fb4fbff..5a781f18bf 100644 --- a/Code/OBIA/otbLabelMapToVectorDataFilter.txx +++ b/Code/OBIA/otbLabelMapToVectorDataFilter.txx @@ -97,7 +97,7 @@ LabelMapToVectorDataFilter<TLabelMap, TVectorData, TFieldsFunctor> typename InputLabelMapType::LabelObjectContainerType::const_iterator it; // And get the object container to reuse it later const typename InputLabelMapType::LabelObjectContainerType& labelObjectContainer = input->GetLabelObjectContainer(); - for (it = labelObjectContainer.begin(); it != labelObjectContainer.end(); it++) + for (it = labelObjectContainer.begin(); it != labelObjectContainer.end(); ++it) { /**the label object*/ LabelObjectType * labelObject = it->second; diff --git a/Code/OBIA/otbLabelMapWithClassLabelToClassLabelImageFilter.txx b/Code/OBIA/otbLabelMapWithClassLabelToClassLabelImageFilter.txx index c6c99c8bce..a317f634b1 100644 --- a/Code/OBIA/otbLabelMapWithClassLabelToClassLabelImageFilter.txx +++ b/Code/OBIA/otbLabelMapWithClassLabelToClassLabelImageFilter.txx @@ -62,7 +62,7 @@ LabelMapWithClassLabelToClassLabelImageFilter<TInputImage, TOutputImage> { IndexType idx = lit->GetIndex(); unsigned long length = lit->GetLength(); - for( unsigned int i=0; i<length; i++) + for( unsigned int i=0; i<length; ++i) { this->GetOutput()->SetPixel( idx, label ); idx[0]++; diff --git a/Code/OBIA/otbShapeAttributesLabelMapFilter.txx b/Code/OBIA/otbShapeAttributesLabelMapFilter.txx index b54885e505..f0be3f4e7c 100644 --- a/Code/OBIA/otbShapeAttributesLabelMapFilter.txx +++ b/Code/OBIA/otbShapeAttributesLabelMapFilter.txx @@ -207,13 +207,13 @@ ShapeAttributesLabelObjectFunctor<TLabelObject, TLabelImage> // compute the size per pixel, to be used later double sizePerPixel = 1; - for (int i = 0; i < LabelObjectType::ImageDimension; i++) + for (int i = 0; i < LabelObjectType::ImageDimension; ++i) { sizePerPixel *= vcl_abs(m_LabelImage->GetSpacing()[i]); } typename std::vector<double> sizePerPixelPerDimension; - for (int i = 0; i < LabelObjectType::ImageDimension; i++) + for (int i = 0; i < LabelObjectType::ImageDimension; ++i) { sizePerPixelPerDimension.push_back(sizePerPixel / vcl_abs(m_LabelImage->GetSpacing()[i])); } @@ -221,7 +221,7 @@ ShapeAttributesLabelObjectFunctor<TLabelObject, TLabelImage> // compute the max the index on the border of the image typename LabelObjectType::IndexType borderMin = m_LabelImage->GetLargestPossibleRegion().GetIndex(); typename LabelObjectType::IndexType borderMax = borderMin; - for (int i = 0; i < LabelObjectType::ImageDimension; i++) + for (int i = 0; i < LabelObjectType::ImageDimension; ++i) { borderMax[i] += borderMin[i] + m_LabelImage->GetLargestPossibleRegion().GetSize()[i] - 1; } @@ -253,7 +253,7 @@ ShapeAttributesLabelObjectFunctor<TLabelObject, TLabelImage> // update the centroid - and report the progress // first, update the axes which are not 0 - for (int i = 1; i < LabelObjectType::ImageDimension; i++) + for (int i = 1; i < LabelObjectType::ImageDimension; ++i) { centroid[i] += length * idx[i]; } @@ -261,7 +261,7 @@ ShapeAttributesLabelObjectFunctor<TLabelObject, TLabelImage> centroid[0] += idx[0] * length + (length * (length - 1)) / 2.0; // update the mins and maxs - for (int i = 0; i < LabelObjectType::ImageDimension; i++) + for (int i = 0; i < LabelObjectType::ImageDimension; ++i) { if (idx[i] < mins[i]) { @@ -280,7 +280,7 @@ ShapeAttributesLabelObjectFunctor<TLabelObject, TLabelImage> // object is on a border ? bool isOnBorder = false; - for (int i = 1; i < LabelObjectType::ImageDimension; i++) + for (int i = 1; i < LabelObjectType::ImageDimension; ++i) { if (idx[i] == borderMin[i] || idx[i] == borderMax[i]) { @@ -328,7 +328,7 @@ ShapeAttributesLabelObjectFunctor<TLabelObject, TLabelImage> physicalSizeOnBorder += sizePerPixelPerDimension[0]; } // then the other dimensions - for (int i = 1; i < LabelObjectType::ImageDimension; i++) + for (int i = 1; i < LabelObjectType::ImageDimension; ++i) { if (idx[i] == borderMin[i]) { @@ -355,9 +355,9 @@ ShapeAttributesLabelObjectFunctor<TLabelObject, TLabelImage> typename TLabelImage::PointType pP; m_LabelImage->TransformIndexToPhysicalPoint(iidx, pP); - for(unsigned int i=0; i<LabelObjectType::ImageDimension; i++) + for(unsigned int i=0; i<LabelObjectType::ImageDimension; ++i) { - for(unsigned int j=0; j<LabelObjectType::ImageDimension; j++) + for(unsigned int j=0; j<LabelObjectType::ImageDimension; ++j) { centralMoments[i][j] += pP[i] * pP[j]; } @@ -377,13 +377,13 @@ ShapeAttributesLabelObjectFunctor<TLabelObject, TLabelImage> + spacing[0] * (length - 1) * ((spacing[0] * (2 * length - 1)) / 6.0 + physicalPosition[0])); // the other ones - for (int i = 1; i < LabelObjectType::ImageDimension; i++) + for (int i = 1; i < LabelObjectType::ImageDimension; ++i) { // do this one here to avoid the double assigment in the following loop // when i == j centralMoments[i][i] += length * physicalPosition[i] * physicalPosition[i]; // central moments are symetrics, so avoid to compute them 2 times - for (int j = i + 1; j < LabelObjectType::ImageDimension; j++) + for (int j = i + 1; j < LabelObjectType::ImageDimension; ++j) { // note that we won't use that code if the image dimension is less than 3 // --> the tests should be in 3D at least @@ -403,14 +403,14 @@ ShapeAttributesLabelObjectFunctor<TLabelObject, TLabelImage> typename TLabelImage::SizeType regionSize; double minSize = itk::NumericTraits<double>::max(); double maxSize = itk::NumericTraits<double>::NonpositiveMin(); - for (int i = 0; i < LabelObjectType::ImageDimension; i++) + for (int i = 0; i < LabelObjectType::ImageDimension; ++i) { centroid[i] /= size; regionSize[i] = maxs[i] - mins[i] + 1; double s = regionSize[i] * vcl_abs(m_LabelImage->GetSpacing()[i]); minSize = std::min(s, minSize); maxSize = std::max(s, maxSize); - for (unsigned int j = 0; j < LabelObjectType::ImageDimension; j++) + for (unsigned int j = 0; j < LabelObjectType::ImageDimension; ++j) { centralMoments[i][j] /= size; } @@ -420,9 +420,9 @@ ShapeAttributesLabelObjectFunctor<TLabelObject, TLabelImage> m_LabelImage->TransformContinuousIndexToPhysicalPoint(centroid, physicalCentroid); // Center the second order moments - for (unsigned int i = 0; i < LabelObjectType::ImageDimension; i++) + for (unsigned int i = 0; i < LabelObjectType::ImageDimension; ++i) { - for (unsigned int j = 0; j < LabelObjectType::ImageDimension; j++) + for (unsigned int j = 0; j < LabelObjectType::ImageDimension; ++j) { centralMoments[i][j] -= physicalCentroid[i] * physicalCentroid[j]; } @@ -432,7 +432,7 @@ ShapeAttributesLabelObjectFunctor<TLabelObject, TLabelImage> itk::Vector<double, LabelObjectType::ImageDimension> principalMoments; vnl_symmetric_eigensystem<double> eigen(centralMoments.GetVnlMatrix()); vnl_diag_matrix<double> pm = eigen.D; - for (unsigned int i = 0; i < LabelObjectType::ImageDimension; i++) + for (unsigned int i = 0; i < LabelObjectType::ImageDimension; ++i) { // principalMoments[i] = 4 * vcl_sqrt( pm(i, i) ); principalMoments[i] = pm(i, i); @@ -446,12 +446,12 @@ ShapeAttributesLabelObjectFunctor<TLabelObject, TLabelImage> vnl_diag_matrix<vcl_complex<double> > eigenval = eigenrot.D; vcl_complex<double> det(1.0, 0.0); - for (unsigned int i = 0; i < LabelObjectType::ImageDimension; i++) + for (unsigned int i = 0; i < LabelObjectType::ImageDimension; ++i) { det *= eigenval(i, i); } - for (unsigned int i = 0; i < LabelObjectType::ImageDimension; i++) + for (unsigned int i = 0; i < LabelObjectType::ImageDimension; ++i) { principalAxes[LabelObjectType::ImageDimension - 1][i] *= std::real(det); } @@ -471,12 +471,12 @@ ShapeAttributesLabelObjectFunctor<TLabelObject, TLabelImage> // compute equilalent ellipsoid radius itk::Vector<double, LabelObjectType::ImageDimension> ellipsoidSize; double edet = 1.0; - for (unsigned int i = 0; i < LabelObjectType::ImageDimension; i++) + for (unsigned int i = 0; i < LabelObjectType::ImageDimension; ++i) { edet *= principalMoments[i]; } edet = vcl_pow(edet, 1.0 / LabelObjectType::ImageDimension); - for (unsigned int i = 0; i < LabelObjectType::ImageDimension; i++) + for (unsigned int i = 0; i < LabelObjectType::ImageDimension; ++i) { ellipsoidSize[i] = 2.0 * equivalentRadius * vcl_sqrt(principalMoments[i] / edet); } @@ -593,7 +593,7 @@ ShapeAttributesLabelObjectFunctor<TLabelObject, TLabelImage> it += idx - it.GetIndex(); // push the pixel in the list if it is on the border of the object - for (unsigned i = 0; i < it.Size(); i++) + for (unsigned i = 0; i < it.Size(); ++i) { if (it.GetPixel(i) != label) { @@ -616,7 +616,7 @@ ShapeAttributesLabelObjectFunctor<TLabelObject, TLabelImage> { // Compute the length between the 2 indexes double length = 0; - for (int i = 0; i < LabelObjectType::ImageDimension; i++) + for (int i = 0; i < LabelObjectType::ImageDimension; ++i) { length += vcl_pow((iIt1->operator[] (i) - iIt2->operator[] (i)) * m_LabelImage->GetSpacing()[i], 2); } @@ -897,7 +897,7 @@ ShapeAttributesLabelMapFilter<TImage, TLabelImage> } // If there are more than one outputs, allocate the remaining outputs - for (unsigned int i=1; i < this->GetNumberOfOutputs(); i++) + for (unsigned int i=1; i < this->GetNumberOfOutputs(); ++i) { ImagePointer outputPtr; diff --git a/Code/OBIA/otbStatisticsAttributesLabelMapFilter.txx b/Code/OBIA/otbStatisticsAttributesLabelMapFilter.txx index af9c077dca..2518a7c9a5 100644 --- a/Code/OBIA/otbStatisticsAttributesLabelMapFilter.txx +++ b/Code/OBIA/otbStatisticsAttributesLabelMapFilter.txx @@ -139,11 +139,11 @@ StatisticsAttributesLabelObjectFunctor<TLabelObject, TFeatureImage> // moments typename TFeatureImage::PointType physicalPosition; m_FeatureImage->TransformIndexToPhysicalPoint(idx, physicalPosition); - for (unsigned int i = 0; i < TFeatureImage::ImageDimension; i++) + for (unsigned int i = 0; i < TFeatureImage::ImageDimension; ++i) { centerOfGravity[i] += physicalPosition[i] * v; centralMoments[i][i] += v * physicalPosition[i] * physicalPosition[i]; - for (unsigned int j = i + 1; j < TFeatureImage::ImageDimension; j++) + for (unsigned int j = i + 1; j < TFeatureImage::ImageDimension; ++j) { const double weight = v * physicalPosition[i] * physicalPosition[j]; centralMoments[i][j] += weight; @@ -192,19 +192,19 @@ StatisticsAttributesLabelObjectFunctor<TLabelObject, TFeatureImage> if (sum != 0) { // Normalize using the total mass - for (unsigned int i = 0; i < TFeatureImage::ImageDimension; i++) + for (unsigned int i = 0; i < TFeatureImage::ImageDimension; ++i) { centerOfGravity[i] /= sum; - for (unsigned int j = 0; j < TFeatureImage::ImageDimension; j++) + for (unsigned int j = 0; j < TFeatureImage::ImageDimension; ++j) { centralMoments[i][j] /= sum; } } // Center the second order moments - for (unsigned int i = 0; i < TFeatureImage::ImageDimension; i++) + for (unsigned int i = 0; i < TFeatureImage::ImageDimension; ++i) { - for (unsigned int j = 0; j < TFeatureImage::ImageDimension; j++) + for (unsigned int j = 0; j < TFeatureImage::ImageDimension; ++j) { centralMoments[i][j] -= centerOfGravity[i] * centerOfGravity[j]; } @@ -213,7 +213,7 @@ StatisticsAttributesLabelObjectFunctor<TLabelObject, TFeatureImage> // Compute principal moments and axes vnl_symmetric_eigensystem<double> eigen(centralMoments.GetVnlMatrix()); vnl_diag_matrix<double> pm = eigen.D; - for (unsigned int i = 0; i < TFeatureImage::ImageDimension; i++) + for (unsigned int i = 0; i < TFeatureImage::ImageDimension; ++i) { // principalMoments[i] = 4 * vcl_sqrt( pm(i, i) ); principalMoments[i] = pm(i, i); @@ -226,12 +226,12 @@ StatisticsAttributesLabelObjectFunctor<TLabelObject, TFeatureImage> vnl_diag_matrix<vcl_complex<double> > eigenval = eigenrot.D; vcl_complex<double> det(1.0, 0.0); - for (unsigned int i = 0; i < TFeatureImage::ImageDimension; i++) + for (unsigned int i = 0; i < TFeatureImage::ImageDimension; ++i) { det *= eigenval(i, i); } - for (unsigned int i = 0; i < TFeatureImage::ImageDimension; i++) + for (unsigned int i = 0; i < TFeatureImage::ImageDimension; ++i) { principalAxes[TFeatureImage::ImageDimension - 1][i] *= std::real(det); } @@ -246,11 +246,11 @@ StatisticsAttributesLabelObjectFunctor<TLabelObject, TFeatureImage> { // can't compute anything in that case - just set everything to a default value // Normalize using the total mass - for (unsigned int i = 0; i < TFeatureImage::ImageDimension; i++) + for (unsigned int i = 0; i < TFeatureImage::ImageDimension; ++i) { centerOfGravity[i] = 0; principalMoments[i] = 0; - for (unsigned int j = 0; j < TFeatureImage::ImageDimension; j++) + for (unsigned int j = 0; j < TFeatureImage::ImageDimension; ++j) { principalAxes[i][j] = 0; } diff --git a/Code/ObjectDetection/otbDescriptorsListSampleGenerator.h b/Code/ObjectDetection/otbDescriptorsListSampleGenerator.h index 0c3b2c1058..fb13e3cf8a 100644 --- a/Code/ObjectDetection/otbDescriptorsListSampleGenerator.h +++ b/Code/ObjectDetection/otbDescriptorsListSampleGenerator.h @@ -187,7 +187,7 @@ private: typedef typename IndexType::IndexValueType IndexValueType; typedef typename ContinuousIndexType::ValueType ContinuousIndexValueType; - for(unsigned int i=0; i<ImageDimension; i++) + for(unsigned int i=0; i<ImageDimension; ++i) { #ifdef ITK_USE_CENTERED_PIXEL_COORDINATES_CONSISTENTLY if( itk::Math::RoundHalfIntegerUp<IndexValueType>(index[i]) < static_cast<IndexValueType>( region.GetIndex(i) ) + static_cast<IndexValueType>(m_NeighborhoodRadius) ) diff --git a/Code/ObjectDetection/otbLabeledSampleLocalizationGenerator.txx b/Code/ObjectDetection/otbLabeledSampleLocalizationGenerator.txx index 1ca19a0a76..fb57af1f9d 100644 --- a/Code/ObjectDetection/otbLabeledSampleLocalizationGenerator.txx +++ b/Code/ObjectDetection/otbLabeledSampleLocalizationGenerator.txx @@ -202,7 +202,7 @@ LabeledSampleLocalizationGenerator<TVectorData> std::string positiveClassIdentifier; bool firstFeature = true; // Copy all point feature in output VectorData - for (unsigned int i=0; i<nbInputs; i++) + for (unsigned int i=0; i<nbInputs; ++i) { typename VectorDataType::ConstPointer vectorData = static_cast<const VectorDataType *>(this->GetInput(i)); @@ -240,7 +240,7 @@ LabeledSampleLocalizationGenerator<TVectorData> // Iterates through the polygon features and generates random point inside the polygon with // the "NoClass" identifier - for (unsigned int i=0; i<nbInputs; i++) + for (unsigned int i=0; i<nbInputs; ++i) { typename VectorDataType::ConstPointer vectorData = static_cast<const VectorDataType *>(this->GetInput(i)); @@ -266,7 +266,7 @@ LabeledSampleLocalizationGenerator<TVectorData> } } // Densify positive points - for (unsigned int i=0; i<nbInputs; i++) + for (unsigned int i=0; i<nbInputs; ++i) { typename VectorDataType::ConstPointer vectorData = static_cast<const VectorDataType *>(this->GetInput(i)); diff --git a/Code/ObjectDetection/otbMultiChannelIFFactory.h b/Code/ObjectDetection/otbMultiChannelIFFactory.h index b1558b2bb4..34bd7d613a 100644 --- a/Code/ObjectDetection/otbMultiChannelIFFactory.h +++ b/Code/ObjectDetection/otbMultiChannelIFFactory.h @@ -108,7 +108,7 @@ public: filter->UpdateOutputInformation(); nbBand = filter->GetOutput()->Size(); - for (unsigned int i=0; i<nbBand; i++) + for (unsigned int i=0; i<nbBand; ++i) { filter->GetOutput()->GetNthElement(i)->UpdateOutputInformation(); m_Factory->Create(filter->GetOutput()->GetNthElement(i), param, metaIF, container); diff --git a/Code/ObjectDetection/otbObjectDetectionClassifier.h b/Code/ObjectDetection/otbObjectDetectionClassifier.h index 00bb73a069..74a0292242 100644 --- a/Code/ObjectDetection/otbObjectDetectionClassifier.h +++ b/Code/ObjectDetection/otbObjectDetectionClassifier.h @@ -187,7 +187,7 @@ private: typedef typename RegionType::IndexType IndexType; typedef typename IndexType::IndexValueType IndexValueType; - for(unsigned int i=0; i<ImageDimension; i++) + for(unsigned int i=0; i<ImageDimension; ++i) { #ifdef ITK_USE_CENTERED_PIXEL_COORDINATES_CONSISTENTLY if( itk::Math::RoundHalfIntegerUp<IndexValueType>(index[i]) < static_cast<IndexValueType>( region.GetIndex(i) ) + m_NeighborhoodRadius + 1 ) diff --git a/Code/ObjectDetection/otbStatisticsXMLFileReader.txx b/Code/ObjectDetection/otbStatisticsXMLFileReader.txx index 691f9bb9cf..8ace419923 100644 --- a/Code/ObjectDetection/otbStatisticsXMLFileReader.txx +++ b/Code/ObjectDetection/otbStatisticsXMLFileReader.txx @@ -48,7 +48,7 @@ StatisticsXMLFileReader<TMeasurementVector> // Check if the name of the Statistic is present bool found = false; unsigned int index = 0; - for(unsigned int idx = 0; idx < m_NumberOfOutputs; idx++) + for(unsigned int idx = 0; idx < m_NumberOfOutputs; ++idx) { if(strcmp(m_MeasurementVectorContainer[idx].first.c_str(), statisticName) == 0 ) { @@ -118,7 +118,7 @@ StatisticsXMLFileReader<TMeasurementVector> // resize the Measurement Vector currentStatisticVector.second.SetSize(tempMeasurementVector.size()); - for(unsigned int i = 0; i < tempMeasurementVector.size(); i++) + for(unsigned int i = 0; i < tempMeasurementVector.size(); ++i) currentStatisticVector.second.SetElement(i, (static_cast<InputValueType>(tempMeasurementVector[i]))); diff --git a/Code/ObjectDetection/otbStatisticsXMLFileWriter.txx b/Code/ObjectDetection/otbStatisticsXMLFileWriter.txx index 194e93276b..31f91031f1 100644 --- a/Code/ObjectDetection/otbStatisticsXMLFileWriter.txx +++ b/Code/ObjectDetection/otbStatisticsXMLFileWriter.txx @@ -41,7 +41,7 @@ StatisticsXMLFileWriter<TMeasurementVector> inputData.first = name; // Check if the statistic name is already added - for(unsigned int idx= 0; idx< m_MeasurementVectorContainer.size(); idx++) + for(unsigned int idx= 0; idx< m_MeasurementVectorContainer.size(); ++idx) { if(strcmp(m_MeasurementVectorContainer[idx].first.c_str(), name) == 0 ) { @@ -84,7 +84,7 @@ StatisticsXMLFileWriter<TMeasurementVector> doc.LinkEndChild( root ); // Iterate through the input - for (unsigned int i = 0; i < m_MeasurementVectorContainer.size(); i++) + for (unsigned int i = 0; i < m_MeasurementVectorContainer.size(); ++i) { std::string featureName = m_MeasurementVectorContainer[i].first; MeasurementVectorType currentMeasurementVector = m_MeasurementVectorContainer[i].second; diff --git a/Code/Projections/otbGCPsToRPCSensorModelImageFilter.txx b/Code/Projections/otbGCPsToRPCSensorModelImageFilter.txx index 437f628c27..5dbeb684ab 100644 --- a/Code/Projections/otbGCPsToRPCSensorModelImageFilter.txx +++ b/Code/Projections/otbGCPsToRPCSensorModelImageFilter.txx @@ -176,7 +176,7 @@ GCPsToRPCSensorModelImageFilter<TImage> typename TImage::Pointer imagePtr = this->GetOutput(); // Iterate on the image GCPs - for (unsigned int i = 0; i < imagePtr->GetGCPCount(); i++) + for (unsigned int i = 0; i < imagePtr->GetGCPCount(); ++i) { // Store row/col in an index typename TImage::IndexType index; @@ -250,7 +250,7 @@ GCPsToRPCSensorModelImageFilter<TImage> // Clear Error container m_ErrorsContainer.clear(); - for (unsigned int i = 0; i < m_GCPsContainer.size(); i++) + for (unsigned int i = 0; i < m_GCPsContainer.size(); ++i) { // GCP value sensorPoint = m_GCPsContainer[i].first; diff --git a/Code/Projections/otbImageToGenericRSOutputParameters.txx b/Code/Projections/otbImageToGenericRSOutputParameters.txx index 17d16b6efa..490db2d252 100644 --- a/Code/Projections/otbImageToGenericRSOutputParameters.txx +++ b/Code/Projections/otbImageToGenericRSOutputParameters.txx @@ -118,7 +118,7 @@ ImageToGenericRSOutputParameters<TImage> vindex.push_back(index3); vindex.push_back(index4); - for (unsigned int i = 0; i < vindex.size(); i++) + for (unsigned int i = 0; i < vindex.size(); ++i) { PointType physicalPoint; m_Input->TransformIndexToPhysicalPoint(vindex[i], physicalPoint); @@ -131,7 +131,7 @@ ImageToGenericRSOutputParameters<TImage> double minY = voutput[0][1]; double maxY = voutput[0][1]; - for (unsigned int i = 0; i < voutput.size(); i++) + for (unsigned int i = 0; i < voutput.size(); ++i) { // Origins if (minX > voutput[i][0]) diff --git a/Code/Projections/otbVectorDataProjectionFilter.txx b/Code/Projections/otbVectorDataProjectionFilter.txx index 943cd4faea..bfb4a02ea0 100644 --- a/Code/Projections/otbVectorDataProjectionFilter.txx +++ b/Code/Projections/otbVectorDataProjectionFilter.txx @@ -210,7 +210,7 @@ VectorDataProjectionFilter<TInputVectorData, TOutputVectorData> index[1] = point[1]; // otbMsgDevMacro(<< "Converting: " << it.Value() << " -> " << pointCoord << " -> " << point << " -> " << index); newLine->AddVertex(index); - it++; + ++it; } return newLine; @@ -238,7 +238,7 @@ VectorDataProjectionFilter<TInputVectorData, TOutputVectorData> index[0] = point[0]; index[1] = point[1]; newPolygon->AddVertex(index); - it++; + ++it; } return newPolygon; } diff --git a/Code/Projections/otbVectorDataTransformFilter.txx b/Code/Projections/otbVectorDataTransformFilter.txx index 6a299d20e5..870a932d7b 100644 --- a/Code/Projections/otbVectorDataTransformFilter.txx +++ b/Code/Projections/otbVectorDataTransformFilter.txx @@ -73,7 +73,7 @@ VectorDataTransformFilter<TInputVectorData, TOutputVectorData> index[1]=point[1]; if (!vnl_math_isnan(index[0]) && !vnl_math_isnan(index[1])) newLine->AddVertex(index); - it++; + ++it; } return newLine; @@ -102,7 +102,7 @@ VectorDataTransformFilter<TInputVectorData, TOutputVectorData> index[1]=point[1]; if( !vnl_math_isnan(index[0]) && !vnl_math_isnan(index[1]) ) newPolygon->AddVertex(index); - it++; + ++it; } return newPolygon; } diff --git a/Code/Radiometry/otbSurfaceAdjacencyEffect6SCorrectionSchemeFilter.txx b/Code/Radiometry/otbSurfaceAdjacencyEffect6SCorrectionSchemeFilter.txx index fa69553ec3..643a692992 100644 --- a/Code/Radiometry/otbSurfaceAdjacencyEffect6SCorrectionSchemeFilter.txx +++ b/Code/Radiometry/otbSurfaceAdjacencyEffect6SCorrectionSchemeFilter.txx @@ -151,7 +151,7 @@ SurfaceAdjacencyEffect6SCorrectionSchemeFilter<TInputImage, TOutputImage> { itkExceptionMacro(<< "Filter Function and image channels mismatch."); } - for (unsigned int i = 0; i < this->GetInput()->GetNumberOfComponentsPerPixel(); i++) + for (unsigned int i = 0; i < this->GetInput()->GetNumberOfComponentsPerPixel(); ++i) { FilterFunctionValuesType::Pointer functionValues = FilterFunctionValuesType::New(); functionValues->SetFilterFunctionValues(m_FilterFunctionCoef[i]); diff --git a/Code/SARPolarimetry/otbReciprocalHAlphaImageFilter.h b/Code/SARPolarimetry/otbReciprocalHAlphaImageFilter.h index 5467db0503..82536d31cb 100644 --- a/Code/SARPolarimetry/otbReciprocalHAlphaImageFilter.h +++ b/Code/SARPolarimetry/otbReciprocalHAlphaImageFilter.h @@ -106,7 +106,7 @@ public: // Extract the first component of each the eigen vector sorted by eigen value decrease order VNLVectorType sortedGreaterEigenVector(3, eigenVectors[0][0]); - for(unsigned int i=0; i<3; i++) + for(unsigned int i=0; i<3; ++i) { if( vcl_abs( eigenValues[1].real()-sortedRealEigenValues[i] ) < m_Epsilon ) { @@ -124,7 +124,7 @@ public: totalEigenValues = m_Epsilon; } - for (unsigned int k = 0; k < 3; k++) + for (unsigned int k = 0; k < 3; ++k) { p[k] = std::max(sortedRealEigenValues[k], 0.) / totalEigenValues; } @@ -143,7 +143,7 @@ public: double val0, val1, val2; double a0, a1, a2; - for(unsigned int k = 0; k < 3; k++) + for(unsigned int k = 0; k < 3; ++k) { p[k] = sortedRealEigenValues[k] / totalEigenValues; diff --git a/Code/Simulation/otbImageSimulationMethod.txx b/Code/Simulation/otbImageSimulationMethod.txx index 1755fd79d0..596d603dac 100644 --- a/Code/Simulation/otbImageSimulationMethod.txx +++ b/Code/Simulation/otbImageSimulationMethod.txx @@ -158,7 +158,7 @@ ImageSimulationMethod< TInputVectorData, TSpatialisation, TSimulationStep1, TSim m_LabelMapToLabelImageFilter->SetInput(m_Spatialisation->GetOutput()); - for (unsigned int i = 0; i < m_NumberOfComponentsPerPixel; i++) + for (unsigned int i = 0; i < m_NumberOfComponentsPerPixel; ++i) { MultiToMonoChannelFilterPointer multiToMonoChannelFilter = MultiToMonoChannelFilterType::New(); @@ -219,7 +219,7 @@ ImageSimulationMethod< TInputVectorData, TSpatialisation, TSimulationStep1, TSim // // m_LabelMapToSimulatedImageFilter->Update(); // // this->GraftNthOutput(0, m_LabelMapToSimulatedImageFilter->GetOutput()); // -// for(unsigned int i = 0; i<m_NumberOfComponentsPerPixel; i++) +// for(unsigned int i = 0; i<m_NumberOfComponentsPerPixel; ++i) // { // // MultiToMonoChannelFilterPointer multiToMonoChannelFilter = MultiToMonoChannelFilterType::New(); diff --git a/Code/Simulation/otbLabelMapToSimulatedImageFilter.txx b/Code/Simulation/otbLabelMapToSimulatedImageFilter.txx index af3c2669f0..5dd7be6cbf 100644 --- a/Code/Simulation/otbLabelMapToSimulatedImageFilter.txx +++ b/Code/Simulation/otbLabelMapToSimulatedImageFilter.txx @@ -75,7 +75,7 @@ LabelMapToSimulatedImageFilter<TInputLabelMap, TSimuStep1, TSimuStep2, TOutputIm SpectralResponsePointer readSpectrum = SpectralResponseType::New(); bool hasPath = false; //Check if the spectrum associated to this object is given by a database. - for (unsigned int i = 0; i < labelObject->GetNumberOfAttributes(); i++) + for (unsigned int i = 0; i < labelObject->GetNumberOfAttributes(); ++i) { if (labelObject->GetAvailableAttributes()[i].compare("path") == 0) hasPath = true; } @@ -122,10 +122,10 @@ LabelMapToSimulatedImageFilter<TInputLabelMap, TSimuStep1, TSimuStep2, TOutputIm { IndexType idx = lit->GetIndex(); unsigned long length = lit->GetLength(); - for (unsigned int i = 0; i < length; i++) + for (unsigned int i = 0; i < length; ++i) { //add gaussian white noise - for (unsigned int i = 0; i < m_NumberOfComponentsPerPixel; i++) + for (unsigned int i = 0; i < m_NumberOfComponentsPerPixel; ++i) { double ran = randomGen->GetNormalVariate(m_Mean, m_Variance); pixel[i] = static_cast<InternalPixelType> (reduceSpectralResponse->GetReduceResponse()->GetResponse()[i].second diff --git a/Code/Simulation/otbProspectModel.cxx b/Code/Simulation/otbProspectModel.cxx index 8222a3ae2a..9cb0f85212 100644 --- a/Code/Simulation/otbProspectModel.cxx +++ b/Code/Simulation/otbProspectModel.cxx @@ -146,7 +146,7 @@ ProspectModel Cm = leafParameters->GetCm(); int nbdata = sizeof(DataSpecP5B) / sizeof(DataSpec); - for (int i = 0; i < nbdata; i++) + for (int i = 0; i < nbdata; ++i) { lambda = DataSpecP5B[i].lambda; n = DataSpecP5B[i].refLeafMatInd; diff --git a/Code/Simulation/otbSailModel.cxx b/Code/Simulation/otbSailModel.cxx index d1e0660278..7fc3c12f7b 100644 --- a/Code/Simulation/otbSailModel.cxx +++ b/Code/Simulation/otbSailModel.cxx @@ -210,7 +210,7 @@ SailModel VectorType result(4); // Weighted sums over LIDF - for(unsigned int i=0; i<lidf.size(); i++) + for(unsigned int i=0; i<lidf.size(); ++i) { ttl = 2.5+5*i; // leaf inclination discrete values ctl = vcl_cos(rd*ttl); @@ -272,7 +272,7 @@ SailModel double resh, resv; int nbdata = sizeof(DataSpecP5B) / sizeof(DataSpec); - for (int i = 0; i < nbdata; i++) + for (int i = 0; i < nbdata; ++i) { lambda = DataSpecP5B[i].lambda; Es = DataSpecP5B[i].directLight; //8 @@ -397,7 +397,7 @@ SailModel fint=(1.-exp(-alf))*0.05; sumint=0; - for(unsigned int j=1; j<=20; j++) + for(unsigned int j=1; j<=20; ++j) { if (j<20) x2 = -vcl_log(1.-j*fint)/alf; else x2 = 1; @@ -466,7 +466,7 @@ SailModel double tl1, tl2, x1, x2, v, alpha, alpha2, x12, x22, alpx1, alpx2, dum, almx1, almx2; VectorType temp; - for(unsigned int i=0; i<n; i++) + for(unsigned int i=0; i<n; ++i) { tx2 = 5*i; tx1 = 5*(i+1); @@ -509,7 +509,7 @@ SailModel } } - for(unsigned int i=0; i<n; i++) + for(unsigned int i=0; i<n; ++i) { freq.push_back(temp[i]/sum); } diff --git a/Code/Simulation/otbSatelliteRSR.txx b/Code/Simulation/otbSatelliteRSR.txx index 36041d1ade..1129246ff0 100644 --- a/Code/Simulation/otbSatelliteRSR.txx +++ b/Code/Simulation/otbSatelliteRSR.txx @@ -128,7 +128,7 @@ SatelliteRSR<TPrecision, TValuePrecision> //typename VectorPairType::iterator it = m_RSR.begin(); //it = m_RSR.at(0); - for(typename RSRVectorType::const_iterator it = m_RSR.begin(); it != m_RSR.end(); it++) + for(typename RSRVectorType::const_iterator it = m_RSR.begin(); it != m_RSR.end(); ++it) { os << indent << "Band Number " << it - m_RSR.begin() << std::endl; (*it)->PrintSelf (os, indent); diff --git a/Code/Simulation/otbSpatialisationFilter.txx b/Code/Simulation/otbSpatialisationFilter.txx index 5db18d871b..ac51b65f12 100644 --- a/Code/Simulation/otbSpatialisationFilter.txx +++ b/Code/Simulation/otbSpatialisationFilter.txx @@ -55,7 +55,7 @@ SpatialisationFilter<TLabelMap> unsigned int numberOfObjects = m_NumberOfObjects[0] * m_NumberOfObjects[1]; //first object must have label 1. 0 is for background value in a label map. - for (unsigned int i = 0; i < numberOfObjects; i++) + for (unsigned int i = 0; i < numberOfObjects; ++i) { this->ProcessObject(i); } diff --git a/Code/Simulation/otbSpectralResponse.txx b/Code/Simulation/otbSpectralResponse.txx index e9f9c04ac2..dd96dcd587 100644 --- a/Code/Simulation/otbSpectralResponse.txx +++ b/Code/Simulation/otbSpectralResponse.txx @@ -117,7 +117,7 @@ SpectralResponse<TPrecision, TValuePrecision> unsigned int lambdaPosGuess = static_cast<unsigned int> ((lambda - lambdaMin) / (lambdaMax - lambdaMin) * m_Response.size()) - 1; - for (typename VectorPairType::const_iterator it = beg + lambdaPosGuess; it <= last; it++) + for (typename VectorPairType::const_iterator it = beg + lambdaPosGuess; it <= last; ++it) { // if the guess was too high if ((*it).first >= lambda) diff --git a/Code/Simulation/otbSurfaceReflectanceToReflectanceFilter.txx b/Code/Simulation/otbSurfaceReflectanceToReflectanceFilter.txx index 21274e3350..2f43afe5b8 100644 --- a/Code/Simulation/otbSurfaceReflectanceToReflectanceFilter.txx +++ b/Code/Simulation/otbSurfaceReflectanceToReflectanceFilter.txx @@ -99,7 +99,7 @@ SurfaceReflectanceToReflectanceFilter<TInputImage, TOutputImage> { itkExceptionMacro(<<"Filter Function and image channels mismatch."); } - for(unsigned int i=0; i<this->GetInput()->GetNumberOfComponentsPerPixel(); i++) + for(unsigned int i=0; i<this->GetInput()->GetNumberOfComponentsPerPixel(); ++i) { FilterFunctionValuesType::Pointer functionValues = FilterFunctionValuesType::New(); functionValues->SetFilterFunctionValues(m_FilterFunctionCoef[i]); diff --git a/Code/Testing/otbTestDriver.cxx b/Code/Testing/otbTestDriver.cxx index 16b2059985..673aa4e045 100644 --- a/Code/Testing/otbTestDriver.cxx +++ b/Code/Testing/otbTestDriver.cxx @@ -165,7 +165,7 @@ int main(int ac, char* av[]) } // a NULL is required at the end of the table char** argv = new char*[remainingArgs.size() + 2]; - for (int i = 0; i < static_cast<int>(remainingArgs.size()); i++) + for (int i = 0; i < static_cast<int>(remainingArgs.size()); ++i) { argv[i + 1] = remainingArgs[i]; } diff --git a/Code/Testing/otbTestHelper.cxx b/Code/Testing/otbTestHelper.cxx index 6badcde5c2..2057c603d9 100644 --- a/Code/Testing/otbTestHelper.cxx +++ b/Code/Testing/otbTestHelper.cxx @@ -115,7 +115,7 @@ int TestHelper::RegressionTestAllImages(const StringList& baselineFilenamesImage (baseline->first).c_str(), m_ToleranceDiffValue); } - cpt++; + ++cpt; result += multiResult; } return result; @@ -1381,7 +1381,7 @@ bool TestHelper::isScientificNumeric(const std::string& str) const if ((str[0] != '+') && (str[0] != '-') && (!isNumber(number))) return false; if ((str[0] == '+') || (str[0] == '-')) { - cpt++; + ++cpt; signDetected = true; } @@ -1410,7 +1410,7 @@ bool TestHelper::isScientificNumeric(const std::string& str) const number = str[cpt]; if (!isNumber(number)) return false; } - cpt++; + ++cpt; } return true; @@ -1489,7 +1489,7 @@ void TestHelper::AddWhiteSpace(const std::string& strIn, std::string &strOut) co keysOut.push_back(" : "); keysOut.push_back(" , "); - for (unsigned int it = 0; it < keys.size(); it++) + for (unsigned int it = 0; it < keys.size(); ++it) { size_t found; found=strLine.find(keys[it]); diff --git a/Code/UtilitiesAdapters/OssimAdapters/otbAeronetFileReader.cxx b/Code/UtilitiesAdapters/OssimAdapters/otbAeronetFileReader.cxx index 28a063cdee..33b7240407 100644 --- a/Code/UtilitiesAdapters/OssimAdapters/otbAeronetFileReader.cxx +++ b/Code/UtilitiesAdapters/OssimAdapters/otbAeronetFileReader.cxx @@ -188,7 +188,7 @@ AeronetFileReader mean = 0.; stddev = 0.; if (vec.size() <= 0) return; - for (unsigned int i = 0; i < vec.size(); i++) + for (unsigned int i = 0; i < vec.size(); ++i) { sum += vec[i]; sumOfSquares += vec[i] * vec[i]; diff --git a/Code/Visualization/otbCircleGlComponent.cxx b/Code/Visualization/otbCircleGlComponent.cxx index 7fecfe384e..602d52f8dd 100644 --- a/Code/Visualization/otbCircleGlComponent.cxx +++ b/Code/Visualization/otbCircleGlComponent.cxx @@ -75,7 +75,7 @@ CircleGlComponent // Enabling line antialiasing glEnable(GL_POINT_SMOOTH); - for (unsigned int i = 0; i < m_IndexList.size(); i++) + for (unsigned int i = 0; i < m_IndexList.size(); ++i) { this->Render(i, extent, space2ScreenTransform); } diff --git a/Code/Visualization/otbCrossGlComponent.cxx b/Code/Visualization/otbCrossGlComponent.cxx index 1998a30d17..821f514606 100644 --- a/Code/Visualization/otbCrossGlComponent.cxx +++ b/Code/Visualization/otbCrossGlComponent.cxx @@ -73,7 +73,7 @@ CrossGlComponent // Enabling line antialiasing glEnable(GL_LINE_SMOOTH); - for (unsigned int i = 0; i < m_IndexList.size(); i++) + for (unsigned int i = 0; i < m_IndexList.size(); ++i) { this->Render(i, extent, space2ScreenTransform); } diff --git a/Code/Visualization/otbCurves2DWidget.cxx b/Code/Visualization/otbCurves2DWidget.cxx index 7542cfe5a8..7bd7a3a80b 100644 --- a/Code/Visualization/otbCurves2DWidget.cxx +++ b/Code/Visualization/otbCurves2DWidget.cxx @@ -71,7 +71,7 @@ void Curves2DWidget::RemoveCurveByItsID(unsigned int id) { unsigned int size = m_Curves->Size(); - for (unsigned int j = 0; j < size; j++) + for (unsigned int j = 0; j < size; ++j) { if (m_Curves->GetNthElement(j)->GetId() == id) { @@ -84,7 +84,7 @@ void Curves2DWidget::RemoveCurveByItsID(unsigned int id) Curves2DWidget::CurvePointerType Curves2DWidget::GetCurveByItsId(unsigned int id) { - for (unsigned int j = 0; j < m_Curves->Size(); j++) + for (unsigned int j = 0; j < m_Curves->Size(); ++j) { if (m_Curves->GetNthElement(j)->GetId() == id) { diff --git a/Code/Visualization/otbGaussianRenderingFunction.h b/Code/Visualization/otbGaussianRenderingFunction.h index 9016af3a86..de760ba938 100644 --- a/Code/Visualization/otbGaussianRenderingFunction.h +++ b/Code/Visualization/otbGaussianRenderingFunction.h @@ -151,7 +151,7 @@ namespace otb ParametersType psup; psup.SetSize(p.GetSize() - 2); - for (unsigned int i = 0; i < psup.GetSize(); i++) + for (unsigned int i = 0; i < psup.GetSize(); ++i) { psup[i] = p[i + 2]; } @@ -182,7 +182,7 @@ namespace otb p[0] = m_Mean; p[1] = m_StandardDeviation; - for (unsigned int i = 0; i < psup.GetSize(); i++) + for (unsigned int i = 0; i < psup.GetSize(); ++i) { p[i + 2] = psup[i]; } diff --git a/Code/Visualization/otbVectorDataModel.cxx b/Code/Visualization/otbVectorDataModel.cxx index 0e81b07ddf..e6ec2b8653 100644 --- a/Code/Visualization/otbVectorDataModel.cxx +++ b/Code/Visualization/otbVectorDataModel.cxx @@ -347,7 +347,7 @@ VectorDataModel::CopyFields( TreeNodeType * node ) { std::vector< std::string > fieldList = node->Get()->GetFieldList(); unsigned int i; - for (i=0; i < fieldList.size(); i++) + for (i=0; i < fieldList.size(); ++i) { m_CurrentGeometry->SetFieldAsString(fieldList.at(i), node->Get()->GetFieldAsString(fieldList.at(i))); } diff --git a/Examples/Classification/BayesianPluginClassifier.cxx b/Examples/Classification/BayesianPluginClassifier.cxx index f2e5bf96e7..81ee71e312 100644 --- a/Examples/Classification/BayesianPluginClassifier.cxx +++ b/Examples/Classification/BayesianPluginClassifier.cxx @@ -303,7 +303,7 @@ int main(int, char *[]) // Software Guide : BeginCodeSnippet std::vector<MembershipFunctionType::Pointer> membershipFunctions; - for (unsigned int i = 0; i < 2; i++) + for (unsigned int i = 0; i < 2; ++i) { membershipFunctions.push_back(MembershipFunctionType::New()); membershipFunctions[i]->SetMean(meanEstimators[i]->GetOutput()); diff --git a/Examples/Classification/ExpectationMaximizationMixtureModelEstimator.cxx b/Examples/Classification/ExpectationMaximizationMixtureModelEstimator.cxx index 6ebbafab1c..c2a4798f2d 100644 --- a/Examples/Classification/ExpectationMaximizationMixtureModelEstimator.cxx +++ b/Examples/Classification/ExpectationMaximizationMixtureModelEstimator.cxx @@ -203,7 +203,7 @@ int main() ComponentType; std::vector<ComponentType::Pointer> components; - for (unsigned int i = 0; i < numberOfClasses; i++) + for (unsigned int i = 0; i < numberOfClasses; ++i) { components.push_back(ComponentType::New()); (components[i])->SetSample(sample); @@ -231,7 +231,7 @@ int main() estimator->SetInitialProportions(initialProportions); - for (unsigned int i = 0; i < numberOfClasses; i++) + for (unsigned int i = 0; i < numberOfClasses; ++i) { estimator->AddComponent((ComponentType::Superclass*) (components[i]).GetPointer()); @@ -247,7 +247,7 @@ int main() // Software Guide : EndLatex // Software Guide : BeginCodeSnippet - for (unsigned int i = 0; i < numberOfClasses; i++) + for (unsigned int i = 0; i < numberOfClasses; ++i) { std::cout << "Cluster[" << i << "]" << std::endl; std::cout << " Parameters:" << std::endl; diff --git a/Examples/Classification/KdTreeBasedKMeansClustering.cxx b/Examples/Classification/KdTreeBasedKMeansClustering.cxx index 9d1314e71d..12def87f0f 100644 --- a/Examples/Classification/KdTreeBasedKMeansClustering.cxx +++ b/Examples/Classification/KdTreeBasedKMeansClustering.cxx @@ -338,10 +338,10 @@ int main() MembershipFunctionType::OriginType origin( sample->GetMeasurementVectorSize()); int index = 0; - for (unsigned int i = 0; i < 2; i++) + for (unsigned int i = 0; i < 2; ++i) { membershipFunctions.push_back(MembershipFunctionType::New()); - for (unsigned int j = 0; j < sample->GetMeasurementVectorSize(); j++) + for (unsigned int j = 0; j < sample->GetMeasurementVectorSize(); ++j) { origin[j] = estimatedMeans[index++]; } diff --git a/Examples/Classification/ScalarImageKmeansClassifier.cxx b/Examples/Classification/ScalarImageKmeansClassifier.cxx index 3dd64b6099..43821b39e8 100644 --- a/Examples/Classification/ScalarImageKmeansClassifier.cxx +++ b/Examples/Classification/ScalarImageKmeansClassifier.cxx @@ -140,7 +140,7 @@ int main(int argc, char * argv[]) // Software Guide : EndLatex // Software Guide : BeginCodeSnippet - for (unsigned k = 0; k < numberOfInitialClasses; k++) + for (unsigned k = 0; k < numberOfInitialClasses; ++k) { const double userProvidedInitialMean = atof(argv[k + argoffset]); kmeansFilter->AddClassWithInitialMean(userProvidedInitialMean); diff --git a/Examples/Classification/ScalarImageMarkovRandomField1.cxx b/Examples/Classification/ScalarImageMarkovRandomField1.cxx index b27b22d760..d4318ce12a 100644 --- a/Examples/Classification/ScalarImageMarkovRandomField1.cxx +++ b/Examples/Classification/ScalarImageMarkovRandomField1.cxx @@ -269,7 +269,7 @@ int main(int argc, char * argv[]) double meanDistance = 0; vnl_vector<double> centroid(1); - for (unsigned int i = 0; i < numberOfClasses; i++) + for (unsigned int i = 0; i < numberOfClasses; ++i) { MembershipFunctionPointer membershipFunction = MembershipFunctionType::New(); diff --git a/Examples/DataRepresentation/Mesh/PointSetWithVectors.cxx b/Examples/DataRepresentation/Mesh/PointSetWithVectors.cxx index 5f8a178119..f0641b0c21 100644 --- a/Examples/DataRepresentation/Mesh/PointSetWithVectors.cxx +++ b/Examples/DataRepresentation/Mesh/PointSetWithVectors.cxx @@ -99,7 +99,7 @@ int main(int, char *[]) unsigned int pointId = 0; const double radius = 300.0; - for (unsigned int i = 0; i < 360; i++) + for (unsigned int i = 0; i < 360; ++i) { const double angle = i * atan(1.0) / 45.0; point[0] = radius * sin(angle); diff --git a/Examples/FeatureExtraction/ExtractSegmentsByStepsExample.cxx b/Examples/FeatureExtraction/ExtractSegmentsByStepsExample.cxx index 4425b4af47..ee009126f0 100644 --- a/Examples/FeatureExtraction/ExtractSegmentsByStepsExample.cxx +++ b/Examples/FeatureExtraction/ExtractSegmentsByStepsExample.cxx @@ -52,7 +52,7 @@ int main(int argc, char * argv[]) if (argc != 12) { - for (int i = 0; i < argc; i++) + for (int i = 0; i < argc; ++i) std::cerr << argv[i] << std::endl; std::cerr << "Usage: " << argv[0] << " inputImageFile "; std::cerr << " outputSegmentsImageFile length width "; diff --git a/Examples/FeatureExtraction/ExtractSegmentsExample.cxx b/Examples/FeatureExtraction/ExtractSegmentsExample.cxx index 099eff10ba..6102f55c6d 100644 --- a/Examples/FeatureExtraction/ExtractSegmentsExample.cxx +++ b/Examples/FeatureExtraction/ExtractSegmentsExample.cxx @@ -46,7 +46,7 @@ int main(int argc, char * argv[]) if (argc != 12) { - for (int i = 0; i < argc; i++) + for (int i = 0; i < argc; ++i) std::cerr << argv[i] << std::endl; std::cerr << "Usage: " << argv[0] << " inputImageFile "; std::cerr << " outputSegmentsImageFile length width "; diff --git a/Examples/FeatureExtraction/FlusserMomentsImageFunctionExample.cxx b/Examples/FeatureExtraction/FlusserMomentsImageFunctionExample.cxx index eeeff99dc5..5eaa18745c 100644 --- a/Examples/FeatureExtraction/FlusserMomentsImageFunctionExample.cxx +++ b/Examples/FeatureExtraction/FlusserMomentsImageFunctionExample.cxx @@ -129,7 +129,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet MomentType Result = fmFunction->EvaluateAtIndex(center); - for (unsigned int j=0; j<11; j++) + for (unsigned int j=0; j<11; ++j) { std::cout << "The moment of order " << j+1 << " is equal to " << Result[j] << std::endl; diff --git a/Examples/FeatureExtraction/HuMomentsImageFunctionExample.cxx b/Examples/FeatureExtraction/HuMomentsImageFunctionExample.cxx index 8f1b978ca3..75c017d00c 100644 --- a/Examples/FeatureExtraction/HuMomentsImageFunctionExample.cxx +++ b/Examples/FeatureExtraction/HuMomentsImageFunctionExample.cxx @@ -129,7 +129,7 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet MomentType Result = hmFunction->EvaluateAtIndex(center); - for (unsigned int j=0; j<7; j++) + for (unsigned int j=0; j<7; ++j) { std::cout << "The moment of order " << j+1 << " is equal to " << Result[j] << std::endl; diff --git a/Examples/FeatureExtraction/SeamCarvingExample.cxx b/Examples/FeatureExtraction/SeamCarvingExample.cxx index 8efaebe8b6..ed19ca151c 100644 --- a/Examples/FeatureExtraction/SeamCarvingExample.cxx +++ b/Examples/FeatureExtraction/SeamCarvingExample.cxx @@ -145,7 +145,7 @@ int main(int argc, char * argv[]) double energyVert, energyHor; - for (int i = 0; i < iteration; i++) + for (int i = 0; i < iteration; ++i) { gradient->SetInput(duplicator->GetOutput()); diff --git a/Examples/FeatureExtraction/SeamCarvingOtherExample.cxx b/Examples/FeatureExtraction/SeamCarvingOtherExample.cxx index b3a665d111..5384fd08c2 100644 --- a/Examples/FeatureExtraction/SeamCarvingOtherExample.cxx +++ b/Examples/FeatureExtraction/SeamCarvingOtherExample.cxx @@ -136,7 +136,7 @@ int main(int argc, char * argv[]) // Software Guide : EndLatex // Software Guide : BeginCodeSnippet - for (int i = 0; i < iteration; i++) + for (int i = 0; i < iteration; ++i) { gradient->SetInput(duplicator->GetOutput()); diff --git a/Examples/IO/ImageSeriesIOExample.cxx b/Examples/IO/ImageSeriesIOExample.cxx index e2eb776954..9fa39ca802 100644 --- a/Examples/IO/ImageSeriesIOExample.cxx +++ b/Examples/IO/ImageSeriesIOExample.cxx @@ -112,7 +112,7 @@ int main(int argc, char** argv) // Software Guide : EndLatex // Software Guide : BeginCodeSnippet - for (unsigned int i = 0; i < NbImages; i++) + for (unsigned int i = 0; i < NbImages; ++i) { ImageReaderType::Pointer imageReader = ImageReaderType::New(); diff --git a/Examples/IO/MetadataExample.cxx b/Examples/IO/MetadataExample.cxx index 741c1fa733..1f5c47b149 100644 --- a/Examples/IO/MetadataExample.cxx +++ b/Examples/IO/MetadataExample.cxx @@ -159,7 +159,7 @@ int main(int argc, char* argv[]) InputImageType::VectorType tab = image->GetGeoTransform(); file << "Geo Transform " << std::endl; - for (unsigned int i = 0; i < tab.size(); i++) + for (unsigned int i = 0; i < tab.size(); ++i) { file << " " << i << " -> " << tab[i] << std::endl; } @@ -167,28 +167,28 @@ int main(int argc, char* argv[]) tab = image->GetUpperLeftCorner(); file << "Corners " << std::endl; - for (unsigned int i = 0; i < tab.size(); i++) + for (unsigned int i = 0; i < tab.size(); ++i) { file << " UL[" << i << "] -> " << tab[i] << std::endl; } tab.clear(); tab = image->GetUpperRightCorner(); - for (unsigned int i = 0; i < tab.size(); i++) + for (unsigned int i = 0; i < tab.size(); ++i) { file << " UR[" << i << "] -> " << tab[i] << std::endl; } tab.clear(); tab = image->GetLowerLeftCorner(); - for (unsigned int i = 0; i < tab.size(); i++) + for (unsigned int i = 0; i < tab.size(); ++i) { file << " LL[" << i << "] -> " << tab[i] << std::endl; } tab.clear(); tab = image->GetLowerRightCorner(); - for (unsigned int i = 0; i < tab.size(); i++) + for (unsigned int i = 0; i < tab.size(); ++i) { file << " LR[" << i << "] -> " << tab[i] << std::endl; } diff --git a/Examples/Iterators/ImageLinearIteratorWithIndex2.cxx b/Examples/Iterators/ImageLinearIteratorWithIndex2.cxx index 7b62fba93d..8ff2da2516 100644 --- a/Examples/Iterators/ImageLinearIteratorWithIndex2.cxx +++ b/Examples/Iterators/ImageLinearIteratorWithIndex2.cxx @@ -105,7 +105,7 @@ int main(int argc, char *argv[]) Spacing4DType spacing4D = image4D->GetSpacing(); Origin4DType origin4D = image4D->GetOrigin(); - for (unsigned int i = 0; i < 3; i++) + for (unsigned int i = 0; i < 3; ++i) { size3D[i] = size4D[i]; index3D[i] = index4D[i]; diff --git a/Examples/Iterators/ImageRegionIterator.cxx b/Examples/Iterators/ImageRegionIterator.cxx index 2185c9ade3..8137036401 100644 --- a/Examples/Iterators/ImageRegionIterator.cxx +++ b/Examples/Iterators/ImageRegionIterator.cxx @@ -172,7 +172,7 @@ int main(int argc, char *argv[]) const ImageType::PointType& inputOrigin = reader->GetOutput()->GetOrigin(); double outputOrigin[Dimension]; - for (unsigned int i = 0; i < Dimension; i++) + for (unsigned int i = 0; i < Dimension; ++i) { outputOrigin[i] = inputOrigin[i] + spacing[i] * inputStart[i]; } diff --git a/Examples/Iterators/ImageSliceIteratorWithIndex.cxx b/Examples/Iterators/ImageSliceIteratorWithIndex.cxx index 6ad57d39a5..c634e4b800 100644 --- a/Examples/Iterators/ImageSliceIteratorWithIndex.cxx +++ b/Examples/Iterators/ImageSliceIteratorWithIndex.cxx @@ -182,7 +182,7 @@ int main(int argc, char *argv[]) if (i != projectionDirection) { direction[j] = i; - j++; + ++j; } } // Software Guide : EndCodeSnippet diff --git a/Examples/Iterators/NeighborhoodIterators6.cxx b/Examples/Iterators/NeighborhoodIterators6.cxx index 8382c8e7d1..972dbc1345 100644 --- a/Examples/Iterators/NeighborhoodIterators6.cxx +++ b/Examples/Iterators/NeighborhoodIterators6.cxx @@ -186,7 +186,7 @@ int main(int argc, char *argv[]) flag = false; PixelType min = it.GetCenterPixel(); - for (unsigned i = 0; i < it.Size(); i++) + for (unsigned i = 0; i < it.Size(); ++i) { if (it.GetPixel(i) < min) { diff --git a/Examples/Learning/SEMModelEstimatorExample.cxx b/Examples/Learning/SEMModelEstimatorExample.cxx index ba212fc3e3..ed0c6f4563 100644 --- a/Examples/Learning/SEMModelEstimatorExample.cxx +++ b/Examples/Learning/SEMModelEstimatorExample.cxx @@ -174,7 +174,7 @@ int main(int argc, char * argv[]) typedef otb::Statistics::GaussianModelComponent<ClassSampleType> GaussianType; - for (int i = 0; i < numberOfClasses; i++) + for (int i = 0; i < numberOfClasses; ++i) classifier->AddComponent(i, GaussianType::New()); // Software Guide : EndCodeSnippet diff --git a/Examples/Projections/SensorModelExample.cxx b/Examples/Projections/SensorModelExample.cxx index 8ad29dcc63..acb37f23ad 100644 --- a/Examples/Projections/SensorModelExample.cxx +++ b/Examples/Projections/SensorModelExample.cxx @@ -390,7 +390,7 @@ int main(int argc, char* argv[]) max_y = pixelIndexArray[1]; min_y = pixelIndexArray[1]; - for (j = 0; j < It; j++) + for (j = 0; j < It; ++j) { if (j % 2 == 0 && pixelIndexArray[j] > max_x) { @@ -454,7 +454,7 @@ int main(int argc, char* argv[]) // Software Guide : BeginCodeSnippet interpolator->SetInputImage(extract->GetOutput()); - for (k = 0; k < It / 2; k++) + for (k = 0; k < It / 2; ++k) { pixelIndexBis[0] = pixelIndexArray[2 * k]; pixelIndexBis[1] = pixelIndexArray[2 * k + 1]; diff --git a/Examples/Radiometry/AtmosphericCorrectionSequencement.cxx b/Examples/Radiometry/AtmosphericCorrectionSequencement.cxx index 6a6438995c..6403506c19 100644 --- a/Examples/Radiometry/AtmosphericCorrectionSequencement.cxx +++ b/Examples/Radiometry/AtmosphericCorrectionSequencement.cxx @@ -181,7 +181,7 @@ int main(int argc, char *argv[]) std::ifstream fin; fin.open(argv[3]); double dalpha(0.), dbeta(0.); - for (unsigned int i = 0; i < nbOfComponent; i++) + for (unsigned int i = 0; i < nbOfComponent; ++i) { fin >> dalpha; fin >> dbeta; @@ -241,7 +241,7 @@ int main(int argc, char *argv[]) fin.open(argv[4]); double dsolarIllumination(0.); - for (unsigned int i = 0; i < nbOfComponent; i++) + for (unsigned int i = 0; i < nbOfComponent; ++i) { fin >> dsolarIllumination; solarIllumination[i] = dsolarIllumination; @@ -317,7 +317,7 @@ int main(int argc, char *argv[]) fin.open(argv[5]); fin >> nbBands; - for (unsigned int i = 0; i < nbBands; i++) + for (unsigned int i = 0; i < nbBands; ++i) { vector.clear(); fin >> sString; @@ -325,7 +325,7 @@ int main(int argc, char *argv[]) fin >> maxSpectralValue; fin >> userStep; fin >> nbValuesPerBand; - for (unsigned int j = 0; j < nbValuesPerBand; j++) + for (unsigned int j = 0; j < nbValuesPerBand; ++j) { fin >> value; vector.push_back(value); diff --git a/Testing/Code/BasicFilters/otbAngularProjectionBinaryImageFilter.cxx b/Testing/Code/BasicFilters/otbAngularProjectionBinaryImageFilter.cxx index 6f1bb2bd4f..0beb6ea23f 100644 --- a/Testing/Code/BasicFilters/otbAngularProjectionBinaryImageFilter.cxx +++ b/Testing/Code/BasicFilters/otbAngularProjectionBinaryImageFilter.cxx @@ -108,7 +108,7 @@ int otbAngularProjectionBinaryImageFilterTest ( int argc, char * argv[] ) std::vector< WriterType::Pointer > writers; writers.resize( filter->GetNumberOfOutputs() ); - for ( unsigned int i = 0; i < filter->GetNumberOfOutputs(); i++ ) + for ( unsigned int i = 0; i < filter->GetNumberOfOutputs(); ++i ) { std::stringstream title; title << outputImageName << "_" << i << ".hdr"; diff --git a/Testing/Code/BasicFilters/otbBandMathImageFilter.cxx b/Testing/Code/BasicFilters/otbBandMathImageFilter.cxx index f55847fc05..4402512a64 100644 --- a/Testing/Code/BasicFilters/otbBandMathImageFilter.cxx +++ b/Testing/Code/BasicFilters/otbBandMathImageFilter.cxx @@ -164,7 +164,7 @@ int otbBandMathImageFilter( int argc, char* argv[]) std::cout << "- nan section\n"; it1.GoToBegin(); it2.GoToBegin(); it.GoToBegin(); - for(i=1; i<=50; i++ , ++it1, ++it2, ++it){} + for(i=1; i<=50; ++i , ++it1, ++it2, ++it){} if(vnl_math_isnan(it.Get())) std::cout << "Pixel_1 = " << it1.Get() << " Pixel_2 = " << it2.Get() << " Result = " << it.Get() << " Expected = nan\n"; else diff --git a/Testing/Code/BasicFilters/otbBoxAndWhiskerImageFilter.cxx b/Testing/Code/BasicFilters/otbBoxAndWhiskerImageFilter.cxx index a8493abc04..fd900b2a16 100644 --- a/Testing/Code/BasicFilters/otbBoxAndWhiskerImageFilter.cxx +++ b/Testing/Code/BasicFilters/otbBoxAndWhiskerImageFilter.cxx @@ -88,7 +88,7 @@ int otbBoxAndWhiskerImageFilter(int argc, char * argv[]) ImageType::PixelType outputPixel = outputIt.Get(); const unsigned int vectorSize = pixel.Size(); - for (unsigned i = 0; i < vectorSize; i++) + for (unsigned i = 0; i < vectorSize; ++i) { if ( OutlierType::IsMissingValue(pixel[i]) ) { diff --git a/Testing/Code/BasicFilters/otbChangeLabelImageFilter.cxx b/Testing/Code/BasicFilters/otbChangeLabelImageFilter.cxx index 6c1ca30427..49026bd169 100644 --- a/Testing/Code/BasicFilters/otbChangeLabelImageFilter.cxx +++ b/Testing/Code/BasicFilters/otbChangeLabelImageFilter.cxx @@ -62,7 +62,7 @@ int otbChangeLabelImageFilter(int argc, char * argv[]) background[2] = 0; filter->SetChange(0, 0); - for (InputPixelType i = lower; i <= upper; i++) + for (InputPixelType i = lower; i <= upper; ++i) { filter->SetChange(i, background); } diff --git a/Testing/Code/BasicFilters/otbConcatenateVectorDataFilter.cxx b/Testing/Code/BasicFilters/otbConcatenateVectorDataFilter.cxx index 12d3bca447..b308eea54c 100644 --- a/Testing/Code/BasicFilters/otbConcatenateVectorDataFilter.cxx +++ b/Testing/Code/BasicFilters/otbConcatenateVectorDataFilter.cxx @@ -57,7 +57,7 @@ int otbConcatenateVectorDataFilter (int argc, char * argv[]) // Concatenate the vector datas ConcatenateFilterType::Pointer concatenate = ConcatenateFilterType::New(); - for (unsigned int idx = 0; idx < nbInputs; idx++) + for (unsigned int idx = 0; idx < nbInputs; ++idx) { // Reader object ReaderType::Pointer reader = ReaderType::New(); diff --git a/Testing/Code/BasicFilters/otbImagePCAShapeModelEstimatorTest.cxx b/Testing/Code/BasicFilters/otbImagePCAShapeModelEstimatorTest.cxx index de76efa384..9cb6257b52 100644 --- a/Testing/Code/BasicFilters/otbImagePCAShapeModelEstimatorTest.cxx +++ b/Testing/Code/BasicFilters/otbImagePCAShapeModelEstimatorTest.cxx @@ -59,12 +59,12 @@ int otbImagePCAShapeModelEstimatorTest(int argc, char* argv[]) std::vector<std::string> imagesfilenames; std::vector<std::string> outputimagesfilenames; int cpt(3); - for(; cpt<(numberOfTrainingImages+3); cpt++) + for(; cpt<(numberOfTrainingImages+3); ++cpt) { imagesfilenames.push_back(argv[cpt]); } int cpt2(cpt); - for(; cpt<(numberOfPrincipalComponentsRequired+cpt2); cpt++) + for(; cpt<(numberOfPrincipalComponentsRequired+cpt2); ++cpt) { outputimagesfilenames.push_back(argv[cpt]); } @@ -164,7 +164,7 @@ int otbImagePCAShapeModelEstimatorTest(int argc, char* argv[]) applyPCAShapeEstimator->GetNumberOfPrincipalComponentsRequired() << " largest eigen values are:" << std::endl; - for (unsigned int i = 0; i < vnl_math_min(numEigVal, (unsigned int) NUMLARGESTPC); i++) + for (unsigned int i = 0; i < vnl_math_min(numEigVal, (unsigned int) NUMLARGESTPC); ++i) { std::cout << eigenValues[i] << std::endl; } @@ -183,7 +183,7 @@ int otbImagePCAShapeModelEstimatorTest(int argc, char* argv[]) } std::cout << " " << std::endl; //Print the largest two eigen vectors - for (unsigned int j=1; j< NUMLARGESTPC + 1; j++ ) + for (unsigned int j=1; j< NUMLARGESTPC + 1; ++j ) { OutputImageType::Pointer outImage2 = applyPCAShapeEstimator->GetOutput( j ); OutputImageIterator outImage2It( outImage2, outImage2->GetBufferedRegion() ); diff --git a/Testing/Code/BasicFilters/otbInnerProductPCAImageFilter.cxx b/Testing/Code/BasicFilters/otbInnerProductPCAImageFilter.cxx index 043f60bfca..90f3efcd16 100644 --- a/Testing/Code/BasicFilters/otbInnerProductPCAImageFilter.cxx +++ b/Testing/Code/BasicFilters/otbInnerProductPCAImageFilter.cxx @@ -60,7 +60,7 @@ int otbInnerProductPCAImageFilter(int argc, char* argv[]) unsigned int nbComponents = numberOfPrincipalComponentsRequired; if (generateMeanComponent == true) nbComponents += 1; - for (unsigned int cpt = 0; cpt < nbComponents; cpt++) + for (unsigned int cpt = 0; cpt < nbComponents; ++cpt) { ExtractROIFilterType::Pointer extractROIFilter = ExtractROIFilterType::New(); WriterType2::Pointer writer2 = WriterType2::New(); diff --git a/Testing/Code/BasicFilters/otbMatrixImageFilterTest.cxx b/Testing/Code/BasicFilters/otbMatrixImageFilterTest.cxx index fb647f2c42..71276dd731 100644 --- a/Testing/Code/BasicFilters/otbMatrixImageFilterTest.cxx +++ b/Testing/Code/BasicFilters/otbMatrixImageFilterTest.cxx @@ -64,9 +64,9 @@ int otbMatrixImageFilterTest(int argc, char * argv[]) FilterType::MatrixType mat(reader->GetOutput()->GetNumberOfComponentsPerPixel(), nbCol, 0.); double val = 0; - for(unsigned int i=0; i<mat.rows(); i++) + for(unsigned int i=0; i<mat.rows(); ++i) { - for(unsigned int j=0; j<mat.cols(); j++) + for(unsigned int j=0; j<mat.cols(); ++j) { mat[i][j] = val; val += 0.5; diff --git a/Testing/Code/BasicFilters/otbVectorImageToMatrixImageFilter.cxx b/Testing/Code/BasicFilters/otbVectorImageToMatrixImageFilter.cxx index 843ee5ef3e..6010eee1e2 100644 --- a/Testing/Code/BasicFilters/otbVectorImageToMatrixImageFilter.cxx +++ b/Testing/Code/BasicFilters/otbVectorImageToMatrixImageFilter.cxx @@ -74,12 +74,12 @@ int otbVectorImageToMatrixTest(int argc, char * argv[]) std::cout << m << std::endl; - for (unsigned int j = 0; j < m.cols(); j++) + for (unsigned int j = 0; j < m.cols(); ++j) { unsigned int x = j % Size; unsigned int y = j / Size; - for (unsigned int i = 0; i < m.rows(); i++) + for (unsigned int i = 0; i < m.rows(); ++i) { if ( m(i, j) != x + y * Size + i ) { diff --git a/Testing/Code/Common/otbDrawLineSpatialObjectList.cxx b/Testing/Code/Common/otbDrawLineSpatialObjectList.cxx index 3bd508a27b..560865d8bc 100644 --- a/Testing/Code/Common/otbDrawLineSpatialObjectList.cxx +++ b/Testing/Code/Common/otbDrawLineSpatialObjectList.cxx @@ -124,7 +124,7 @@ int otbDrawLineSpatialObjectList(int argc, char* argv[]) /* LinesListType::const_iterator it; std::cout<<list.size()<<std::endl; - for (it=list.begin(); it!=list.end(); it++) + for (it=list.begin(); it!=list.end(); ++it) std::cout<< (*it) <<std::endl; */ filter->SetInputLineSpatialObjectList(list); diff --git a/Testing/Code/Common/otbDrawPathFilter.cxx b/Testing/Code/Common/otbDrawPathFilter.cxx index ba97b33e99..9c30a19db5 100644 --- a/Testing/Code/Common/otbDrawPathFilter.cxx +++ b/Testing/Code/Common/otbDrawPathFilter.cxx @@ -57,7 +57,7 @@ int otbDrawPathFilter(int argc, char * argv[]) PathType::Pointer path = PathType::New(); - for (unsigned int i = 1; i < nbpoints; i++) + for (unsigned int i = 1; i < nbpoints; ++i) { VertexType vertex1, vertex2; vertex1[0] = 0; @@ -67,7 +67,7 @@ int otbDrawPathFilter(int argc, char * argv[]) path->AddVertex(vertex1); path->AddVertex(vertex2); } - for (unsigned int i = 1; i < nbpoints; i++) + for (unsigned int i = 1; i < nbpoints; ++i) { VertexType vertex1, vertex2; vertex1[0] = i * sizex / nbpoints; diff --git a/Testing/Code/Common/otbDrawPathListFilter.cxx b/Testing/Code/Common/otbDrawPathListFilter.cxx index 54b71ce536..07622e70be 100644 --- a/Testing/Code/Common/otbDrawPathListFilter.cxx +++ b/Testing/Code/Common/otbDrawPathListFilter.cxx @@ -58,7 +58,7 @@ int otbDrawPathListFilter(int argc, char * argv[]) PathType::Pointer path1 = PathType::New(); - for (unsigned int i = 1; i < nbpoints; i++) + for (unsigned int i = 1; i < nbpoints; ++i) { VertexType vertex1, vertex2; vertex1[0] = 0; @@ -70,7 +70,7 @@ int otbDrawPathListFilter(int argc, char * argv[]) } PathType::Pointer path2 = PathType::New(); - for (unsigned int i = 1; i < nbpoints; i++) + for (unsigned int i = 1; i < nbpoints; ++i) { VertexType vertex1, vertex2; vertex1[0] = i * sizex / nbpoints; diff --git a/Testing/Code/Common/otbDrawPathListFilterWithValue.cxx b/Testing/Code/Common/otbDrawPathListFilterWithValue.cxx index dc16a4353e..478f1cfe70 100644 --- a/Testing/Code/Common/otbDrawPathListFilterWithValue.cxx +++ b/Testing/Code/Common/otbDrawPathListFilterWithValue.cxx @@ -58,7 +58,7 @@ int otbDrawPathListFilterWithValue(int argc, char * argv[]) PathType::Pointer path1 = PathType::New(); - for (unsigned int i = 1; i < nbpoints; i++) + for (unsigned int i = 1; i < nbpoints; ++i) { VertexType vertex1, vertex2; vertex1[0] = 0; @@ -70,7 +70,7 @@ int otbDrawPathListFilterWithValue(int argc, char * argv[]) } PathType::Pointer path2 = PathType::New(); - for (unsigned int i = 1; i < nbpoints; i++) + for (unsigned int i = 1; i < nbpoints; ++i) { VertexType vertex1, vertex2; vertex1[0] = i * sizex / nbpoints; diff --git a/Testing/Code/Common/otbLineSpatialObjectList.cxx b/Testing/Code/Common/otbLineSpatialObjectList.cxx index 2c4845cdf2..0bf6c1724c 100644 --- a/Testing/Code/Common/otbLineSpatialObjectList.cxx +++ b/Testing/Code/Common/otbLineSpatialObjectList.cxx @@ -29,7 +29,7 @@ int otbLineSpatialObjectList(int argc, char * argv[]) typedef LineSpatialObjectListType::const_iterator LineSpatialObjectListConstIterator; LineSpatialObjectListType::Pointer listLines = LineSpatialObjectListType::New(); - for (int i = 0; i < 10; i++) + for (int i = 0; i < 10; ++i) { LineSpatialObjecType::Pointer lLine = LineSpatialObjecType::New(); listLines->push_back(lLine); diff --git a/Testing/Code/Common/otbMultiChannelExtractROI.cxx b/Testing/Code/Common/otbMultiChannelExtractROI.cxx index fe320eeefa..d4b873549d 100644 --- a/Testing/Code/Common/otbMultiChannelExtractROI.cxx +++ b/Testing/Code/Common/otbMultiChannelExtractROI.cxx @@ -62,7 +62,7 @@ int generic_otbMultiChannelExtractROI(int argc, char * argv[], const char * inpu } else if (strArgv == "-channels") { - cpt++; + ++cpt; bool searchChannels(true); while (searchChannels == true) { @@ -81,7 +81,7 @@ int generic_otbMultiChannelExtractROI(int argc, char * argv[], const char * inpu { extractROIFilter->SetChannel((unsigned int) ::atoi(argv[cpt])); std::cout << " ->SetChannel(" << ::atoi(argv[cpt]) << ")" << std::endl; - cpt++; + ++cpt; nbcanaux++; } } @@ -97,7 +97,7 @@ int generic_otbMultiChannelExtractROI(int argc, char * argv[], const char * inpu std::cout << " Canaux selectionnes (" << extractROIFilter->GetNbChannels() << ") : "; typename ExtractROIFilterType::ChannelsType lChannels; lChannels = extractROIFilter->GetChannels(); - for (unsigned int i = 0; i < lChannels.size(); i++) + for (unsigned int i = 0; i < lChannels.size(); ++i) { std::cout << lChannels[i] << " "; } @@ -137,28 +137,28 @@ int otbMultiChannelExtractROI(int argc, char * argv[]) if (argv[cpt][0] == '-') { linputPixelType = std::string(argv[cpt]); - cpt++; + ++cpt; inputFilename = argv[cpt]; - cpt++; + ++cpt; } else { linputPixelType = std::string("-uchar"); inputFilename = argv[cpt]; - cpt++; + ++cpt; } if (argv[cpt][0] == '-') { loutputPixelType = std::string(argv[cpt]); - cpt++; + ++cpt; outputFilename = argv[cpt]; - cpt++; + ++cpt; } else { loutputPixelType = std::string("-uchar"); outputFilename = argv[cpt]; - cpt++; + ++cpt; } argc -= cpt; diff --git a/Testing/Code/Common/otbMultiToMonoChannelExtractROI.cxx b/Testing/Code/Common/otbMultiToMonoChannelExtractROI.cxx index a0366f2019..d8b5934807 100644 --- a/Testing/Code/Common/otbMultiToMonoChannelExtractROI.cxx +++ b/Testing/Code/Common/otbMultiToMonoChannelExtractROI.cxx @@ -109,28 +109,28 @@ int otbMultiToMonoChannelExtractROI(int argc, char * argv[]) if (argv[cpt][0] == '-') { linputPixelType = std::string(argv[cpt]); - cpt++; + ++cpt; inputFilename = argv[cpt]; - cpt++; + ++cpt; } else { linputPixelType = std::string("-uchar"); inputFilename = argv[cpt]; - cpt++; + ++cpt; } if (argv[cpt][0] == '-') { loutputPixelType = std::string(argv[cpt]); - cpt++; + ++cpt; outputFilename = argv[cpt]; - cpt++; + ++cpt; } else { loutputPixelType = std::string("-uchar"); outputFilename = argv[cpt]; - cpt++; + ++cpt; } argc -= cpt; diff --git a/Testing/Code/Common/otbPathListToHistogramGenerator.cxx b/Testing/Code/Common/otbPathListToHistogramGenerator.cxx index dd65efc18f..7848611241 100644 --- a/Testing/Code/Common/otbPathListToHistogramGenerator.cxx +++ b/Testing/Code/Common/otbPathListToHistogramGenerator.cxx @@ -44,7 +44,7 @@ int otbPathListToHistogramGenerator(int argc, char* argv[]) PathListType* PathList = new PathListType; PathList->clear(); - for (int i = 0; i < NbAngle; i++) + for (int i = 0; i < NbAngle; ++i) { PathPointer pathElt = PathType::New(); pathElt->Initialize(); diff --git a/Testing/Code/Common/otbPolyLineImageConstIterator.cxx b/Testing/Code/Common/otbPolyLineImageConstIterator.cxx index 70e993e2cc..1f16f44eb3 100644 --- a/Testing/Code/Common/otbPolyLineImageConstIterator.cxx +++ b/Testing/Code/Common/otbPolyLineImageConstIterator.cxx @@ -58,7 +58,7 @@ int otbPolyLineImageConstIterator(int argc, char * argv[]) PathType::Pointer path = PathType::New(); - for (unsigned int i = 1; i < nbpoints; i++) + for (unsigned int i = 1; i < nbpoints; ++i) { VertexType vertex1, vertex2; vertex1[0] = 0; @@ -68,7 +68,7 @@ int otbPolyLineImageConstIterator(int argc, char * argv[]) path->AddVertex(vertex1); path->AddVertex(vertex2); } - for (unsigned int i = 1; i < nbpoints; i++) + for (unsigned int i = 1; i < nbpoints; ++i) { VertexType vertex1, vertex2; vertex1[0] = i * sizex / nbpoints; diff --git a/Testing/Code/Common/otbPolyLineImageIterator.cxx b/Testing/Code/Common/otbPolyLineImageIterator.cxx index 124abb4845..dfc29d5179 100644 --- a/Testing/Code/Common/otbPolyLineImageIterator.cxx +++ b/Testing/Code/Common/otbPolyLineImageIterator.cxx @@ -57,7 +57,7 @@ int otbPolyLineImageIterator(int argc, char * argv[]) PathType::Pointer path = PathType::New(); - for (unsigned int i = 1; i < nbpoints; i++) + for (unsigned int i = 1; i < nbpoints; ++i) { VertexType vertex1, vertex2; vertex1[0] = 0; @@ -67,7 +67,7 @@ int otbPolyLineImageIterator(int argc, char * argv[]) path->AddVertex(vertex1); path->AddVertex(vertex2); } - for (unsigned int i = 1; i < nbpoints; i++) + for (unsigned int i = 1; i < nbpoints; ++i) { VertexType vertex1, vertex2; vertex1[0] = i * sizex / nbpoints; diff --git a/Testing/Code/Common/otbTestCommandLineArgumentParserList.cxx b/Testing/Code/Common/otbTestCommandLineArgumentParserList.cxx index 8af0e62b15..45f916953c 100644 --- a/Testing/Code/Common/otbTestCommandLineArgumentParserList.cxx +++ b/Testing/Code/Common/otbTestCommandLineArgumentParserList.cxx @@ -53,7 +53,7 @@ int otbTestCommandLineArgumentParserList(int argc, char * argv[]) std::cout << "Double : " << lDouble << std::endl; std::cout << "List de Double : " << parseResult->GetNumberOfParameters("-doubles") << std::endl; - for (int i = 0; i < parseResult->GetNumberOfParameters("-doubles"); i++) + for (int i = 0; i < parseResult->GetNumberOfParameters("-doubles"); ++i) { //double value = otb::GetParameter<double>(parseResult,"-doubles", i); double value = parseResult->GetParameterDouble("-doubles", i); diff --git a/Testing/Code/FeatureExtraction/otbAlignImageToPath.cxx b/Testing/Code/FeatureExtraction/otbAlignImageToPath.cxx index 4690934fe7..6767a3a50a 100644 --- a/Testing/Code/FeatureExtraction/otbAlignImageToPath.cxx +++ b/Testing/Code/FeatureExtraction/otbAlignImageToPath.cxx @@ -134,7 +134,7 @@ int otbAlignImageToPath(int argc, char * argv[]) int nbPath = sortiePath->Size(); otbGenericMsgDebugMacro(<< "NbSegment: " << nbPath); fprintf(file, "Nb Segment: %d\n", nbPath); - for (int i = 0; i < nbPath; i++) + for (int i = 0; i < nbPath; ++i) { vertexList = sortiePath->GetNthElement(i)->GetVertexList(); cindex = vertexList->GetElement(0); diff --git a/Testing/Code/FeatureExtraction/otbBreakAngularPathListFilter.cxx b/Testing/Code/FeatureExtraction/otbBreakAngularPathListFilter.cxx index d592d5e461..5922070988 100644 --- a/Testing/Code/FeatureExtraction/otbBreakAngularPathListFilter.cxx +++ b/Testing/Code/FeatureExtraction/otbBreakAngularPathListFilter.cxx @@ -40,9 +40,9 @@ int otbBreakAngularPathListFilter(int argc, char * argv[]) while (argv[cpt][0] != '|') { ListMaxAngle.push_back(static_cast<double>(::atof(argv[cpt]))); - cpt++; + ++cpt; } - cpt++; + ++cpt; ListPoints.clear(); while (argv[cpt] != NULL) @@ -60,7 +60,7 @@ int otbBreakAngularPathListFilter(int argc, char * argv[]) { ListPoints.push_back(static_cast<double>(::atof(argv[cpt]))); } - cpt++; + ++cpt; } MatricePoints.push_back(ListPoints); diff --git a/Testing/Code/FeatureExtraction/otbComplexMomentsImageFunction.cxx b/Testing/Code/FeatureExtraction/otbComplexMomentsImageFunction.cxx index 444db225aa..10b0851a10 100644 --- a/Testing/Code/FeatureExtraction/otbComplexMomentsImageFunction.cxx +++ b/Testing/Code/FeatureExtraction/otbComplexMomentsImageFunction.cxx @@ -84,9 +84,9 @@ int otbComplexMomentsImageFunction(int argc, char * argv[]) function->SetNeighborhoodRadius(3); Result = function->EvaluateAtIndex(index); - for (unsigned int k=0; k<=p; k++) + for (unsigned int k=0; k<=p; ++k) { - for (unsigned int l=0; l<=q; l++) + for (unsigned int l=0; l<=q; ++l) { outputStream << "ComplexMoment c(" << k << l << ") : " << Result.at(k).at(l) << std::endl; } @@ -159,9 +159,9 @@ int otbComplexMomentsImageFunctionScaleInvariant(int argc, char * argv[]) error = 0.0; - for (unsigned int k=0; k<=p; k++) + for (unsigned int k=0; k<=p; ++k) { - for (unsigned int l=0; l<=q; l++) + for (unsigned int l=0; l<=q; ++l) { error += vcl_pow(vcl_abs( Result1.at(k).at(l) - Result2.at(k).at(l) ), 2); diff --git a/Testing/Code/FeatureExtraction/otbFlusserMomentsImageFunction.cxx b/Testing/Code/FeatureExtraction/otbFlusserMomentsImageFunction.cxx index fcf226105a..ac92a1fd30 100644 --- a/Testing/Code/FeatureExtraction/otbFlusserMomentsImageFunction.cxx +++ b/Testing/Code/FeatureExtraction/otbFlusserMomentsImageFunction.cxx @@ -80,7 +80,7 @@ int otbFlusserMomentsImageFunction(int argc, char * argv[]) std::ofstream outputStream(outputFilename); outputStream << std::setprecision(10) << "Flusser Image moments: [10]" << std::endl; - for (unsigned int j = 1; j < 12; j++) + for (unsigned int j = 1; j < 12; ++j) { outputStream << "Flusser(" << j << ") = " << Result[j-1] << std::endl; } @@ -144,7 +144,7 @@ int otbFlusserMomentsImageFunctionScaleInvariant(int argc, char * argv[]) double error = 0.0; - for (unsigned int j = 1; j < 12; j++) + for (unsigned int j = 1; j < 12; ++j) { error += vcl_pow(vcl_abs( Result1[j-1] - Result2[j-1]), 2); @@ -250,7 +250,7 @@ int otbFlusserMomentsImageFunctionRotationInvariant(int argc, char * argv[]) double error = 0.0; - for (unsigned int j = 1; j < 12; j++) + for (unsigned int j = 1; j < 12; ++j) { error += vcl_pow(vcl_abs( Result1[j-1] - Result2[j-1]), 2); diff --git a/Testing/Code/FeatureExtraction/otbFourierMellinDescriptors.cxx b/Testing/Code/FeatureExtraction/otbFourierMellinDescriptors.cxx index 92603c21c5..6a57b6fe9d 100644 --- a/Testing/Code/FeatureExtraction/otbFourierMellinDescriptors.cxx +++ b/Testing/Code/FeatureExtraction/otbFourierMellinDescriptors.cxx @@ -80,9 +80,9 @@ int otbFourierMellinDescriptors(int argc, char * argv[]) std::ofstream outputStream(outputFilename); outputStream << std::setprecision(10); - for (unsigned int k=0; k<=p; k++) + for (unsigned int k=0; k<=p; ++k) { - for (unsigned int l=0; l<=q; l++) + for (unsigned int l=0; l<=q; ++l) { outputStream << "FMDescriptor |M(" << k << l << ")| : " << Result.at(k).at(l) << std::endl; } @@ -152,9 +152,9 @@ int otbFourierMellinDescriptorsScaleInvariant(int argc, char * argv[]) double error = 0.0; - for (unsigned int k=0; k<=p; k++) + for (unsigned int k=0; k<=p; ++k) { - for (unsigned int l=0; l<=q; l++) + for (unsigned int l=0; l<=q; ++l) { error += vcl_pow(vcl_abs( Result1.at(k).at(l) - Result2.at(k).at(l) ), 2); @@ -266,9 +266,9 @@ int otbFourierMellinDescriptorsRotationInvariant(int argc, char * argv[]) double error = 0.0; - for (unsigned int k=0; k<=p; k++) + for (unsigned int k=0; k<=p; ++k) { - for (unsigned int l=0; l<=q; l++) + for (unsigned int l=0; l<=q; ++l) { error += vcl_pow(vcl_abs( Result1.at(k).at(l) - Result2.at(k).at(l) ), 2); diff --git a/Testing/Code/FeatureExtraction/otbHarrisToPointSet.cxx b/Testing/Code/FeatureExtraction/otbHarrisToPointSet.cxx index 203196b134..2ab4745c03 100644 --- a/Testing/Code/FeatureExtraction/otbHarrisToPointSet.cxx +++ b/Testing/Code/FeatureExtraction/otbHarrisToPointSet.cxx @@ -74,7 +74,7 @@ int otbHarrisToPointSet(int argc, char * argv[]) unsigned long NbPoints = pointList->GetNumberOfPoints(); file << "NbPoints : " << NbPoints << std::endl; - for (unsigned long i = 0; i < NbPoints; i++) + for (unsigned long i = 0; i < NbPoints; ++i) { pointList->GetPoint(i, &CoordPoint); file << i + 1 << " / " << NbPoints << " : "; diff --git a/Testing/Code/FeatureExtraction/otbHuMomentsImageFunction.cxx b/Testing/Code/FeatureExtraction/otbHuMomentsImageFunction.cxx index fa1feb20a6..1ca8b4af6d 100644 --- a/Testing/Code/FeatureExtraction/otbHuMomentsImageFunction.cxx +++ b/Testing/Code/FeatureExtraction/otbHuMomentsImageFunction.cxx @@ -77,7 +77,7 @@ int otbHuMomentsImageFunction(int argc, char * argv[]) std::ofstream outputStream(outputFilename); outputStream << std::setprecision(10) << "Hu Image moments: [10]" << std::endl; - for (unsigned int j = 1; j < 8; j++) + for (unsigned int j = 1; j < 8; ++j) { outputStream << "Hu(" << j << ") = " << Result[j-1] << std::endl; } @@ -141,7 +141,7 @@ int otbHuMomentsImageFunctionScaleInvariant(int argc, char * argv[]) double error = 0.0; - for (unsigned int j = 1; j < 8; j++) + for (unsigned int j = 1; j < 8; ++j) { error += vcl_pow(vcl_abs( Result1[j-1] - Result2[j-1]), 2); @@ -247,7 +247,7 @@ int otbHuMomentsImageFunctionRotationInvariant(int argc, char * argv[]) double error = 0.0; - for (unsigned int j = 1; j < 8; j++) + for (unsigned int j = 1; j < 8; ++j) { error += vcl_pow(vcl_abs( Result1[j-1] - Result2[j-1]), 2); diff --git a/Testing/Code/FeatureExtraction/otbImageFunctionAdaptor.cxx b/Testing/Code/FeatureExtraction/otbImageFunctionAdaptor.cxx index 34d08f81bf..fb87b9e52d 100644 --- a/Testing/Code/FeatureExtraction/otbImageFunctionAdaptor.cxx +++ b/Testing/Code/FeatureExtraction/otbImageFunctionAdaptor.cxx @@ -152,9 +152,9 @@ int otbImageFunctionAdaptor(int argc, char * argv[]) FMDImageFunctionAdaptorType::OutputType resultAdaptedFMD = FMDadaptedFunction->EvaluateAtIndex(index); rsltIdx = 0; - for (unsigned int i = 0; i <= 5; i++) + for (unsigned int i = 0; i <= 5; ++i) { - for (unsigned int j = 0; j <= 5; j++) + for (unsigned int j = 0; j <= 5; ++j) { error += vcl_pow(vcl_abs(resultAdaptedFMD[rsltIdx] - resultFMD.at(i).at(j)), 2); @@ -188,9 +188,9 @@ int otbImageFunctionAdaptor(int argc, char * argv[]) RMImageFunctionAdaptorType::OutputType resultAdaptedRM = RMadaptedFunction->EvaluateAtIndex(index); rsltIdx = 0; - for (unsigned int i = 0; i <= 5; i++) + for (unsigned int i = 0; i <= 5; ++i) { - for (unsigned int j = 0; j <= 5; j++) + for (unsigned int j = 0; j <= 5; ++j) { error += vcl_pow(vcl_abs(resultAdaptedRM[rsltIdx] - resultRM.at(i).at(j)), 2); @@ -223,9 +223,9 @@ int otbImageFunctionAdaptor(int argc, char * argv[]) CMImageFunctionAdaptorType::OutputType resultAdaptedCM = CMadaptedFunction->EvaluateAtIndex(index); rsltIdx = 0; - for (unsigned int i = 0; i <= 5; i++) + for (unsigned int i = 0; i <= 5; ++i) { - for (unsigned int j = 0; j <= 5; j++) + for (unsigned int j = 0; j <= 5; ++j) { error += vcl_pow(vcl_abs(resultAdaptedCM[rsltIdx] - resultCM.at(i).at(j).real()), 2); std::cout << "resultAdaptedCM : (" << resultAdaptedCM[rsltIdx] << "," << resultAdaptedCM[rsltIdx + 1] << ")" @@ -255,7 +255,7 @@ int otbImageFunctionAdaptor(int argc, char * argv[]) FMImageFunctionAdaptorType::OutputType resultAdaptedFM = FMadaptedFunction->EvaluateAtIndex(index); rsltIdx = 0; - for (unsigned int i = 0; i < 11; i++) + for (unsigned int i = 0; i < 11; ++i) { error += vcl_pow(vcl_abs(resultAdaptedFM[rsltIdx] - resultFM[i]), 2); @@ -282,7 +282,7 @@ int otbImageFunctionAdaptor(int argc, char * argv[]) HMImageFunctionAdaptorType::OutputType resultAdaptedHM = HMadaptedFunction->EvaluateAtIndex(index); rsltIdx = 0; - for (unsigned int i = 0; i < 7; i++) + for (unsigned int i = 0; i < 7; ++i) { error += vcl_pow(vcl_abs(resultAdaptedHM[rsltIdx] - resultHM[i]), 2); @@ -309,7 +309,7 @@ int otbImageFunctionAdaptor(int argc, char * argv[]) RaMImageFunctionAdaptorType::OutputType resultAdaptedRaM = RaMadaptedFunction->EvaluateAtIndex(index); rsltIdx = 0; - for (unsigned int i = 0; i < 4; i++) + for (unsigned int i = 0; i < 4; ++i) { error += vcl_pow(vcl_abs(resultAdaptedRaM[rsltIdx] - resultRaM[i]), 2); @@ -343,7 +343,7 @@ int otbImageFunctionAdaptor(int argc, char * argv[]) LHImageFunctionAdaptorType::OutputType resultAdaptedLH = LHadaptedFunction->EvaluateAtIndex(index); rsltIdx = 0; - for (unsigned int i = 0; i < 64; i++) + for (unsigned int i = 0; i < 64; ++i) { error += vcl_pow(vcl_abs(resultAdaptedLH[rsltIdx] - resultLH->GetFrequency(i)), 2); @@ -386,9 +386,9 @@ int otbImageFunctionAdaptor(int argc, char * argv[]) FMDImageFunctionAdaptorType::OutputType myResult = myAdaptedFunction->EvaluateAtIndex(index); rsltIdx = 0; - for (unsigned int i = 0; i <= 2; i++) + for (unsigned int i = 0; i <= 2; ++i) { - for (unsigned int j = 0; j <= 2; j++) + for (unsigned int j = 0; j <= 2; ++j) { std::cout << "myResult: " << myResult[rsltIdx] << std::endl; rsltIdx++; diff --git a/Testing/Code/FeatureExtraction/otbImageToEdgePathFilter.cxx b/Testing/Code/FeatureExtraction/otbImageToEdgePathFilter.cxx index ab0dd27a07..7e9980a273 100644 --- a/Testing/Code/FeatureExtraction/otbImageToEdgePathFilter.cxx +++ b/Testing/Code/FeatureExtraction/otbImageToEdgePathFilter.cxx @@ -76,7 +76,7 @@ int otbImageToEdgePathFilter(int argc, char * argv[]) // Create one iterator for the Input Image (this is a light object) IteratorType it(outputImage, outputImage->GetBufferedRegion()); - for (unsigned int cpt = 0; cpt < ptrVertexList->Size(); cpt++) + for (unsigned int cpt = 0; cpt < ptrVertexList->Size(); ++cpt) { std::cout << " Point " << cpt << " : " << ptrVertexList->GetElement(cpt) << std::endl; IndexType pos; diff --git a/Testing/Code/FeatureExtraction/otbLikelihoodPathListFilter.cxx b/Testing/Code/FeatureExtraction/otbLikelihoodPathListFilter.cxx index 5622c8d90e..6396f3007a 100644 --- a/Testing/Code/FeatureExtraction/otbLikelihoodPathListFilter.cxx +++ b/Testing/Code/FeatureExtraction/otbLikelihoodPathListFilter.cxx @@ -54,7 +54,7 @@ int otbLikelihoodPathListFilter(int argc, char * argv[]) { ListPoints.push_back(static_cast<double>(::atof(argv[cpt]))); } - cpt++; + ++cpt; } MatricePoints.push_back(ListPoints); diff --git a/Testing/Code/FeatureExtraction/otbLineSpatialObjectListToRightAnglePointSetFilter.cxx b/Testing/Code/FeatureExtraction/otbLineSpatialObjectListToRightAnglePointSetFilter.cxx index cb63d904a3..8900379811 100644 --- a/Testing/Code/FeatureExtraction/otbLineSpatialObjectListToRightAnglePointSetFilter.cxx +++ b/Testing/Code/FeatureExtraction/otbLineSpatialObjectListToRightAnglePointSetFilter.cxx @@ -128,7 +128,7 @@ int otbLineSpatialObjectListToRightAnglePointSetFilter(int argc, char * argv[]) segmentOrtho = rightAngleFilter->GetOutput(); PointSetType::PointType pRight; - for (unsigned int i = 0; i < segmentOrtho->GetNumberOfPoints(); i++) + for (unsigned int i = 0; i < segmentOrtho->GetNumberOfPoints(); ++i) { segmentOrtho->GetPoint(i, &pRight); outfile << " Right Angle found in point : " << pRight << std::endl; diff --git a/Testing/Code/FeatureExtraction/otbLineSpatialObjectListToRightAnglePointSetFilterByStepsOutputAscii.cxx b/Testing/Code/FeatureExtraction/otbLineSpatialObjectListToRightAnglePointSetFilterByStepsOutputAscii.cxx index f540fc5a81..54903f226f 100644 --- a/Testing/Code/FeatureExtraction/otbLineSpatialObjectListToRightAnglePointSetFilterByStepsOutputAscii.cxx +++ b/Testing/Code/FeatureExtraction/otbLineSpatialObjectListToRightAnglePointSetFilterByStepsOutputAscii.cxx @@ -132,7 +132,7 @@ int otbLineSpatialObjectListToRightAnglePointSetFilterByStepsOutputAscii(int arg std::ofstream outfile(outfname); outfile << "Number of right angles detected " << rightAngleFilter->GetOutput()->GetNumberOfPoints() << std::endl; - for (unsigned int i = 0; i < segmentOrtho->GetNumberOfPoints(); i++) + for (unsigned int i = 0; i < segmentOrtho->GetNumberOfPoints(); ++i) { segmentOrtho->GetPoint(i, &pRight); outfile << " Right Angle found in point : " << pRight << std::endl; diff --git a/Testing/Code/FeatureExtraction/otbLinkPathListFilter.cxx b/Testing/Code/FeatureExtraction/otbLinkPathListFilter.cxx index e8a7f11c9b..c43ca29de9 100644 --- a/Testing/Code/FeatureExtraction/otbLinkPathListFilter.cxx +++ b/Testing/Code/FeatureExtraction/otbLinkPathListFilter.cxx @@ -55,7 +55,7 @@ int otbLinkPathListFilter(int argc, char * argv[]) { ListPoints.push_back(static_cast<double>(::atof(argv[cpt]))); } - cpt++; + ++cpt; } MatricePoints.push_back(ListPoints); diff --git a/Testing/Code/FeatureExtraction/otbRadiometricMomentsImageFunction.cxx b/Testing/Code/FeatureExtraction/otbRadiometricMomentsImageFunction.cxx index bc635ca35c..7e88d7cfa6 100644 --- a/Testing/Code/FeatureExtraction/otbRadiometricMomentsImageFunction.cxx +++ b/Testing/Code/FeatureExtraction/otbRadiometricMomentsImageFunction.cxx @@ -75,7 +75,7 @@ int otbRadiometricMomentsImageFunction(int argc, char * argv[]) std::ofstream outputStream(outputFilename); outputStream << std::setprecision(10) << "Radiometric moments: [10]" << std::endl; - for (unsigned int j = 1; j < 5; j++) + for (unsigned int j = 1; j < 5; ++j) { outputStream << "Radiometric Moment(" << j << ") = " << Result[j-1] << std::endl; } diff --git a/Testing/Code/FeatureExtraction/otbRealMomentsImageFunction.cxx b/Testing/Code/FeatureExtraction/otbRealMomentsImageFunction.cxx index 6d658d9adb..35ea155e5f 100644 --- a/Testing/Code/FeatureExtraction/otbRealMomentsImageFunction.cxx +++ b/Testing/Code/FeatureExtraction/otbRealMomentsImageFunction.cxx @@ -81,9 +81,9 @@ int otbRealMomentsImageFunction(int argc, char * argv[]) function->SetNeighborhoodRadius(3); Result = function->EvaluateAtIndex(index); - for (unsigned int k=0; k<=p; k++) + for (unsigned int k=0; k<=p; ++k) { - for (unsigned int l=0; l<=q; l++) + for (unsigned int l=0; l<=q; ++l) { outputStream << "RealMoment c(" << k << l << ") : " << Result.at(k).at(l) << std::endl; } diff --git a/Testing/Code/FeatureExtraction/otbRemoveTortuousPathListFilter.cxx b/Testing/Code/FeatureExtraction/otbRemoveTortuousPathListFilter.cxx index b6ca9144bf..53887382d3 100644 --- a/Testing/Code/FeatureExtraction/otbRemoveTortuousPathListFilter.cxx +++ b/Testing/Code/FeatureExtraction/otbRemoveTortuousPathListFilter.cxx @@ -50,7 +50,7 @@ int otbRemoveTortuousPathListFilter(int argc, char * argv[]) { ListPoints.push_back(static_cast<double>(::atof(argv[cpt]))); } - cpt++; + ++cpt; } MatricePoints.push_back(ListPoints); diff --git a/Testing/Code/FeatureExtraction/otbSimplePointCountStrategyTest.cxx b/Testing/Code/FeatureExtraction/otbSimplePointCountStrategyTest.cxx index 5de46e41f4..e9eceb600e 100644 --- a/Testing/Code/FeatureExtraction/otbSimplePointCountStrategyTest.cxx +++ b/Testing/Code/FeatureExtraction/otbSimplePointCountStrategyTest.cxx @@ -44,7 +44,7 @@ int otbSimplePointCountStrategyTest(int argc, char * argv[]) Point[0] = 12.14; Point[1] = 14.14; - for (int i = 0; i < 10; i++) + for (int i = 0; i < 10; ++i) { pointset->SetPoint(count, Point); count++; diff --git a/Testing/Code/FeatureExtraction/otbSimplifyPathListFilter.cxx b/Testing/Code/FeatureExtraction/otbSimplifyPathListFilter.cxx index 85b963dc80..f16f72a29f 100644 --- a/Testing/Code/FeatureExtraction/otbSimplifyPathListFilter.cxx +++ b/Testing/Code/FeatureExtraction/otbSimplifyPathListFilter.cxx @@ -50,7 +50,7 @@ int otbSimplifyPathListFilter(int argc, char * argv[]) { ListPoints.push_back(static_cast<double>(::atof(argv[cpt]))); } - cpt++; + ++cpt; } MatricePoints.push_back(ListPoints); diff --git a/Testing/Code/FeatureExtraction/otbThresholdImageToPointSetTest.cxx b/Testing/Code/FeatureExtraction/otbThresholdImageToPointSetTest.cxx index 4579de3c88..ca287f1d7b 100644 --- a/Testing/Code/FeatureExtraction/otbThresholdImageToPointSetTest.cxx +++ b/Testing/Code/FeatureExtraction/otbThresholdImageToPointSetTest.cxx @@ -66,7 +66,7 @@ int otbThresholdImageToPointSetTest(int argc, char * argv[]) //Initialization CoordPoint.Fill(0); - for (unsigned long i = 0; i < NbPoints; i++) + for (unsigned long i = 0; i < NbPoints; ++i) { pointList->GetPoint(i, &CoordPoint); file << i + 1 << "/" << NbPoints << " : " << CoordPoint[0] << " , " << CoordPoint[1] << std::endl; diff --git a/Testing/Code/Fuzzy/otbFuzzyVariableDSApplied.cxx b/Testing/Code/Fuzzy/otbFuzzyVariableDSApplied.cxx index 3444e1c7da..1443ef8d54 100644 --- a/Testing/Code/Fuzzy/otbFuzzyVariableDSApplied.cxx +++ b/Testing/Code/Fuzzy/otbFuzzyVariableDSApplied.cxx @@ -38,7 +38,7 @@ int otbFuzzyVariableDSApplied(int argc, char* argv[]) PrecisionType memTheta; - for(unsigned int i=0; i<=100; i++) + for(unsigned int i=0; i<=100; ++i) { pos = (PrecisionType)i/100; maxVar = fv->GetMaxVar(pos); diff --git a/Testing/Code/Fuzzy/otbJointMassOfBeliefFilter.cxx b/Testing/Code/Fuzzy/otbJointMassOfBeliefFilter.cxx index f2fbce1700..9bd6d42d26 100644 --- a/Testing/Code/Fuzzy/otbJointMassOfBeliefFilter.cxx +++ b/Testing/Code/Fuzzy/otbJointMassOfBeliefFilter.cxx @@ -95,7 +95,7 @@ int otbJointMassOfBeliefFilter(int argc, char* argv[]) results.push_back(jointMass->GetBelief(hyp)); results.push_back(jointMass->GetPlausibility(hyp)); - for (unsigned int i=0; i<baseline.size(); i++) + for (unsigned int i=0; i<baseline.size(); ++i) { if (vcl_abs(baseline[i] - results[i]) >= .000001) { diff --git a/Testing/Code/Hyperspectral/otbSparseUnmixingImageFilter.cxx b/Testing/Code/Hyperspectral/otbSparseUnmixingImageFilter.cxx index 228f02d954..b6d22ecf07 100644 --- a/Testing/Code/Hyperspectral/otbSparseUnmixingImageFilter.cxx +++ b/Testing/Code/Hyperspectral/otbSparseUnmixingImageFilter.cxx @@ -104,7 +104,7 @@ int otbSparseUnmixingImageFilterTest ( int argc, char * argv[] ) std::vector< WriterType::Pointer > writers; writers.resize( filter->GetNumberOfOutputs() ); - for ( unsigned int i = 0; i < filter->GetNumberOfOutputs(); i++ ) + for ( unsigned int i = 0; i < filter->GetNumberOfOutputs(); ++i ) { std::stringstream title; title << outputImageName << "_" << i << ".hdr"; diff --git a/Testing/Code/IO/otbComplexImageManipulationTest.cxx b/Testing/Code/IO/otbComplexImageManipulationTest.cxx index 23bc11757e..b8b3e6b03d 100644 --- a/Testing/Code/IO/otbComplexImageManipulationTest.cxx +++ b/Testing/Code/IO/otbComplexImageManipulationTest.cxx @@ -55,7 +55,7 @@ template<class TInternalPixel> bool IsEqual(itk::VariableLengthVector<TInternalPixel> output, itk::VariableLengthVector<TInternalPixel> expected) { bool result = true; - for(unsigned int i = 0; i < output.Size(); i++) + for(unsigned int i = 0; i < output.Size(); ++i) { result = result && IsEqual(output[i], expected[i]); } diff --git a/Testing/Code/IO/otbGDALImageIOTestWriteMetadata.cxx b/Testing/Code/IO/otbGDALImageIOTestWriteMetadata.cxx index 3690869d45..31cf96a1d4 100644 --- a/Testing/Code/IO/otbGDALImageIOTestWriteMetadata.cxx +++ b/Testing/Code/IO/otbGDALImageIOTestWriteMetadata.cxx @@ -102,7 +102,7 @@ public: os << "GCP Projection Ref: " << this->m_GCPProjRef <<std::endl; os << "GCP count: " << this->m_GCPCount << std::endl; - /* for (int it = 0; it<this->m_GCPCount; it++) + /* for (int it = 0; it<this->m_GCPCount; ++it) { os << " GCP Id = " << this->m_GCPs[it].pszId << std::endl; os << " GCP Info = " << this->m_GCPs[it].pszInfo << std::endl; @@ -549,7 +549,7 @@ bool writeReadDatasetMetadata(std::string filename, std::vector<std::string> opt // Write data into dataset GDALRasterBand *poBand; GByte abyRaster[128*128]; - for (unsigned int it=0; it < 128*128; it++) + for (unsigned int it=0; it < 128*128; ++it) { abyRaster[it] = 0; } diff --git a/Testing/Code/IO/otbImageFileReaderMSTAR.cxx b/Testing/Code/IO/otbImageFileReaderMSTAR.cxx index 2eb7a44337..8782ede2a6 100644 --- a/Testing/Code/IO/otbImageFileReaderMSTAR.cxx +++ b/Testing/Code/IO/otbImageFileReaderMSTAR.cxx @@ -76,7 +76,7 @@ int otbImageFileReaderMSTAR(int argc, char* argv[]) const InternalImageType::PointType& inputOrigin = reader->GetOutput()->GetOrigin(); double outputOrigin[InputDimension]; - for (unsigned int i = 0; i < InputDimension; i++) + for (unsigned int i = 0; i < InputDimension; ++i) { outputOrigin[i] = inputOrigin[i] + spacing[i] * inputStart[i]; } diff --git a/Testing/Code/IO/otbImageSeriesFileReader.cxx b/Testing/Code/IO/otbImageSeriesFileReader.cxx index dc2435dc6c..7546c31a6d 100644 --- a/Testing/Code/IO/otbImageSeriesFileReader.cxx +++ b/Testing/Code/IO/otbImageSeriesFileReader.cxx @@ -46,7 +46,7 @@ int otbImageSeriesFileReader(int argc, char* argv[]) typedef otb::StreamingImageFileWriter<ImageType> WriterType; - for (unsigned int i = 0; i < imageList->Size(); i++) + for (unsigned int i = 0; i < imageList->Size(); ++i) { std::cout << "Image no " << i << "\n"; diff --git a/Testing/Code/IO/otbImageTest.cxx b/Testing/Code/IO/otbImageTest.cxx index 10382eac28..eb7cfb5675 100644 --- a/Testing/Code/IO/otbImageTest.cxx +++ b/Testing/Code/IO/otbImageTest.cxx @@ -80,7 +80,7 @@ int otbImageTest(int argc, char* argv[]) InputImageType::VectorType tab = image->GetGeoTransform(); file << "Geo Transform " << std::endl; - for (unsigned int i = 0; i < tab.size(); i++) + for (unsigned int i = 0; i < tab.size(); ++i) { file << " " << i << " -> " << tab[i] << std::endl; } @@ -88,28 +88,28 @@ int otbImageTest(int argc, char* argv[]) tab = image->GetUpperLeftCorner(); file << "Corners " << std::endl; - for (unsigned int i = 0; i < tab.size(); i++) + for (unsigned int i = 0; i < tab.size(); ++i) { file << " UL[" << i << "] -> " << tab[i] << std::endl; } tab.clear(); tab = image->GetUpperRightCorner(); - for (unsigned int i = 0; i < tab.size(); i++) + for (unsigned int i = 0; i < tab.size(); ++i) { file << " UR[" << i << "] -> " << tab[i] << std::endl; } tab.clear(); tab = image->GetLowerLeftCorner(); - for (unsigned int i = 0; i < tab.size(); i++) + for (unsigned int i = 0; i < tab.size(); ++i) { file << " LL[" << i << "] -> " << tab[i] << std::endl; } tab.clear(); tab = image->GetLowerRightCorner(); - for (unsigned int i = 0; i < tab.size(); i++) + for (unsigned int i = 0; i < tab.size(); ++i) { file << " LR[" << i << "] -> " << tab[i] << std::endl; } diff --git a/Testing/Code/IO/otbScalarBufferToImageFileWriterTest.cxx b/Testing/Code/IO/otbScalarBufferToImageFileWriterTest.cxx index f6d4736a6d..7b4de7c34d 100644 --- a/Testing/Code/IO/otbScalarBufferToImageFileWriterTest.cxx +++ b/Testing/Code/IO/otbScalarBufferToImageFileWriterTest.cxx @@ -38,7 +38,7 @@ int otbScalarBufferToImageFileWriterTest(int argc, char* argv[]) { for(unsigned int sy=0; sy<sizeY; sy++) { - for(unsigned int i=0; i<nbCh; i++) + for(unsigned int i=0; i<nbCh; ++i) { tab[cpt++] = val; val++; diff --git a/Testing/Code/IO/otbVectorImageFileWriterTestWithoutInput.cxx b/Testing/Code/IO/otbVectorImageFileWriterTestWithoutInput.cxx index c2ad4a9098..ca53af2273 100644 --- a/Testing/Code/IO/otbVectorImageFileWriterTestWithoutInput.cxx +++ b/Testing/Code/IO/otbVectorImageFileWriterTestWithoutInput.cxx @@ -73,7 +73,7 @@ int otbVectorImageFileWriterScalarTestWithoutInputGeneric(int argc, char* argv[] ImagePixelType pix0; pix0.SetSize(atoi(argv[3])); - for (unsigned int i = 0; i < static_cast<unsigned int> (atoi(argv[3])); i++) + for (unsigned int i = 0; i < static_cast<unsigned int> (atoi(argv[3])); ++i) { pix0[i] = static_cast<PixelType> (0); } @@ -87,7 +87,7 @@ int otbVectorImageFileWriterScalarTestWithoutInputGeneric(int argc, char* argv[] while (!it.IsAtEnd()) { - for (unsigned int i = 0; i < static_cast<unsigned int> (atoi(argv[3])); i++) + for (unsigned int i = 0; i < static_cast<unsigned int> (atoi(argv[3])); ++i) { pixVal[i] = static_cast<PixelType> (i * size[0] * size[1] + size[0] * it.GetIndex()[1] + it.GetIndex()[0]); } @@ -167,7 +167,7 @@ int otbVectorImageFileWriterComplexTestWithoutInputGeneric(int argc, char* argv[ ImagePixelType pix0; pix0.SetSize(atoi(argv[3])); - for (unsigned int i = 0; i < static_cast<unsigned int> (atoi(argv[3])); i++) + for (unsigned int i = 0; i < static_cast<unsigned int> (atoi(argv[3])); ++i) { pix0[i] = static_cast<PixelType> (0); } @@ -182,7 +182,7 @@ int otbVectorImageFileWriterComplexTestWithoutInputGeneric(int argc, char* argv[ typedef typename itk::NumericTraits<PixelType>::ScalarRealType ScalarRealType; while (!it.IsAtEnd()) { - for (unsigned int i = 0; i < static_cast<unsigned int> (atoi(argv[3])); i++) + for (unsigned int i = 0; i < static_cast<unsigned int> (atoi(argv[3])); ++i) { ScalarRealType realPart = 2 * (i *size[0]*size[1] + size[0] * it.GetIndex()[1] + it.GetIndex()[0]); ScalarRealType imagPart = 2 * (i *size[0]*size[1] + size[0] * it.GetIndex()[1] + it.GetIndex()[0]) + 1; diff --git a/Testing/Code/IO/otbVectorImageStreamingFileWriterTestWithoutInput.cxx b/Testing/Code/IO/otbVectorImageStreamingFileWriterTestWithoutInput.cxx index 0a6771b264..cef466a499 100644 --- a/Testing/Code/IO/otbVectorImageStreamingFileWriterTestWithoutInput.cxx +++ b/Testing/Code/IO/otbVectorImageStreamingFileWriterTestWithoutInput.cxx @@ -73,7 +73,7 @@ int otbVectorImageStreamingFileWriterScalarTestWithoutInputGeneric(int argc, cha ImagePixelType pix0; pix0.SetSize(atoi(argv[3])); - for (unsigned int i = 0; i < static_cast<unsigned int> (atoi(argv[3])); i++) + for (unsigned int i = 0; i < static_cast<unsigned int> (atoi(argv[3])); ++i) { pix0[i] = static_cast<PixelType> (0); } @@ -87,7 +87,7 @@ int otbVectorImageStreamingFileWriterScalarTestWithoutInputGeneric(int argc, cha while (!it.IsAtEnd()) { - for (unsigned int i = 0; i < static_cast<unsigned int> (atoi(argv[3])); i++) + for (unsigned int i = 0; i < static_cast<unsigned int> (atoi(argv[3])); ++i) { pixVal[i] = static_cast<PixelType> (i * size[0] * size[1] + size[0] * it.GetIndex()[1] + it.GetIndex()[0]); } @@ -167,7 +167,7 @@ int otbVectorImageStreamingFileWriterComplexTestWithoutInputGeneric(int argc, ch ImagePixelType pix0; pix0.SetSize(atoi(argv[3])); - for (unsigned int i = 0; i < static_cast<unsigned int> (atoi(argv[3])); i++) + for (unsigned int i = 0; i < static_cast<unsigned int> (atoi(argv[3])); ++i) { pix0[i] = static_cast<PixelType> (0); } @@ -182,7 +182,7 @@ int otbVectorImageStreamingFileWriterComplexTestWithoutInputGeneric(int argc, ch typedef typename itk::NumericTraits<PixelType>::ScalarRealType ScalarRealType; while (!it.IsAtEnd()) { - for (unsigned int i = 0; i < static_cast<unsigned int> (atoi(argv[3])); i++) + for (unsigned int i = 0; i < static_cast<unsigned int> (atoi(argv[3])); ++i) { ScalarRealType realPart = 2 * (i *size[0]*size[1] + size[0] * it.GetIndex()[1] + it.GetIndex()[0]); ScalarRealType imagPart = 2 * (i *size[0]*size[1] + size[0] * it.GetIndex()[1] + it.GetIndex()[0]) + 1; diff --git a/Testing/Code/IO/otbVectorImageTest.cxx b/Testing/Code/IO/otbVectorImageTest.cxx index a2cc5b0ed0..7efae569ec 100644 --- a/Testing/Code/IO/otbVectorImageTest.cxx +++ b/Testing/Code/IO/otbVectorImageTest.cxx @@ -82,7 +82,7 @@ int otbVectorImageLegacyTest(int argc, char* argv[]) InputImageType::VectorType tab = image->GetGeoTransform(); file << "Geo Transform " << std::endl; - for (unsigned int i = 0; i < tab.size(); i++) + for (unsigned int i = 0; i < tab.size(); ++i) { file << " " << i << " -> " << tab[i] << std::endl; } @@ -90,28 +90,28 @@ int otbVectorImageLegacyTest(int argc, char* argv[]) tab = image->GetUpperLeftCorner(); file << "Corners " << std::endl; - for (unsigned int i = 0; i < tab.size(); i++) + for (unsigned int i = 0; i < tab.size(); ++i) { file << " UL[" << i << "] -> " << tab[i] << std::endl; } tab.clear(); tab = image->GetUpperRightCorner(); - for (unsigned int i = 0; i < tab.size(); i++) + for (unsigned int i = 0; i < tab.size(); ++i) { file << " UR[" << i << "] -> " << tab[i] << std::endl; } tab.clear(); tab = image->GetLowerLeftCorner(); - for (unsigned int i = 0; i < tab.size(); i++) + for (unsigned int i = 0; i < tab.size(); ++i) { file << " LL[" << i << "] -> " << tab[i] << std::endl; } tab.clear(); tab = image->GetLowerRightCorner(); - for (unsigned int i = 0; i < tab.size(); i++) + for (unsigned int i = 0; i < tab.size(); ++i) { file << " LR[" << i << "] -> " << tab[i] << std::endl; } diff --git a/Testing/Code/Learning/otbConfusionMatrixCalculatorTest.cxx b/Testing/Code/Learning/otbConfusionMatrixCalculatorTest.cxx index 09b922157e..32426ae678 100644 --- a/Testing/Code/Learning/otbConfusionMatrixCalculatorTest.cxx +++ b/Testing/Code/Learning/otbConfusionMatrixCalculatorTest.cxx @@ -60,7 +60,7 @@ int otbConfusionMatrixCalculatorSetListSamples(int argc, char* argv[]) int nbSamples = atoi(argv[1]); int nbClasses = atoi(argv[2]); - for (int i = 0; i < nbSamples; i++) + for (int i = 0; i < nbSamples; ++i) { int label = (i % nbClasses) + 1; PLabelType plab; @@ -100,7 +100,7 @@ int otbConfusionMatrixCalculatorWrongSize(int argc, char* argv[]) int nbSamples = atoi(argv[1]); int nbClasses = atoi(argv[2]); - for (int i = 0; i < nbSamples; i++) + for (int i = 0; i < nbSamples; ++i) { int label = (i % nbClasses) + 1; PLabelType plab; @@ -154,7 +154,7 @@ int otbConfusionMatrixCalculatorUpdate(int argc, char* argv[]) int nbSamples = atoi(argv[1]); int nbClasses = atoi(argv[2]); - for (int i = 0; i < nbSamples; i++) + for (int i = 0; i < nbSamples; ++i) { int label = (i % nbClasses) + 1; PLabelType plab; @@ -184,8 +184,8 @@ int otbConfusionMatrixCalculatorUpdate(int argc, char* argv[]) double totalError = 0.0; - for (int i = 0; i < nbClasses; i++) - for (int j = 0; j < nbClasses; j++) + for (int i = 0; i < nbClasses; ++i) + for (int j = 0; j < nbClasses; ++j) { double goodValue = 0.0; if (i == j) goodValue = nbSamples / nbClasses; diff --git a/Testing/Code/Learning/otbListSampleGeneratorTest.cxx b/Testing/Code/Learning/otbListSampleGeneratorTest.cxx index 8f181b83d4..75ea81b8f1 100644 --- a/Testing/Code/Learning/otbListSampleGeneratorTest.cxx +++ b/Testing/Code/Learning/otbListSampleGeneratorTest.cxx @@ -105,7 +105,7 @@ int otbListSampleGenerator(int argc, char* argv[]) while (sampleIt != samples->End()) { trainingFile << labelIt.GetMeasurementVector()[0]; - for (unsigned int i = 0; i < sampleIt.GetMeasurementVector().Size(); i++) + for (unsigned int i = 0; i < sampleIt.GetMeasurementVector().Size(); ++i) { // Careful, the numbering is 1..N in libsvm trainingFile << " " << i + 1 << ":" << sampleIt.GetMeasurementVector()[i]; @@ -134,7 +134,7 @@ int otbListSampleGenerator(int argc, char* argv[]) while (sampleIt != samples->End()) { validationFile << labelIt.GetMeasurementVector()[0]; - for (unsigned int i = 0; i < sampleIt.GetMeasurementVector().Size(); i++) + for (unsigned int i = 0; i < sampleIt.GetMeasurementVector().Size(); ++i) { // Careful, the numbering is 1..N in libsvm validationFile << " " << i + 1 << ":" << sampleIt.GetMeasurementVector()[i]; diff --git a/Testing/Code/Learning/otbSVMImageModelEstimatorModelAccessor.cxx b/Testing/Code/Learning/otbSVMImageModelEstimatorModelAccessor.cxx index 5737b352a7..ad40d09441 100644 --- a/Testing/Code/Learning/otbSVMImageModelEstimatorModelAccessor.cxx +++ b/Testing/Code/Learning/otbSVMImageModelEstimatorModelAccessor.cxx @@ -87,13 +87,13 @@ int otbSVMImageModelEstimatorModelAccessor(int argc, char* argv[]) { itkGenericExceptionMacro(<< "SVs NULL"); } - for (unsigned int i = 0; i < nbSupportVector; i++) + for (unsigned int i = 0; i < nbSupportVector; ++i) { if (SVs[i] == NULL) itkGenericExceptionMacro(<< "SVs " << i << " NULL"); f << std::endl; f << " SV[" << i << "]:"; const svm_node *p = SVs[i]; - /* for(unsigned int j=0; j<nbSupportVector; j++) + /* for(unsigned int j=0; j<nbSupportVector; ++j) { f << " SV["<<i<<"]["<<j<<"]:"; */ if (svmEstimator->GetKernelType() == PRECOMPUTED) @@ -121,7 +121,7 @@ int otbSVMImageModelEstimatorModelAccessor(int argc, char* argv[]) itkGenericExceptionMacro(<< "rhos NULL"); } f << std::setprecision(10) << " "; - for (unsigned int i = 0; i < taille; i++) + for (unsigned int i = 0; i < taille; ++i) { f << " " << rhos[i]; } @@ -133,11 +133,11 @@ int otbSVMImageModelEstimatorModelAccessor(int argc, char* argv[]) { itkGenericExceptionMacro(<< "alphas NULL"); } - for (unsigned int i = 0; i < nbClass - 1; i++) + for (unsigned int i = 0; i < nbClass - 1; ++i) { if (alphas[i] == NULL) itkGenericExceptionMacro(<< "alphas " << i << " NULL"); f << " "; - for (unsigned int j = 0; j < nbSupportVector; j++) + for (unsigned int j = 0; j < nbSupportVector; ++j) { f << " " << alphas[i][j]; } @@ -150,7 +150,7 @@ int otbSVMImageModelEstimatorModelAccessor(int argc, char* argv[]) // _evaluateHyperplaneDistance = ptrModel->EvaluateHyperplaneDistance(); // f << " - EvaluateHyperplaneDistance() VariableLengthVector() nb value(s): "<<_evaluateHyperplaneDistance.Size()<<std::endl; -// for (unsigned int i=0; i<_evaluateHyperplaneDistance.Size(); i++) +// for (unsigned int i=0; i<_evaluateHyperplaneDistance.Size(); ++i) // { // f << " "<<_evaluateHyperplaneDistance[i]<<std::endl; // } diff --git a/Testing/Code/Learning/otbSVMModelAccessor.cxx b/Testing/Code/Learning/otbSVMModelAccessor.cxx index 978829248a..85953bbfc0 100644 --- a/Testing/Code/Learning/otbSVMModelAccessor.cxx +++ b/Testing/Code/Learning/otbSVMModelAccessor.cxx @@ -55,7 +55,7 @@ int otbSVMModelAccessor(int argc, char* argv[]) { itkGenericExceptionMacro(<< "SVs NULL"); } - for (unsigned int i = 0; i < nbSupportVector; i++) + for (unsigned int i = 0; i < nbSupportVector; ++i) { if (SVs[i] == NULL) itkGenericExceptionMacro(<< "SVs " << i << " NULL"); f << std::endl; @@ -77,7 +77,7 @@ int otbSVMModelAccessor(int argc, char* argv[]) itkGenericExceptionMacro(<< "rhos NULL"); } f << " "; - for (unsigned int i = 0; i < taille; i++) + for (unsigned int i = 0; i < taille; ++i) { f << " " << rhos[i]; } @@ -89,11 +89,11 @@ int otbSVMModelAccessor(int argc, char* argv[]) { itkGenericExceptionMacro(<< "alphas NULL"); } - for (unsigned int i = 0; i < nbClass - 1; i++) + for (unsigned int i = 0; i < nbClass - 1; ++i) { if (alphas[i] == NULL) itkGenericExceptionMacro(<< "alphas " << i << " NULL"); f << " "; - for (unsigned int j = 0; j < nbSupportVector; j++) + for (unsigned int j = 0; j < nbSupportVector; ++j) { f << " " << alphas[i][j]; } @@ -106,7 +106,7 @@ int otbSVMModelAccessor(int argc, char* argv[]) // _evaluateHyperplaneDistance = ptrModel->EvaluateHyperplaneDistance(); // f << " - EvaluateHyperplaneDistance() VariableLengthVector() nb value(s): "<<_evaluateHyperplaneDistance.Size()<<std::endl; -// for (unsigned int i=0; i<_evaluateHyperplaneDistance.Size(); i++) +// for (unsigned int i=0; i<_evaluateHyperplaneDistance.Size(); ++i) // { // f << " "<<_evaluateHyperplaneDistance[i]<<std::endl; // } diff --git a/Testing/Code/Learning/otbSVMModelGenericKernelsTest.cxx b/Testing/Code/Learning/otbSVMModelGenericKernelsTest.cxx index 968cc102bf..cad93a012c 100644 --- a/Testing/Code/Learning/otbSVMModelGenericKernelsTest.cxx +++ b/Testing/Code/Learning/otbSVMModelGenericKernelsTest.cxx @@ -97,7 +97,7 @@ int otbSVMModelGenericKernelsTest(int argc, char* argv[]) model->l = 5; model->sv_coef = new double*[model->nr_class - 1]; - for (int i = 0; i < model->nr_class - 1; i++) + for (int i = 0; i < model->nr_class - 1; ++i) model->sv_coef[i] = new double[model->l]; model->SV = new svm_node *[model->l]; for (int n = 0; n < model->l; ++n) diff --git a/Testing/Code/MultiScale/otbWaveletFilterBank.cxx b/Testing/Code/MultiScale/otbWaveletFilterBank.cxx index 1942d7d30a..dcdcbb17c8 100644 --- a/Testing/Code/MultiScale/otbWaveletFilterBank.cxx +++ b/Testing/Code/MultiScale/otbWaveletFilterBank.cxx @@ -58,7 +58,7 @@ int otbWaveletFilterBank(int argc, char * argv[]) typedef otb::WaveletFilterBank<ImageType, ImageType, InvWaveletOperator, otb::Wavelet::INVERSE> InvFilterType; InvFilterType::Pointer invFilter = InvFilterType::New(); - for (unsigned int i = 0; i < filter->GetNumberOfOutputs(); i++) + for (unsigned int i = 0; i < filter->GetNumberOfOutputs(); ++i) invFilter->SetInput(i, filter->GetOutput(i)); invFilter->SetSubsampleImageFactor(filter->GetSubsampleImageFactor()); diff --git a/Testing/Code/MultiTemporal/otbTimeSeriesLeastSquareFittingFunctorTest.cxx b/Testing/Code/MultiTemporal/otbTimeSeriesLeastSquareFittingFunctorTest.cxx index 1143e434db..51ec506de9 100644 --- a/Testing/Code/MultiTemporal/otbTimeSeriesLeastSquareFittingFunctorTest.cxx +++ b/Testing/Code/MultiTemporal/otbTimeSeriesLeastSquareFittingFunctorTest.cxx @@ -37,7 +37,7 @@ int otbTimeSeriesLeastSquareFittingFunctorTest(int argc, char* argv[]) DatesType doySeries; // one acquisition every 2 days - for(unsigned int i = 0; i<nbDates; i++) + for(unsigned int i = 0; i<nbDates; ++i) doySeries[i] = 2*i; @@ -48,7 +48,7 @@ int otbTimeSeriesLeastSquareFittingFunctorTest(int argc, char* argv[]) inCoefs[2] = ::atof(argv[3]); // x = a + b * t + c * t^2 - for(unsigned int i = 0; i<nbDates; i++) + for(unsigned int i = 0; i<nbDates; ++i) inSeries[i] = inCoefs[0]+inCoefs[1]*doySeries[i]+inCoefs[2]*vcl_pow(doySeries[i], 2.0); @@ -57,7 +57,7 @@ int otbTimeSeriesLeastSquareFittingFunctorTest(int argc, char* argv[]) FunctorType::CoefficientsType outCoefs = f.GetCoefficients(inSeries); - for(unsigned int i=0; i<= Degree; i++) + for(unsigned int i=0; i<= Degree; ++i) if(fabs((outCoefs[i]-inCoefs[i])/inCoefs[i])>0.01) { std::cout << outCoefs[i] << " != " << inCoefs[i] << std::endl; diff --git a/Testing/Code/MultiTemporal/otbTimeSeriesLeastSquareFittingFunctorWeightsTest.cxx b/Testing/Code/MultiTemporal/otbTimeSeriesLeastSquareFittingFunctorWeightsTest.cxx index c7b17a2377..f68a291e60 100644 --- a/Testing/Code/MultiTemporal/otbTimeSeriesLeastSquareFittingFunctorWeightsTest.cxx +++ b/Testing/Code/MultiTemporal/otbTimeSeriesLeastSquareFittingFunctorWeightsTest.cxx @@ -37,7 +37,7 @@ int otbTimeSeriesLeastSquareFittingFunctorWeightsTest(int argc, char* argv[]) DatesType doySeries; // one acquisition every 2 days - for(unsigned int i = 0; i<nbDates; i++) + for(unsigned int i = 0; i<nbDates; ++i) doySeries[i] = 2*i; @@ -49,7 +49,7 @@ int otbTimeSeriesLeastSquareFittingFunctorWeightsTest(int argc, char* argv[]) inCoefs[2] = ::atof(argv[3]); // x = a + b * t + c * t^2 - for(unsigned int i = 0; i<nbDates; i++) + for(unsigned int i = 0; i<nbDates; ++i) { inSeries[i] = inCoefs[0]+inCoefs[1]*doySeries[i]+inCoefs[2]*vcl_pow(doySeries[i], 2.0); weightSeries[i] = 1; @@ -70,7 +70,7 @@ int otbTimeSeriesLeastSquareFittingFunctorWeightsTest(int argc, char* argv[]) FunctorType::CoefficientsType outCoefs = f.GetCoefficients(inSeries); - for(unsigned int i=0; i<= Degree; i++) + for(unsigned int i=0; i<= Degree; ++i) if(fabs((outCoefs[i]-inCoefs[i])/inCoefs[i])>0.01) { std::cout << outCoefs[i] << " != " << inCoefs[i] << std::endl; diff --git a/Testing/Code/Projections/otbOssimElevManagerTest2.cxx b/Testing/Code/Projections/otbOssimElevManagerTest2.cxx index cfa16b6068..f8ef7236a3 100644 --- a/Testing/Code/Projections/otbOssimElevManagerTest2.cxx +++ b/Testing/Code/Projections/otbOssimElevManagerTest2.cxx @@ -55,7 +55,7 @@ int otbOssimElevManagerTest2(int argc, char* argv[]) std::ofstream file; file.open(outfname); - for (int i = 0; i < size; i++) + for (int i = 0; i < size; ++i) { PointType point; point[0] = origin[0] + i * spacing; diff --git a/Testing/Code/Radiometry/otbAtmosphericCorrectionParametersTo6SAtmosphericRadiativeTerms.cxx b/Testing/Code/Radiometry/otbAtmosphericCorrectionParametersTo6SAtmosphericRadiativeTerms.cxx index 8e099bb43b..c8d12a6d54 100644 --- a/Testing/Code/Radiometry/otbAtmosphericCorrectionParametersTo6SAtmosphericRadiativeTerms.cxx +++ b/Testing/Code/Radiometry/otbAtmosphericCorrectionParametersTo6SAtmosphericRadiativeTerms.cxx @@ -48,7 +48,7 @@ int otbAtmosphericCorrectionParametersTo6SAtmosphericRadiativeTerms(int argc, ch ValueType val = 0.0025; - //for(unsigned int i=0; i<wavelenghFiles.size(); i++) + //for(unsigned int i=0; i<wavelenghFiles.size(); ++i) //{ //functionValues = FilterFunctionValuesType::New(); vect.clear(); @@ -167,14 +167,14 @@ int otbAtmosphericCorrectionParametersTo6SAtmosphericRadiativeTerms(int argc, ch std::endl; fout << " ---------------------------------------------------------" << std::endl; fout << "Input wavelength band values [" << functionValues->GetFilterFunctionValues().size() << "]:" << std::endl; - for (unsigned int i = 0; i < functionValues->GetFilterFunctionValues().size(); i++) + for (unsigned int i = 0; i < functionValues->GetFilterFunctionValues().size(); ++i) { fout << " " << functionValues->GetFilterFunctionValues()[i] << std::endl; } fout << " ---------------------------------------------------------" << std::endl; fout << "Output wavelength band values 6S [" << functionValues->GetFilterFunctionValues6S().size() << "]:" << std::endl; - for (unsigned int i = 0; i < functionValues->GetFilterFunctionValues6S().size(); i++) + for (unsigned int i = 0; i < functionValues->GetFilterFunctionValues6S().size(); ++i) { fout << " " << functionValues->GetFilterFunctionValues6S()[i] << std::endl; } diff --git a/Testing/Code/Radiometry/otbAtmosphericCorrectionSequencement.cxx b/Testing/Code/Radiometry/otbAtmosphericCorrectionSequencement.cxx index f925ecceff..fafc60fba5 100644 --- a/Testing/Code/Radiometry/otbAtmosphericCorrectionSequencement.cxx +++ b/Testing/Code/Radiometry/otbAtmosphericCorrectionSequencement.cxx @@ -76,7 +76,7 @@ int otbAtmosphericCorrectionSequencementTest(int argc, char *argv[]) std::ifstream fin; fin.open(argv[3]); double dalpha(0.), dbeta(0.); - for (unsigned int i = 0; i < nbOfComponent; i++) + for (unsigned int i = 0; i < nbOfComponent; ++i) { fin >> dalpha; fin >> dbeta; @@ -101,7 +101,7 @@ int otbAtmosphericCorrectionSequencementTest(int argc, char *argv[]) fin.open(argv[7]); double dsolarIllumination(0.); - for (unsigned int i = 0; i < nbOfComponent; i++) + for (unsigned int i = 0; i < nbOfComponent; ++i) { fin >> dsolarIllumination; solarIllumination[i] = dsolarIllumination; @@ -150,7 +150,7 @@ int otbAtmosphericCorrectionSequencementTest(int argc, char *argv[]) fin.open(argv[16]); fin >> nbBands; - for (unsigned int i = 0; i < nbBands; i++) + for (unsigned int i = 0; i < nbBands; ++i) { valuesVector.clear(); fin >> sString; @@ -158,7 +158,7 @@ int otbAtmosphericCorrectionSequencementTest(int argc, char *argv[]) fin >> maxSpectralValue; fin >> userStep; fin >> nbValuesPerBand; - for (unsigned int j = 0; j < nbValuesPerBand; j++) + for (unsigned int j = 0; j < nbValuesPerBand; ++j) { fin >> value; valuesVector.push_back(value); diff --git a/Testing/Code/Radiometry/otbFilterFunctionValues.cxx b/Testing/Code/Radiometry/otbFilterFunctionValues.cxx index d69865b502..3fc9f13769 100644 --- a/Testing/Code/Radiometry/otbFilterFunctionValues.cxx +++ b/Testing/Code/Radiometry/otbFilterFunctionValues.cxx @@ -37,7 +37,7 @@ int otbFilterFunctionValuesTest(int argc, char * argv[]) FilterFunctionValuesType::Pointer object = FilterFunctionValuesType::New(); FilterFunctionValuesType::ValuesVectorType vect; - for (int i = 5; i < argc; i++) + for (int i = 5; i < argc; ++i) { vect.push_back(atof(argv[i])); } @@ -57,13 +57,13 @@ int otbFilterFunctionValuesTest(int argc, char * argv[]) file.open(outname); file << "Input Vector :" << std::endl; - for (unsigned int i = 0; i < vect.size(); i++) + for (unsigned int i = 0; i < vect.size(); ++i) { file << vect[i] << std::endl; } file << std::endl; file << "Output vector :" << std::endl; - for (unsigned int i = 0; i < object->GetFilterFunctionValues6S().size(); i++) + for (unsigned int i = 0; i < object->GetFilterFunctionValues6S().size(); ++i) { file << object->GetFilterFunctionValues6S()[i] << std::endl; } @@ -111,7 +111,7 @@ int otbFilterFunctionValuesDigitalGlobeTest(int argc, char * argv[]) itksys::String itksLine(line); // Suppress multiple spaces - for (unsigned int i = 0; i < itksLine.size() - 1; i++) + for (unsigned int i = 0; i < itksLine.size() - 1; ++i) { if (itksLine.compare(i, 1, " ") == 0 && itksLine.compare(i + 1, 1, " ") == 0) { @@ -134,7 +134,7 @@ int otbFilterFunctionValuesDigitalGlobeTest(int argc, char * argv[]) nbBands = keywordStrings.size() - 1; std::cout << "firstline " << " mini " << mini << " nbBands "<< nbBands << std::endl; std::cout << "keywordStrings[nbBands] " << keywordStrings[nbBands] << std::endl; - for (unsigned int j = 0; j < nbBands; j++) + for (unsigned int j = 0; j < nbBands; ++j) { wavelengthSpectralBand->PushBack(FilterFunctionValuesType::New()); ValuesVectorType temp; @@ -171,7 +171,7 @@ int otbFilterFunctionValuesDigitalGlobeTest(int argc, char * argv[]) //outputFile << std::endl; //outputFile << "Output vector :" << std::endl; - for (unsigned int j = 0; j < nbBands; j++) + for (unsigned int j = 0; j < nbBands; ++j) { wavelengthSpectralBand->GetNthElement(j)->SetFilterFunctionValues(valuesVector[j]); wavelengthSpectralBand->GetNthElement(j)->SetMinSpectralValue(mini); @@ -187,7 +187,7 @@ int otbFilterFunctionValuesDigitalGlobeTest(int argc, char * argv[]) outputFile << std::endl; - for (unsigned int i = 0; i < wavelengthSpectralBand->GetNthElement(j)->GetFilterFunctionValues6S().size(); i++) + for (unsigned int i = 0; i < wavelengthSpectralBand->GetNthElement(j)->GetFilterFunctionValues6S().size(); ++i) { outputFile << wavelengthSpectralBand->GetNthElement(j)->GetFilterFunctionValues6S()[i] << std::endl; } diff --git a/Testing/Code/Radiometry/otbImageToLuminanceImageFilter.cxx b/Testing/Code/Radiometry/otbImageToLuminanceImageFilter.cxx index 5f3153225a..0263b8bc6c 100644 --- a/Testing/Code/Radiometry/otbImageToLuminanceImageFilter.cxx +++ b/Testing/Code/Radiometry/otbImageToLuminanceImageFilter.cxx @@ -50,7 +50,7 @@ int otbImageToLuminanceImageFilter(int argc, char * argv[]) alpha.Fill(0); beta.Fill(0); - for (unsigned int i = 0; i < nbOfComponent; i++) + for (unsigned int i = 0; i < nbOfComponent; ++i) { alpha[i] = static_cast<double>(atof(argv[i + 3])); beta[i] = static_cast<double>(atof(argv[i + 7])); diff --git a/Testing/Code/Radiometry/otbImageToReflectanceImageFilter.cxx b/Testing/Code/Radiometry/otbImageToReflectanceImageFilter.cxx index dc4f8cd600..12d46697ce 100644 --- a/Testing/Code/Radiometry/otbImageToReflectanceImageFilter.cxx +++ b/Testing/Code/Radiometry/otbImageToReflectanceImageFilter.cxx @@ -66,7 +66,7 @@ int otbImageToReflectanceImageFilter(int argc, char * argv[]) beta.Fill(0); solarIllumination.Fill(0); - for (unsigned int i = 0; i < nbOfComponent; i++) + for (unsigned int i = 0; i < nbOfComponent; ++i) { alpha[i] = static_cast<double>(atof(argv[i + 4])); beta[i] = static_cast<double>(atof(argv[i + 8])); diff --git a/Testing/Code/Radiometry/otbReflectanceToSurfaceReflectanceImageFilterTest.cxx b/Testing/Code/Radiometry/otbReflectanceToSurfaceReflectanceImageFilterTest.cxx index 7595616c93..46eee240f2 100644 --- a/Testing/Code/Radiometry/otbReflectanceToSurfaceReflectanceImageFilterTest.cxx +++ b/Testing/Code/Radiometry/otbReflectanceToSurfaceReflectanceImageFilterTest.cxx @@ -73,7 +73,7 @@ int otbReflectanceToSurfaceReflectanceImageFilterTest(int argc, char * argv[]) DataVectorType downTrans; DataVectorType upTrans; - for (unsigned int j = 0; j < nbChannel; j++) + for (unsigned int j = 0; j < nbChannel; ++j) { intrinsic.push_back(static_cast<double>(atof(argv[3 + j]))); albedo.push_back(static_cast<double>(atof(argv[3 + j + nbChannel]))); diff --git a/Testing/Code/Radiometry/otbRomaniaReflectanceToRomaniaSurfaceReflectanceImageFilter.cxx b/Testing/Code/Radiometry/otbRomaniaReflectanceToRomaniaSurfaceReflectanceImageFilter.cxx index 6ac4aca74c..7bf1964a2b 100644 --- a/Testing/Code/Radiometry/otbRomaniaReflectanceToRomaniaSurfaceReflectanceImageFilter.cxx +++ b/Testing/Code/Radiometry/otbRomaniaReflectanceToRomaniaSurfaceReflectanceImageFilter.cxx @@ -66,7 +66,7 @@ int otbRomaniaReflectanceToRomaniaSurfaceReflectanceImageFilter(int argc, char * reader->UpdateOutputInformation(); unsigned int nbChannel = reader->GetOutput()->GetNumberOfComponentsPerPixel(); - for (unsigned int i = 0; i < nbChannel; i++) + for (unsigned int i = 0; i < nbChannel; ++i) { wavelenghFiles.push_back(argv[i + 4]); } @@ -116,7 +116,7 @@ int otbRomaniaReflectanceToRomaniaSurfaceReflectanceImageFilter(int argc, char * param->SetAerosolOptical(static_cast<double>(aerosolOptical)); ValuesVectorType vect; - for (unsigned int j = 0; j < nbChannel; j++) + for (unsigned int j = 0; j < nbChannel; ++j) { functionValues = FilterFunctionValuesType::New(); vect.clear(); diff --git a/Testing/Code/Radiometry/otbSIXSTraitsComputeAtmosphericParameters.cxx b/Testing/Code/Radiometry/otbSIXSTraitsComputeAtmosphericParameters.cxx index db5151dd65..e5e0ce767f 100644 --- a/Testing/Code/Radiometry/otbSIXSTraitsComputeAtmosphericParameters.cxx +++ b/Testing/Code/Radiometry/otbSIXSTraitsComputeAtmosphericParameters.cxx @@ -159,14 +159,14 @@ int otbSIXSTraitsComputeAtmosphericParametersTest(int argc, char * argv[]) std::endl; fout << " ---------------------------------------------------------" << std::endl; fout << "Input wavelength band values [" << functionValues->GetFilterFunctionValues().size() << "]:" << std::endl; - for (unsigned int i = 0; i < functionValues->GetFilterFunctionValues().size(); i++) + for (unsigned int i = 0; i < functionValues->GetFilterFunctionValues().size(); ++i) { fout << " " << functionValues->GetFilterFunctionValues()[i] << std::endl; } fout << " ---------------------------------------------------------" << std::endl; fout << "Output wavelength band values 6S [" << functionValues->GetFilterFunctionValues6S().size() << "]:" << std::endl; - for (unsigned int i = 0; i < functionValues->GetFilterFunctionValues6S().size(); i++) + for (unsigned int i = 0; i < functionValues->GetFilterFunctionValues6S().size(); ++i) { fout << " " << functionValues->GetFilterFunctionValues6S()[i] << std::endl; } diff --git a/Testing/Code/Radiometry/otbSurfaceAdjacencyEffect6SCorrectionSchemeFilter.cxx b/Testing/Code/Radiometry/otbSurfaceAdjacencyEffect6SCorrectionSchemeFilter.cxx index cb13ff0016..a65d8b39ad 100644 --- a/Testing/Code/Radiometry/otbSurfaceAdjacencyEffect6SCorrectionSchemeFilter.cxx +++ b/Testing/Code/Radiometry/otbSurfaceAdjacencyEffect6SCorrectionSchemeFilter.cxx @@ -72,7 +72,7 @@ int otbSurfaceAdjacencyEffect6SCorrectionSchemeFilter(int argc, char * argv[]) reader->UpdateOutputInformation(); std::vector<const char *> wavelenghFiles; unsigned int nbChannel = reader->GetOutput()->GetNumberOfComponentsPerPixel(); - for (unsigned int i = 0; i < nbChannel; i++) + for (unsigned int i = 0; i < nbChannel; ++i) { wavelenghFiles.push_back(argv[i + 6]); } @@ -122,7 +122,7 @@ int otbSurfaceAdjacencyEffect6SCorrectionSchemeFilter(int argc, char * argv[]) param->SetAerosolOptical(static_cast<double>(aerosolOptical)); ValuesVectorType vect; - for (unsigned int j = 0; j < nbChannel; j++) + for (unsigned int j = 0; j < nbChannel; ++j) { functionValues = FilterFunctionValuesType::New(); vect.clear(); diff --git a/Testing/Code/SARPolarimetry/otbHermitianEigenAnalysisTest.cxx b/Testing/Code/SARPolarimetry/otbHermitianEigenAnalysisTest.cxx index 8e205c8275..798acee253 100644 --- a/Testing/Code/SARPolarimetry/otbHermitianEigenAnalysisTest.cxx +++ b/Testing/Code/SARPolarimetry/otbHermitianEigenAnalysisTest.cxx @@ -72,7 +72,7 @@ int otbHermitianEigenAnalysisTest(int argc, char * argv[]) mat.Fill(0.); float val = 0; - for(unsigned int i=0; i<mat.Size(); i++) + for(unsigned int i=0; i<mat.Size(); ++i) { mat[i] = val; val += 0.5; @@ -96,9 +96,9 @@ int otbHermitianEigenAnalysisTest(int argc, char * argv[]) } bool isOK = true; - for(unsigned int i=0; i<6; i++) + for(unsigned int i=0; i<6; ++i) { - for(unsigned int j=0; j<3; j++) + for(unsigned int j=0; j<3; ++j) { if(vcl_abs(eigVal[j][i] - resEigVal[j][i]) > 1e-5) { @@ -148,7 +148,7 @@ int otbHermitianEigenAnalysisTest(int argc, char * argv[]) std::cout<<"W:: "<<std::endl; vnl_vector< ComplexType > lol = syst.W; - for(unsigned i=0; i<lol.size(); i++) + for(unsigned i=0; i<lol.size(); ++i) { std::cout<<" "<<lol[i]; } diff --git a/Testing/Code/SARPolarimetry/otbMuellerToReciprocalCovarianceFunctor.cxx b/Testing/Code/SARPolarimetry/otbMuellerToReciprocalCovarianceFunctor.cxx index fa63173b6c..1fc4a8e1ed 100644 --- a/Testing/Code/SARPolarimetry/otbMuellerToReciprocalCovarianceFunctor.cxx +++ b/Testing/Code/SARPolarimetry/otbMuellerToReciprocalCovarianceFunctor.cxx @@ -37,7 +37,7 @@ int otbMuellerToReciprocalCovarianceFunctor(int argc, char * argv[]) result.SetSize(6); double val = 0; - for(unsigned int i=0; i<input.Size(); i++) + for(unsigned int i=0; i<input.Size(); ++i) { input[i] = val; val += 0.5; diff --git a/Testing/Code/Simulation/otbAtmosphericCorrectionsRSRSVMClassifier.cxx b/Testing/Code/Simulation/otbAtmosphericCorrectionsRSRSVMClassifier.cxx index 81c04ca738..ad34b51309 100644 --- a/Testing/Code/Simulation/otbAtmosphericCorrectionsRSRSVMClassifier.cxx +++ b/Testing/Code/Simulation/otbAtmosphericCorrectionsRSRSVMClassifier.cxx @@ -141,7 +141,7 @@ int otbAtmosphericCorrectionsRSRSVMClassifier(int argc, char * argv[]) const ossimString regularExpressionPattern = ".*\\.txt$"; int flags = ossimDirectory::OSSIM_DIR_DEFAULT; - for (unsigned int i = 0; i < dirSR.size(); i++) //for each class (directory) + for (unsigned int i = 0; i < dirSR.size(); ++i) //for each class (directory) { std::vector<ossimFilename> result; ossimDirectory * directory = new ossimDirectory(); @@ -161,7 +161,7 @@ int otbAtmosphericCorrectionsRSRSVMClassifier(int argc, char * argv[]) randomGen = itk::Statistics::MersenneTwisterRandomVariateGenerator::New(); //randomGen->Initialize(); - for (unsigned int j = 0; j < static_cast<unsigned int> (percentage * result.size()); j++) + for (unsigned int j = 0; j < static_cast<unsigned int> (percentage * result.size()); ++j) { ind = randomGen->GetIntegerVariate() % (result.size()); testing.push_back(result[ind]); @@ -169,14 +169,14 @@ int otbAtmosphericCorrectionsRSRSVMClassifier(int argc, char * argv[]) } //add to global training files and testing files - for (unsigned int k = 0; k < testing.size(); k++) + for (unsigned int k = 0; k < testing.size(); ++k) { std::cout << "testing[" << k << "] : " << testing[k] << std::endl; testingFiles.push_back(testing[k]); testingGTClasses.push_back(i); } - for (unsigned int l = 0; l < training.size(); l++) + for (unsigned int l = 0; l < training.size(); ++l) { std::cout << "training[" << l << "] : " << training[l] << std::endl; trainingFiles.push_back(training[l]); @@ -188,7 +188,7 @@ int otbAtmosphericCorrectionsRSRSVMClassifier(int argc, char * argv[]) SampleListType::Pointer sampleList = SampleListType::New(); TrainingSampleListType::Pointer trainingList = TrainingSampleListType::New(); - for (unsigned int i = 0; i < trainingFiles.size(); i++) + for (unsigned int i = 0; i < trainingFiles.size(); ++i) { SpectralResponsePointerType spectralResponse = SpectralResponseType::New(); ReduceSpectralResponseType::Pointer reduceSpectralResponse = ReduceSpectralResponseType::New(); @@ -212,7 +212,7 @@ int otbAtmosphericCorrectionsRSRSVMClassifier(int argc, char * argv[]) TrainingSampleType trainingSample; sample.SetSize(atmosphericEffectsFilter->GetCorrectedSpectralResponse()->Size()); std::cout << "corrected response : ["; - for (unsigned int j = 0; j < atmosphericEffectsFilter->GetCorrectedSpectralResponse()->Size(); j++) + for (unsigned int j = 0; j < atmosphericEffectsFilter->GetCorrectedSpectralResponse()->Size(); ++j) { sample[j] = atmosphericEffectsFilter->GetCorrectedSpectralResponse()->GetResponse()[j].second; std::cout << atmosphericEffectsFilter->GetCorrectedSpectralResponse()->GetResponse()[j].second << " "; @@ -235,7 +235,7 @@ int otbAtmosphericCorrectionsRSRSVMClassifier(int argc, char * argv[]) //compute spectral response for testing files sampleList->Clear(); //clear the sample list to re use it for testing samples TrainingSampleListType::Pointer groundTruthClassList = TrainingSampleListType::New(); - for (unsigned int i = 0; i < testingFiles.size(); i++) + for (unsigned int i = 0; i < testingFiles.size(); ++i) { SpectralResponsePointerType spectralResponse = SpectralResponseType::New(); ReduceSpectralResponseType::Pointer reduceSpectralResponse = ReduceSpectralResponseType::New(); @@ -258,7 +258,7 @@ int otbAtmosphericCorrectionsRSRSVMClassifier(int argc, char * argv[]) SampleType sample; TrainingSampleType gtClass; sample.SetSize(atmosphericEffectsFilter->GetCorrectedSpectralResponse()->Size()); - for (unsigned int j = 0; j < atmosphericEffectsFilter->GetCorrectedSpectralResponse()->Size(); j++) + for (unsigned int j = 0; j < atmosphericEffectsFilter->GetCorrectedSpectralResponse()->Size(); ++j) { sample[j] = atmosphericEffectsFilter->GetCorrectedSpectralResponse()->GetResponse()[j].second; } @@ -283,7 +283,7 @@ int otbAtmosphericCorrectionsRSRSVMClassifier(int argc, char * argv[]) classifierListLabel->PushBack(it.GetClassLabel()); ++it; } - for (unsigned int i = 0; i < testingFiles.size(); i++) + for (unsigned int i = 0; i < testingFiles.size(); ++i) { std::cout << "ground truth class : " << testingGTClasses[i] << std::endl; } diff --git a/Testing/Code/Simulation/otbImageSimulationMethodKMeansClassif.cxx b/Testing/Code/Simulation/otbImageSimulationMethodKMeansClassif.cxx index 249b2c16cf..e13afed9e9 100644 --- a/Testing/Code/Simulation/otbImageSimulationMethodKMeansClassif.cxx +++ b/Testing/Code/Simulation/otbImageSimulationMethodKMeansClassif.cxx @@ -146,7 +146,7 @@ int otbImageSimulationMethodKMeansClassif(int argc, char * argv[]) { if(it.GetIndex()==centroidIndex) { - for(unsigned int j=0; j<nbBands; j++) + for(unsigned int j=0; j<nbBands; ++j) { initialCentroids[j+classIndex*nbBands]=it.Get()[j]; } diff --git a/Testing/Code/Simulation/otbProspectReflTest.cxx b/Testing/Code/Simulation/otbProspectReflTest.cxx index 585a4a61ed..7dd385d91b 100644 --- a/Testing/Code/Simulation/otbProspectReflTest.cxx +++ b/Testing/Code/Simulation/otbProspectReflTest.cxx @@ -60,7 +60,7 @@ int otbProspectReflTest(int argc, char * argv[]) prospect->Update(); std::ofstream outputFile(OutputName, std::ios::out); - for(unsigned int i=0; i<prospect->GetReflectance()->Size(); i++) + for(unsigned int i=0; i<prospect->GetReflectance()->Size(); ++i) { outputFile<<prospect->GetReflectance()->GetResponse()[i].second<<std::endl; } diff --git a/Testing/Code/Simulation/otbProspectTransTest.cxx b/Testing/Code/Simulation/otbProspectTransTest.cxx index ece4cdc7b2..d691ab8006 100644 --- a/Testing/Code/Simulation/otbProspectTransTest.cxx +++ b/Testing/Code/Simulation/otbProspectTransTest.cxx @@ -58,7 +58,7 @@ int otbProspectTransTest(int argc, char * argv[]) prospect->Update(); std::ofstream outputFile(OutputName, std::ios::out); - for(unsigned int i=0; i<prospect->GetTransmittance()->Size(); i++) + for(unsigned int i=0; i<prospect->GetTransmittance()->Size(); ++i) { outputFile<<prospect->GetTransmittance()->GetResponse()[i].second<<std::endl; } diff --git a/Testing/Code/Simulation/otbReduceSpectralResponseSVMClassifier.cxx b/Testing/Code/Simulation/otbReduceSpectralResponseSVMClassifier.cxx index 22dcc02afa..8ada44e364 100644 --- a/Testing/Code/Simulation/otbReduceSpectralResponseSVMClassifier.cxx +++ b/Testing/Code/Simulation/otbReduceSpectralResponseSVMClassifier.cxx @@ -92,7 +92,7 @@ int otbReduceSpectralResponseSVMClassifier(int argc, char * argv[]) const ossimString regularExpressionPattern = ".*\\.txt$"; int flags = ossimDirectory::OSSIM_DIR_DEFAULT; - for (unsigned int i = 0; i < dirSR.size(); i++) //for each class (directory) + for (unsigned int i = 0; i < dirSR.size(); ++i) //for each class (directory) { std::vector<ossimFilename> result; ossimDirectory * directory = new ossimDirectory(); @@ -112,7 +112,7 @@ int otbReduceSpectralResponseSVMClassifier(int argc, char * argv[]) randomGen = itk::Statistics::MersenneTwisterRandomVariateGenerator::New(); //randomGen->Initialize(); - for (unsigned int j = 0; j < static_cast<unsigned int> (percentage * result.size()); j++) + for (unsigned int j = 0; j < static_cast<unsigned int> (percentage * result.size()); ++j) { ind = randomGen->GetIntegerVariate() % (result.size()); testing.push_back(result[ind]); @@ -120,14 +120,14 @@ int otbReduceSpectralResponseSVMClassifier(int argc, char * argv[]) } //add to global training files and testing files - for (unsigned int k = 0; k < testing.size(); k++) + for (unsigned int k = 0; k < testing.size(); ++k) { std::cout << "testing[" << k << "] : " << testing[k] << std::endl; testingFiles.push_back(testing[k]); testingGTClasses.push_back(i); } - for (unsigned int l = 0; l < training.size(); l++) + for (unsigned int l = 0; l < training.size(); ++l) { std::cout << "training[" << l << "] : " << training[l] << std::endl; trainingFiles.push_back(training[l]); @@ -138,7 +138,7 @@ int otbReduceSpectralResponseSVMClassifier(int argc, char * argv[]) //compute spectral response for all training files SampleListType::Pointer sampleList = SampleListType::New(); TrainingSampleListType::Pointer trainingList = TrainingSampleListType::New(); - for (unsigned int i = 0; i < trainingFiles.size(); i++) + for (unsigned int i = 0; i < trainingFiles.size(); ++i) { ResponsePointerType spectralResponse = ResponseType::New(); std::cout << "training file : " << trainingFiles[i] << std::endl; @@ -157,7 +157,7 @@ int otbReduceSpectralResponseSVMClassifier(int argc, char * argv[]) TrainingSampleType trainingSample; sample.SetSize(reduceResponse->GetReduceResponse()->Size()); std::cout << "reduce response : ["; - for (unsigned int j = 0; j < reduceResponse->GetReduceResponse()->Size(); j++) + for (unsigned int j = 0; j < reduceResponse->GetReduceResponse()->Size(); ++j) { sample[j] = reduceResponse->GetReduceResponse()->GetResponse()[j].second; std::cout << reduceResponse->GetReduceResponse()->GetResponse()[j].second << " "; @@ -187,7 +187,7 @@ int otbReduceSpectralResponseSVMClassifier(int argc, char * argv[]) //compute spectral response for testing files sampleList->Clear(); //clear the sample list to re use it for testing samples TrainingSampleListType::Pointer groundTruthClassList = TrainingSampleListType::New(); - for (unsigned int i = 0; i < testingFiles.size(); i++) + for (unsigned int i = 0; i < testingFiles.size(); ++i) { ResponsePointerType spectralResponse = ResponseType::New(); std::cout << "testing file : " << testingFiles[i] << std::endl; @@ -205,7 +205,7 @@ int otbReduceSpectralResponseSVMClassifier(int argc, char * argv[]) SampleType sample; TrainingSampleType gtClass; sample.SetSize(reduceResponse->GetReduceResponse()->Size()); - for (unsigned int j = 0; j < reduceResponse->GetReduceResponse()->Size(); j++) + for (unsigned int j = 0; j < reduceResponse->GetReduceResponse()->Size(); ++j) { sample[j] = reduceResponse->GetReduceResponse()->GetResponse()[j].second; } @@ -230,7 +230,7 @@ int otbReduceSpectralResponseSVMClassifier(int argc, char * argv[]) classifierListLabel->PushBack(it.GetClassLabel()); ++it; } - for (unsigned int i = 0; i < testingFiles.size(); i++) + for (unsigned int i = 0; i < testingFiles.size(); ++i) { std::cout << "ground truth class : " << testingGTClasses[i] << std::endl; } diff --git a/Testing/Code/Simulation/otbSailReflHTest.cxx b/Testing/Code/Simulation/otbSailReflHTest.cxx index 983f8c5259..0bf1d1e946 100644 --- a/Testing/Code/Simulation/otbSailReflHTest.cxx +++ b/Testing/Code/Simulation/otbSailReflHTest.cxx @@ -82,7 +82,7 @@ int otbSailReflHTest(int argc, char * argv[]) sail->Update(); std::ofstream outputFile(OutputName, std::ios::out); - for(unsigned int i=0; i<sail->GetHemisphericalReflectance()->Size(); i++) + for(unsigned int i=0; i<sail->GetHemisphericalReflectance()->Size(); ++i) { outputFile<<sail->GetHemisphericalReflectance()->GetResponse()[i].second<<std::endl; } diff --git a/Testing/Code/Simulation/otbSailReflVTest.cxx b/Testing/Code/Simulation/otbSailReflVTest.cxx index 6b405cd27e..49f85bf4fa 100644 --- a/Testing/Code/Simulation/otbSailReflVTest.cxx +++ b/Testing/Code/Simulation/otbSailReflVTest.cxx @@ -83,7 +83,7 @@ int otbSailReflVTest(int argc, char * argv[]) sail->Update(); std::ofstream outputFile(OutputName, std::ios::out); - for(unsigned int i=0; i<sail->GetViewingReflectance()->Size(); i++) + for(unsigned int i=0; i<sail->GetViewingReflectance()->Size(); ++i) { outputFile<<sail->GetViewingReflectance()->GetResponse()[i].second<<std::endl; } diff --git a/Testing/Code/Simulation/otbSatelliteRSR.cxx b/Testing/Code/Simulation/otbSatelliteRSR.cxx index d92e8bab8d..1b6b312129 100644 --- a/Testing/Code/Simulation/otbSatelliteRSR.cxx +++ b/Testing/Code/Simulation/otbSatelliteRSR.cxx @@ -43,7 +43,7 @@ int otbSatelliteRSR(int argc, char * argv[]) std::cout << myResponse <<std::endl; std::cout << "RSR("<<lambda<<","<< NumBand <<")= " << (*myResponse)(lambda, NumBand) << std::endl; -// for(unsigned int i=0; i<myResponse->GetRSR()[NumBand]->GetResponse().size(); i++) +// for(unsigned int i=0; i<myResponse->GetRSR()[NumBand]->GetResponse().size(); ++i) // { // std::cout << "RSR("<<myResponse->GetRSR()[NumBand]->GetResponse()[i]->first<<","<< NumBand <<")= " << myResponse->GetRSR()[NumBand]->GetResponse()[i]->second << std::endl; // } diff --git a/Testing/Code/Simulation/otbSurfaceReflectanceToReflectanceFilterNew.cxx b/Testing/Code/Simulation/otbSurfaceReflectanceToReflectanceFilterNew.cxx index 369aafa4ad..154116dc03 100644 --- a/Testing/Code/Simulation/otbSurfaceReflectanceToReflectanceFilterNew.cxx +++ b/Testing/Code/Simulation/otbSurfaceReflectanceToReflectanceFilterNew.cxx @@ -101,7 +101,7 @@ int otbSurfaceReflectanceToReflectanceFilterTest(int argc, char * argv[]) ImageType::PixelType pixel; pixel.SetSize((myResponse)->Size()); - for ( unsigned int i = 0; i<(myResponse)->Size(); i++ ) + for ( unsigned int i = 0; i<(myResponse)->Size(); ++i ) { pixel[i] = myResponse->GetResponse()[i].second; } diff --git a/Testing/Code/SpatialReasoning/otbImageMultiSegmentationToRCC8GraphFilter.cxx b/Testing/Code/SpatialReasoning/otbImageMultiSegmentationToRCC8GraphFilter.cxx index a0eb750a29..df6cf4cd96 100644 --- a/Testing/Code/SpatialReasoning/otbImageMultiSegmentationToRCC8GraphFilter.cxx +++ b/Testing/Code/SpatialReasoning/otbImageMultiSegmentationToRCC8GraphFilter.cxx @@ -47,7 +47,7 @@ int otbImageMultiSegmentationToRCC8GraphFilter(int argc, char* argv[]) ImageListType::Pointer inputList = ImageListType::New(); // Reading input images - for (unsigned int i = 0; i < nbImages; i++) + for (unsigned int i = 0; i < nbImages; ++i) { ReaderType::Pointer reader = ReaderType::New(); reader->SetFileName(argv[4 + i]); diff --git a/Testing/Code/SpatialReasoning/otbImageToImageRCC8Calculator.cxx b/Testing/Code/SpatialReasoning/otbImageToImageRCC8Calculator.cxx index c0f8849379..2799803ba4 100644 --- a/Testing/Code/SpatialReasoning/otbImageToImageRCC8Calculator.cxx +++ b/Testing/Code/SpatialReasoning/otbImageToImageRCC8Calculator.cxx @@ -96,10 +96,10 @@ int otbImageToImageRCC8Calculator(int argc, char* argv[]) return EXIT_FAILURE; } } - j++; + ++j; } j = 1; - i++; + ++i; out << std::endl; } out.close(); diff --git a/Testing/Code/SpatialReasoning/otbPolygonToPolygonRCC8Calculator.cxx b/Testing/Code/SpatialReasoning/otbPolygonToPolygonRCC8Calculator.cxx index 13ed3b34ef..a0d37ff18c 100644 --- a/Testing/Code/SpatialReasoning/otbPolygonToPolygonRCC8Calculator.cxx +++ b/Testing/Code/SpatialReasoning/otbPolygonToPolygonRCC8Calculator.cxx @@ -145,10 +145,10 @@ int otbPolygonToPolygonRCC8Calculator(int argc, char* argv[]) return EXIT_FAILURE; } } - j++; + ++j; } j = 1; - i++; + ++i; out << std::endl; } out.close(); diff --git a/Testing/Code/TestSystem/otbCompareAsciiTestsEpsilon3_WhiteSpace.cxx b/Testing/Code/TestSystem/otbCompareAsciiTestsEpsilon3_WhiteSpace.cxx index 87e0935c03..59cf198731 100644 --- a/Testing/Code/TestSystem/otbCompareAsciiTestsEpsilon3_WhiteSpace.cxx +++ b/Testing/Code/TestSystem/otbCompareAsciiTestsEpsilon3_WhiteSpace.cxx @@ -43,7 +43,7 @@ int otbCompareAsciiTestsEpsilon3_WhiteSpace(int argc, char * argv[]) // Write temporary object without modification std::ofstream fileTestOutput; fileTestOutput.open(argv[2]); - for (unsigned int i=0; i < listLineFileTest.size(); i++) + for (unsigned int i=0; i < listLineFileTest.size(); ++i) { fileTestOutput << listLineFileTest[i]; } diff --git a/Testing/Fa/MapActivation.cxx b/Testing/Fa/MapActivation.cxx index 0af7291bfa..480a543d9a 100644 --- a/Testing/Fa/MapActivation.cxx +++ b/Testing/Fa/MapActivation.cxx @@ -79,11 +79,11 @@ int main(int argc, char* argv[]) typedef itk::Statistics::ListSample<MeasurementVectorType> SampleType; SampleType::Pointer liste = SampleType::New(); - for (int j = 0; j < nblines; j++) + for (int j = 0; j < nblines; ++j) { MeasurementVectorType tab; tab.SetSize(nbcolonnes); - for (int i = 0; i < nbcolonnes; i++) + for (int i = 0; i < nbcolonnes; ++i) { tab[i] = vectTab[j][i]; } @@ -156,7 +156,7 @@ int main(int argc, char* argv[]) ClassifierType::OutputType::ConstIterator m_last = membershipSample->End(); /*int count[16]; - for(int i=0; i<16; i++) + for(int i=0; i<16; ++i) { count[i]=0; } @@ -174,7 +174,7 @@ int main(int argc, char* argv[]) ++m_iter; } - /*for(int i=0; i<16; i++) + /*for(int i=0; i<16; ++i) { std::cout<<" classe: "<< i <<" nb elements= "<<count[i]<<std::endl; }*/ @@ -182,7 +182,7 @@ int main(int argc, char* argv[]) int nbclass = membershipSample->GetNumberOfClasses(); std::cout << " nb of classes= " << nbclass << std::endl; - for (int i = 0; i < nbclass; i++) + for (int i = 0; i < nbclass; ++i) { if (membershipSample->GetInternalClassLabel(i) != -1) { diff --git a/Testing/Fa/PolygonsVectorization.cxx b/Testing/Fa/PolygonsVectorization.cxx index 5dd693c6c5..f9241cf82a 100644 --- a/Testing/Fa/PolygonsVectorization.cxx +++ b/Testing/Fa/PolygonsVectorization.cxx @@ -221,7 +221,7 @@ int main(int argc, char * argv[]) if ((OutputPolyList->GetNthElement(i)->GetArea() > surfaceLimit) //delete big polygon || (OutputPolyList->GetNthElement(i)->GetArea() == 0)) //delete invalid polygon OutputPolyList->Erase(i); - else i++; + else ++i; } //Display results after erasure @@ -246,7 +246,7 @@ int main(int argc, char * argv[]) oit.Set(iit.Get()); // erase small polygon - for (unsigned int i = 0; i < OutputPolyList->Size(); i++) + for (unsigned int i = 0; i < OutputPolyList->Size(); ++i) { std::cout << "polygon " << i << std::endl; ImageRegionType polygonRegion = OutputPolyList->GetNthElement(i)->GetBoundingRegion().GetImageRegion(); -- GitLab