diff --git a/AUTHORS b/AUTHORS index 47cdd1cca4..8be2cc6140 100644 --- a/AUTHORS +++ b/AUTHORS @@ -25,3 +25,4 @@ Mohamed Mellouli Jean-David Génevaux Thomas Caissard Boris Mansencal +Raphael Lenain diff --git a/ChangeLog.md b/ChangeLog.md index d8b695c4cb..136542571c 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -42,7 +42,13 @@ - New LpMetric class (model of CMetricSpace) for distance computations in R^n. (David Coeurjolly, [#1388](https://github.com/DGtal-team/DGtal/pull/1388)) +- *Documentation* + - Improving KhalimskySpace related classes documentations by displaying + a short description in the member list. + (Roland Denis, [#1398](https://github.com/DGtal-team/DGtal/pull/1398)) + ## Bug Fixes + - *Configuration/General* - Continuous integration AppVeyor fix [#1326](https://github.com/DGtal-team/DGtal/pull/1326) @@ -50,11 +56,18 @@ (Roland Denis, [#1335](https://github.com/DGtal-team/DGtal/pull/1335)) - Fixing warning of Clang when including GraphicsMagick v1.3.31 (Roland Denis, [#1366](https://github.com/DGtal-team/DGtal/pull/1366)) + - Fix compilation warnings with gcc 8.2.1 + (Boris Mansencal, [#1384](https://github.com/DGtal-team/DGtal/pull/1384)) - Fix compilation with Visual Studio (15.9.5) and some io tests (Boris Mansencal, [#1380](https://github.com/DGtal-team/DGtal/pull/1380)) - Fixing & updating Travis: documentation deployement and DGtalTools job (Roland Denis, [#1383](https://github.com/DGtal-team/DGtal/pull/1383)) - + - Various warnings fixed on Xcode (David Coeurjolly, + [#1389](https://github.com/DGtal-team/DGtal/pull/1389)) + - Fix compilation and adding debug version for the generated file with Visual Studio + (Raphael Lenain, [#1395](https://github.com/DGtal-team/DGtal/pull/1395)) + + - *Base* - Fixing wrong members in PredicateCombiner (David Coeurjolly, [#1321](https://github.com/DGtal-team/DGtal/pull/1321)) @@ -78,12 +91,15 @@ - *IO* - Improve ITKReader, testITKio and testITKReader (Boris Mansencal, [#1379](https://github.com/DGtal-team/DGtal/pull/1379)) + [#1394](https://github.com/DGtal-team/DGtal/pull/1394)) - Fix wrong typedef for double case in ITKReader (Adrien Krähenbühl, [#1259](https://github.com/DGtal-team/DGtal/pull/1322)) - Fix safeguard when using ImageMagick without cmake activation (David Coeurjolly, [#1344](https://github.com/DGtal-team/DGtal/pull/1344)) - Fix Color::Green definition (David Coeurjolly, [#1385](https://github.com/DGtal-team/DGtal/pull/1385)) + - Fix Visual Studio ContourHelper tests. + (Bertrand Kerautret, [#1386](https://github.com/DGtal-team/DGtal/pull/1386)) - *Documentation* - Replacing html internal links by ref command in Digital Topology module @@ -134,6 +150,9 @@ testParDirCollapse. (Jacques-Olivier Lachaud, [#1390](https://github.com/DGtal-team/DGtal/pull/1390)) + - Move operators outside of functions namespace in VoxelComplexFunctions. + (Pablo Hernandez, [#1392](https://github.com/DGtal-team/DGtal/pull/1392)) + - *Miscellaneous* - Fix Small bug in Integral Invariant Volume Estimator in 2D (Thomas Caissard, [#1316](https://github.com/DGtal-team/DGtal/pull/1316)) diff --git a/cmake/Common.cmake b/cmake/Common.cmake index d5392bf1da..bf25e6be4d 100644 --- a/cmake/Common.cmake +++ b/cmake/Common.cmake @@ -28,6 +28,13 @@ foreach(p LIB BIN INCLUDE DATA) endif() endforeach() +# ----------------------------------------------------------------------------- +# Visual Studio : to distinguish between debug and release lib +# ----------------------------------------------------------------------------- +IF (MSVC) + set(CMAKE_DEBUG_POSTFIX "d") +ENDIF (MSVC) + # ----------------------------------------------------------------------------- # Doxygen targets # ----------------------------------------------------------------------------- @@ -52,7 +59,11 @@ ADD_CUSTOM_TARGET(uninstall # ----------------------------------------------------------------------------- # Parsing cmake options # ----------------------------------------------------------------------------- -OPTION(BUILD_SHARED_LIBS "Build shared libraries." ON) +IF (MSVC) + OPTION(BUILD_SHARED_LIBS "Build shared libraries." OFF) +ELSE (MSVC) + OPTION(BUILD_SHARED_LIBS "Build shared libraries." ON) +ENDIF (MSVC) OPTION(BUILD_TESTING "Build testing." OFF) OPTION(DEBUG_VERBOSE "Verbose debug messages." OFF) OPTION(VERBOSE "Verbose messages." OFF) diff --git a/cmake/DGtalConfig.cmake.in b/cmake/DGtalConfig.cmake.in index ee28392980..16dc422e57 100644 --- a/cmake/DGtalConfig.cmake.in +++ b/cmake/DGtalConfig.cmake.in @@ -75,7 +75,7 @@ ENDIF(@COLOR_WITH_ALPHA_ARITH_DGTAL@) # When user or compiler have not set any std flag. try_compile( CPP11_COMPATIBLE_FLAG_SET_BY_USER ${CMAKE_BINARY_DIR}/CMakeTmp - @DGTAL_CMAKE_DIR@/cpp11_check.cpp + "@DGTAL_CMAKE_DIR@/cpp11_check.cpp" CMAKE_FLAGS "-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}" OUTPUT_VARIABLE OUTPUT ) @@ -120,7 +120,7 @@ ENDIF(@HDF5_FOUND_DGTAL@) if (@QGLVIEWER_FOUND_DGTAL@) add_definitions("-DWITH_VISU3D_QGLVIEWER ") set(WITH_VISU3D_QGLVIEWER 1) - set(DGTAL_INCLUDE_DIRS ${DGTAL_INCLUDE_DIRS} @QGLVIEWER_INCLUDE_DIR@) + set(DGTAL_INCLUDE_DIRS ${DGTAL_INCLUDE_DIRS} "@QGLVIEWER_INCLUDE_DIR@") endif (@QGLVIEWER_FOUND_DGTAL@) #-- We force the Qt rediscovering @@ -130,7 +130,7 @@ if (@QT4_FOUND_DGTAL@) add_definitions("-DWITH_QT4") set(WITH_QT4 1) include(${QT_USE_FILE}) - set(DGTAL_INCLUDE_DIRS ${DGTAL_INCLUDE_DIRS} ${QT_INCLUDE_DIR}) + set(DGTAL_INCLUDE_DIRS ${DGTAL_INCLUDE_DIRS} "${QT_INCLUDE_DIR}") endif (@QT4_FOUND_DGTAL@) if (@QT5_FOUND_DGTAL@) @@ -139,9 +139,9 @@ if (@QT5_FOUND_DGTAL@) set(WITH_QT5 1) set(Qt5_DIR @Qt5_DIR@) set(DGTAL_INCLUDE_DIRS ${DGTAL_INCLUDE_DIRS} - ${Qt5Widgets_INCLUDE_DIRS} - ${Qt5OpenGL_INCLUDE_DIRS} - ${Qt5Xml_INCLUDE_DIRS}) + "${Qt5Widgets_INCLUDE_DIRS}" + "${Qt5OpenGL_INCLUDE_DIRS}" + "${Qt5Xml_INCLUDE_DIRS}") endif (@QT5_FOUND_DGTAL@) IF(@OPENMP_FOUND_DGTAL@) @@ -156,7 +156,7 @@ ENDIF(@OPENMP_FOUND_DGTAL@) IF(@EIGEN_FOUND_DGTAL@) ADD_DEFINITIONS("-DWITH_EIGEN ") SET(WITH_EIGEN 1) - SET(DGTAL_INCLUDE_DIRS ${DGTAL_INCLUDE_DIRS} @EIGEN3_INCLUDE_DIR@ ) + SET(DGTAL_INCLUDE_DIRS ${DGTAL_INCLUDE_DIRS} "@EIGEN3_INCLUDE_DIR@" ) ENDIF(@EIGEN_FOUND_DGTAL@) diff --git a/cmake/FindFFTW3.cmake b/cmake/FindFFTW3.cmake index 4177293ea1..4cbb184a4f 100644 --- a/cmake/FindFFTW3.cmake +++ b/cmake/FindFFTW3.cmake @@ -24,7 +24,9 @@ find_library (FFTW3_LONG_THREADS_LIBRARIES NAMES fftw3l_threads ) # Gathering FFTW3 libraries set (FFTW3_LIBRARIES ${FFTW3_FLOAT_LIBRARIES} ${FFTW3_DOUBLE_LIBRARIES} ${FFTW3_LONG_LIBRARIES}) set (FFTW3_THREADS_LIBRARIES ${FFTW3_FLOAT_THREADS_LIBRARIES} ${FFTW3_DOUBLE_THREADS_LIBRARIES} ${FFTW3_LONG_THREADS_LIBRARIES}) -set (FFTW3_DEP_LIBRARIES m) +if (NOT MSVC) + set (FFTW3_DEP_LIBRARIES m) +endif (NOT MSVC) # Telling which FFT precisions are found. include(FindPackageHandleStandardArgs) @@ -36,7 +38,9 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(FFTW3_LONG DEFAULT_MSG FFTW3_INCLUDE_DIR FFT # Adding threaded version of FFTW3 if (FFTW3_THREADS_LIBRARIES) set (FFTW3_LIBRARIES ${FFTW3_LIBRARIES} ${FFTW3_THREADS_LIBRARIES}) - set (FFTW3_DEP_LIBRARIES ${FFTW3_DEP_LIBRARIES} pthread) + if (NOT MSVC) + set (FFTW3_DEP_LIBRARIES ${FFTW3_DEP_LIBRARIES} pthread) + endif (NOT MSVC) endif (FFTW3_THREADS_LIBRARIES) diff --git a/cmake/TargetDoxygenDox.cmake b/cmake/TargetDoxygenDox.cmake index 609c0b0d06..8c85e95eef 100644 --- a/cmake/TargetDoxygenDox.cmake +++ b/cmake/TargetDoxygenDox.cmake @@ -65,8 +65,8 @@ IF (DOXYGEN_FOUND) SET (TMP "${CMAKE_CURRENT_BINARY_DIR}\\Doc\\html\\index.hhp") STRING(REGEX REPLACE "[/]" "\\\\" HHP_FILE ${TMP} ) # MESSAGE(SEND_ERROR "DBG HHP_FILE=${HHP_FILE}") - ADD_CUSTOM_TARGET(winhelp ${HTML_HELP_COMPILER} ${HHP_FILE}) - ADD_DEPENDENCIES (winhelp doc) + ADD_CUSTOM_TARGET(winhelp-dox ${HTML_HELP_COMPILER} ${HHP_FILE}) + ADD_DEPENDENCIES (winhelp-dox dox) IF (NOT TARGET_DOC_SKIP_INSTALL) # install windows help? diff --git a/examples/geometry/curves/estimation/exampleCurvature.cpp b/examples/geometry/curves/estimation/exampleCurvature.cpp index d8c55e53af..02d4877ff5 100644 --- a/examples/geometry/curves/estimation/exampleCurvature.cpp +++ b/examples/geometry/curves/estimation/exampleCurvature.cpp @@ -149,7 +149,7 @@ estimatorOnShapeDigitization( const string& name, std::cout << i << " " << estimations.at(i) << std::endl; } } - catch ( InputException e ) + catch ( InputException& e ) { std::cerr << "[estimatorOnShapeDigitization]" << " error in finding a bel." << std::endl; diff --git a/examples/geometry/tools/determinant/exampleInHalfPlane.cpp b/examples/geometry/tools/determinant/exampleInHalfPlane.cpp index 1fe671804b..6bb21cf5cf 100644 --- a/examples/geometry/tools/determinant/exampleInHalfPlane.cpp +++ b/examples/geometry/tools/determinant/exampleInHalfPlane.cpp @@ -119,6 +119,7 @@ advice() //! [FunctorDefinition30] Functor *a = new Functor(); BOOST_VERIFY(a); + delete a; } { @@ -131,6 +132,7 @@ advice() //! [FunctorDefinition52] Functor *a = new Functor(); BOOST_VERIFY(a); + delete a; //NB. using double as coordinate type is slightly faster than using DGtal::int64_t //typedef PointVector<2, double> Point; } @@ -144,6 +146,7 @@ advice() //! [FunctorDefinition62] Functor *a= new Functor(); BOOST_VERIFY( a); + delete a; } { @@ -157,6 +160,7 @@ advice() Functor *a = new Functor(); BOOST_VERIFY(a == a); //! [FunctorDefinition62bis] + delete a; } #ifdef WITH_BIGINTEGER @@ -169,6 +173,7 @@ advice() Functor *a= new Functor(); BOOST_VERIFY( a); //! [FunctorDefinition62plus] + delete a; } #endif diff --git a/examples/topology/ctopo-2.cpp b/examples/topology/ctopo-2.cpp index 19c28e0bdd..b6c5d9ecf7 100644 --- a/examples/topology/ctopo-2.cpp +++ b/examples/topology/ctopo-2.cpp @@ -103,7 +103,7 @@ int main( int /*argc*/, char** /*argv*/ ) new CustomColors( Color( 255, 255, 0 ), Color( 192, 192, 0 ) )); - GradientColorMap cmap_grad( 0, (const int)vectBdrySCell.size() ); + GradientColorMap cmap_grad( 0, (int)vectBdrySCell.size() ); cmap_grad.addColor( Color( 50, 50, 255 ) ); cmap_grad.addColor( Color( 255, 0, 0 ) ); cmap_grad.addColor( Color( 255, 255, 10 ) ); @@ -138,7 +138,7 @@ int main( int /*argc*/, char** /*argv*/ ) std::vector< std::vector > vectContoursBdrySCell; Surfaces::extractAll2DSCellContours( vectContoursBdrySCell, ks, SAdj, set2d ); - GradientColorMap cmap_grad3( 0, (const int)vectContoursBdrySCell.size() ); + GradientColorMap cmap_grad3( 0, (int)vectContoursBdrySCell.size() ); cmap_grad3.addColor( Color( 50, 50, 255 ) ); cmap_grad3.addColor( Color( 255, 0, 0 ) ); cmap_grad3.addColor( Color( 20, 200, 0 ) ); diff --git a/examples/tutorial-examples/CMakeLists.txt b/examples/tutorial-examples/CMakeLists.txt index 7a8ade9585..7287981295 100644 --- a/examples/tutorial-examples/CMakeLists.txt +++ b/examples/tutorial-examples/CMakeLists.txt @@ -13,6 +13,10 @@ SET(DGTAL_TUTO_EXAMPLES_SRC FOREACH(FILE ${DGTAL_TUTO_EXAMPLES_SRC}) + if(MSVC) + set_source_files_properties( ${FILE} PROPERTIES COMPILE_FLAGS "/bigobj" ) + endif(MSVC) + add_executable(${FILE} ${FILE}) target_link_libraries (${FILE} DGtal ) ENDFOREACH(FILE) diff --git a/examples/tutorial-examples/FMMErosion.cpp b/examples/tutorial-examples/FMMErosion.cpp index 665172d413..afb54fd056 100644 --- a/examples/tutorial-examples/FMMErosion.cpp +++ b/examples/tutorial-examples/FMMErosion.cpp @@ -94,7 +94,7 @@ int main( int argc, char** argv ) bel = Surfaces::findABel( ks, binaryImage, domain.size() ); trace.info() << "starting bel: " << bel << std::endl; - } catch (DGtal::InputException i) { + } catch (DGtal::InputException& i) { trace.emphase() << "starting bel not found" << std::endl; return 0; } diff --git a/examples/tutorial-examples/freemanChainFromImage.cpp b/examples/tutorial-examples/freemanChainFromImage.cpp index 59b414108b..197bc002e9 100644 --- a/examples/tutorial-examples/freemanChainFromImage.cpp +++ b/examples/tutorial-examples/freemanChainFromImage.cpp @@ -97,7 +97,7 @@ int main() //! [freemanChainFromImage-extraction] - GradientColorMap cmap_grad( 0, (const int)vectContoursBdryPointels.size() ); + GradientColorMap cmap_grad( 0, (int)vectContoursBdryPointels.size() ); cmap_grad.addColor( Color( 50, 50, 255 ) ); cmap_grad.addColor( Color( 255, 0, 0 ) ); cmap_grad.addColor( Color( 255, 255, 10 ) ); diff --git a/examples/tutorial-examples/shortcuts-geometry.cpp b/examples/tutorial-examples/shortcuts-geometry.cpp index fa53b6db7f..8b447230ab 100644 --- a/examples/tutorial-examples/shortcuts-geometry.cpp +++ b/examples/tutorial-examples/shortcuts-geometry.cpp @@ -66,7 +66,7 @@ int main( int /* argc */, char** /* argv */ ) bool ok = SH3::saveOBJ( surface, SH3::RealVectors(), colors, "al-H-II.obj" ); //! [dgtal_shortcuts_ssec2_1_6s] - ++nb, nbok += ok ? 1 : 0; + ++nb; nbok += ok ? 1 : 0; } trace.endBlock(); @@ -84,7 +84,7 @@ int main( int /* argc */, char** /* argv */ ) std::transform( curv.cbegin(), curv.cend(), colors.begin(), cmap ); bool ok = SH3::saveOBJ( surface, SH3::RealVectors(), colors, "al-G-II.obj" ); - ++nb, nbok += ok ? 1 : 0; + ++nb; nbok += ok ? 1 : 0; } trace.endBlock(); @@ -112,12 +112,12 @@ int main( int /* argc */, char** /* argv */ ) trace.info() << " min(G)=" << stat_gauss.min() << " avg(G)=" << stat_gauss.mean() << " max(G)=" << stat_gauss.max() << std::endl; - ++nb, nbok += positions.size() == surfels.size() ? 1 : 0; - ++nb, nbok += normals.size() == surfels.size() ? 1 : 0; - ++nb, nbok += mean_curvs.size() == surfels.size() ? 1 : 0; - ++nb, nbok += gauss_curvs.size() == surfels.size() ? 1 : 0; - ++nb, nbok += stat_mean.min() > 0.08 ? 1 : 0; - ++nb, nbok += stat_gauss.min() > 0.0064 ? 1 : 0; + ++nb; nbok += positions.size() == surfels.size() ? 1 : 0; + ++nb; nbok += normals.size() == surfels.size() ? 1 : 0; + ++nb; nbok += mean_curvs.size() == surfels.size() ? 1 : 0; + ++nb; nbok += gauss_curvs.size() == surfels.size() ? 1 : 0; + ++nb; nbok += stat_mean.min() > 0.08 ? 1 : 0; + ++nb; nbok += stat_gauss.min() > 0.0064 ? 1 : 0; } trace.endBlock(); @@ -144,7 +144,7 @@ int main( int /* argc */, char** /* argv */ ) SH3::RealVectors(), SH3::Colors(), "goursat-quad-proj.obj" ); //! [dgtal_shortcuts_ssec2_2_6s] - ++nb, nbok += ok ? 1 : 0; + ++nb; nbok += ok ? 1 : 0; } trace.endBlock(); @@ -166,7 +166,7 @@ int main( int /* argc */, char** /* argv */ ) bool ok = SH3::saveOBJ( surface, SH3::RealVectors(), colors, "goursat-H.obj" ); //! [dgtal_shortcuts_ssec2_2_7s] - ++nb, nbok += ok ? 1 : 0; + ++nb; nbok += ok ? 1 : 0; } trace.endBlock(); @@ -200,7 +200,7 @@ int main( int /* argc */, char** /* argv */ ) << " L2=" << SHG3::getScalarsNormL2 ( t_curv, ii_curv ) << std::endl; //! [dgtal_shortcuts_ssec2_2_8s] - ++nb, nbok += ( ok_t && ok_ii && ok_err ) ? 1 : 0; + ++nb; nbok += ( ok_t && ok_ii && ok_err ) ? 1 : 0; } trace.endBlock(); @@ -220,7 +220,7 @@ int main( int /* argc */, char** /* argv */ ) bool ok = SH3::saveOBJ( surface, vcm_normals, SH3::Colors(), "goursat-primal-vcm.obj" ); //! [dgtal_shortcuts_ssec2_2_9s] - ++nb, nbok += ok ? 1 : 0; + ++nb; nbok += ok ? 1 : 0; } trace.endBlock(); @@ -250,7 +250,7 @@ int main( int /* argc */, char** /* argv */ ) colors[ i ] = cmap( ii_mean_curv[ match[ i ] ] ); bool ok_H = SH3::saveOBJ( surface, SH3::RealVectors(), colors, "goursat-imp-H-ii.obj" ); //! [dgtal_shortcuts_ssec2_2_10s] - ++nb, nbok += ( ok_H && ii_mean_curv.size() == ii_mean_curv2.size() ) ? 1 : 0; + ++nb; nbok += ( ok_H && ii_mean_curv.size() == ii_mean_curv2.size() ) ? 1 : 0; } trace.endBlock(); @@ -282,8 +282,8 @@ int main( int /* argc */, char** /* argv */ ) [&] (const SH3::Cell& c){ return ppos[ c2i[ c ] ];}, SH3::RealVectors(), SH3::Colors(), proj_fname ); - ++nb, nbok += ok ? 1 : 0; - ++nb, nbok += proj_ok ? 1 : 0; + ++nb; nbok += ok ? 1 : 0; + ++nb; nbok += proj_ok ? 1 : 0; } } trace.endBlock(); diff --git a/examples/tutorial-examples/shortcuts.cpp b/examples/tutorial-examples/shortcuts.cpp index 63545e8404..9024614dd6 100644 --- a/examples/tutorial-examples/shortcuts.cpp +++ b/examples/tutorial-examples/shortcuts.cpp @@ -56,7 +56,7 @@ int main( int /* argc */, char** /* argv */ ) params( "noise", 0.3 ) ); auto ok = SH3::saveBinaryImage( al_capone, "noisy-Al.vol" ); //! [dgtal_shortcuts_ssec2_1_1s] - ++nb, nbok += ok ? 1 : 0; + ++nb; nbok += ok ? 1 : 0; } trace.endBlock(); trace.beginBlock ( "Load vol file -> build main connected digital surface." ); @@ -68,7 +68,7 @@ int main( int /* argc */, char** /* argv */ ) auto surface = SH3::makeLightDigitalSurface( al_capone, K, params ); trace.info() << "#surfels=" << surface->size() << std::endl; //! [dgtal_shortcuts_ssec2_1_2s] - ++nb, nbok += surface->size() == 21239 ? 1 : 0; + ++nb; nbok += surface->size() == 21239 ? 1 : 0; } trace.endBlock(); @@ -85,7 +85,7 @@ int main( int /* argc */, char** /* argv */ ) trace.info() << "#mesh150=" << mesh150->nbVertex() << " #mesh40=" << mesh40->nbVertex() << std::endl; //! [dgtal_shortcuts_ssec2_1_3s] - ++nb, nbok += ( mesh150->nbVertex() < mesh40->nbVertex() ) + ++nb; nbok += ( mesh150->nbVertex() < mesh40->nbVertex() ) && ( mesh40->nbVertex() == 273182 ) ? 1 : 0; } trace.endBlock(); @@ -105,8 +105,8 @@ int main( int /* argc */, char** /* argv */ ) "lobster-150.obj", // opaque blue diffuse color SH3::Color( 30,30,30 ), SH3::Color( 0,0,255,255 ) ); //! [dgtal_shortcuts_ssec2_1_4s] - ++nb, nbok += ok40 ? 1 : 0; - ++nb, nbok += ok150 ? 1 : 0; + ++nb; nbok += ok40 ? 1 : 0; + ++nb; nbok += ok150 ? 1 : 0; } trace.endBlock(); @@ -125,7 +125,7 @@ int main( int /* argc */, char** /* argv */ ) for ( unsigned int i = 0; i < surfels.size(); ++i ) colors[ i ] = cmap( i ); bool ok = SH3::saveOBJ( surface, SH3::RealVectors(), colors, "al-primal-bft.obj" ); //! [dgtal_shortcuts_ssec2_1_5s] - ++nb, nbok += ok ? 1 : 0; + ++nb; nbok += ok ? 1 : 0; } trace.endBlock(); @@ -140,7 +140,7 @@ int main( int /* argc */, char** /* argv */ ) auto noisy_shape = SH3::makeBinaryImage ( digitized_shape, params ); auto ok = SH3::saveBinaryImage ( noisy_shape, "noisy-ellipsoid.vol" ); //! [dgtal_shortcuts_ssec2_2_1s] - ++nb, nbok += ok ? 1 : 0; + ++nb; nbok += ok ? 1 : 0; } trace.endBlock(); @@ -156,7 +156,7 @@ int main( int /* argc */, char** /* argv */ ) auto surface = SH3::makeDigitalSurface( binary_image, K, params ); bool ok = SH3::saveOBJ( surface, "goursat-primal.obj" ); //! [dgtal_shortcuts_ssec2_2_2s] - ++nb, nbok += ok ? 1 : 0; + ++nb; nbok += ok ? 1 : 0; } trace.endBlock(); @@ -177,7 +177,7 @@ int main( int /* argc */, char** /* argv */ ) auto surface = SH3::makeIdxDigitalSurface( binary_image, K, params ); trace.info() << "#surfels=" << surface->size() << std::endl; //! [dgtal_shortcuts_ssec2_2_3s] - ++nb, nbok += surface->size() > 1000 ? 1 : 0; + ++nb; nbok += surface->size() > 1000 ? 1 : 0; } trace.endBlock(); @@ -213,7 +213,7 @@ int main( int /* argc */, char** /* argv */ ) colors[ i ] = cmap( label[ all_surfels[ i ] ] ); bool ok = SH3::saveOBJ( surface, SH3::RealVectors(), colors, "leopold-primal-cc.obj" ); //! [dgtal_shortcuts_ssec2_2_4s] - ++nb, nbok += ok ? 1 : 0; + ++nb; nbok += ok ? 1 : 0; } trace.endBlock(); diff --git a/src/Board/Shapes.cpp b/src/Board/Shapes.cpp index 34e74a556f..afda3daa30 100644 --- a/src/Board/Shapes.cpp +++ b/src/Board/Shapes.cpp @@ -2076,8 +2076,7 @@ Rectangle::flushTikZ( std::ostream & stream, stream << "\\path[" << tikzProperties(transform) << "] (" << _path[0].x << ',' << _path[0].y << ')' - << " rectangle (" - << _path[1].x << ',' << _path[3].y << "); "; + << " rectangle (" << _path[1].x << ',' << _path[3].y << "); "; } /* diff --git a/src/DGtal/base/LabelledMap.h b/src/DGtal/base/LabelledMap.h index 940e6ea050..c4b927faa1 100644 --- a/src/DGtal/base/LabelledMap.h +++ b/src/DGtal/base/LabelledMap.h @@ -1151,7 +1151,7 @@ namespace DGtal Removes all the datas stored in the block structure. @param size must be the current size of the block structure. */ - void blockClear( unsigned int size ); + void blockClear( size_t size ); /** Random unprotected read-write access to data at position \a idx @@ -1160,7 +1160,7 @@ namespace DGtal @pre idx < size() NB: O( b ), E = O( 1 + ceil( ( idx - N ) / M ) ) */ - Data & blockAt( unsigned int idx ); + Data & blockAt( size_t idx ); /** Random unprotected read access to data at position \a idx @@ -1169,7 +1169,7 @@ namespace DGtal @pre idx < size() NB: O( b ), E = O( 1 + ceil( ( idx - N ) / M ) ) */ - const Data & blockAt( unsigned int idx ) const; + const Data & blockAt( size_t idx ) const; /** Insertion of a new data at given position. The former data at @@ -1181,7 +1181,7 @@ namespace DGtal @param data the data to insert. NB: O( n ), E = O( n - idx ) */ - Data & blockInsert( unsigned int idx, unsigned int block_size, const Data & data ); + Data & blockInsert( size_t idx, size_t block_size, const Data & data ); /** Removal of a data at a given position. Following datas are shifted. @@ -1190,7 +1190,7 @@ namespace DGtal @pre idx < size() NB: O( n ), E = O( n - idx ) */ - void blockErase( unsigned int idx ); + void blockErase( size_t idx ); /// @return an iterator pointing on the first element in the container. diff --git a/src/DGtal/base/LabelledMap.ih b/src/DGtal/base/LabelledMap.ih index 1b8797ae74..5c6a6d6041 100644 --- a/src/DGtal/base/LabelledMap.ih +++ b/src/DGtal/base/LabelledMap.ih @@ -555,7 +555,7 @@ LabelledMap( const LabelledMap & other ) : myLabels( other.myLabels ), myFirstBlock( other.myFirstBlock ) { - const unsigned int theSize = other.size(); + const auto theSize = other.size(); if ( theSize > N + 1 ) { unsigned int s = N; @@ -596,7 +596,7 @@ operator=( const LabelledMap & other ) myLabels = other.myLabels; myFirstBlock = other.myFirstBlock; - const unsigned int theSize = other.size(); + auto theSize = other.size(); if ( theSize > N + 1 ) { unsigned int s = N; @@ -628,7 +628,7 @@ template :: -blockClear( unsigned int theSize ) +blockClear( size_t theSize ) { if ( theSize != N+1 ) { @@ -731,7 +731,7 @@ template ::Data & DGtal::LabelledMap:: -blockAt( unsigned int idx ) const +blockAt( size_t idx ) const { ASSERT( idx < size() ); if ( idx < N ) @@ -753,7 +753,7 @@ template ::Data & DGtal::LabelledMap:: -blockAt( unsigned int idx ) +blockAt( size_t idx ) { ASSERT( idx < size() ); if ( idx < N ) @@ -801,7 +801,7 @@ operator[]( const Key & key ) bool exists = myLabels.test( key ); if ( ! exists ) { - unsigned int block_size = size(); + auto block_size = size(); myLabels.set( key ); // must be done before so that 'index' works. return blockInsert( myLabels.index( key ), block_size, Data() ); } @@ -929,7 +929,7 @@ insert( InputIterator first, InputIterator last ) Key k = first->first; if ( ! myLabels.test( k ) ) { - unsigned int block_size = size(); + auto block_size = size(); myLabels.set( k ); // must be done before so that 'index' works. blockInsert( myLabels.index( k ), block_size, first->second ); } @@ -1065,7 +1065,7 @@ template ::Data & DGtal::LabelledMap:: -blockInsert( unsigned int idx, unsigned int block_size, const Data & data ) +blockInsert( size_t idx, size_t block_size, const Data & data ) { ASSERT( idx <= block_size ); // end is ok. return myFirstBlock.insert( idx, block_size, data ); @@ -1075,10 +1075,10 @@ template :: -blockErase( unsigned int idx ) +blockErase( size_t idx ) { ASSERT( idx < size() ); // end is not ok. - myFirstBlock.erase( idx, static_cast(size() )); + myFirstBlock.erase( idx, size() ); } //----------------------------------------------------------------------------- template diff --git a/src/DGtal/base/OrderedAlphabet.ih b/src/DGtal/base/OrderedAlphabet.ih index 82fe5199f2..51f10dd93c 100644 --- a/src/DGtal/base/OrderedAlphabet.ih +++ b/src/DGtal/base/OrderedAlphabet.ih @@ -92,7 +92,7 @@ DGtal::OrderedAlphabet::letter( unsigned int i ) const ASSERT( i < myNb ); for ( unsigned int j = 0; j < myNb; ++j ) if ( myOrder[ j ] == i ) - return myFirst + j; + return static_cast(myFirst + j); return myFirst; } @@ -180,7 +180,7 @@ DGtal::OrderedAlphabet::orderedAlphabet() const tbl = (char *)malloc((myNb + 1)*sizeof(char)); for ( unsigned int i = 0; i < myNb; ++i ) { - tbl[ myOrder[ i ] ] = myFirst + i; + tbl[ myOrder[ i ] ] = static_cast(myFirst + i); } tbl[ myNb ] = '\0'; std::string s( tbl ); diff --git a/src/DGtal/geometry/curves/FreemanChain.ih b/src/DGtal/geometry/curves/FreemanChain.ih index 0b9e0936d8..b3e8348027 100644 --- a/src/DGtal/geometry/curves/FreemanChain.ih +++ b/src/DGtal/geometry/curves/FreemanChain.ih @@ -840,7 +840,7 @@ template inline short DGtal::FreemanChain::freemanCode4C(int dx, int dy) { - short number = ( dx != 0 ? (1 - dx) : (2 - dy) ); + short number = static_cast(( dx != 0 ? (1 - dx) : (2 - dy) )); if ( (number < 0) || (number > 3) ) { return 8; diff --git a/src/DGtal/geometry/curves/estimation/LambdaMST2D.ih b/src/DGtal/geometry/curves/estimation/LambdaMST2D.ih index 1270089f1f..42277945d8 100644 --- a/src/DGtal/geometry/curves/estimation/LambdaMST2D.ih +++ b/src/DGtal/geometry/curves/estimation/LambdaMST2D.ih @@ -66,8 +66,8 @@ DGtal::LambdaMST2DEstimator< TSpace, TSegmentation, Functor >::eval( const typen { if ( DSS->isInDSS ( *it ) ) { - unsigned int pos = std::distance ( DSS.begin(), std::find ( DSS.begin(), DSS.end(), *it ) ); - unsigned int dssLen = std::distance ( DSS.begin(), DSS.end() ); + auto pos = std::distance ( DSS.begin(), std::find ( DSS.begin(), DSS.end(), *it ) ); + auto dssLen = std::distance ( DSS.begin(), DSS.end() ); SegmentComputer comp ( *DSS ); partial = myFunctor ( comp, pos, dssLen ); tangent += partial; @@ -94,9 +94,9 @@ DGtal::LambdaMST2DEstimator< TSpace, TSegmentation, Functor >::eval ( const type typename TSegmentation::SegmentComputerIterator lastDSS = dssSegments->end(); for ( ; DSS != lastDSS; ++DSS ) { - unsigned int dssLen = std::distance ( DSS.begin(), DSS.end() ); + auto dssLen = std::distance ( DSS.begin(), DSS.end() ); SegmentComputer comp ( *DSS ); - for ( unsigned int i = 0; i < dssLen; i++ ) + for ( decltype(dssLen) i = 0; i < dssLen; i++ ) outValues[ std::distance ( itb, DSS.begin() ) + i ] += myFunctor ( comp, i, dssLen ); } accumulate ( outValues, result ); diff --git a/src/DGtal/geometry/helpers/ContourHelper.ih b/src/DGtal/geometry/helpers/ContourHelper.ih index f8a871e8f8..68a5a5a2e6 100644 --- a/src/DGtal/geometry/helpers/ContourHelper.ih +++ b/src/DGtal/geometry/helpers/ContourHelper.ih @@ -75,9 +75,9 @@ DGtal::ContourHelper::pixels2pixels8C(const TIterator &itb, const TIterator &ite { TIterator it = itb; *out++ = *it; - unsigned int size = std::distance(itb, ite); - int i=0; - while(i<(int)size-1) + auto size = std::distance(itb, ite); + decltype(size) i = 0; + while(i+2::freemanCode4C((*(it+1))[0]-(*it)[0],(*(it+1))[1]-(*it)[1]); diff --git a/src/DGtal/geometry/surfaces/DigitalSurfaceConvolver.ih b/src/DGtal/geometry/surfaces/DigitalSurfaceConvolver.ih index 6c1e39b78e..76a1809499 100644 --- a/src/DGtal/geometry/surfaces/DigitalSurfaceConvolver.ih +++ b/src/DGtal/geometry/surfaces/DigitalSurfaceConvolver.ih @@ -2064,7 +2064,7 @@ DGtal::DigitalSurfaceConvolver< Functor, KernelFunctor, KSpace, DigitalKernel, 3 #endif typedef typename Functor::Quantity FQuantity; - DGtal::Dimension nbMasks = myMasks->size() - 1; + DGtal::Dimension nbMasks = static_cast(myMasks->size()) - 1; DGtal::Dimension positionOfFullKernel = 13; Quantity m = NumberTraits< Quantity >::ZERO; diff --git a/src/DGtal/geometry/surfaces/estimation/IntegralInvariantCovarianceEstimator.ih b/src/DGtal/geometry/surfaces/estimation/IntegralInvariantCovarianceEstimator.ih index e85176787d..a1110391f4 100644 --- a/src/DGtal/geometry/surfaces/estimation/IntegralInvariantCovarianceEstimator.ih +++ b/src/DGtal/geometry/surfaces/estimation/IntegralInvariantCovarianceEstimator.ih @@ -197,7 +197,7 @@ init ASSERT( ( myConvolver != 0 ) && "[DGtal::IntegralInvariantCovarianceEstimator:init] Shape of interest must have been initialized with a call to 'attach'." ); - typedef typename RealPoint::Component Scalar; + typedef typename RealPoint::Component ScalarC; // Clear stuff for( unsigned int i = 0; i < myKernelsSet.size(); ++i ) if ( myKernelsSet[ i ] != 0 ) delete myKernelsSet[ i ]; @@ -228,8 +228,8 @@ init /// Computation of shifting masks if( offset == middle ) continue; // no shift for ( Dimension k = 0; k < Space::dimension; ++k ) - shiftPoint[ k ] = (Scalar) (*it_neigh)[ k ]; - shiftPoint *= (Scalar) myH; + shiftPoint[ k ] = (ScalarC) (*it_neigh)[ k ]; + shiftPoint *= (ScalarC) myH; KernelSupport* kernelShifted = new KernelSupport( shiftPoint, eRadius ); EuclideanMinus* current = new EuclideanMinus( *myKernel ); current->minus( *kernelShifted ); diff --git a/src/DGtal/geometry/surfaces/estimation/IntegralInvariantVolumeEstimator.ih b/src/DGtal/geometry/surfaces/estimation/IntegralInvariantVolumeEstimator.ih index f7f35377e9..7797e983f2 100644 --- a/src/DGtal/geometry/surfaces/estimation/IntegralInvariantVolumeEstimator.ih +++ b/src/DGtal/geometry/surfaces/estimation/IntegralInvariantVolumeEstimator.ih @@ -197,7 +197,7 @@ init ASSERT( ( myConvolver != 0 ) && "[DGtal::IntegralInvariantVolumeEstimator:init] Shape of interest must have been initialized with a call to 'attach'." ); - typedef typename RealPoint::Component Scalar; + typedef typename RealPoint::Component ScalarC; // Clear stuff for( unsigned int i = 0; i < myKernelsSet.size(); ++i ) if ( myKernelsSet[ i ] != 0 ) delete myKernelsSet[ i ]; @@ -228,8 +228,8 @@ init /// Computation of shifting masks if( offset == middle ) continue; // no shift for ( Dimension k = 0; k < Space::dimension; ++k ) - shiftPoint[ k ] = (Scalar) (*it_neigh)[ k ]; - shiftPoint *= (Scalar) myH; + shiftPoint[ k ] = (ScalarC) (*it_neigh)[ k ]; + shiftPoint *= (ScalarC) myH; KernelSupport* kernelShifted = new KernelSupport( shiftPoint, eRadius ); EuclideanMinus* current = new EuclideanMinus( myKernel ); current->minus( kernelShifted ); diff --git a/src/DGtal/geometry/surfaces/estimation/estimationFunctors/SphericalHoughNormalVectorEstimator.h b/src/DGtal/geometry/surfaces/estimation/estimationFunctors/SphericalHoughNormalVectorEstimator.h index 6fc882b335..f3f306364c 100644 --- a/src/DGtal/geometry/surfaces/estimation/estimationFunctors/SphericalHoughNormalVectorEstimator.h +++ b/src/DGtal/geometry/surfaces/estimation/estimationFunctors/SphericalHoughNormalVectorEstimator.h @@ -152,7 +152,8 @@ namespace DGtal Quantity eval( ) { std::default_random_engine generator; - std::uniform_int_distribution distribution(0, myPoints.size() - 1 ); + std::uniform_int_distribution distribution(0, + static_cast(myPoints.size()) - 1 ); double aspect; for(auto t = 0u; t < myNbTrials ; ++t) diff --git a/src/DGtal/geometry/tools/MelkmanConvexHull.ih b/src/DGtal/geometry/tools/MelkmanConvexHull.ih index c7ea6861d7..0ae7a3f6dc 100644 --- a/src/DGtal/geometry/tools/MelkmanConvexHull.ih +++ b/src/DGtal/geometry/tools/MelkmanConvexHull.ih @@ -180,7 +180,7 @@ unsigned int DGtal::MelkmanConvexHull::size() const { // by definition the first and last points of the deque are the same. - return myContainer.size()-1; + return ( myContainer.size()-1u ); } // ---------------------------------------------------------------------------- diff --git a/src/DGtal/geometry/tools/SphericalAccumulator.h b/src/DGtal/geometry/tools/SphericalAccumulator.h index b1fef37b6a..2312c98856 100644 --- a/src/DGtal/geometry/tools/SphericalAccumulator.h +++ b/src/DGtal/geometry/tools/SphericalAccumulator.h @@ -111,7 +111,7 @@ namespace DGtal typedef DGtal::int32_t Quantity; ///Type to represent bin indexes - typedef DGtal::uint32_t Size; + typedef size_t Size; ///Type to iterate on bin values. typedef std::vector::const_iterator ConstIterator; diff --git a/src/DGtal/geometry/volumes/distance/FMM.ih b/src/DGtal/geometry/volumes/distance/FMM.ih index d1fbd2a7f8..0f0d25456d 100644 --- a/src/DGtal/geometry/volumes/distance/FMM.ih +++ b/src/DGtal/geometry/volumes/distance/FMM.ih @@ -189,7 +189,6 @@ DGtal::FMM /// types typedef typename KSpace::Cell Bel; - typedef typename TImplicitFunction::Value Value; typedef std::pair BelValue; typedef std::map Buffer; diff --git a/src/DGtal/helpers/Shortcuts.h b/src/DGtal/helpers/Shortcuts.h index ae6fe3e0cf..2cf6beb16a 100644 --- a/src/DGtal/helpers/Shortcuts.h +++ b/src/DGtal/helpers/Shortcuts.h @@ -1070,7 +1070,7 @@ namespace DGtal { try { // Search initial bel bel = Surfaces::findABel( K, *bimage, nb_tries_to_find_a_bel ); - } catch (DGtal::InputException e) { + } catch (DGtal::InputException& e) { trace.error() << "[Shortcuts::makeLightDigitalSurface]" << " ERROR Unable to find bel." << std::endl; return ptrSurface; diff --git a/src/DGtal/helpers/ShortcutsGeometry.h b/src/DGtal/helpers/ShortcutsGeometry.h index 75d8b0eadb..70d9667292 100644 --- a/src/DGtal/helpers/ShortcutsGeometry.h +++ b/src/DGtal/helpers/ShortcutsGeometry.h @@ -545,9 +545,9 @@ namespace DGtal typedef functors::HatPointFunction KernelFunction; typedef VoronoiCovarianceMeasureOnDigitalSurface < SurfaceContainer, Metric, KernelFunction > VCMOnSurface; - typedef functors::VCMNormalVectorFunctor NormalFunctor; + typedef functors::VCMNormalVectorFunctor NormalVFunctor; typedef VCMDigitalSurfaceLocalEstimator - < SurfaceContainer, Metric, KernelFunction, NormalFunctor> VCMNormalEstimator; + < SurfaceContainer, Metric, KernelFunction, NormalVFunctor> VCMNormalEstimator; KernelFunction chi_r( 1.0, r ); VCMNormalEstimator estimator; estimator.attach( *surface ); @@ -561,9 +561,9 @@ namespace DGtal typedef functors::BallConstantPointFunction KernelFunction; typedef VoronoiCovarianceMeasureOnDigitalSurface < SurfaceContainer, Metric, KernelFunction > VCMOnSurface; - typedef functors::VCMNormalVectorFunctor NormalFunctor; + typedef functors::VCMNormalVectorFunctor NormalVFunctor; typedef VCMDigitalSurfaceLocalEstimator - < SurfaceContainer, Metric, KernelFunction, NormalFunctor> VCMNormalEstimator; + < SurfaceContainer, Metric, KernelFunction, NormalVFunctor> VCMNormalEstimator; KernelFunction chi_r( 1.0, r ); VCMNormalEstimator estimator; estimator.attach( *surface ); diff --git a/src/DGtal/io/Display2DFactory.ih b/src/DGtal/io/Display2DFactory.ih index e8bcd4e599..c7979dd552 100644 --- a/src/DGtal/io/Display2DFactory.ih +++ b/src/DGtal/io/Display2DFactory.ih @@ -60,9 +60,9 @@ DGtal::Display2DFactory::drawDECSignedKhalimskyCell(DGtal::Board2D& board, const const Embedder embedder( K ); const Embedder::RealPoint coords = embedder( sk ); - const float x = coords[0]; - const float y = coords[1]; - const float retract = 0.1f; + const double x = coords[0]; + const double y = coords[1]; + const double retract = 0.1f; const bool xodd = ( KPS::sKCoord(sk, 0) & 1 ); const bool yodd = ( KPS::sKCoord(sk, 1) & 1 ); board.setLineWidth( .5 ); @@ -568,7 +568,7 @@ void DGtal::Display2DFactory::drawArc(Board2D & aBoard, const DGtal::CircleFrom3 //drawing aBoard.drawArc (cx, cy, radius, alpha1, alpha2, orientation); } - catch ( InfiniteNumberException e ) + catch ( InfiniteNumberException& e ) { aBoard.drawLine( NumberTraits::castToDouble(aPoint1[0]), NumberTraits::castToDouble(aPoint1[1]), @@ -611,7 +611,7 @@ void DGtal::Display2DFactory::drawSector(Board2D & aBoard, const DGtal::CircleFr aBoard.drawLine(lx, ly, cx, cy ); } - catch ( InfiniteNumberException e ) + catch ( InfiniteNumberException& e ) { aBoard.drawLine( NumberTraits::castToDouble(aPoint1[0]), NumberTraits::castToDouble(aPoint1[1]), @@ -661,7 +661,7 @@ void DGtal::Display2DFactory::drawAnnulus(Board2D & aBoard, const DGtal::CircleF double oly = cy + (radius+w)*std::sin(alpha2); aBoard.drawLine(ilx, ily, olx, oly); } - catch ( InfiniteNumberException e ) + catch ( InfiniteNumberException& e ) { aBoard.drawLine( NumberTraits::castToDouble(aPoint1[0]), NumberTraits::castToDouble(aPoint1[1]), @@ -698,7 +698,7 @@ void DGtal::Display2DFactory::draw(Board2D & aBoard, const DGtal::CircleFrom3Poi cf3p.getParameters(cx,cy,radius); aBoard.drawCircle (cx,cy,radius); } - catch ( InfiniteNumberException e ) + catch ( InfiniteNumberException& e ) { aBoard.drawLine( NumberTraits::castToDouble(cf3p.myP[0]), NumberTraits::castToDouble(cf3p.myP[1]), diff --git a/src/DGtal/io/Display3DFactory.ih b/src/DGtal/io/Display3DFactory.ih index 8946dafe1a..ff33226875 100644 --- a/src/DGtal/io/Display3DFactory.ih +++ b/src/DGtal/io/Display3DFactory.ih @@ -51,7 +51,6 @@ DGtal::Display3DFactory::draw(Display3D& display, typedef typename Calculus::ConstIterator ConstIterator; typedef typename Calculus::Cell Cell; typedef typename Calculus::SCell SCell; - typedef typename Calculus::KSpace KSpace; display << DGtal::CustomColors3D(DGtal::Color::Black, DGtal::Color::White); diff --git a/src/DGtal/io/colormaps/HueShadeColorMap.ih b/src/DGtal/io/colormaps/HueShadeColorMap.ih index 6a37b64a56..bf7d3a7004 100644 --- a/src/DGtal/io/colormaps/HueShadeColorMap.ih +++ b/src/DGtal/io/colormaps/HueShadeColorMap.ih @@ -159,9 +159,9 @@ DGtal::HueShadeColorMap::getColor const double hue = 360 * ( scale * cycles - floor(scale * cycles)); double red, green, blue; HueShadeColorMap::HSVtoRGB( red, green, blue, hue, 0.9, 1.0 ); - return Color( static_cast( red * 255), - static_cast( green * 255), - static_cast( blue * 255) ); + return Color( static_cast( red * 255), + static_cast( green * 255), + static_cast( blue * 255) ); } /////////////////////////////////////////////////////////////////////////////// diff --git a/src/DGtal/io/readers/ITKReader.ih b/src/DGtal/io/readers/ITKReader.ih index ce8f7f1928..477ff69c72 100644 --- a/src/DGtal/io/readers/ITKReader.ih +++ b/src/DGtal/io/readers/ITKReader.ih @@ -108,6 +108,7 @@ namespace DGtal { typedef ImageContainerByITKImage DGtalITKImage; return readDGtalImageFromITKtypes( filename, aFunctor ); } +#if (ITK_VERSION_MAJOR > 4) || (ITK_VERSION_MAJOR == 4 && ITK_VERSION_MINOR >= 13) case itk::ImageIOBase::ULONGLONG: { typedef ImageContainerByITKImage DGtalITKImage; @@ -118,6 +119,7 @@ namespace DGtal { typedef ImageContainerByITKImage DGtalITKImage; return readDGtalImageFromITKtypes( filename, aFunctor ); } +#endif case itk::ImageIOBase::FLOAT: { typedef ImageContainerByITKImage DGtalITKImage; diff --git a/src/DGtal/kernel/sets/DigitalSetDomain.ih b/src/DGtal/kernel/sets/DigitalSetDomain.ih index 0ae2e20fa5..df85fd133e 100644 --- a/src/DGtal/kernel/sets/DigitalSetDomain.ih +++ b/src/DGtal/kernel/sets/DigitalSetDomain.ih @@ -116,7 +116,7 @@ typename DGtal::DigitalSetDomain::Size DGtal::DigitalSetDomain ::size() const { - return mySet->size(); + return static_cast(mySet->size()); } //------------------------------------------------------------------------------ template diff --git a/src/DGtal/shapes/Shapes.ih b/src/DGtal/shapes/Shapes.ih index 2c79bbb43d..9e82327633 100644 --- a/src/DGtal/shapes/Shapes.ih +++ b/src/DGtal/shapes/Shapes.ih @@ -255,7 +255,6 @@ DGtal::Shapes::makeSetFromPointPredicate BOOST_STATIC_ASSERT (( concepts::ConceptUtils::SameType< Point, typename PointPredicate::Point >::value )); - typedef typename Domain::ConstIterator ConstIterator; for ( ConstIterator it = aSet.domain().begin(), it_end = aSet.domain().end(); it != it_end; ++it ) if ( aPP( *it ) ) aSet.insert( *it ); diff --git a/src/DGtal/shapes/parametric/StarShaped3D.ih b/src/DGtal/shapes/parametric/StarShaped3D.ih index 396558fd20..23c2cf798b 100644 --- a/src/DGtal/shapes/parametric/StarShaped3D.ih +++ b/src/DGtal/shapes/parametric/StarShaped3D.ih @@ -102,9 +102,6 @@ inline double DGtal::StarShaped3D::meanCurvature( AngularCoordinates t) const { - typedef typename Space::RealPoint RealPoint; - - RealPoint art = rt(t); RealPoint arp = rp(t); RealPoint artt = rtt(t); @@ -143,9 +140,6 @@ inline double DGtal::StarShaped3D::gaussianCurvature( AngularCoordinates t ) const { - - typedef typename Space::RealPoint RealPoint; - RealPoint art = rt(t); RealPoint arp = rp(t); RealPoint artt = rtt(t); diff --git a/src/DGtal/topology/CubicalComplex.ih b/src/DGtal/topology/CubicalComplex.ih index b8659701f9..18c86e22e4 100644 --- a/src/DGtal/topology/CubicalComplex.ih +++ b/src/DGtal/topology/CubicalComplex.ih @@ -244,7 +244,7 @@ typename DGtal::CubicalComplex::Size DGtal::CubicalComplex:: nbCells( Dimension d ) const { - return myCells[ d ].size(); + return static_cast(myCells[ d ].size()); } //----------------------------------------------------------------------------- diff --git a/src/DGtal/topology/DigitalSurface.ih b/src/DGtal/topology/DigitalSurface.ih index a6d33d3b49..cf8ef8ff83 100644 --- a/src/DGtal/topology/DigitalSurface.ih +++ b/src/DGtal/topology/DigitalSurface.ih @@ -278,8 +278,8 @@ facesAroundVertex( const Vertex & v, bool order_ccw_in_3d ) const FaceRange faces; faces.push_back( facesAroundArc( arcs[ 0 ] )[ 0 ] ); faces.push_back( facesAroundArc( arcs[ 2 ] )[ 0 ] ); - faces.push_back( facesAroundArc( arcs[ 1 ] )[ 0 ] ); //< to change order. - faces.push_back( facesAroundArc( arcs[ 3 ] )[ 0 ] ); //< to change order. + faces.push_back( facesAroundArc( arcs[ 1 ] )[ 0 ] ); // < to change order. + faces.push_back( facesAroundArc( arcs[ 3 ] )[ 0 ] ); // < to change order. const KSpace& K = container().space(); auto orth_dir = K.sOrthDir( v ); auto direct = K.sDirect( v, orth_dir ); // true: ccw, false: ! ccw diff --git a/src/DGtal/topology/DigitalSurface2DSlice.ih b/src/DGtal/topology/DigitalSurface2DSlice.ih index f4ff410633..96bcb7b2fb 100644 --- a/src/DGtal/topology/DigitalSurface2DSlice.ih +++ b/src/DGtal/topology/DigitalSurface2DSlice.ih @@ -111,7 +111,7 @@ typename DGtal::DigitalSurface2DSlice::Size DGtal::DigitalSurface2DSlice:: size() const { - return mySurfels.size(); + return static_cast(mySurfels.size()); } //----------------------------------------------------------------------------- template diff --git a/src/DGtal/topology/HalfEdgeDataStructure.h b/src/DGtal/topology/HalfEdgeDataStructure.h index 66c022c4ed..162397d399 100644 --- a/src/DGtal/topology/HalfEdgeDataStructure.h +++ b/src/DGtal/topology/HalfEdgeDataStructure.h @@ -338,7 +338,7 @@ namespace DGtal bool build( const std::vector& triangles ) { std::vector edges; - const int nbVtx = getUnorderedEdgesFromTriangles( triangles, edges ); + const Size nbVtx = getUnorderedEdgesFromTriangles( triangles, edges ); return build( nbVtx, triangles, edges ); } @@ -353,7 +353,7 @@ namespace DGtal bool build( const std::vector& polygonal_faces ) { std::vector edges; - const int nbVtx = getUnorderedEdgesFromPolygonalFaces( polygonal_faces, edges ); + const Size nbVtx = getUnorderedEdgesFromPolygonalFaces( polygonal_faces, edges ); return build( nbVtx, polygonal_faces, edges ); } diff --git a/src/DGtal/topology/KhalimskyCellHashFunctions.h b/src/DGtal/topology/KhalimskyCellHashFunctions.h index 88f5ba109d..0fd1066fb7 100644 --- a/src/DGtal/topology/KhalimskyCellHashFunctions.h +++ b/src/DGtal/topology/KhalimskyCellHashFunctions.h @@ -46,7 +46,7 @@ namespace std { - /** + /** @brief * Extend std namespace to define a std::hash function on * DGtal::KhalimskyCell. * @@ -62,7 +62,7 @@ namespace std { } }; - /** + /** @brief * Extend std namespace to define a std::hash function on * DGtal::SignedKhalimskyCell. * @@ -83,7 +83,7 @@ namespace std { } namespace boost{ - /** + /** @brief * Extend boost namespace to define a boost::hash function on * DGtal::KhalimskyCell. * @@ -99,7 +99,7 @@ namespace boost{ } }; - /** + /** @brief * Extend boost namespace to define a boost::hash function on * DGtal::SignedKhalimskyCell. * diff --git a/src/DGtal/topology/KhalimskyPreSpaceND.h b/src/DGtal/topology/KhalimskyPreSpaceND.h index 5ceda6f1cd..e2081764b5 100644 --- a/src/DGtal/topology/KhalimskyPreSpaceND.h +++ b/src/DGtal/topology/KhalimskyPreSpaceND.h @@ -61,7 +61,7 @@ namespace DGtal class KhalimskyPreSpaceND; ///////////////////////////////////////////////////////////////////////////// - /** Represents an unsigned cell in an unbounded cellular grid space by its + /** @brief Represents an unsigned cell in an unbounded cellular grid space by its * Khalimsky coordinates. * * @tparam dim the dimension of the digital space. @@ -72,7 +72,7 @@ namespace DGtal struct KhalimskyPreCell { - // Integer must be a model of the concept CInteger. + /// Integer must be a model of the concept CInteger. BOOST_CONCEPT_ASSERT(( concepts::CInteger ) ); // Aliases @@ -99,44 +99,44 @@ namespace DGtal explicit KhalimskyPreCell( Integer dummy = 0 ); - /** Implicit constructor from its Khalimsky coordinates. + /** @brief Implicit constructor from its Khalimsky coordinates. * @param aPoint Its Khalimsky coordinates as a point. */ KhalimskyPreCell( Point const& aPoint ); - /** Copy constructor. + /** @brief Copy constructor. * @param aCell any other pre-cell. */ KhalimskyPreCell( KhalimskyPreCell const& aCell ) = default; - /** Copy operator + /** @brief Copy operator * @param aCell any other pre-cell. */ KhalimskyPreCell & operator=( KhalimskyPreCell const& aCell ) = default; - /** Move constructor. + /** @brief Move constructor. * @param aCell any other pre-cell. */ KhalimskyPreCell( KhalimskyPreCell && aCell ) = default; - /** Move operator + /** @brief Move operator * @param aCell any other pre-cell. */ KhalimskyPreCell & operator=( KhalimskyPreCell && aCell ) = default; - /** + /** @brief * Equality operator. * @param other any other pre-cell. */ bool operator==( const KhalimskyPreCell & other ) const; - /** + /** @brief * Difference operator. * @param other any other pre-cell. */ bool operator!=( const KhalimskyPreCell & other ) const; - /** + /** @brief * Inferior operator. (lexicographic order). * @param other any other pre-cell. */ @@ -145,7 +145,8 @@ namespace DGtal // --------------- CDrawableWithBoard2D realization ------------------- public: - /** + /** @brief Return the style name used for drawing this object. + * * @return the style name used for drawing this object. */ std::string className() const; @@ -158,7 +159,7 @@ namespace DGtal operator<<( std::ostream & out, const KhalimskyPreCell< dim, TInteger > & object ); - /** Represents a signed cell in an unbounded cellular grid space by its + /** @brief Represents a signed cell in an unbounded cellular grid space by its * Khalimsky coordinates and a boolean value. * * @tparam dim the dimension of the digital space. @@ -196,46 +197,46 @@ namespace DGtal /// Default constructor. explicit SignedKhalimskyPreCell( Integer dummy = 0 ); - /** Implicit constructor from its Khalimsky coordinates. + /** @brief Implicit constructor from its Khalimsky coordinates. * * @param aPoint Its Khalimsky coordinates as a point. * @param positive if cell has positive sign. */ SignedKhalimskyPreCell( Point const& aPoint, bool positive ); - /** Copy constructor. + /** @brief Copy constructor. * @param aCell any other pre-cell. */ SignedKhalimskyPreCell( SignedKhalimskyPreCell const& aCell ) = default; - /** Copy operator + /** @brief Copy operator * @param aCell any other pre-cell. */ SignedKhalimskyPreCell & operator=( SignedKhalimskyPreCell const& aCell ) = default; - /** Move constructor. + /** @brief Move constructor. * @param aCell any other pre-cell. */ SignedKhalimskyPreCell( SignedKhalimskyPreCell && aCell ) = default; - /** Move operator + /** @brief Move operator * @param aCell any other pre-cell. */ SignedKhalimskyPreCell & operator=( SignedKhalimskyPreCell && aCell ) = default; - /** + /** @brief * Equality operator. * @param other any other pre-cell. */ bool operator==( const SignedKhalimskyPreCell & other ) const; - /** + /** @brief * Difference operator. * @param other any other pre-cell. */ bool operator!=( const SignedKhalimskyPreCell & other ) const; - /** + /** @brief * Inferior operator. (lexicographic order). * @param other any other pre-cell. */ @@ -244,7 +245,8 @@ namespace DGtal // --------------- CDrawableWithBoard2D realization ------------------- public: - /** + /** @brief Return the style name used for drawing this object. + * * @return the style name used for drawing this object. */ std::string className() const; @@ -259,8 +261,11 @@ namespace DGtal /** @brief This class is useful for looping on all "interesting" coordinates of a - pre-cell. For instance, surfels in Z3 have two interesting coordinates (the + pre-cell. + + For instance, surfels in Z3 have two interesting coordinates (the ones spanned by the surfel). + @code KPreSpace::Cell p; KPreSpace::DirIterator q; @@ -282,66 +287,68 @@ namespace DGtal typedef SignedKhalimskyPreCell< dim, Integer > SCell; public: - /** + /** @brief * Constructor from a pre-cell. * @param cell any unsigned pre-cell * @param open 'true' if the cell if open. */ explicit PreCellDirectionIterator( Cell cell, bool open = true ); - /** + /** @brief * Constructor from a signed pre-cell. * @param scell any signed pre-cell * @param open 'true' if the cell if open. */ explicit PreCellDirectionIterator( SCell scell, bool open = true ); - /** + /** @brief Return the current direction. + * * @return the current direction. */ Dimension operator*() const; - /** - * Pre-increment. Go to next direction. - */ + /// Pre-increment. Go to next direction. PreCellDirectionIterator & operator++(); - /** - * Fast comparison with unsigned integer (unused - * parameter). Comparison is 'false' at the end of the iteration. + /** @brief Fast comparison with unsigned integer (unused + * parameter). + * + * Comparison is 'false' at the end of the iteration. * * @return 'true' if the iterator is finished. */ bool operator!=( const Integer ) const; - /** + /** @brief Return 'true' if the iteration is ended. + * * @return 'true' if the iteration is ended. */ bool end() const; - /** + /** @brief * Slow comparison with other iterator. Useful to check for end of loop. * @param other any direction iterator. */ bool operator!=( const PreCellDirectionIterator & other ) const; - /** + /** @brief * Slow comparison with other iterator. * @param other any direction iterator. */ bool operator==( const PreCellDirectionIterator & other ) const; private: - /** the current direction. */ + /// the current direction. Dimension myDir; - /** the cell. */ + /// the cell. Cell myCell; - /** If 'true', returns open coordinates, otherwise returns closed - coordinates. */ + /** @brief If 'true', returns open coordinates, otherwise returns closed + * coordinates. + */ bool myOpen; private: - /** Look for next valid coordinate. */ + /// Look for next valid coordinate. void find(); }; @@ -371,11 +378,11 @@ namespace DGtal > class KhalimskyPreSpaceND { - //Integer must be signed to characterize a ring. + /// Integer must be signed to characterize a ring. BOOST_CONCEPT_ASSERT(( concepts::CInteger ) ); public: - ///Arithmetic ring induced by (+,-,*) and Integer numbers. + /// Arithmetic ring induced by (+,-,*) and Integer numbers. using Integer = TInteger; // Cells @@ -445,7 +452,7 @@ namespace DGtal */ public: - /** From the Khalimsky coordinates of a cell, + /** @brief From the Khalimsky coordinates of a cell, * builds the corresponding unsigned pre-cell. * * @param kp an integer point (Khalimsky coordinates of cell). @@ -453,7 +460,7 @@ namespace DGtal */ static Cell uCell( const Point & kp ); - /** From the digital coordinates of a point in Zn and a cell type, + /** @brief From the digital coordinates of a point in Zn and a cell type, * builds the corresponding unsigned pre-cell. * * @param p an integer point (digital coordinates of cell). @@ -463,7 +470,7 @@ namespace DGtal */ static Cell uCell( Point p, const Cell & c ); - /** From the Khalimsky coordinates of a cell and a sign, + /** @brief From the Khalimsky coordinates of a cell and a sign, * builds the corresponding signed pre-cell. * * @param kp an integer point (Khalimsky coordinates of cell). @@ -472,7 +479,7 @@ namespace DGtal */ static SCell sCell( const Point & kp, Sign sign = POS ); - /** From the digital coordinates of a point in Zn and a signed cell type, + /** @brief From the digital coordinates of a point in Zn and a signed cell type, * builds the corresponding signed pre-cell. * * @param p an integer point (digital coordinates of cell). @@ -482,7 +489,7 @@ namespace DGtal */ static SCell sCell( Point p, const SCell & c ); - /** From the digital coordinates of a point in Zn, + /** @brief From the digital coordinates of a point in Zn, * builds the corresponding pre-spel (pre-cell of maximal dimension). * * @param p an integer point (digital coordinates of cell). @@ -490,7 +497,7 @@ namespace DGtal */ static Cell uSpel( Point p ); - /** From the digital coordinates of a point in Zn, + /** @brief From the digital coordinates of a point in Zn, * builds the corresponding pre-spel (pre-cell of maximal dimension). * * @param p an integer point (digital coordinates of cell). @@ -499,7 +506,7 @@ namespace DGtal */ static SCell sSpel( Point p, Sign sign = POS ); - /** From the digital coordinates of a point in Zn, + /** @brief From the digital coordinates of a point in Zn, * builds the corresponding pre-pointel (pre-cell of dimension 0). * * @param p an integer point (digital coordinates of cell). @@ -507,7 +514,7 @@ namespace DGtal */ static Cell uPointel( Point p ); - /** From the digital coordinates of a point in Zn, + /** @brief From the digital coordinates of a point in Zn, * builds the corresponding pre-pointel (pre-cell of dimension 0). * * @param p an integer point (digital coordinates of cell). @@ -523,59 +530,68 @@ namespace DGtal * @{ */ public: - /** + /** @brief Return its Khalimsky coordinate along [k]. + * @param c any unsigned pre-cell. * @param k any valid dimension. * @return its Khalimsky coordinate along [k]. */ static Integer uKCoord( const Cell & c, Dimension k ); - /** + /** @brief Return its digital coordinate along [k]. + * @param c any unsigned pre-cell. * @param k any valid dimension. * @return its digital coordinate along [k]. */ static Integer uCoord( const Cell & c, Dimension k ); - /** + /** @brief Return its Khalimsky coordinates. + * @param c any unsigned pre-cell. * @return its Khalimsky coordinates. */ static const Point & uKCoords( const Cell & c ); - /** + /** @brief Return its digital coordinates. + * @param c any unsigned pre-cell. * @return its digital coordinates. */ static Point uCoords( const Cell & c ); - /** + /** @brief Return its Khalimsky coordinate along [k]. + * @param c any signed pre-cell. * @param k any valid dimension. * @return its Khalimsky coordinate along [k]. */ static Integer sKCoord( const SCell & c, Dimension k ); - /** + /** @brief Return its digital coordinate along [k]. + * @param c any signed pre-cell. * @param k any valid dimension. * @return its digital coordinate along [k]. */ static Integer sCoord( const SCell & c, Dimension k ); - /** + /** @brief Return its Khalimsky coordinates. + * @param c any signed pre-cell. * @return its Khalimsky coordinates. */ static const Point & sKCoords( const SCell & c ); - /** + /** @brief Return its digital coordinates. + * @param c any signed pre-cell. * @return its digital coordinates. */ static Point sCoords( const SCell & c ); - /** + /** @brief Return its sign. + * @param c any signed pre-cell. * @return its sign. */ @@ -589,59 +605,59 @@ namespace DGtal */ public: - /** Sets the [k]-th Khalimsky coordinate of [c] to [i]. + /** @brief Sets the [k]-th Khalimsky coordinate of [c] to [i]. * @param c any unsigned pre-cell. * @param k any valid dimension. * @param i an integer coordinate. */ static void uSetKCoord( Cell & c, Dimension k, Integer i ); - /** Sets the [k]-th Khalimsky coordinate of [c] to [i]. + /** @brief Sets the [k]-th Khalimsky coordinate of [c] to [i]. * @param c any signed pre-cell. * @param k any valid dimension. * @param i an integer coordinate. */ static void sSetKCoord( SCell & c, Dimension k, Integer i ); - /** Sets the [k]-th digital coordinate of [c] to [i]. + /** @brief Sets the [k]-th digital coordinate of [c] to [i]. * @param c any unsigned pre-cell. * @param k any valid dimension. * @param i an integer coordinate. */ static void uSetCoord( Cell & c, Dimension k, Integer i ); - /** Sets the [k]-th digital coordinate of [c] to [i]. + /** @brief Sets the [k]-th digital coordinate of [c] to [i]. * @param c any signed pre-cell. * @param k any valid dimension. * @param i an integer coordinate. */ static void sSetCoord( SCell & c, Dimension k, Integer i ); - /** Sets the Khalimsky coordinates of [c] to [kp]. + /** @brief Sets the Khalimsky coordinates of [c] to [kp]. * @param c any unsigned pre-cell. * @param kp the new Khalimsky coordinates for [c]. */ static void uSetKCoords( Cell & c, const Point & kp ); - /** Sets the Khalimsky coordinates of [c] to [kp]. + /** @brief Sets the Khalimsky coordinates of [c] to [kp]. * @param c any signed pre-cell. * @param kp the new Khalimsky coordinates for [c]. */ static void sSetKCoords( SCell & c, const Point & kp ); - /** Sets the digital coordinates of [c] to [kp]. + /** @brief Sets the digital coordinates of [c] to [kp]. * @param c any unsigned pre-cell. * @param kp the new Khalimsky coordinates for [c]. */ static void uSetCoords( Cell & c, const Point & kp ); - /** Sets the digital coordinates of [c] to [kp]. + /** @brief Sets the digital coordinates of [c] to [kp]. * @param c any signed pre-cell. * @param kp the new Khalimsky coordinates for [c]. */ static void sSetCoords( SCell & c, const Point & kp ); - /** Sets the sign of the pre-cell. + /** @brief Sets the sign of the pre-cell. * @param c (modified) any signed pre-cell. * @param s any sign. */ @@ -654,21 +670,20 @@ namespace DGtal * @{ */ public: - /** Creates a signed pre-cell from an unsigned one and a given sign. + /** @brief Creates a signed pre-cell from an unsigned one and a given sign. * @param p any unsigned pre-cell. * @param s a sign. * @return the signed version of the pre-cell [p] with sign [s]. */ static SCell signs( const Cell & p, Sign s ); - /** Creates an unsigned pre-cell from a signed one. + /** @brief Creates an unsigned pre-cell from a signed one. * @param p any signed pre-cell. * @return the unsigned version of the pre-cell [p]. */ static Cell unsigns( const SCell & p ); - /** - * Creates the signed pre-cell with the inverse sign of [p]. + /** @brief Creates the signed pre-cell with the inverse sign of [p]. * @param p any signed pre-cell. * @return the pre-cell [p] with opposite sign. */ @@ -681,50 +696,57 @@ namespace DGtal * @{ */ public: - /** + /** @brief Return the topology word of [p]. * @param p any unsigned pre-cell. * @return the topology word of [p]. */ static Integer uTopology( const Cell & p ); - /** + /** @brief Return the topology word of [p]. + * @param p any signed pre-cell. * @return the topology word of [p]. */ static Integer sTopology( const SCell & p ); - /** + /** @brief Return the dimension of the pre-cell [p]. + * @param p any unsigned pre-cell. * @return the dimension of the pre-cell [p]. */ static Dimension uDim( const Cell & p ); - /** + /** @brief Return the dimension of the pre-cell [p]. + * @param p any signed pre-cell. * @return the dimension of the pre-cell [p]. */ static Dimension sDim( const SCell & p ); - /** + /** @brief Return 'true' if [b] is a surfel (spans all but one coordinate). + * @param b any unsigned pre-cell. * @return 'true' if [b] is a surfel (spans all but one coordinate). */ static bool uIsSurfel( const Cell & b ); - /** + /** @brief Return 'true' if [b] is a surfel (spans all but one coordinate). + * @param b any signed pre-cell. * @return 'true' if [b] is a surfel (spans all but one coordinate). */ static bool sIsSurfel( const SCell & b ); - /** + /** @brief Return 'true' if [p] is open along the direction [k]. + * @param p any pre-cell. * @param k any direction. * @return 'true' if [p] is open along the direction [k]. */ static bool uIsOpen( const Cell & p, Dimension k ); - /** + /** @brief Return 'true' if [p] is open along the direction [k]. + * @param p any signed pre-cell. * @param k any direction. * @return 'true' if [p] is open along the direction [k]. @@ -739,9 +761,11 @@ namespace DGtal */ public: - /** Given an unsigned pre-cell [p], returns an iterator to iterate over + /** @brief Given an unsigned pre-cell [p], returns an iterator to iterate over * each coordinate the cell spans. (A spel spans all coordinates; a - * surfel all but one, etc). Example: + * surfel all but one, etc). + * + * Example: * * @code * KPreSpace::Cell p; @@ -759,9 +783,11 @@ namespace DGtal */ static DirIterator uDirs( const Cell & p ); - /** Given a signed pre-cell [p], returns an iterator to iterate over + /** @brief Given a signed pre-cell [p], returns an iterator to iterate over * each coordinate the cell spans. (A spel spans all coordinates; a - * surfel all but one, etc). Example: + * surfel all but one, etc). + * + * Example: * * @code * KPreSpace::SCell p; @@ -779,9 +805,11 @@ namespace DGtal */ static DirIterator sDirs( const SCell & p ); - /** Given an unsigned pre-cell [p], returns an iterator to iterate over each + /** @brief Given an unsigned pre-cell [p], returns an iterator to iterate over each * coordinate the cell does not span. (A spel spans all coordinates; - * a surfel all but one, etc). Example: + * a surfel all but one, etc). + * + * Example: * * @code * KPreSpace::Cell p; @@ -799,9 +827,11 @@ namespace DGtal */ static DirIterator uOrthDirs( const Cell & p ); - /** Given a signed pre-cell [p], returns an iterator to iterate over each + /** @brief Given a signed pre-cell [p], returns an iterator to iterate over each * coordinate the cell does not span. (A spel spans all coordinates; - * a surfel all but one, etc). Example: + * a surfel all but one, etc). + * + * Example: * * @code * KPreSpace::SCell p; @@ -819,7 +849,7 @@ namespace DGtal */ static DirIterator sOrthDirs( const SCell & p ); - /** Given an unsigned pre-surfel [s], returns its orthogonal direction (ie, + /** @brief Given an unsigned pre-surfel [s], returns its orthogonal direction (ie, * the coordinate where the surfel is closed). * * @param s an unsigned pre-surfel @@ -827,7 +857,7 @@ namespace DGtal */ static Dimension uOrthDir( const Cell & s ); - /** Given a signed pre-surfel [s], returns its orthogonal direction (ie, + /** @brief Given a signed pre-surfel [s], returns its orthogonal direction (ie, * the coordinate where the surfel is closed). * * @param s a signed pre-surfel @@ -843,7 +873,9 @@ namespace DGtal */ public: - /** + /** @brief Return the same element as [p] except for the incremented + * coordinate [k]. + * @param p any pre-cell. * @param k the coordinate that is changed. * @return the same element as [p] except for the incremented @@ -851,7 +883,9 @@ namespace DGtal */ static Cell uGetIncr( Cell p, Dimension k ); - /** Useful to check if you are going out of the space. Only for compatibility reasons. + /** @brief Useful to check if you are going out of the space. + * + * Only for compatibility reasons. * * @param p any pre-cell. * @param k the tested coordinate. @@ -860,7 +894,9 @@ namespace DGtal static bool uIsMax( const Cell & p, Dimension k ); - /** Useful to check if you are going out of the space. Only for compatibility reasons. + /** @brief Useful to check if you are going out of the space. + * + * Only for compatibility reasons. * * @param p any pre-cell. * @param k the tested coordinate. @@ -869,14 +905,18 @@ namespace DGtal static bool uIsInside( const Cell & p, Dimension k ); - /** Useful to check if you are going out of the space. Only for compatibility reasons. + /** @brief Useful to check if you are going out of the space. + * + * Only for compatibility reasons. * * @param p any pre-cell. * @return always true. */ static bool uIsInside( const Cell & p ); - /** + /** @brief Return the same element as [p] except for an decremented + * coordinate [k]. + * @param p any pre-cell. * @param k the coordinate that is changed. * @return the same element as [p] except for an decremented @@ -884,14 +924,19 @@ namespace DGtal */ static Cell uGetDecr( Cell p, Dimension k ); - /** Useful to check if you are going out of the space. Only for compatibility reasons. + /** @brief Useful to check if you are going out of the space. + * + * Only for compatibility reasons. + * * @param p any pre-cell. * @param k the tested coordinate. * @return always false. */ static bool uIsMin( const Cell & p, Dimension k ); - /** + /** @brief Return the same element as [p] except for a coordinate [k] + * incremented with x. + * @param p any pre-cell. * @param k the coordinate that is changed. * @param x the increment. @@ -900,7 +945,9 @@ namespace DGtal */ static Cell uGetAdd( Cell p, Dimension k, Integer x ); - /** + /** @brief Return the same element as [p] except for a coordinate [k] + * decremented with x. + * @param p any pre-cell. * @param k the coordinate that is changed. * @param x the decrement. @@ -909,7 +956,7 @@ namespace DGtal */ static Cell uGetSub( Cell p, Dimension k, Integer x ); - /** Add the vector [vec] to [p]. + /** @brief Add the vector [vec] to [p]. * * @param p any pre-cell. * @param vec any pointel. @@ -917,8 +964,10 @@ namespace DGtal */ static Cell uTranslation( Cell p, const Vector & vec ); - /** Return the projection of [p] along the [k]th direction toward - * [bound]. Otherwise said, p[ k ] == bound[ k ] afterwards. + /** @brief Return the projection of [p] along the [k]th direction toward + * [bound]. + * + * Otherwise said, p[ k ] == bound[ k ] afterwards. * * @param p any pre-cell. * @param bound the element acting as bound (same topology as p). @@ -929,8 +978,9 @@ namespace DGtal */ static Cell uProjection( Cell p, const Cell & bound, Dimension k ); - /** Projects [p] along the [k]th direction toward - * [bound]. Otherwise said, p[ k ] == bound[ k ] afterwards + /** @brief Projects [p] along the [k]th direction toward [bound]. + * + * Otherwise said, p[ k ] == bound[ k ] afterwards * * @param [in,out] p any pre-cell. * @param [in] bound the element acting as bound (same topology as p). @@ -939,8 +989,10 @@ namespace DGtal */ static void uProject( Cell & p, const Cell & bound, Dimension k ); - /** Increment the pre-cell [p] to its next position (as classically done in - * a scanning). Example: + /** @brief Increment the pre-cell [p] to its next position (as classically done in + * a scanning). + * + * Example: * * \code * Cell first, last; // lower and upper bounds @@ -968,7 +1020,9 @@ namespace DGtal */ public: - /** + /** @brief Return the same element as [p] except for the incremented + * coordinate [k]. + * @param p any pre-cell. * @param k the coordinate that is changed. * @return the same element as [p] except for the incremented @@ -976,7 +1030,9 @@ namespace DGtal */ static SCell sGetIncr( SCell p, Dimension k ); - /** Useful to check if you are going out of the space. Only for compatibility reasons. + /** @brief Useful to check if you are going out of the space. + * + * Only for compatibility reasons. * * @param p any pre-cell. * @param k the tested coordinate. @@ -985,7 +1041,9 @@ namespace DGtal static bool sIsMax( const SCell & p, Dimension k ); - /** Useful to check if you are going out of the space. Only for compatibility reasons. + /** @brief Useful to check if you are going out of the space. + * + * Only for compatibility reasons. * * @param p any pre-cell. * @param k the tested coordinate. @@ -994,14 +1052,18 @@ namespace DGtal static bool sIsInside( const SCell & p, Dimension k ); - /** Useful to check if you are going out of the space. Only for compatibility reasons. + /** @brief Useful to check if you are going out of the space. + * + * Only for compatibility reasons. * * @param p any pre-cell. * @return always true. */ static bool sIsInside( const SCell & p ); - /** + /** @brief Return the same element as [p] except for an decremented + * coordinate [k]. + * @param p any pre-cell. * @param k the coordinate that is changed. * @return the same element as [p] except for an decremented @@ -1009,14 +1071,19 @@ namespace DGtal */ static SCell sGetDecr( SCell p, Dimension k ); - /** Useful to check if you are going out of the space. Only for compatibility reasons. + /** @brief Useful to check if you are going out of the space. + * + * Only for compatibility reasons. + * * @param p any pre-cell. * @param k the tested coordinate. * @return always false. */ static bool sIsMin( const SCell & p, Dimension k ); - /** + /** @brief Return the same element as [p] except for a coordinate [k] + * incremented with x. + * @param p any pre-cell. * @param k the coordinate that is changed. * @param x the increment. @@ -1025,7 +1092,9 @@ namespace DGtal */ static SCell sGetAdd( SCell p, Dimension k, Integer x ); - /** + /** @brief Return the same element as [p] except for a coordinate [k] + * decremented with x. + * @param p any pre-cell. * @param k the coordinate that is changed. * @param x the decrement. @@ -1034,7 +1103,7 @@ namespace DGtal */ static SCell sGetSub( SCell p, Dimension k, Integer x ); - /** Add the vector [vec] to [p]. + /** @brief Add the vector [vec] to [p]. * * @param p any pre-cell. * @param vec any pointel. @@ -1042,8 +1111,10 @@ namespace DGtal */ static SCell sTranslation( SCell p, const Vector & vec ); - /** Return the projection of [p] along the [k]th direction toward - * [bound]. Otherwise said, p[ k ] == bound[ k ] afterwards. + /** @brief Return the projection of [p] along the [k]th direction toward + * [bound]. + * + * Otherwise said, p[ k ] == bound[ k ] afterwards. * * @param p any pre-cell. * @param bound the element acting as bound (same topology as p). @@ -1054,8 +1125,9 @@ namespace DGtal */ static SCell sProjection( SCell p, const SCell & bound, Dimension k ); - /** Projects [p] along the [k]th direction toward - * [bound]. Otherwise said, p[ k ] == bound[ k ] afterwards. + /** @brief Projects [p] along the [k]th direction toward [bound]. + * + * Otherwise said, p[ k ] == bound[ k ] afterwards. * * @param p any pre-cell. * @param bound the element acting as bound (same topology as p). @@ -1064,9 +1136,11 @@ namespace DGtal */ static void sProject( SCell & p, const SCell & bound, Dimension k ); - /** Increment the pre-cell [p] to its next position (as classically done in - * a scanning). Example: - + /** @brief Increment the pre-cell [p] to its next position (as classically done in + * a scanning). + * + * Example: + * * \code * Cell first, last; // lower and upper bounds * Cell p = first; @@ -1093,43 +1167,51 @@ namespace DGtal */ public: - /** Computes the 1-neighborhood of the pre-cell [c] and returns - * it. It is the set of cells with same topology that are adjacent - * to [c]. + /** @brief Computes the 1-neighborhood of the pre-cell [c] and returns it. + * + * It is the set of cells with same topology that are adjacent + * to [c]. * * @param cell the unsigned pre-cell of interest. * @return the pre-cells of the 1-neighborhood of [cell]. */ static Cells uNeighborhood( const Cell & cell ); - /** Computes the 1-neighborhood of the pre-cell [c] and returns - * it. It is the set of pre-cells with same topology that are adjacent - * to [c]. + /** @brief Computes the 1-neighborhood of the pre-cell [c] and returns it. + * + * It is the set of pre-cells with same topology that are adjacent + * to [c]. * * @param cell the signed pre-cell of interest. * @return the pre-cells of the 1-neighborhood of [cell]. */ static SCells sNeighborhood( const SCell & cell ); - /** Computes the proper 1-neighborhood of the pre-cell [c] and returns - * it. It is the set of pre-cells with same topology that are adjacent - * to [c] and different from [c]. + /** @brief Computes the proper 1-neighborhood of the pre-cell [c] and + * returns it. + * + * It is the set of pre-cells with same topology that are adjacent + * to [c] and different from [c]. * * @param cell the unsigned pre-cell of interest. * @return the pre-cells of the proper 1-neighborhood of [cell]. */ static Cells uProperNeighborhood( const Cell & cell ); - /** Computes the proper 1-neighborhood of the pre-cell [c] and returns - * it. It is the set of pre-cells with same topology that are adjacent - * to [c] and different from [c]. + /** @brief Computes the proper 1-neighborhood of the pre-cell [c] and + * returns it. + * + * It is the set of pre-cells with same topology that are adjacent + * to [c] and different from [c]. * * @param cell the signed pre-cell of interest. * @return the pre-cells of the proper 1-neighborhood of [cell]. */ static SCells sProperNeighborhood( const SCell & cell ); - /** + /** @brief Return the adjacent element to [p] along axis [k] in the given + * direction and orientation. + * * @param p any pre-cell. * @param k the coordinate that is changed. * @param up if 'true' the orientation is forward along axis @@ -1140,7 +1222,9 @@ namespace DGtal */ static Cell uAdjacent( const Cell & p, Dimension k, bool up ); - /** + /** @brief Return the adjacent element to [p] along axis [k] in the given + * direction and orientation. + * * @param p any pre-cell. * @param k the coordinate that is changed. * @param up if 'true' the orientation is forward along axis @@ -1159,7 +1243,8 @@ namespace DGtal */ public: - /** + /** @brief Return the forward or backward unsigned pre-cell incident to [c] + * along axis [k], depending on [up]. * @param c any unsigned pre-cell. * @param k any coordinate. * @param up if 'true' the orientation is forward along axis @@ -1171,7 +1256,9 @@ namespace DGtal */ static Cell uIncident( Cell c, Dimension k, bool up ); - /** + /** @brief Return the forward or backward signed pre-cell incident to [c] + * along axis [k], depending on [up]. + * * @param c any signed pre-cell. * @param k any coordinate. * @param up if 'true' the orientation is forward along axis @@ -1186,46 +1273,54 @@ namespace DGtal */ static SCell sIncident( SCell c, Dimension k, bool up ); - /** + /** @brief Return the pre-cells directly low incident to c. + * * @param c any unsigned pre-cell. * @return the pre-cells directly low incident to c. */ static Cells uLowerIncident( const Cell & c ); - /** + /** @brief Return the pre-cells directly up incident to c. + * * @param c any unsigned pre-cell. * @return the pre-cells directly up incident to c. */ static Cells uUpperIncident( const Cell & c ); - /** + /** @brief Return the signed pre-cells directly low incident to c. + * * @param c any signed pre-cell. * @return the signed pre-cells directly low incident to c. * @note it is the lower boundary of c expressed as a list of signed pre-cells. */ static SCells sLowerIncident( const SCell & c ); - /** + /** @brief Return the signed pre-cells directly up incident to c. + * * @param c any signed pre-cell. * @return the signed pre-cells directly up incident to c. * @note it is the upper boundary of c expressed as a list of signed pre-cells. */ static SCells sUpperIncident( const SCell & c ); - /** + /** @brief Return the proper faces of [c] (chain of lower incidence). + * * @param c any unsigned pre-cell. * @return the proper faces of [c] (chain of lower incidence). */ static Cells uFaces( const Cell & c ); - /** + /** @brief Return the proper cofaces of [c] (chain of upper incidence). + * * @param c any unsigned ipre-cell. * @return the proper cofaces of [c] (chain of upper incidence). */ static Cells uCoFaces( const Cell & c ); - /** Return 'true' if the direct orientation of [p] along [k] is in - * the positive coordinate direction. The direct orientation in a + /** @brief Return 'true' if the direct orientation of [p] along [k] is in + * the positive coordinate direction. + * + * The direct orientation in a * direction allows to go from positive incident pre-cells to positive * incident pre-cells. This means that * @code @@ -1240,7 +1335,9 @@ namespace DGtal */ static bool sDirect( const SCell & p, Dimension k ); - /** + /** @brief Return the direct incident pre-cell of [p] along [k] (the incident + * pre-cell along [k]) + * * @param p any signed pre-cell. * @param k any coordinate. * @return the direct incident pre-cell of [p] along [k] (the incident @@ -1248,7 +1345,9 @@ namespace DGtal */ static SCell sDirectIncident( SCell p, Dimension k ); - /** + /** @brief Return the indirect incident pre-cell of [p] along [k] (the incident + * cell along [k] whose sign is negative). + * * @param p any signed pre-cell. * @param k any coordinate. * @return the indirect incident pre-cell of [p] along [k] (the incident @@ -1264,12 +1363,12 @@ namespace DGtal * @{ */ private: - /** + /** @brief * Used by uFaces for computing incident faces. */ static void uAddFaces( Cells & faces, const Cell & c, Dimension axis ); - /** + /** @brief * Used by uCoFaces for computing incident cofaces. */ static void uAddCoFaces( Cells & cofaces, const Cell & c, Dimension axis ); @@ -1282,14 +1381,14 @@ namespace DGtal */ public: - /** - * Writes/Displays the object on an output stream. + /** @brief Writes/Displays the object on an output stream. + * * @param out the output stream where the object is written. */ static void selfDisplay ( std::ostream & out ); - /** - * Checks the validity/consistency of the object. + /** @brief Checks the validity/consistency of the object. + * * @return 'true' if the object is valid, 'false' otherwise. */ static constexpr bool isValid(); @@ -1298,7 +1397,7 @@ namespace DGtal }; // end of class KhalimskyPreSpaceND - /** + /** @brief * Overloads 'operator<<' for displaying objects of class 'KhalimskyPreSpaceND'. * @param out the output stream where the object is written. * @param object the object of class 'KhalimskyPreSpaceND' to write. diff --git a/src/DGtal/topology/KhalimskySpaceND.h b/src/DGtal/topology/KhalimskySpaceND.h index d21809ed9c..2848ea94f1 100644 --- a/src/DGtal/topology/KhalimskySpaceND.h +++ b/src/DGtal/topology/KhalimskySpaceND.h @@ -64,7 +64,7 @@ namespace DGtal class KhalimskySpaceND; ///////////////////////////////////////////////////////////////////////////// - /** Internal class of KhalimskySpaceND that provides some optimizations + /** @brief Internal class of KhalimskySpaceND that provides some optimizations * depending on the space type. */ template < class TKhalimskySpace > @@ -82,7 +82,7 @@ namespace DGtal struct KhalimskyCell { - //Integer must be a model of the concept CInteger. + /// Integer must be a model of the concept CInteger. BOOST_CONCEPT_ASSERT(( concepts::CInteger ) ); @@ -101,19 +101,19 @@ namespace DGtal friend class KhalimskySpaceNDHelper< CellularGridSpace >; private: - // Underlying pre-cell + /// Underlying pre-cell PreCell myPreCell; private: - /** - * Explicit constructor from its Khalimsky coordinates. + /** @brief Explicit constructor from its Khalimsky coordinates. + * * @param aPoint Its Khalimsky coordinates as a point. */ explicit KhalimskyCell( const Point & aPoint ); - /** - * Explicit constructor from a KhalimskyPreCell. + /** @brief Explicit constructor from a KhalimskyPreCell. + * * @param aCell a pre-cell. */ explicit KhalimskyCell( const PreCell & aCell ); @@ -130,44 +130,44 @@ namespace DGtal explicit operator PreCell & (); public: - /** + /** @brief * Default constructor. */ explicit KhalimskyCell( Integer dummy = 0 ); - /** Copy constructor. + /** @brief Copy constructor. * @param other any other cell. */ KhalimskyCell( const KhalimskyCell & other ) = default; - /** Copy operator. + /** @brief Copy operator. * @param other any other cell. */ KhalimskyCell & operator=( const KhalimskyCell & other ) = default; - /** Move constructor. + /** @brief Move constructor. * @param other any other cell. */ KhalimskyCell( KhalimskyCell && other ) = default; - /** Move operator. + /** @brief Move operator. * @param other any other cell. */ KhalimskyCell & operator=( KhalimskyCell && other ) = default; - /** + /** @brief * Equality operator. * @param other any other cell. */ bool operator==( const KhalimskyCell & other ) const; - /** + /** @brief * Difference operator. * @param other any other cell. */ bool operator!=( const KhalimskyCell & other ) const; - /** + /** @brief * Inferior operator. (lexicographic order). * @param other any other cell. */ @@ -182,7 +182,7 @@ namespace DGtal */ //DrawableWithBoard2D* defaultStyle( std::string mode = "" ) const; - /** + /** @brief Return the style name used for drawing this object. * @return the style name used for drawing this object. */ std::string className() const; @@ -207,7 +207,7 @@ namespace DGtal typename TInteger = DGtal::int32_t > struct SignedKhalimskyCell { - //Integer must be a model of the concept CInteger. + /// Integer must be a model of the concept CInteger. BOOST_CONCEPT_ASSERT(( concepts::CInteger ) ); // Aliases @@ -225,73 +225,73 @@ namespace DGtal friend class KhalimskySpaceNDHelper< CellularGridSpace >; private: - // Underlying signed pre-cell + /// Underlying signed pre-cell SPreCell mySPreCell; private: - /** - * Explicit constructor from its Khalimsky coordinates. + /** @brief Explicit constructor from its Khalimsky coordinates. + * * @param aPoint any point. * @param positive if cell has positive sign. */ explicit SignedKhalimskyCell( const Point & aPoint, bool positive ); - /**² - * Explicit constructor from a SignedKhalimskyPreCell. + /** @brief Explicit constructor from a SignedKhalimskyPreCell. + * * @param aCell a pre-cell. */ explicit SignedKhalimskyCell( const SPreCell & aCell ); public: - /// Constant conversion to KhalimskySignedPreCell. + /// Constant conversion to SignedKhalimskyPreCell. operator SPreCell const& () const; /// Returns the underlying constant signed pre-cell. SPreCell const& preCell() const; private: - /// Mutable conversion to KhalimskySignedPreCell. + /// Mutable conversion to SignedKhalimskyPreCell. explicit operator SPreCell & (); public: - /** + /** @brief * Default constructor. */ explicit SignedKhalimskyCell( Integer dummy = 0 ); - /** Copy constructor. + /** @brief Copy constructor. * @param other any other cell. */ SignedKhalimskyCell( const SignedKhalimskyCell & other ) = default; - /** Copy operator. + /** @brief Copy operator. * @param other any other cell. */ SignedKhalimskyCell & operator=( const SignedKhalimskyCell & other ) = default; - /** Move constructor. + /** @brief Move constructor. * @param other any other cell. */ SignedKhalimskyCell( SignedKhalimskyCell && other ) = default; - /** Move operator. + /** @brief Move operator. * @param other any other cell. */ SignedKhalimskyCell & operator=( SignedKhalimskyCell && other ) = default; - /** + /** @brief * Equality operator. * @param other any other cell. */ bool operator==( const SignedKhalimskyCell & other ) const; - /** + /** @brief * Difference operator. * @param other any other cell. */ bool operator!=( const SignedKhalimskyCell & other ) const; - /** + /** @brief * Inferior operator. (lexicographic order). * @param other any other cell. */ @@ -306,7 +306,8 @@ namespace DGtal */ //DrawableWithBoard2D* defaultStyle( std::string mode = "" ) const; - /** + /** @brief Return the style name used for drawing this object. + * * @return the style name used for drawing this object. */ std::string className() const; @@ -395,14 +396,14 @@ namespace DGtal typedef KhalimskySpaceNDHelper< KhalimskySpaceND< dim, TInteger > > Helper; ///< Features basic operations on coordinates, especially for periodic dimensions. friend class KhalimskySpaceNDHelper< KhalimskySpaceND< dim, TInteger > >; - //Integer must be signed to characterize a ring. + /// Integer must be signed to characterize a ring. BOOST_CONCEPT_ASSERT(( concepts::CInteger ) ); public: - ///Arithmetic ring induced by (+,-,*) and Integer numbers. + /// Arithmetic ring induced by (+,-,*) and Integer numbers. typedef TInteger Integer; - ///Type used to represent sizes in the digital space. + /// Type used to represent sizes in the digital space. typedef typename NumberTraits::UnsignedVersion Size; // Spaces @@ -480,44 +481,39 @@ namespace DGtal */ public: - /** - * Destructor. - */ + /// Destructor. ~KhalimskySpaceND(); - /** - * Default constructor. - */ + /// Default constructor. KhalimskySpaceND(); - /** - * Copy constructor. + /** @brief Copy constructor. + * * @param other the object to clone. */ KhalimskySpaceND ( const KhalimskySpaceND & other ) = default; - /** - * Copy operator. + /** @brief Copy operator. + * * @param other the object to copy. * @return a reference on 'this'. */ KhalimskySpaceND & operator= ( const KhalimskySpaceND & other ) = default; - /** - * Move constructor. + /** @brief Move constructor. + * * @param other the object to clone. */ KhalimskySpaceND ( KhalimskySpaceND && other ) = default; - /** - * Move operator. + /** @brief Move operator. + * * @param other the object to copy. * @return a reference on 'this'. */ KhalimskySpaceND & operator= ( KhalimskySpaceND && other ) = default; - /** - * Specifies the upper and lower bounds for the maximal cells in + /** @brief Specifies the upper and lower bounds for the maximal cells in * this space. * * @param lower the lowest point in this space (digital coords) @@ -531,8 +527,7 @@ namespace DGtal const Point & upper, bool isClosed ); - /** - * Specifies the upper and lower bounds for the maximal cells in + /** @brief Specifies the upper and lower bounds for the maximal cells in * this space. * * @param lower the lowest point in this space (digital coords) @@ -547,8 +542,7 @@ namespace DGtal const Point & upper, Closure closure ); - /** - * Specifies the upper and lower bounds for the maximal cells in + /** @brief Specifies the upper and lower bounds for the maximal cells in * this space. * * @param lower the lowest point in this space (digital coords) @@ -571,52 +565,61 @@ namespace DGtal */ public: - /** + /** @brief Return the width of the space in the \a k-dimension. + * * @param k a dimension. * @return the width of the space in the \a k-dimension. * @note For periodic dimension, it returns the number of unique coordinates along that dimension. */ Size size( Dimension k ) const; - /** + /** @brief Return the minimal digital coordinate in the \a k-dimension. + * * @param k a dimension. * @return the minimal digital coordinate in the \a k-dimension. * @note For periodic dimension, it returns the minimal unique digital coordinate along that dimension. */ Integer min( Dimension k ) const; - /** + /** @brief Return the maximal digital coordinate in the \a k-dimension. + * * @param k a coordinate. * @return the maximal digital coordinate in the \a k-dimension. * @note For periodic dimension, it returns the maximal unique digital coordinate along that dimension. */ Integer max( Dimension k ) const; - /** + /** @brief Return the lower bound for digital points in this space. + * * @return the lower bound for digital points in this space. * @note For periodic dimension, it returns the lower digital point with unique coordinates. See also the \ref KhalimskySpaceNDBounds "class documentation". */ const Point & lowerBound() const; - /** + /** @brief Return the upper bound for digital points in this space. + * * @return the upper bound for digital points in this space. * @note For periodic dimension, it returns the upper digital point with unique coordinates. See also the \ref KhalimskySpaceNDBounds "class documentation". */ const Point & upperBound() const; - /** + /** @brief Return the lower bound for cells in this space. + * * @return the lower bound for cells in this space. * @note For periodic dimension, it returns the upper cell with unique coordinates. See also the \ref KhalimskySpaceNDBounds "class documentation". */ const Cell & lowerCell() const; - /** + /** @brief Return the upper bound for cells in this space. + * * @return the upper bound for cells in this space. * @note For periodic dimension, it returns the upper cell with unique coordinates. See also the \ref KhalimskySpaceNDBounds "class documentation". */ const Cell & upperCell() const; - /** + /** @brief Returns \c true if the given unsigned cell has his k-th Khalimsky coordinate + * between those of the cells returned by lowerCell and upperCell. + * * @param c an unsigned cell. * @param k a dimension. * @returns \c true if the given unsigned cell has his k-th Khalimsky coordinate @@ -628,7 +631,9 @@ namespace DGtal */ bool uIsValid( const PreCell & c, Dimension k ) const; - /** + /** @brief Returns \c true if the given unsigned cell has Khalimsky coordinates + * between those of the cells returned by lowerCell and upperCell. + * * @param c a unsigned cell. * @returns \c true if the given unsigned cell has Khalimsky coordinates * between those of the cells returned by lowerCell and upperCell. @@ -639,7 +644,9 @@ namespace DGtal */ bool uIsValid( const PreCell & c ) const; - /** + /** @brief Returns \c true if the given signed cell his k-th Khalimsky coordinate + * between those of the cells returned by lowerCell and upperCell. + * * @param c a signed cell. * @param k a dimension. * @returns \c true if the given signed cell his k-th Khalimsky coordinate @@ -651,7 +658,9 @@ namespace DGtal */ bool sIsValid( const SPreCell & c, Dimension k ) const; - /** + /** @brief Returns \c true if the given signed cell has Khalimsky coordinates + * between those of the cells returned by lowerCell and upperCell. + * * @param c a signed cell. * @returns \c true if the given signed cell has Khalimsky coordinates * between those of the cells returned by lowerCell and upperCell. @@ -662,7 +671,9 @@ namespace DGtal */ bool sIsValid( const SPreCell & c ) const; - /** + /** @brief Returns \c true if the given cell has his k-th Khalimsky coordinate + * between those of the cells returned by lowerCell and upperCell. + * * @param p an integer point (Khalimsky coordinates of cell). * @param k a dimension. * @returns \c true if the given cell has his k-th Khalimsky coordinate @@ -672,7 +683,9 @@ namespace DGtal */ bool cIsValid( const Point & p, Dimension k ) const; - /** + /** @brief Returns \c true if the given cell has Khalimsky coordinates + * between those of the cells returned by lowerCell and upperCell. + * * @param p an integer point (Khalimsky coordinates of cell). * @returns \c true if the given cell has Khalimsky coordinates * between those of the cells returned by lowerCell and upperCell. @@ -689,34 +702,39 @@ namespace DGtal */ public: - /** + /** @brief Return 'true' iff the space is closed or periodic along every dimension. + * * @return 'true' iff the space is closed or periodic along every dimension. */ bool isSpaceClosed() const; - /** + /** @brief Return 'true' iff the space is closed or periodic along the specified dimension. + * * @param k the dimension. * @return 'true' iff the space is closed or periodic along the specified dimension. */ bool isSpaceClosed( Dimension k ) const; - /** + /** @brief Return 'true' iff the space is periodic along every dimension. + * * @return 'true' iff the space is periodic along every dimension. */ bool isSpacePeriodic() const; - /** + /** @brief Return 'true' iff the space is periodic along the specified dimension. + * * @param k the dimension. * @return 'true' iff the space is periodic along the specified dimension. */ bool isSpacePeriodic( Dimension k ) const; - /** + /** @brief Return 'true' iff the space is periodic along at least one dimension. + * * @return 'true' iff the space is periodic along at least one dimension. */ bool isAnyDimensionPeriodic() const; - /** Gets closure type. + /** @brief Gets closure type. * @param k the dimension. * @return closure type along the specified dimension. */ @@ -730,7 +748,7 @@ namespace DGtal */ public: - /** From an unsigned cell, returns an unsigned cell lying into this Khalismky space. + /** @brief From an unsigned cell, returns an unsigned cell lying into this Khalismky space. * * Along a non-periodic dimension, if the given Khalimsky coordinate lies * outside the space, it replaces it by the nearest valid coordinate. @@ -746,7 +764,7 @@ namespace DGtal */ Cell uCell( const PreCell & c ) const; - /** From the Khalimsky coordinates of a cell, + /** @brief From the Khalimsky coordinates of a cell, * builds the corresponding unsigned cell lying into this Khalismky space. * * Along a non-periodic dimension, if the given Khalimsky coordinate lies @@ -761,7 +779,7 @@ namespace DGtal */ Cell uCell( const Point & kp ) const; - /** From the digital coordinates of a point in Zn and a cell type, + /** @brief From the digital coordinates of a point in Zn and a cell type, * builds the corresponding unsigned cell lying into this Khalismky space. * * Along a non-periodic dimension, if the given digital coordinate lies @@ -778,7 +796,7 @@ namespace DGtal */ Cell uCell( Point p, const PreCell & c ) const; - /** From a signed cell, returns a signed cell lying into this Khalismky space. + /** @brief From a signed cell, returns a signed cell lying into this Khalismky space. * * Along a non-periodic dimension, if the given Khalimsky coordinate lies * outside the space, it replaces it by the nearest valid coordinate. @@ -794,7 +812,7 @@ namespace DGtal */ SCell sCell( const SPreCell & c ) const; - /** From the Khalimsky coordinates of a cell and a sign, + /** @brief From the Khalimsky coordinates of a cell and a sign, * builds the corresponding signed cell lying into this Khalismky space. * * Along a non-periodic dimension, if the given Khalimsky coordinate lies @@ -810,7 +828,7 @@ namespace DGtal */ SCell sCell( const Point & kp, Sign sign = POS ) const; - /** From the digital coordinates of a point in Zn and a signed cell type, + /** @brief From the digital coordinates of a point in Zn and a signed cell type, * builds the corresponding signed cell lying into this Khalismky space. * * Along a non-periodic dimension, if the given digital coordinate lies @@ -827,7 +845,7 @@ namespace DGtal */ SCell sCell( Point p, const SPreCell & c ) const; - /** From the digital coordinates of a point in Zn, + /** @brief From the digital coordinates of a point in Zn, * builds the corresponding spel (cell of maximal dimension) lying into this Khalismky space. * * Along a non-periodic dimension, if the given digital coordinate lies @@ -842,7 +860,7 @@ namespace DGtal */ Cell uSpel( Point p ) const; - /** From the digital coordinates of a point in Zn, + /** @brief From the digital coordinates of a point in Zn, * builds the corresponding spel (cell of maximal dimension) lying into this Khalismky space. * * Along a non-periodic dimension, if the given digital coordinate lies @@ -858,7 +876,7 @@ namespace DGtal */ SCell sSpel( Point p, Sign sign = POS ) const; - /** From the digital coordinates of a point in Zn, + /** @brief From the digital coordinates of a point in Zn, * builds the corresponding pointel (cell of dimension 0) lying into this Khalismky space. * * Along a non-periodic dimension, if the given digital coordinate lies @@ -873,7 +891,7 @@ namespace DGtal */ Cell uPointel( Point p ) const; - /** From the digital coordinates of a point in Zn, + /** @brief From the digital coordinates of a point in Zn, * builds the corresponding pointel (cell of dimension 0) lying into this Khalismky space. * * Along a non-periodic dimension, if the given digital coordinate lies @@ -897,7 +915,8 @@ namespace DGtal * @{ */ public: - /** + /** @brief Return its Khalimsky coordinate along [k]. + * * @param c any unsigned cell. * @param k any valid dimension. * @return its Khalimsky coordinate along [k]. @@ -905,7 +924,8 @@ namespace DGtal */ Integer uKCoord( const Cell & c, Dimension k ) const; - /** + /** @brief Return its digital coordinate along [k]. + * * @param c any unsigned cell. * @param k any valid dimension. * @return its digital coordinate along [k]. @@ -913,21 +933,24 @@ namespace DGtal */ Integer uCoord( const Cell & c, Dimension k ) const; - /** + /** @brief Return its Khalimsky coordinates. + * * @param c any unsigned cell. * @return its Khalimsky coordinates. * @pre `uIsValid(c)` is \a true. */ const Point & uKCoords( const Cell & c ) const; - /** + /** @brief Return its digital coordinates + * * @param c any unsigned cell. * @return its digital coordinates * @pre `uIsValid(c)` is \a true. */ Point uCoords( const Cell & c ) const; - /** + /** @brief Return its Khalimsky coordinate along [k]. + * * @param c any signed cell. * @param k any valid dimension. * @return its Khalimsky coordinate along [k]. @@ -935,7 +958,8 @@ namespace DGtal */ Integer sKCoord( const SCell & c, Dimension k ) const; - /** + /** @brief Return its digital coordinate along [k]. + * * @param c any signed cell. * @param k any valid dimension. * @return its digital coordinate along [k]. @@ -943,21 +967,24 @@ namespace DGtal */ Integer sCoord( const SCell & c, Dimension k ) const; - /** + /** @brief Return its Khalimsky coordinates. + * * @param c any signed cell. * @return its Khalimsky coordinates. * @pre `uIsValid(c)` is \a true. */ const Point & sKCoords( const SCell & c ) const; - /** + /** @brief Return its digital coordinates. + * * @param c any signed cell. * @return its digital coordinates. * @pre `uIsValid(c)` is \a true. */ Point sCoords( const SCell & c ) const; - /** + /** @brief Return its sign. + * * @param c any signed cell. * @return its sign. * @pre `uIsValid(c)` is \a true. @@ -972,7 +999,7 @@ namespace DGtal */ public: - /** Sets the [k]-th Khalimsky coordinate of [c] to [i]. + /** @brief Sets the [k]-th Khalimsky coordinate of [c] to [i]. * @param c any unsigned cell. * @param k any valid dimension. * @param i an integer coordinate within the space. @@ -982,7 +1009,7 @@ namespace DGtal */ void uSetKCoord( Cell & c, Dimension k, Integer i ) const; - /** Sets the [k]-th Khalimsky coordinate of [c] to [i]. + /** @brief Sets the [k]-th Khalimsky coordinate of [c] to [i]. * @param c any signed cell. * @param k any valid dimension. * @param i an integer coordinate within the space. @@ -992,7 +1019,7 @@ namespace DGtal */ void sSetKCoord( SCell & c, Dimension k, Integer i ) const; - /** Sets the [k]-th digital coordinate of [c] to [i]. + /** @brief Sets the [k]-th digital coordinate of [c] to [i]. * @param c any unsigned cell. * @param k any valid dimension. * @param i an integer coordinate within the space. @@ -1002,7 +1029,7 @@ namespace DGtal */ void uSetCoord( Cell & c, Dimension k, Integer i ) const; - /** Sets the [k]-th digital coordinate of [c] to [i]. + /** @brief Sets the [k]-th digital coordinate of [c] to [i]. * @param c any signed cell. * @param k any valid dimension. * @param i an integer coordinate within the space. @@ -1012,7 +1039,7 @@ namespace DGtal */ void sSetCoord( SCell & c, Dimension k, Integer i ) const; - /** Sets the Khalimsky coordinates of [c] to [kp]. + /** @brief Sets the Khalimsky coordinates of [c] to [kp]. * @param c any unsigned cell. * @param kp the new Khalimsky coordinates for [c]. * @note The coordinates \a kp will be corrected for periodic dimensions. @@ -1022,7 +1049,7 @@ namespace DGtal */ void uSetKCoords( Cell & c, const Point & kp ) const; - /** Sets the Khalimsky coordinates of [c] to [kp]. + /** @brief Sets the Khalimsky coordinates of [c] to [kp]. * @param c any signed cell. * @param kp the new Khalimsky coordinates for [c]. * @note The coordinates \a kp will be corrected for periodic dimensions. @@ -1031,7 +1058,7 @@ namespace DGtal */ void sSetKCoords( SCell & c, const Point & kp ) const; - /** Sets the digital coordinates of [c] to [kp]. + /** @brief Sets the digital coordinates of [c] to [kp]. * @param c any unsigned cell. * @param kp the new Khalimsky coordinates for [c]. * @note The coordinates \a kp will be corrected for periodic dimensions. @@ -1040,7 +1067,7 @@ namespace DGtal */ void uSetCoords( Cell & c, const Point & kp ) const; - /** Sets the digital coordinates of [c] to [kp]. + /** @brief Sets the digital coordinates of [c] to [kp]. * @param c any signed cell. * @param kp the new Khalimsky coordinates for [c]. * @note The coordinates \a kp will be corrected for periodic dimensions. @@ -1049,7 +1076,7 @@ namespace DGtal */ void sSetCoords( SCell & c, const Point & kp ) const; - /** Sets the sign of the cell. + /** @brief Sets the sign of the cell. * @param c (modified) any signed cell. * @param s any sign. */ @@ -1062,7 +1089,8 @@ namespace DGtal * @{ */ public: - /** Creates a signed cell from an unsigned one and a given sign. + /** @brief Creates a signed cell from an unsigned one and a given sign. + * * @param p any unsigned cell. * @param s a sign. * @return the signed version of the cell [p] with sign [s]. @@ -1071,7 +1099,8 @@ namespace DGtal */ SCell signs( const Cell & p, Sign s ) const; - /** Creates an unsigned cell from a signed one. + /** @brief Creates an unsigned cell from a signed one. + * * @param p any signed cell. * @return the unsigned version of the cell [p]. * @pre `sIsValid(p)` is \a true. @@ -1079,8 +1108,8 @@ namespace DGtal */ Cell unsigns( const SCell & p ) const; - /** - * Creates the signed cell with the inverse sign of [p]. + /** @brief Creates the signed cell with the inverse sign of [p]. + * * @param p any signed cell. * @return the cell [p] with opposite sign. * @pre `sIsValid(p)` is \a true. @@ -1095,50 +1124,58 @@ namespace DGtal * @{ */ public: - /** + /** @brief Return the topology word of [p]. + * * @param p any unsigned cell. * @return the topology word of [p]. */ Integer uTopology( const Cell & p ) const; - /** + /** @brief Return the topology word of [p]. + * * @param p any signed cell. * @return the topology word of [p]. */ Integer sTopology( const SCell & p ) const; - /** + /** @brief Return the dimension of the cell [p]. + * * @param p any unsigned cell. * @return the dimension of the cell [p]. */ Dimension uDim( const Cell & p ) const; - /** + /** @brief Return the dimension of the cell [p]. + * * @param p any signed cell. * @return the dimension of the cell [p]. */ Dimension sDim( const SCell & p ) const; - /** + /** @brief Return 'true' if [b] is a surfel (spans all but one coordinate). + * * @param b any unsigned cell. * @return 'true' if [b] is a surfel (spans all but one coordinate). */ bool uIsSurfel( const Cell & b ) const; - /** + /** @brief Return 'true' if [b] is a surfel (spans all but one coordinate). + * * @param b any signed cell. * @return 'true' if [b] is a surfel (spans all but one coordinate). */ bool sIsSurfel( const SCell & b ) const; - /** + /** @brief Return 'true' if [p] is open along the direction [k]. + * * @param p any cell. * @param k any direction. * @return 'true' if [p] is open along the direction [k]. */ bool uIsOpen( const Cell & p, Dimension k ) const; - /** + /** @brief Return 'true' if [p] is open along the direction [k]. + * * @param p any signed cell. * @param k any direction. * @return 'true' if [p] is open along the direction [k]. @@ -1153,9 +1190,12 @@ namespace DGtal */ public: - /** Given an unsigned cell [p], returns an iterator to iterate over - * each coordinate the cell spans. (A spel spans all coordinates; a - * surfel all but one, etc). Example: + /** @brief Given an unsigned cell [p], returns an iterator to iterate over + * each coordinate the cell spans. + * + * (A spel spans all coordinates; a surfel all but one, etc). + * + * Example: * * @code * KSpace::Cell p; @@ -1173,9 +1213,12 @@ namespace DGtal */ DirIterator uDirs( const Cell & p ) const; - /** Given a signed cell [p], returns an iterator to iterate over - * each coordinate the cell spans. (A spel spans all coordinates; a - * surfel all but one, etc). Example: + /** @brief Given a signed cell [p], returns an iterator to iterate over + * each coordinate the cell spans. + * + * (A spel spans all coordinates; a surfel all but one, etc). + * + * Example: * * @code * KSpace::SCell p; @@ -1193,9 +1236,12 @@ namespace DGtal */ DirIterator sDirs( const SCell & p ) const; - /** Given an unsigned cell [p], returns an iterator to iterate over each - * coordinate the cell does not span. (A spel spans all coordinates; - * a surfel all but one, etc). Example: + /** @brief Given an unsigned cell [p], returns an iterator to iterate over each + * coordinate the cell does not span. + * + * (A spel spans all coordinates; a surfel all but one, etc). + * + * Example: * * @code * KSpace::Cell p; @@ -1213,9 +1259,12 @@ namespace DGtal */ DirIterator uOrthDirs( const Cell & p ) const; - /** Given a signed cell [p], returns an iterator to iterate over each - * coordinate the cell does not span. (A spel spans all coordinates; - * a surfel all but one, etc). Example: + /** @brief Given a signed cell [p], returns an iterator to iterate over each + * coordinate the cell does not span. + * + * (A spel spans all coordinates; a surfel all but one, etc). + * + * Example: * * @code * KSpace::SCell p; @@ -1233,7 +1282,7 @@ namespace DGtal */ DirIterator sOrthDirs( const SCell & p ) const; - /** Given an unsigned surfel [s], returns its orthogonal direction (ie, + /** @brief Given an unsigned surfel [s], returns its orthogonal direction (ie, * the coordinate where the surfel is closed). * * @param s an unsigned surfel @@ -1241,7 +1290,7 @@ namespace DGtal */ Dimension uOrthDir( const Cell & s ) const; - /** Given a signed surfel [s], returns its orthogonal direction (ie, + /** @brief Given a signed surfel [s], returns its orthogonal direction (ie, * the coordinate where the surfel is closed). * * @param s a signed surfel @@ -1257,35 +1306,41 @@ namespace DGtal */ public: - /** + /** @brief Return the k-th Khalimsky coordinate of the first cell of the space with the same type as [p]. + * * @return the k-th Khalimsky coordinate of the first cell of the space with the same type as [p]. * @note For periodic dimension, it returns the first unique coordinate of a cell of same type as \a p. * @post The returned coordinate is between `lowerCell()[k]` and `upperCell()[k]`. */ Integer uFirst( const PreCell & p, Dimension k ) const; - /** + /** @brief Return the first cell of the space with the same type as [p]. + * * @return the first cell of the space with the same type as [p]. * @note Along periodic dimensions, it returns the first unique coordinate of a cell of same type as \a p. * @post `uIsValid(uFirst(p))` is \a true. */ Cell uFirst( const PreCell & p ) const; - /** + /** @brief Return the k-th Khalimsky coordinate of the last cell of the space with the same type as [p]. + * * @return the k-th Khalimsky coordinate of the last cell of the space with the same type as [p]. * @note For periodic dimension, it returns the last unique coordinate of a cell of same type as \a p. * @post The returned coordinate is between `lowerCell()[k]` and `upperCell()[k]`. */ Integer uLast( const PreCell & p, Dimension k ) const; - /** + /** @brief Return the last cell of the space with the same type as [p]. + * * @return the last cell of the space with the same type as [p]. * @note Along periodic dimensions, it returns the last unique coordinate of a cell of same type as \a p. * @post `uIsValid(uLast(p))` is \a true. */ Cell uLast( const PreCell & p ) const; - /** + /** @brief Return the same element as [p] except for the incremented + * coordinate [k]. + * * @param p any cell. * @param k the coordinate that is changed. * @return the same element as [p] except for the incremented @@ -1295,7 +1350,7 @@ namespace DGtal */ Cell uGetIncr( const Cell & p, Dimension k ) const; - /** Useful to check if you are going out of the space. + /** @brief Useful to check if you are going out of the space. * * @param p any cell. * @param k the tested coordinate. @@ -1307,7 +1362,7 @@ namespace DGtal bool uIsMax( const Cell & p, Dimension k ) const; - /** Useful to check if you are going out of the space. + /** @brief Useful to check if you are going out of the space. * * @param p any cell. * @param k the tested coordinate. @@ -1317,7 +1372,7 @@ namespace DGtal bool uIsInside( const PreCell & p, Dimension k ) const; - /** Useful to check if you are going out of the space. + /** @brief Useful to check if you are going out of the space. * * @param p any cell. * @return true if [p] has its coordinates within the allowed bounds. @@ -1325,7 +1380,7 @@ namespace DGtal */ bool uIsInside( const PreCell & p ) const; - /** Useful to check if you are going out of the space. + /** @brief Useful to check if you are going out of the space. * * @param p any integer point (Khalimsky coordinates). * @param k the tested coordinate. @@ -1335,7 +1390,7 @@ namespace DGtal bool cIsInside( const Point & p, Dimension k ) const; - /** Useful to check if you are going out of the space. + /** @brief Useful to check if you are going out of the space. * * @param p any integer point (Khalimsky coordinates). * @return true if [p] has its coordinates within the allowed bounds. @@ -1343,7 +1398,7 @@ namespace DGtal */ bool cIsInside( const Point & p ) const; - /** Useful to check if you are going out of the space. + /** @brief Useful to check if you are going out of the space. * * @param p any cell. * @param k the concerned coordinate. @@ -1354,7 +1409,9 @@ namespace DGtal */ Cell uGetMax( Cell p, Dimension k ) const; - /** + /** @brief Return the same element as [p] except for an decremented + * coordinate [k]. + * * @param p any cell. * @param k the coordinate that is changed. * @return the same element as [p] except for an decremented @@ -1364,7 +1421,8 @@ namespace DGtal */ Cell uGetDecr( const Cell & p, Dimension k ) const; - /** Useful to check if you are going out of the space. + /** @brief Useful to check if you are going out of the space. + * * @param p any cell. * @param k the tested coordinate. * @return true if [p] cannot have its [k]-coordinate decreased @@ -1374,7 +1432,7 @@ namespace DGtal */ bool uIsMin( const Cell & p, Dimension k ) const; - /** Useful to check if you are going out of the space. + /** @brief Useful to check if you are going out of the space. * * @param p any cell. * @param k the concerned coordinate. @@ -1386,7 +1444,9 @@ namespace DGtal Cell uGetMin( Cell p, Dimension k ) const; - /** + /** @brief Return the same element as [p] except for a coordinate [k] + * incremented with x. + * * @param p any cell. * @param k the coordinate that is changed. * @param x the increment. @@ -1397,7 +1457,9 @@ namespace DGtal */ Cell uGetAdd( const Cell & p, Dimension k, Integer x ) const; - /** + /** @brief Return the same element as [p] except for a coordinate [k] + * decremented with x. + * * @param p any cell. * @param k the coordinate that is changed. * @param x the decrement. @@ -1408,7 +1470,7 @@ namespace DGtal */ Cell uGetSub( const Cell & p, Dimension k, Integer x ) const; - /** Useful to check if you are going out of the space (for non-periodic dimensions). + /** @brief Useful to check if you are going out of the space (for non-periodic dimensions). * * @param p any cell. * @param k the coordinate that is tested. @@ -1417,7 +1479,7 @@ namespace DGtal */ Integer uDistanceToMax( const Cell & p, Dimension k ) const; - /** Useful to check if you are going out of the space (for non-periodic dimensions). + /** @brief Useful to check if you are going out of the space (for non-periodic dimensions). * * @param p any cell. * @param k the coordinate that is tested. @@ -1427,7 +1489,7 @@ namespace DGtal */ Integer uDistanceToMin( const Cell & p, Dimension k ) const; - /** Add the vector [vec] to [p]. + /** @brief Add the vector [vec] to [p]. * * @param p any cell. * @param vec any pointel. @@ -1437,8 +1499,10 @@ namespace DGtal */ Cell uTranslation( const Cell & p, const Vector & vec ) const; - /** Return the projection of [p] along the [k]th direction toward - * [bound]. Otherwise said, p[ k ] == bound[ k ] afterwards. + /** @brief Return the projection of [p] along the [k]th direction toward + * [bound]. + * + * Otherwise said, p[ k ] == bound[ k ] afterwards. * * @param p any cell. * @param bound the element acting as bound (same topology as p). @@ -1449,8 +1513,10 @@ namespace DGtal */ Cell uProjection( const Cell & p, const Cell & bound, Dimension k ) const; - /** Projects [p] along the [k]th direction toward - * [bound]. Otherwise said, p[ k ] == bound[ k ] afterwards + /** @brief Projects [p] along the [k]th direction toward + * [bound]. + * + * Otherwise said, p[ k ] == bound[ k ] afterwards * * @param [in,out] p any cell. * @param [in] bound the element acting as bound (same topology as p). @@ -1460,8 +1526,10 @@ namespace DGtal */ void uProject( Cell & p, const Cell & bound, Dimension k ) const; - /** Increment the cell [p] to its next position (as classically done in - * a scanning). Example: + /** @brief Increment the cell [p] to its next position (as classically done in + * a scanning). + * + * Example: * * \code * KSpace K; @@ -1491,35 +1559,41 @@ namespace DGtal */ public: - /** + /** @brief Return the k-th coordinate of the first cell of the space with the same type as [p]. + * * @return the k-th coordinate of the first cell of the space with the same type as [p]. * @note For periodic dimension, it returns the first unique coordinate of a cell of same type as \a p. * @post The returned coordinate is between `lowerCell()[k]` and `upperCell()[k]`. */ Integer sFirst( const SPreCell & p, Dimension k ) const; - /** + /** @brief Return the first cell of the space with the same type as [p]. + * * @return the first cell of the space with the same type as [p]. * @note Along periodic dimensions, it returns the first unique coordinate of a cell of same type as \a p. * @post `sIsValid(sFirst(p))` is \a true. */ SCell sFirst( const SPreCell & p ) const; - /** + /** @brief Return the k-th Khalimsky coordinate of the last cell of the space with the same type as [p]. + * * @return the k-th Khalimsky coordinate of the last cell of the space with the same type as [p]. * @note For periodic dimension, it returns the last unique coordinate of a cell of same type as \a p. * @post The returned coordinate is between `lowerCell()[k]` and `upperCell()[k]`. */ Integer sLast( const SPreCell & p, Dimension k ) const; - /** + /** @brief Return the last cell of the space with the same type as [p]. + * * @return the last cell of the space with the same type as [p]. * @note Along periodic dimensions, it returns the last unique coordinate of a cell of same type as \a p. * @post `sIsValid(sLast(p))` is \a true. */ SCell sLast( const SPreCell & p ) const; - /** + /** @brief Return the same element as [p] except for the incremented + * coordinate [k]. + * * @param p any cell. * @param k the coordinate that is changed. * @return the same element as [p] except for the incremented @@ -1529,7 +1603,8 @@ namespace DGtal */ SCell sGetIncr( const SCell & p, Dimension k ) const; - /** Useful to check if you are going out of the space. + /** @brief Useful to check if you are going out of the space. + * * @param p any cell. * @param k the tested coordinate. * @return true if [p] cannot have its [k]-coordinate augmented @@ -1539,15 +1614,16 @@ namespace DGtal */ bool sIsMax( const SCell & p, Dimension k ) const; - /** Useful to check if you are going out of the space. + /** @brief Useful to check if you are going out of the space. + * * @param p any cell. * @param k the tested coordinate. * @return true if [p] has its [k]-coordinate within the allowed bounds. - * @note It returns always \a true for periodic dimension. + * @note It returns always \a true for periodic dimension. */ bool sIsInside( const SPreCell & p, Dimension k ) const; - /** Useful to check if you are going out of the space. + /** @brief Useful to check if you are going out of the space. * * @param p any cell. * @return true if [p] has its coordinates within the allowed bounds. @@ -1555,7 +1631,7 @@ namespace DGtal */ bool sIsInside( const SPreCell & p ) const; - /** Useful to check if you are going out of the space. + /** @brief Useful to check if you are going out of the space. * * @param p any cell. * @param k the concerned coordinate. @@ -1566,7 +1642,9 @@ namespace DGtal */ SCell sGetMax( SCell p, Dimension k ) const; - /** + /** @brief Return the same element as [p] except for an decremented + * coordinate [k]. + * * @param p any cell. * @param k the coordinate that is changed. * @return the same element as [p] except for an decremented @@ -1576,7 +1654,7 @@ namespace DGtal */ SCell sGetDecr( const SCell & p, Dimension k ) const; - /** Useful to check if you are going out of the space. + /** @brief Useful to check if you are going out of the space. * * @param p any cell. * @param k the tested coordinate. @@ -1587,7 +1665,8 @@ namespace DGtal */ bool sIsMin( const SCell & p, Dimension k ) const; - /** Useful to check if you are going out of the space. + /** @brief Useful to check if you are going out of the space. + * * @param p any cell. * @param k the concerned coordinate. * @return the cell similar to [p] but with the minimum allowed @@ -1597,7 +1676,9 @@ namespace DGtal */ SCell sGetMin( SCell p, Dimension k ) const; - /** + /** @brief Return the same element as [p] except for a coordinate [k] + * incremented with x. + * * @param p any cell. * @param k the coordinate that is changed. * @param x the increment. @@ -1608,7 +1689,9 @@ namespace DGtal */ SCell sGetAdd( const SCell & p, Dimension k, Integer x ) const; - /** + /** @brief Return the same element as [p] except for a coordinate [k] + * decremented with x. + * * @param p any cell. * @param k the coordinate that is changed. * @param x the decrement. @@ -1619,7 +1702,7 @@ namespace DGtal */ SCell sGetSub( const SCell & p, Dimension k, Integer x ) const; - /** Useful to check if you are going out of the space (for non-periodic dimensions). + /** @brief Useful to check if you are going out of the space (for non-periodic dimensions). * * @param p any cell. * @param k the coordinate that is tested. @@ -1628,7 +1711,7 @@ namespace DGtal */ Integer sDistanceToMax( const SCell & p, Dimension k ) const; - /** Useful to check if you are going out of the space (for non-periodic dimensions). + /** @brief Useful to check if you are going out of the space (for non-periodic dimensions). * * @param p any cell. * @param k the coordinate that is tested. @@ -1638,7 +1721,7 @@ namespace DGtal */ Integer sDistanceToMin( const SCell & p, Dimension k ) const; - /** Add the vector [vec] to [p]. + /** @brief Add the vector [vec] to [p]. * * @param p any cell. * @param vec any pointel. @@ -1648,8 +1731,10 @@ namespace DGtal */ SCell sTranslation( const SCell & p, const Vector & vec ) const; - /** Return the projection of [p] along the [k]th direction toward - * [bound]. Otherwise said, p[ k ] == bound[ k ] afterwards. + /** @brief Return the projection of [p] along the [k]th direction toward + * [bound]. + * + * Otherwise said, p[ k ] == bound[ k ] afterwards. * * @param p any cell. * @param bound the element acting as bound (same topology as p). @@ -1660,8 +1745,10 @@ namespace DGtal */ SCell sProjection( const SCell & p, const SCell & bound, Dimension k ) const; - /** Projects [p] along the [k]th direction toward - * [bound]. Otherwise said, p[ k ] == bound[ k ] afterwards. + /** @brief Projects [p] along the [k]th direction toward + * [bound]. + * + * Otherwise said, p[ k ] == bound[ k ] afterwards. * * @param p any cell. * @param bound the element acting as bound (same topology as p). @@ -1671,9 +1758,11 @@ namespace DGtal */ void sProject( SCell & p, const SCell & bound, Dimension k ) const; - /** Increment the cell [p] to its next position (as classically done in - * a scanning). Example: - + /** @brief Increment the cell [p] to its next position (as classically done in + * a scanning). + * + * Example: + * * \code * KSpace K; * Cell first, last; // lower and upper bounds @@ -1702,9 +1791,11 @@ namespace DGtal */ public: - /** Computes the 1-neighborhood of the cell [c] and returns - * it. It is the set of cells with same topology that are adjacent - * to [c] and which are within the bounds of this space. + /** @brief Computes the 1-neighborhood of the cell [c] and returns + * it. + * + * It is the set of cells with same topology that are adjacent + * to [c] and which are within the bounds of this space. * * @param cell the unsigned cell of interest. * @return the cells of the 1-neighborhood of [cell]. @@ -1713,9 +1804,11 @@ namespace DGtal */ Cells uNeighborhood( const Cell & cell ) const; - /** Computes the 1-neighborhood of the cell [c] and returns - * it. It is the set of cells with same topology that are adjacent - * to [c] and which are within the bounds of this space. + /** @brief Computes the 1-neighborhood of the cell [c] and returns + * it. + * + * It is the set of cells with same topology that are adjacent + * to [c] and which are within the bounds of this space. * * @param cell the signed cell of interest. * @return the cells of the 1-neighborhood of [cell]. @@ -1724,10 +1817,12 @@ namespace DGtal */ SCells sNeighborhood( const SCell & cell ) const; - /** Computes the proper 1-neighborhood of the cell [c] and returns - * it. It is the set of cells with same topology that are adjacent - * to [c], different from [c] and which are within the bounds of - * this space. + /** @brief Computes the proper 1-neighborhood of the cell [c] and returns + * it. + * + * It is the set of cells with same topology that are adjacent + * to [c], different from [c] and which are within the bounds of + * this space. * * @param cell the unsigned cell of interest. * @return the cells of the proper 1-neighborhood of [cell]. @@ -1736,10 +1831,12 @@ namespace DGtal */ Cells uProperNeighborhood( const Cell & cell ) const; - /** Computes the proper 1-neighborhood of the cell [c] and returns - * it. It is the set of cells with same topology that are adjacent - * to [c], different from [c] and which are within the bounds of - * this space. + /** @brief Computes the proper 1-neighborhood of the cell [c] and returns + * it. + * + * It is the set of cells with same topology that are adjacent + * to [c], different from [c] and which are within the bounds of + * this space. * * @param cell the signed cell of interest. * @return the cells of the proper 1-neighborhood of [cell]. @@ -1748,7 +1845,9 @@ namespace DGtal */ SCells sProperNeighborhood( const SCell & cell ) const; - /** + /** @brief Return the adjacent element to [p] along axis [k] in the given + * direction and orientation. + * * @param p any cell. * @param k the coordinate that is changed. * @param up if 'true' the orientation is forward along axis @@ -1761,7 +1860,9 @@ namespace DGtal */ Cell uAdjacent( const Cell & p, Dimension k, bool up ) const; - /** + /** @brief Return the adjacent element to [p] along axis [k] in the given + * direction and orientation. + * * @param p any cell. * @param k the coordinate that is changed. * @param up if 'true' the orientation is forward along axis @@ -1782,7 +1883,9 @@ namespace DGtal */ public: - /** + /** @brief Return the forward or backward unsigned cell incident to [c] + * along axis [k], depending on [up]. + * * @param c any unsigned cell. * @param k any coordinate. * @param up if 'true' the orientation is forward along axis @@ -1796,7 +1899,9 @@ namespace DGtal */ Cell uIncident( const Cell & c, Dimension k, bool up ) const; - /** + /** @brief Return the forward or backward signed cell incident to [c] + * along axis [k], depending on [up]. + * * @param c any signed cell. * @param k any coordinate. * @param up if 'true' the orientation is forward along axis @@ -1813,7 +1918,8 @@ namespace DGtal */ SCell sIncident( const SCell & c, Dimension k, bool up ) const; - /** + /** @brief Return the cells directly low incident to c in this space. + * * @param c any unsigned cell. * @return the cells directly low incident to c in this space. * @pre `uIsValid(c)` is \a true. @@ -1821,7 +1927,8 @@ namespace DGtal */ Cells uLowerIncident( const Cell & c ) const; - /** + /** @brief Return the cells directly up incident to c in this space. + * * @param c any unsigned cell. * @return the cells directly up incident to c in this space. * @pre `uIsValid(c)` is \a true. @@ -1829,16 +1936,18 @@ namespace DGtal */ Cells uUpperIncident( const Cell & c ) const; - /** - * @param c any signed cell. - * @return the signed cells directly low incident to c in this space. - * @note it is the lower boundary of c expressed as a list of signed cells. + /** @brief Return the signed cells directly low incident to c in this space. + * + * @param c any signed cell. + * @return the signed cells directly low incident to c in this space. + * @note it is the lower boundary of c expressed as a list of signed cells. * @pre `sIsValid(c)` is \a true. * @post `sIsValid(b)` is \a true for every returned cell \a b. */ SCells sLowerIncident( const SCell & c ) const; - /** + /** @brief Return the signed cells directly up incident to c in this space. + * * @param c any signed cell. * @return the signed cells directly up incident to c in this space. * @note it is the upper boundary of c expressed as a list of signed cells. @@ -1847,7 +1956,8 @@ namespace DGtal */ SCells sUpperIncident( const SCell & c ) const; - /** + /** @brief Return the proper faces of [c] (chain of lower incidence) that belong to the space. + * * @param c any unsigned cell. * @return the proper faces of [c] (chain of lower incidence) that belong to the space. * @pre `uIsValid(c)` is \a true. @@ -1855,7 +1965,8 @@ namespace DGtal */ Cells uFaces( const Cell & c ) const; - /** + /** @brief Return the proper cofaces of [c] (chain of upper incidence) that belong to the space. + * * @param c any unsigned cell. * @return the proper cofaces of [c] (chain of upper incidence) that belong to the space. * @pre `uIsValid(c)` is \a true. @@ -1863,14 +1974,16 @@ namespace DGtal */ Cells uCoFaces( const Cell & c ) const; - /** Return 'true' if the direct orientation of [p] along [k] is in - * the positive coordinate direction. The direct orientation in a - * direction allows to go from positive incident cells to positive - * incident cells. This means that - * @code - * K.sSign( K.sIncident( p, k, K.sDirect( p, k ) ) ) == K.POS - * @endcode - * is always true. + /** @brief Return 'true' if the direct orientation of [p] along [k] is in + * the positive coordinate direction. + * + * The direct orientation in a + * direction allows to go from positive incident cells to positive + * incident cells. This means that + * @code + * K.sSign( K.sIncident( p, k, K.sDirect( p, k ) ) ) == K.POS + * @endcode + * is always true. * * @param p any signed cell. * @param k any coordinate. @@ -1879,7 +1992,9 @@ namespace DGtal */ bool sDirect( const SCell & p, Dimension k ) const; - /** + /** @brief Return the direct incident cell of [p] along [k] (the incident + * cell along [k]) + * * @param p any signed cell. * @param k any coordinate. * @return the direct incident cell of [p] along [k] (the incident @@ -1890,7 +2005,9 @@ ose sign is positive). */ SCell sDirectIncident( const SCell & p, Dimension k ) const; - /** + /** @brief Return the indirect incident cell of [p] along [k] (the incident + * cell along [k] whose sign is negative). + * * @param p any signed cell. * @param k any coordinate. * @return the indirect incident cell of [p] along [k] (the incident @@ -1898,7 +2015,7 @@ ose sign is positive). * @pre `sIsValid(p)` and the cell should have an indirect incident cell in this direction. * @post `sIsValid(c)` is \a true for every returned cell \a c. ose sign is positive). - */ + */ SCell sIndirectIncident( const SCell & p, Dimension k ) const; /// @} @@ -1909,14 +2026,14 @@ ose sign is positive). */ public: - /** - * Writes/Displays the object on an output stream. + /** @brief Writes/Displays the object on an output stream. + * * @param out the output stream where the object is written. */ void selfDisplay ( std::ostream & out ) const; - /** - * Checks the validity/consistency of the object. + /** @brief Checks the validity/consistency of the object. + * * @return 'true' if the object is valid, 'false' otherwise. */ bool isValid() const; @@ -1946,14 +2063,10 @@ ose sign is positive). * @{ */ private: - /** - * Used by uFaces for computing incident faces. - */ + /// Used by uFaces for computing incident faces. void uAddFaces( Cells& faces, const Cell& c, Dimension axis ) const; - /** - * Used by uCoFaces for computing incident cofaces. - */ + /// Used by uCoFaces for computing incident cofaces. void uAddCoFaces( Cells& cofaces, const Cell& c, Dimension axis ) const; /// @} @@ -1961,8 +2074,8 @@ ose sign is positive). }; // end of class KhalimskySpaceND - /** - * Overloads 'operator<<' for displaying objects of class 'KhalimskySpaceND'. + /** @brief Overloads 'operator<<' for displaying objects of class 'KhalimskySpaceND'. + * * @param out the output stream where the object is written. * @param object the object of class 'KhalimskySpaceND' to write. * @return the output stream after the writing. diff --git a/src/DGtal/topology/VoxelComplex.h b/src/DGtal/topology/VoxelComplex.h index 1cf41f5e13..df28e8696f 100644 --- a/src/DGtal/topology/VoxelComplex.h +++ b/src/DGtal/topology/VoxelComplex.h @@ -50,7 +50,7 @@ namespace DGtal { // Forward definitions. template class VoxelComplex; -namespace functions { + template VoxelComplex & operator-=(VoxelComplex &, @@ -60,7 +60,6 @@ VoxelComplex operator-(const VoxelComplex &, const VoxelComplex &); -} // namespace functions ///////////////////////////////////////////////////////////////////////////// // template class VoxelComplex /** @@ -94,8 +93,8 @@ class VoxelComplex : public CubicalComplex { /** Type of this instance of VoxelComplex. */ using Self = VoxelComplex; - friend Self &DGtal::functions::operator-=<>(Self &, const Self &); - friend Self DGtal::functions::operator-<>(const Self &, const Self &); + friend Self &DGtal::operator-=<>(Self &, const Self &); + friend Self DGtal::operator-<>(const Self &, const Self &); // ----------------------- associated types ------------------------------ /** Type of the parent class CubicalComplex. */ using Parent = CubicalComplex; diff --git a/src/DGtal/topology/VoxelComplex.ih b/src/DGtal/topology/VoxelComplex.ih index 892eb83efe..2ee8d0c221 100644 --- a/src/DGtal/topology/VoxelComplex.ih +++ b/src/DGtal/topology/VoxelComplex.ih @@ -332,7 +332,7 @@ DGtal::VoxelComplex::K_2( auto orientation_vector = B - A; ASSERT(orientation_vector.norm1() == 1); int direction{-1}; - for (size_t i = 0; i != ks.DIM; ++i) + for (auto i = 0; i != ks.DIM; ++i) if (orientation_vector[i] == 1 || orientation_vector[i] == -1) { direction = i; break; diff --git a/src/DGtal/topology/VoxelComplexFunctions.h b/src/DGtal/topology/VoxelComplexFunctions.h index 3fa570c402..0a95a357b1 100644 --- a/src/DGtal/topology/VoxelComplexFunctions.h +++ b/src/DGtal/topology/VoxelComplexFunctions.h @@ -365,55 +365,55 @@ namespace DGtal template std::vector< TObject > connectedComponents(const TObject & input_obj, bool verbose); - + } // namespace functions ////////////////////////////////////////////////////////////////////////////// -//Operators between VoxelComplexes// + //Operators between VoxelComplexes// - /** - * Voxel Complex difference operation. Updates the voxel complex S1 as S1 - S2. - * @tparam TKSpace the digital space in which lives the voxel complex. - * @tparam TCellContainer the associative container used to store cells within the voxel complex. - * - * @param[in,out] S1 an input voxel complex, \a S1 - \a S2 as output. - * @param[in] S2 another input voxel complex. - * - * @return a reference to the modified voxel complex S1. - */ - template + /** + * Voxel Complex difference operation. Updates the voxel complex S1 as S1 - S2. + * @tparam TKSpace the digital space in which lives the voxel complex. + * @tparam TCellContainer the associative container used to store cells within + * the voxel complex. + * + * @param[in,out] S1 an input voxel complex, \a S1 - \a S2 as output. + * @param[in] S2 another input voxel complex. + * + * @return a reference to the modified voxel complex S1. + */ + template inline VoxelComplex< TKSpace, TCellContainer >& operator-=( VoxelComplex< TKSpace, TCellContainer >& S1, - const VoxelComplex< TKSpace, TCellContainer >& S2 ) + const VoxelComplex< TKSpace, TCellContainer >& S2 ) { typedef VoxelComplex< TKSpace, TCellContainer > VC; for ( Dimension i = 0; i <= VC::dimension; ++i ) - setops::operator-=( S1.myCells[ i ],S2.myCells[ i ] ); + functions::setops::operator-=( S1.myCells[ i ],S2.myCells[ i ] ); return S1; } - /** - * Voxel Complex difference operation. Returns the difference of \a S1 - \a S2. - * @tparam TKSpace the digital space in which lives the voxel complex. - * @tparam TCellContainer the associative container used to store cells within the voxel complex. - * - * @param[in] S1 an input voxel complex - * @param[in] S2 another input voxel complex. - * - * @return the voxel complex \a S1 - \a S2. - */ - template + /** + * Voxel Complex difference operation. Returns the difference of \a S1 - \a S2. + * @tparam TKSpace the digital space in which lives the voxel complex. + * @tparam TCellContainer the associative container used to store cells within + * the voxel complex. + * + * @param[in] S1 an input voxel complex + * @param[in] S2 another input voxel complex. + * + * @return the voxel complex \a S1 - \a S2. + */ + template inline VoxelComplex< TKSpace, TCellContainer > operator-( const VoxelComplex< TKSpace, TCellContainer >& S1, - const VoxelComplex< TKSpace, TCellContainer >& S2 ) + const VoxelComplex< TKSpace, TCellContainer >& S2 ) { typedef VoxelComplex< TKSpace, TCellContainer > VC; VC S(S1); for ( Dimension i = 0; i <= VC::dimension; ++i ) - setops::operator-=( S.myCells[ i ],S2.myCells[ i ] ); + functions::setops::operator-=( S.myCells[ i ],S2.myCells[ i ] ); return S; } - - } // namespace functions } // namespace DGtal diff --git a/tests/arithmetic/testLatticePolytope2D.cpp b/tests/arithmetic/testLatticePolytope2D.cpp index d74bb61baa..b9cef2d0e7 100644 --- a/tests/arithmetic/testLatticePolytope2D.cpp +++ b/tests/arithmetic/testLatticePolytope2D.cpp @@ -141,12 +141,12 @@ bool testLatticePolytope2D() cip.pushBack( Point( 0, 3 ) ); Integer area2 = cip.twiceArea(); trace.info() << "- 2*area = " << area2 << std::endl; - ++nb, nbok += ( area2 == 15 ) ? 1 : 0; + ++nb; nbok += ( area2 == 15 ) ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "2*area == 15" << std::endl; Point3I c = cip.centroid( area2 ); trace.info() << "- centroid = " << c << std::endl; - ++nb, nbok += ( c == Point3I( 75, 45, 45 ) ) ? 1 : 0; + ++nb; nbok += ( c == Point3I( 75, 45, 45 ) ) ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "centroid == [75,45,45]" << std::endl; Domain d = cip.boundingBoxDomain(); @@ -264,7 +264,7 @@ bool exhaustiveTestLatticePolytope2D() HalfSpace h( Vector( x, y ), cc ); trace.info() << "[" << j << " size=" << cip2.size() << "]" << " cut by (" << x << "," << y << ")," << c << std::endl; - ++nb, nbok += checkCut( cip2, h ) ? 1 : 0; + ++nb; nbok += checkCut( cip2, h ) ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") cuts" << std::endl; //std::cerr << " " << cip2.size() << flush; if ( nb != nbok ) break; @@ -304,7 +304,7 @@ bool specificTestLatticePolytope2D() cip.pushBack( Point( -3, 6 ) ); HalfSpace hs1( Vector( -5, 11 ), 8 ); //12 HalfSpace hs2( Vector( -3, -11 ), 8 ); //-37 - ++nb, nbok += checkCut( cip, hs1 ) ? 1 : 0; + ++nb; nbok += checkCut( cip, hs1 ) ? 1 : 0; Domain d = cip.boundingBoxDomain(); Board2D board; @@ -325,7 +325,7 @@ bool specificTestLatticePolytope2D() board.saveEPS( "cip3.eps" ); board.clear(); - ++nb, nbok += checkCut( cip, hs2 ) ? 1 : 0; + ++nb; nbok += checkCut( cip, hs2 ) ? 1 : 0; return nbok == nb; } diff --git a/tests/arithmetic/testLightSternBrocot.cpp b/tests/arithmetic/testLightSternBrocot.cpp index 8c50b00bce..f27000acf7 100644 --- a/tests/arithmetic/testLightSternBrocot.cpp +++ b/tests/arithmetic/testLightSternBrocot.cpp @@ -96,7 +96,7 @@ bool testReducedFraction() trace.info() << " - f1 = "; SB::display( trace.info(), f1 ); trace.info() << std::endl; - ++nb, nbok += ok ? 1 : 0; + ++nb; nbok += ok ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << " cfrac" << std::endl; @@ -108,7 +108,7 @@ bool testReducedFraction() fr.getCFrac( cf1_red ); cf1.resize( depth - k ); ok = equalCFrac( cf1, cf1_red ); - ++nb, nbok += ok ? 1 : 0; + ++nb; nbok += ok ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "reduced(" << k << ")="; SB::display( trace.info(), fr ); @@ -177,31 +177,31 @@ bool testPattern() pat_odd.getSmallestCoveringSubpattern( sp, np, start, 0, 17 ); trace.info() << "sub(0,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 12 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 12 ) ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 1, 17 ); trace.info() << "sub(1,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 12 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 12 ) ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 7, 17 ); trace.info() << "sub(7,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 3, 7 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 3, 7 ) ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 8, 17 ); trace.info() << "sub(8,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 3, 7 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 3, 7 ) ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 13, 17 ); trace.info() << "sub(13,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 3, 7 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 3, 7 ) ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 14, 17 ); trace.info() << "sub(14,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 1, 2 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 1, 2 ) ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 15, 17 ); trace.info() << "sub(15,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 1, 2 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 1, 2 ) ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") covering left Subpatterns." << endl; @@ -209,27 +209,27 @@ bool testPattern() pat_odd.getSmallestCoveringSubpattern( sp, np, start, 0, 16 ); trace.info() << "sub(0,16) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 12 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 12 ) ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 0, 15 ); trace.info() << "sub(0,15) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 12 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 12 ) ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 0, 14 ); trace.info() << "sub(0,14) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 2 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 2 ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 0, 8 ); trace.info() << "sub(0,8) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 2 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 2 ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 0, 7 ); trace.info() << "sub(0,7) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 0, 1 ); trace.info() << "sub(0,1) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") covering right Subpatterns." << endl; @@ -237,35 +237,35 @@ bool testPattern() pat_odd.getSmallestCoveringSubpattern( sp, np, start, 1, 16 ); trace.info() << "sub(1,16) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 12 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 12 ) ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 2, 14 ); trace.info() << "sub(2,14) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 2 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 2 ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 7, 15 ); trace.info() << "sub(7,15) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 3, 7 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 3, 7 ) && np == 1 ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 7, 14 ); trace.info() << "sub(7,14) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 3, 6 ); trace.info() << "sub(3,6) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 6, 8 ); trace.info() << "sub(6,8) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 2 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 2 ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 8, 12 ); trace.info() << "sub(8,12) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 15, 16 ); trace.info() << "sub(15,16) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 1, 2 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 1, 2 ) && np == 1 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") covering middle Subpatterns." << endl; trace.endBlock(); @@ -279,73 +279,73 @@ bool testPattern() pat_even.getSmallestCoveringSubpattern( sp, np, start, 0, 29 ); trace.info() << "sub(0,29) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 12, 17 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 12, 17 ) ? 1 : 0; pat_even.getSmallestCoveringSubpattern( sp, np, start, 0, 25 ); trace.info() << "sub(0,25) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 12, 17 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 12, 17 ) ? 1 : 0; pat_even.getSmallestCoveringSubpattern( sp, np, start, 0, 17 ); trace.info() << "sub(0,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 7, 10 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 7, 10 ) ? 1 : 0; pat_even.getSmallestCoveringSubpattern( sp, np, start, 0, 6 ); trace.info() << "sub(0,6) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 7, 10 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 7, 10 ) ? 1 : 0; pat_even.getSmallestCoveringSubpattern( sp, np, start, 0, 5 ); trace.info() << "sub(0,5) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 3 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 3 ) ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") covering left Subpatterns." << endl; // Right Subpatterns pat_even.getSmallestCoveringSubpattern( sp, np, start, 4, 29 ); trace.info() << "sub(4,29) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 12, 17 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 12, 17 ) ? 1 : 0; pat_even.getSmallestCoveringSubpattern( sp, np, start, 5, 29 ); trace.info() << "sub(5,29) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 2 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 2 ? 1 : 0; pat_even.getSmallestCoveringSubpattern( sp, np, start, 16, 29 ); trace.info() << "sub(16,29) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 2 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 2 ? 1 : 0; pat_even.getSmallestCoveringSubpattern( sp, np, start, 17, 29 ); trace.info() << "sub(17,29) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") covering right Subpatterns." << endl; // Middle Subpatterns pat_even.getSmallestCoveringSubpattern( sp, np, start, 1, 27 ); trace.info() << "sub(1,27) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 12, 17 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 12, 17 ) ? 1 : 0; pat_even.getSmallestCoveringSubpattern( sp, np, start, 5, 24 ); trace.info() << "sub(5,24) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 2 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 2 ? 1 : 0; pat_even.getSmallestCoveringSubpattern( sp, np, start, 4, 17 ); trace.info() << "sub(4,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 7, 10 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 7, 10 ) && np == 1 ? 1 : 0; pat_even.getSmallestCoveringSubpattern( sp, np, start, 5, 17 ); trace.info() << "sub(5,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; pat_even.getSmallestCoveringSubpattern( sp, np, start, 7, 12 ); trace.info() << "sub(7,12) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; pat_even.getSmallestCoveringSubpattern( sp, np, start, 1, 4 ); trace.info() << "sub(1,4) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 3 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 3 ) && np == 1 ? 1 : 0; pat_even.getSmallestCoveringSubpattern( sp, np, start, 18, 25 ); trace.info() << "sub(18,20) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") covering middle Subpatterns." << endl; trace.endBlock(); @@ -359,31 +359,31 @@ bool testPattern() pat_odd.getGreatestIncludedSubpattern( sp, np, start, 0, 17 ); trace.info() << "sub(0,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 12 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 12 ) ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 1, 17 ); trace.info() << "sub(1,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 3, 7 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 3, 7 ) ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 7, 17 ); trace.info() << "sub(7,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 3, 7 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 3, 7 ) ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 8, 17 ); trace.info() << "sub(8,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 1, 2 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 1, 2 ) ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 13, 17 ); trace.info() << "sub(13,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 1, 2 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 1, 2 ) ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 14, 17 ); trace.info() << "sub(14,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 1, 2 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 1, 2 ) ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 15, 17 ); trace.info() << "sub(15,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == Fraction() ? 1 : 0; + ++nb; nbok += sp.slope() == Fraction() ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") covering left Subpatterns." << endl; @@ -391,27 +391,27 @@ bool testPattern() pat_odd.getGreatestIncludedSubpattern( sp, np, start, 0, 15 ); trace.info() << "sub(0,15) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 2 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 2 ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 0, 14 ); trace.info() << "sub(0,14) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 2 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 2 ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 0, 13 ); trace.info() << "sub(0,13) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 0, 7 ); trace.info() << "sub(0,7) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 0, 6 ); trace.info() << "sub(0,6) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == Fraction() ? 1 : 0; + ++nb; nbok += sp.slope() == Fraction() ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 0, 1 ); trace.info() << "sub(0,1) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == Fraction() ? 1 : 0; + ++nb; nbok += sp.slope() == Fraction() ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") covering right Subpatterns." << endl; @@ -419,35 +419,35 @@ bool testPattern() pat_odd.getGreatestIncludedSubpattern( sp, np, start, 1, 16 ); trace.info() << "sub(1,16) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 2, 14 ); trace.info() << "sub(2,14) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 7, 15 ); trace.info() << "sub(7,15) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 7, 14 ); trace.info() << "sub(7,14) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 3, 6 ); trace.info() << "sub(3,6) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == Fraction() ? 1 : 0; + ++nb; nbok += sp.slope() == Fraction() ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 6, 8 ); trace.info() << "sub(6,8) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == Fraction() ? 1 : 0; + ++nb; nbok += sp.slope() == Fraction() ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 8, 12 ); trace.info() << "sub(8,12) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == Fraction() ? 1 : 0; + ++nb; nbok += sp.slope() == Fraction() ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 15, 16 ); trace.info() << "sub(15,16) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == Fraction() ? 1 : 0; + ++nb; nbok += sp.slope() == Fraction() ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") covering middle Subpatterns." << endl; trace.endBlock(); @@ -460,85 +460,85 @@ bool testPattern() pat_even.getGreatestIncludedSubpattern( sp, np, start, 0, 29 ); trace.info() << "sub(0,29) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 12, 17 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 12, 17 ) ? 1 : 0; pat_even.getGreatestIncludedSubpattern( sp, np, start, 0, 25 ); trace.info() << "sub(0,25) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 7, 10 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 7, 10 ) ? 1 : 0; pat_even.getGreatestIncludedSubpattern( sp, np, start, 0, 17 ); trace.info() << "sub(0,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 7, 10 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 7, 10 ) ? 1 : 0; pat_even.getGreatestIncludedSubpattern( sp, np, start, 0, 16 ); trace.info() << "sub(0,16) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 3 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 3 ) ? 1 : 0; pat_even.getGreatestIncludedSubpattern( sp, np, start, 0, 6 ); trace.info() << "sub(0,6) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 3 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 3 ) ? 1 : 0; pat_even.getGreatestIncludedSubpattern( sp, np, start, 0, 5 ); trace.info() << "sub(0,5) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 3 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 3 ) ? 1 : 0; pat_even.getGreatestIncludedSubpattern( sp, np, start, 0, 4 ); trace.info() << "sub(0,4) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == Fraction() ? 1 : 0; + ++nb; nbok += sp.slope() == Fraction() ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") covering left Subpatterns." << endl; // Right Subpatterns pat_even.getGreatestIncludedSubpattern( sp, np, start, 4, 29 ); trace.info() << "sub(4,29) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 2 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 2 ? 1 : 0; pat_even.getGreatestIncludedSubpattern( sp, np, start, 5, 29 ); trace.info() << "sub(5,29) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 2 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 2 ? 1 : 0; pat_even.getGreatestIncludedSubpattern( sp, np, start, 16, 29 ); trace.info() << "sub(16,29) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; pat_even.getGreatestIncludedSubpattern( sp, np, start, 17, 29 ); trace.info() << "sub(17,29) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; pat_even.getGreatestIncludedSubpattern( sp, np, start, 18, 29 ); trace.info() << "sub(18,29) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == Fraction() ? 1 : 0; + ++nb; nbok += sp.slope() == Fraction() ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") covering right Subpatterns." << endl; // Middle Subpatterns pat_even.getGreatestIncludedSubpattern( sp, np, start, 1, 27 ); trace.info() << "sub(1,27) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; pat_even.getGreatestIncludedSubpattern( sp, np, start, 5, 24 ); trace.info() << "sub(5,24) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; pat_even.getGreatestIncludedSubpattern( sp, np, start, 4, 17 ); trace.info() << "sub(4,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; pat_even.getGreatestIncludedSubpattern( sp, np, start, 5, 17 ); trace.info() << "sub(5,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; pat_even.getGreatestIncludedSubpattern( sp, np, start, 7, 16 ); trace.info() << "sub(5,16) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == Fraction() ? 1 : 0; + ++nb; nbok += sp.slope() == Fraction() ? 1 : 0; pat_even.getGreatestIncludedSubpattern( sp, np, start, 1, 4 ); trace.info() << "sub(1,4) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == Fraction() ? 1 : 0; + ++nb; nbok += sp.slope() == Fraction() ? 1 : 0; pat_even.getGreatestIncludedSubpattern( sp, np, start, 18, 25 ); trace.info() << "sub(18,20) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == Fraction() ? 1 : 0; + ++nb; nbok += sp.slope() == Fraction() ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") covering middle Subpatterns." << endl; trace.endBlock(); @@ -577,20 +577,20 @@ bool testStandardDSLQ0() Point L = D1.L(); trace.info() << "- U=" << U << " r(U)=" << D1.r( U ) << ", L=" << L << " r(L)=" << D1.r( L ) << endl; - ++nb, nbok += D1.r( U ) == D1.mu() ? 1 : 0; - ++nb, nbok += D1.r( L ) == D1.mup() ? 1 : 0; + ++nb; nbok += D1.r( U ) == D1.mu() ? 1 : 0; + ++nb; nbok += D1.r( L ) == D1.mup() ? 1 : 0; } DSL D2( 12, 17, 5 ); for ( Integer x = -5; x < 30; ++x ) { Point P = D2.lowestY( x ); - ++nb, nbok += D2( P ) && ( ! D2( P - Vector2I(0,1) ) ) ? 1 : 0; + ++nb; nbok += D2( P ) && ( ! D2( P - Vector2I(0,1) ) ) ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "D2(P) && ! D2(P-y) P=" << P << " r(P)=" << D2.r( P ) << endl; P = D2.uppermostY( x ); - ++nb, nbok += D2( P ) && ( ! D2( P + Vector2I(0,1) ) ) ? 1 : 0; + ++nb; nbok += D2( P ) && ( ! D2( P + Vector2I(0,1) ) ) ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "D2(P) && ! D2(P+y) P=" << P << " r(P)=" << D2.r( P ) << endl; @@ -598,12 +598,12 @@ bool testStandardDSLQ0() for ( Integer y = -5; y < 30; ++y ) { Point P = D2.lowestX( y ); - ++nb, nbok += D2( P ) && ( ! D2( P - Vector2I(1,0) ) ) ? 1 : 0; + ++nb; nbok += D2( P ) && ( ! D2( P - Vector2I(1,0) ) ) ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "D2(P) && ! D2(P-x) P=" << P << " r(P)=" << D2.r( P ) << endl; P = D2.uppermostX( y ); - ++nb, nbok += D2( P ) && ( ! D2( P + Vector2I(1,0) ) ) ? 1 : 0; + ++nb; nbok += D2( P ) && ( ! D2( P + Vector2I(1,0) ) ) ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "D2(P) && ! D2(P+x) P=" << P << " r(P)=" << D2.r( P ) << endl; @@ -678,7 +678,7 @@ bool testSubStandardDSLQ0() Integer x2 = x1 + 1 + ( rand() % 1000 ); Point A = D.lowestY( x1 ); Point B = D.lowestY( x2 ); - ++nb, nbok += checkSubStandardDSLQ0( D, A, B ) ? 1 : 0; + ++nb; nbok += checkSubStandardDSLQ0( D, A, B ) ? 1 : 0; if ( nb != nbok ) trace.info() << "(" << nbok << "/" << nb << ") correct reversedSmartDSS." << std::endl; diff --git a/tests/arithmetic/testLighterSternBrocot.cpp b/tests/arithmetic/testLighterSternBrocot.cpp index 4130fecd77..ba7731c450 100644 --- a/tests/arithmetic/testLighterSternBrocot.cpp +++ b/tests/arithmetic/testLighterSternBrocot.cpp @@ -99,7 +99,7 @@ bool testReducedFraction() trace.info() << " - f1 = "; SB::display( trace.info(), f1 ); trace.info() << std::endl; - ++nb, nbok += ok ? 1 : 0; + ++nb; nbok += ok ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << " cfrac" << std::endl; @@ -111,7 +111,7 @@ bool testReducedFraction() fr.getCFrac( cf1_red ); cf1.resize( depth - k ); ok = equalCFrac( cf1, cf1_red ); - ++nb, nbok += ok ? 1 : 0; + ++nb; nbok += ok ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "reduced(" << k << ")="; SB::display( trace.info(), fr ); @@ -180,31 +180,31 @@ bool testPattern() pat_odd.getSmallestCoveringSubpattern( sp, np, start, 0, 17 ); trace.info() << "sub(0,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 12 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 12 ) ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 1, 17 ); trace.info() << "sub(1,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 12 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 12 ) ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 7, 17 ); trace.info() << "sub(7,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 3, 7 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 3, 7 ) ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 8, 17 ); trace.info() << "sub(8,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 3, 7 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 3, 7 ) ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 13, 17 ); trace.info() << "sub(13,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 3, 7 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 3, 7 ) ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 14, 17 ); trace.info() << "sub(14,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 1, 2 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 1, 2 ) ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 15, 17 ); trace.info() << "sub(15,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 1, 2 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 1, 2 ) ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") covering left Subpatterns." << endl; @@ -212,27 +212,27 @@ bool testPattern() pat_odd.getSmallestCoveringSubpattern( sp, np, start, 0, 16 ); trace.info() << "sub(0,16) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 12 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 12 ) ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 0, 15 ); trace.info() << "sub(0,15) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 12 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 12 ) ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 0, 14 ); trace.info() << "sub(0,14) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 2 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 2 ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 0, 8 ); trace.info() << "sub(0,8) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 2 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 2 ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 0, 7 ); trace.info() << "sub(0,7) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 0, 1 ); trace.info() << "sub(0,1) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") covering right Subpatterns." << endl; @@ -240,35 +240,35 @@ bool testPattern() pat_odd.getSmallestCoveringSubpattern( sp, np, start, 1, 16 ); trace.info() << "sub(1,16) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 12 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 12 ) ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 2, 14 ); trace.info() << "sub(2,14) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 2 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 2 ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 7, 15 ); trace.info() << "sub(7,15) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 3, 7 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 3, 7 ) && np == 1 ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 7, 14 ); trace.info() << "sub(7,14) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 3, 6 ); trace.info() << "sub(3,6) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 6, 8 ); trace.info() << "sub(6,8) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 2 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 2 ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 8, 12 ); trace.info() << "sub(8,12) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 15, 16 ); trace.info() << "sub(15,16) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 1, 2 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 1, 2 ) && np == 1 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") covering middle Subpatterns." << endl; trace.endBlock(); @@ -282,73 +282,73 @@ bool testPattern() pat_even.getSmallestCoveringSubpattern( sp, np, start, 0, 29 ); trace.info() << "sub(0,29) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 12, 17 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 12, 17 ) ? 1 : 0; pat_even.getSmallestCoveringSubpattern( sp, np, start, 0, 25 ); trace.info() << "sub(0,25) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 12, 17 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 12, 17 ) ? 1 : 0; pat_even.getSmallestCoveringSubpattern( sp, np, start, 0, 17 ); trace.info() << "sub(0,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 7, 10 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 7, 10 ) ? 1 : 0; pat_even.getSmallestCoveringSubpattern( sp, np, start, 0, 6 ); trace.info() << "sub(0,6) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 7, 10 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 7, 10 ) ? 1 : 0; pat_even.getSmallestCoveringSubpattern( sp, np, start, 0, 5 ); trace.info() << "sub(0,5) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 3 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 3 ) ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") covering left Subpatterns." << endl; // Right Subpatterns pat_even.getSmallestCoveringSubpattern( sp, np, start, 4, 29 ); trace.info() << "sub(4,29) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 12, 17 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 12, 17 ) ? 1 : 0; pat_even.getSmallestCoveringSubpattern( sp, np, start, 5, 29 ); trace.info() << "sub(5,29) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 2 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 2 ? 1 : 0; pat_even.getSmallestCoveringSubpattern( sp, np, start, 16, 29 ); trace.info() << "sub(16,29) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 2 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 2 ? 1 : 0; pat_even.getSmallestCoveringSubpattern( sp, np, start, 17, 29 ); trace.info() << "sub(17,29) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") covering right Subpatterns." << endl; // Middle Subpatterns pat_even.getSmallestCoveringSubpattern( sp, np, start, 1, 27 ); trace.info() << "sub(1,27) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 12, 17 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 12, 17 ) ? 1 : 0; pat_even.getSmallestCoveringSubpattern( sp, np, start, 5, 24 ); trace.info() << "sub(5,24) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 2 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 2 ? 1 : 0; pat_even.getSmallestCoveringSubpattern( sp, np, start, 4, 17 ); trace.info() << "sub(4,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 7, 10 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 7, 10 ) && np == 1 ? 1 : 0; pat_even.getSmallestCoveringSubpattern( sp, np, start, 5, 17 ); trace.info() << "sub(5,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; pat_even.getSmallestCoveringSubpattern( sp, np, start, 7, 12 ); trace.info() << "sub(7,12) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; pat_even.getSmallestCoveringSubpattern( sp, np, start, 1, 4 ); trace.info() << "sub(1,4) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 3 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 3 ) && np == 1 ? 1 : 0; pat_even.getSmallestCoveringSubpattern( sp, np, start, 18, 25 ); trace.info() << "sub(18,20) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") covering middle Subpatterns." << endl; trace.endBlock(); @@ -362,31 +362,31 @@ bool testPattern() pat_odd.getGreatestIncludedSubpattern( sp, np, start, 0, 17 ); trace.info() << "sub(0,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 12 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 12 ) ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 1, 17 ); trace.info() << "sub(1,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 3, 7 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 3, 7 ) ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 7, 17 ); trace.info() << "sub(7,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 3, 7 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 3, 7 ) ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 8, 17 ); trace.info() << "sub(8,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 1, 2 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 1, 2 ) ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 13, 17 ); trace.info() << "sub(13,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 1, 2 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 1, 2 ) ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 14, 17 ); trace.info() << "sub(14,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 1, 2 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 1, 2 ) ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 15, 17 ); trace.info() << "sub(15,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == Fraction() ? 1 : 0; + ++nb; nbok += sp.slope() == Fraction() ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") covering left Subpatterns." << endl; @@ -394,27 +394,27 @@ bool testPattern() pat_odd.getGreatestIncludedSubpattern( sp, np, start, 0, 15 ); trace.info() << "sub(0,15) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 2 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 2 ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 0, 14 ); trace.info() << "sub(0,14) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 2 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 2 ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 0, 13 ); trace.info() << "sub(0,13) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 0, 7 ); trace.info() << "sub(0,7) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 0, 6 ); trace.info() << "sub(0,6) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == Fraction() ? 1 : 0; + ++nb; nbok += sp.slope() == Fraction() ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 0, 1 ); trace.info() << "sub(0,1) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == Fraction() ? 1 : 0; + ++nb; nbok += sp.slope() == Fraction() ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") covering right Subpatterns." << endl; @@ -422,35 +422,35 @@ bool testPattern() pat_odd.getGreatestIncludedSubpattern( sp, np, start, 1, 16 ); trace.info() << "sub(1,16) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 2, 14 ); trace.info() << "sub(2,14) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 7, 15 ); trace.info() << "sub(7,15) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 7, 14 ); trace.info() << "sub(7,14) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 3, 6 ); trace.info() << "sub(3,6) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == Fraction() ? 1 : 0; + ++nb; nbok += sp.slope() == Fraction() ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 6, 8 ); trace.info() << "sub(6,8) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == Fraction() ? 1 : 0; + ++nb; nbok += sp.slope() == Fraction() ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 8, 12 ); trace.info() << "sub(8,12) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == Fraction() ? 1 : 0; + ++nb; nbok += sp.slope() == Fraction() ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 15, 16 ); trace.info() << "sub(15,16) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == Fraction() ? 1 : 0; + ++nb; nbok += sp.slope() == Fraction() ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") covering middle Subpatterns." << endl; trace.endBlock(); @@ -463,85 +463,85 @@ bool testPattern() pat_even.getGreatestIncludedSubpattern( sp, np, start, 0, 29 ); trace.info() << "sub(0,29) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 12, 17 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 12, 17 ) ? 1 : 0; pat_even.getGreatestIncludedSubpattern( sp, np, start, 0, 25 ); trace.info() << "sub(0,25) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 7, 10 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 7, 10 ) ? 1 : 0; pat_even.getGreatestIncludedSubpattern( sp, np, start, 0, 17 ); trace.info() << "sub(0,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 7, 10 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 7, 10 ) ? 1 : 0; pat_even.getGreatestIncludedSubpattern( sp, np, start, 0, 16 ); trace.info() << "sub(0,16) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 3 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 3 ) ? 1 : 0; pat_even.getGreatestIncludedSubpattern( sp, np, start, 0, 6 ); trace.info() << "sub(0,6) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 3 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 3 ) ? 1 : 0; pat_even.getGreatestIncludedSubpattern( sp, np, start, 0, 5 ); trace.info() << "sub(0,5) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 3 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 3 ) ? 1 : 0; pat_even.getGreatestIncludedSubpattern( sp, np, start, 0, 4 ); trace.info() << "sub(0,4) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == Fraction() ? 1 : 0; + ++nb; nbok += sp.slope() == Fraction() ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") covering left Subpatterns." << endl; // Right Subpatterns pat_even.getGreatestIncludedSubpattern( sp, np, start, 4, 29 ); trace.info() << "sub(4,29) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 2 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 2 ? 1 : 0; pat_even.getGreatestIncludedSubpattern( sp, np, start, 5, 29 ); trace.info() << "sub(5,29) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 2 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 2 ? 1 : 0; pat_even.getGreatestIncludedSubpattern( sp, np, start, 16, 29 ); trace.info() << "sub(16,29) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; pat_even.getGreatestIncludedSubpattern( sp, np, start, 17, 29 ); trace.info() << "sub(17,29) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; pat_even.getGreatestIncludedSubpattern( sp, np, start, 18, 29 ); trace.info() << "sub(18,29) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == Fraction() ? 1 : 0; + ++nb; nbok += sp.slope() == Fraction() ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") covering right Subpatterns." << endl; // Middle Subpatterns pat_even.getGreatestIncludedSubpattern( sp, np, start, 1, 27 ); trace.info() << "sub(1,27) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; pat_even.getGreatestIncludedSubpattern( sp, np, start, 5, 24 ); trace.info() << "sub(5,24) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; pat_even.getGreatestIncludedSubpattern( sp, np, start, 4, 17 ); trace.info() << "sub(4,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; pat_even.getGreatestIncludedSubpattern( sp, np, start, 5, 17 ); trace.info() << "sub(5,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; pat_even.getGreatestIncludedSubpattern( sp, np, start, 7, 16 ); trace.info() << "sub(5,16) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == Fraction() ? 1 : 0; + ++nb; nbok += sp.slope() == Fraction() ? 1 : 0; pat_even.getGreatestIncludedSubpattern( sp, np, start, 1, 4 ); trace.info() << "sub(1,4) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == Fraction() ? 1 : 0; + ++nb; nbok += sp.slope() == Fraction() ? 1 : 0; pat_even.getGreatestIncludedSubpattern( sp, np, start, 18, 25 ); trace.info() << "sub(18,20) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == Fraction() ? 1 : 0; + ++nb; nbok += sp.slope() == Fraction() ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") covering middle Subpatterns." << endl; trace.endBlock(); @@ -580,20 +580,20 @@ bool testStandardDSLQ0() Point L = D1.L(); trace.info() << "- U=" << U << " r(U)=" << D1.r( U ) << ", L=" << L << " r(L)=" << D1.r( L ) << endl; - ++nb, nbok += D1.r( U ) == D1.mu() ? 1 : 0; - ++nb, nbok += D1.r( L ) == D1.mup() ? 1 : 0; + ++nb; nbok += D1.r( U ) == D1.mu() ? 1 : 0; + ++nb; nbok += D1.r( L ) == D1.mup() ? 1 : 0; } DSL D2( 12, 17, 5 ); for ( Integer x = -5; x < 30; ++x ) { Point P = D2.lowestY( x ); - ++nb, nbok += D2( P ) && ( ! D2( P - Vector2I(0,1) ) ) ? 1 : 0; + ++nb; nbok += D2( P ) && ( ! D2( P - Vector2I(0,1) ) ) ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "D2(P) && ! D2(P-y) P=" << P << " r(P)=" << D2.r( P ) << endl; P = D2.uppermostY( x ); - ++nb, nbok += D2( P ) && ( ! D2( P + Vector2I(0,1) ) ) ? 1 : 0; + ++nb; nbok += D2( P ) && ( ! D2( P + Vector2I(0,1) ) ) ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "D2(P) && ! D2(P+y) P=" << P << " r(P)=" << D2.r( P ) << endl; @@ -601,12 +601,12 @@ bool testStandardDSLQ0() for ( Integer y = -5; y < 30; ++y ) { Point P = D2.lowestX( y ); - ++nb, nbok += D2( P ) && ( ! D2( P - Vector2I(1,0) ) ) ? 1 : 0; + ++nb; nbok += D2( P ) && ( ! D2( P - Vector2I(1,0) ) ) ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "D2(P) && ! D2(P-x) P=" << P << " r(P)=" << D2.r( P ) << endl; P = D2.uppermostX( y ); - ++nb, nbok += D2( P ) && ( ! D2( P + Vector2I(1,0) ) ) ? 1 : 0; + ++nb; nbok += D2( P ) && ( ! D2( P + Vector2I(1,0) ) ) ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "D2(P) && ! D2(P+x) P=" << P << " r(P)=" << D2.r( P ) << endl; @@ -680,7 +680,7 @@ bool testSubStandardDSLQ0() Integer x2 = x1 + 1 + ( rand() % 1000 ); Point A = D.lowestY( x1 ); Point B = D.lowestY( x2 ); - ++nb, nbok += checkSubStandardDSLQ0( D, A, B ) ? 1 : 0; + ++nb; nbok += checkSubStandardDSLQ0( D, A, B ) ? 1 : 0; if ( nb != nbok ) trace.info() << "(" << nbok << "/" << nb << ") correct reversedSmartDSS." << std::endl; @@ -778,7 +778,7 @@ bool testContinuedFractions() trace.beginBlock ( "Testing block: continued fraction." ); for ( unsigned int i = 0; i < nbtests; ++i ) { - ++nb, nbok += testContinuedFraction() ? 1 : 0; + ++nb; nbok += testContinuedFraction() ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ")" << " continued fractions." << std::endl; } diff --git a/tests/arithmetic/testModuloComputer.cpp b/tests/arithmetic/testModuloComputer.cpp index 5b2aab8afd..829ee4b3a0 100644 --- a/tests/arithmetic/testModuloComputer.cpp +++ b/tests/arithmetic/testModuloComputer.cpp @@ -74,7 +74,7 @@ bool testModuloComputer() nb++; trace.info() << "a= "<( cf1, cf1_red ); - ++nb, nbok += ok ? 1 : 0; + ++nb; nbok += ok ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "reduced(" << k << ")="; SB::display( trace.info(), fr ); @@ -176,31 +176,31 @@ bool testPattern() pat_odd.getSmallestCoveringSubpattern( sp, np, start, 0, 17 ); trace.info() << "sub(0,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 12 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 12 ) ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 1, 17 ); trace.info() << "sub(1,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 12 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 12 ) ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 7, 17 ); trace.info() << "sub(7,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 3, 7 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 3, 7 ) ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 8, 17 ); trace.info() << "sub(8,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 3, 7 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 3, 7 ) ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 13, 17 ); trace.info() << "sub(13,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 3, 7 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 3, 7 ) ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 14, 17 ); trace.info() << "sub(14,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 1, 2 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 1, 2 ) ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 15, 17 ); trace.info() << "sub(15,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 1, 2 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 1, 2 ) ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") covering left Subpatterns." << endl; @@ -208,27 +208,27 @@ bool testPattern() pat_odd.getSmallestCoveringSubpattern( sp, np, start, 0, 16 ); trace.info() << "sub(0,16) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 12 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 12 ) ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 0, 15 ); trace.info() << "sub(0,15) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 12 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 12 ) ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 0, 14 ); trace.info() << "sub(0,14) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 2 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 2 ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 0, 8 ); trace.info() << "sub(0,8) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 2 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 2 ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 0, 7 ); trace.info() << "sub(0,7) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 0, 1 ); trace.info() << "sub(0,1) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") covering right Subpatterns." << endl; @@ -236,35 +236,35 @@ bool testPattern() pat_odd.getSmallestCoveringSubpattern( sp, np, start, 1, 16 ); trace.info() << "sub(1,16) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 12 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 12 ) ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 2, 14 ); trace.info() << "sub(2,14) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 2 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 2 ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 7, 15 ); trace.info() << "sub(7,15) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 3, 7 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 3, 7 ) && np == 1 ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 7, 14 ); trace.info() << "sub(7,14) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 3, 6 ); trace.info() << "sub(3,6) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 6, 8 ); trace.info() << "sub(6,8) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 2 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 2 ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 8, 12 ); trace.info() << "sub(8,12) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; pat_odd.getSmallestCoveringSubpattern( sp, np, start, 15, 16 ); trace.info() << "sub(15,16) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 1, 2 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 1, 2 ) && np == 1 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") covering middle Subpatterns." << endl; trace.endBlock(); @@ -278,73 +278,73 @@ bool testPattern() pat_even.getSmallestCoveringSubpattern( sp, np, start, 0, 29 ); trace.info() << "sub(0,29) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 12, 17 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 12, 17 ) ? 1 : 0; pat_even.getSmallestCoveringSubpattern( sp, np, start, 0, 25 ); trace.info() << "sub(0,25) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 12, 17 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 12, 17 ) ? 1 : 0; pat_even.getSmallestCoveringSubpattern( sp, np, start, 0, 17 ); trace.info() << "sub(0,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 7, 10 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 7, 10 ) ? 1 : 0; pat_even.getSmallestCoveringSubpattern( sp, np, start, 0, 6 ); trace.info() << "sub(0,6) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 7, 10 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 7, 10 ) ? 1 : 0; pat_even.getSmallestCoveringSubpattern( sp, np, start, 0, 5 ); trace.info() << "sub(0,5) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 3 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 3 ) ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") covering left Subpatterns." << endl; // Right Subpatterns pat_even.getSmallestCoveringSubpattern( sp, np, start, 4, 29 ); trace.info() << "sub(4,29) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 12, 17 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 12, 17 ) ? 1 : 0; pat_even.getSmallestCoveringSubpattern( sp, np, start, 5, 29 ); trace.info() << "sub(5,29) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 2 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 2 ? 1 : 0; pat_even.getSmallestCoveringSubpattern( sp, np, start, 16, 29 ); trace.info() << "sub(16,29) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 2 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 2 ? 1 : 0; pat_even.getSmallestCoveringSubpattern( sp, np, start, 17, 29 ); trace.info() << "sub(17,29) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") covering right Subpatterns." << endl; // Middle Subpatterns pat_even.getSmallestCoveringSubpattern( sp, np, start, 1, 27 ); trace.info() << "sub(1,27) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 12, 17 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 12, 17 ) ? 1 : 0; pat_even.getSmallestCoveringSubpattern( sp, np, start, 5, 24 ); trace.info() << "sub(5,24) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 2 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 2 ? 1 : 0; pat_even.getSmallestCoveringSubpattern( sp, np, start, 4, 17 ); trace.info() << "sub(4,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 7, 10 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 7, 10 ) && np == 1 ? 1 : 0; pat_even.getSmallestCoveringSubpattern( sp, np, start, 5, 17 ); trace.info() << "sub(5,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; pat_even.getSmallestCoveringSubpattern( sp, np, start, 7, 12 ); trace.info() << "sub(7,12) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; pat_even.getSmallestCoveringSubpattern( sp, np, start, 1, 4 ); trace.info() << "sub(1,4) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 3 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 3 ) && np == 1 ? 1 : 0; pat_even.getSmallestCoveringSubpattern( sp, np, start, 18, 25 ); trace.info() << "sub(18,20) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") covering middle Subpatterns." << endl; trace.endBlock(); @@ -358,31 +358,31 @@ bool testPattern() pat_odd.getGreatestIncludedSubpattern( sp, np, start, 0, 17 ); trace.info() << "sub(0,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 12 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 12 ) ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 1, 17 ); trace.info() << "sub(1,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 3, 7 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 3, 7 ) ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 7, 17 ); trace.info() << "sub(7,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 3, 7 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 3, 7 ) ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 8, 17 ); trace.info() << "sub(8,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 1, 2 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 1, 2 ) ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 13, 17 ); trace.info() << "sub(13,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 1, 2 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 1, 2 ) ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 14, 17 ); trace.info() << "sub(14,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 1, 2 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 1, 2 ) ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 15, 17 ); trace.info() << "sub(15,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == Fraction() ? 1 : 0; + ++nb; nbok += sp.slope() == Fraction() ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") covering left Subpatterns." << endl; @@ -390,27 +390,27 @@ bool testPattern() pat_odd.getGreatestIncludedSubpattern( sp, np, start, 0, 15 ); trace.info() << "sub(0,15) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 2 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 2 ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 0, 14 ); trace.info() << "sub(0,14) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 2 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 2 ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 0, 13 ); trace.info() << "sub(0,13) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 0, 7 ); trace.info() << "sub(0,7) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 0, 6 ); trace.info() << "sub(0,6) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == Fraction() ? 1 : 0; + ++nb; nbok += sp.slope() == Fraction() ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 0, 1 ); trace.info() << "sub(0,1) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == Fraction() ? 1 : 0; + ++nb; nbok += sp.slope() == Fraction() ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") covering right Subpatterns." << endl; @@ -418,35 +418,35 @@ bool testPattern() pat_odd.getGreatestIncludedSubpattern( sp, np, start, 1, 16 ); trace.info() << "sub(1,16) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 2, 14 ); trace.info() << "sub(2,14) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 7, 15 ); trace.info() << "sub(7,15) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 7, 14 ); trace.info() << "sub(7,14) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 5 ) && np == 1 ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 3, 6 ); trace.info() << "sub(3,6) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == Fraction() ? 1 : 0; + ++nb; nbok += sp.slope() == Fraction() ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 6, 8 ); trace.info() << "sub(6,8) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == Fraction() ? 1 : 0; + ++nb; nbok += sp.slope() == Fraction() ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 8, 12 ); trace.info() << "sub(8,12) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == Fraction() ? 1 : 0; + ++nb; nbok += sp.slope() == Fraction() ? 1 : 0; pat_odd.getGreatestIncludedSubpattern( sp, np, start, 15, 16 ); trace.info() << "sub(15,16) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == Fraction() ? 1 : 0; + ++nb; nbok += sp.slope() == Fraction() ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") covering middle Subpatterns." << endl; trace.endBlock(); @@ -459,85 +459,85 @@ bool testPattern() pat_even.getGreatestIncludedSubpattern( sp, np, start, 0, 29 ); trace.info() << "sub(0,29) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 12, 17 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 12, 17 ) ? 1 : 0; pat_even.getGreatestIncludedSubpattern( sp, np, start, 0, 25 ); trace.info() << "sub(0,25) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 7, 10 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 7, 10 ) ? 1 : 0; pat_even.getGreatestIncludedSubpattern( sp, np, start, 0, 17 ); trace.info() << "sub(0,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 7, 10 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 7, 10 ) ? 1 : 0; pat_even.getGreatestIncludedSubpattern( sp, np, start, 0, 16 ); trace.info() << "sub(0,16) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 3 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 3 ) ? 1 : 0; pat_even.getGreatestIncludedSubpattern( sp, np, start, 0, 6 ); trace.info() << "sub(0,6) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 3 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 3 ) ? 1 : 0; pat_even.getGreatestIncludedSubpattern( sp, np, start, 0, 5 ); trace.info() << "sub(0,5) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 2, 3 ) ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 2, 3 ) ? 1 : 0; pat_even.getGreatestIncludedSubpattern( sp, np, start, 0, 4 ); trace.info() << "sub(0,4) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == Fraction() ? 1 : 0; + ++nb; nbok += sp.slope() == Fraction() ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") covering left Subpatterns." << endl; // Right Subpatterns pat_even.getGreatestIncludedSubpattern( sp, np, start, 4, 29 ); trace.info() << "sub(4,29) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 2 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 2 ? 1 : 0; pat_even.getGreatestIncludedSubpattern( sp, np, start, 5, 29 ); trace.info() << "sub(5,29) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 2 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 2 ? 1 : 0; pat_even.getGreatestIncludedSubpattern( sp, np, start, 16, 29 ); trace.info() << "sub(16,29) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; pat_even.getGreatestIncludedSubpattern( sp, np, start, 17, 29 ); trace.info() << "sub(17,29) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; pat_even.getGreatestIncludedSubpattern( sp, np, start, 18, 29 ); trace.info() << "sub(18,29) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == Fraction() ? 1 : 0; + ++nb; nbok += sp.slope() == Fraction() ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") covering right Subpatterns." << endl; // Middle Subpatterns pat_even.getGreatestIncludedSubpattern( sp, np, start, 1, 27 ); trace.info() << "sub(1,27) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; pat_even.getGreatestIncludedSubpattern( sp, np, start, 5, 24 ); trace.info() << "sub(5,24) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; pat_even.getGreatestIncludedSubpattern( sp, np, start, 4, 17 ); trace.info() << "sub(4,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; pat_even.getGreatestIncludedSubpattern( sp, np, start, 5, 17 ); trace.info() << "sub(5,17) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; + ++nb; nbok += sp.slope() == SB::fraction( 5, 7 ) && np == 1 ? 1 : 0; pat_even.getGreatestIncludedSubpattern( sp, np, start, 7, 16 ); trace.info() << "sub(5,16) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == Fraction() ? 1 : 0; + ++nb; nbok += sp.slope() == Fraction() ? 1 : 0; pat_even.getGreatestIncludedSubpattern( sp, np, start, 1, 4 ); trace.info() << "sub(1,4) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == Fraction() ? 1 : 0; + ++nb; nbok += sp.slope() == Fraction() ? 1 : 0; pat_even.getGreatestIncludedSubpattern( sp, np, start, 18, 25 ); trace.info() << "sub(18,20) = " << sp << " " << sp.rE() << "^" << np << endl; - ++nb, nbok += sp.slope() == Fraction() ? 1 : 0; + ++nb; nbok += sp.slope() == Fraction() ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") covering middle Subpatterns." << endl; trace.endBlock(); @@ -576,20 +576,20 @@ bool testStandardDSLQ0() Point L = D1.L(); trace.info() << "- U=" << U << " r(U)=" << D1.r( U ) << ", L=" << L << " r(L)=" << D1.r( L ) << endl; - ++nb, nbok += D1.r( U ) == D1.mu() ? 1 : 0; - ++nb, nbok += D1.r( L ) == D1.mup() ? 1 : 0; + ++nb; nbok += D1.r( U ) == D1.mu() ? 1 : 0; + ++nb; nbok += D1.r( L ) == D1.mup() ? 1 : 0; } DSL D2( 12, 17, 5 ); for ( Integer x = -5; x < 30; ++x ) { Point P = D2.lowestY( x ); - ++nb, nbok += D2( P ) && ( ! D2( P - Vector2I(0,1) ) ) ? 1 : 0; + ++nb; nbok += D2( P ) && ( ! D2( P - Vector2I(0,1) ) ) ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "D2(P) && ! D2(P-y) P=" << P << " r(P)=" << D2.r( P ) << endl; P = D2.uppermostY( x ); - ++nb, nbok += D2( P ) && ( ! D2( P + Vector2I(0,1) ) ) ? 1 : 0; + ++nb; nbok += D2( P ) && ( ! D2( P + Vector2I(0,1) ) ) ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "D2(P) && ! D2(P+y) P=" << P << " r(P)=" << D2.r( P ) << endl; @@ -597,12 +597,12 @@ bool testStandardDSLQ0() for ( Integer y = -5; y < 30; ++y ) { Point P = D2.lowestX( y ); - ++nb, nbok += D2( P ) && ( ! D2( P - Vector2I(1,0) ) ) ? 1 : 0; + ++nb; nbok += D2( P ) && ( ! D2( P - Vector2I(1,0) ) ) ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "D2(P) && ! D2(P-x) P=" << P << " r(P)=" << D2.r( P ) << endl; P = D2.uppermostX( y ); - ++nb, nbok += D2( P ) && ( ! D2( P + Vector2I(1,0) ) ) ? 1 : 0; + ++nb; nbok += D2( P ) && ( ! D2( P + Vector2I(1,0) ) ) ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "D2(P) && ! D2(P+x) P=" << P << " r(P)=" << D2.r( P ) << endl; @@ -676,7 +676,7 @@ bool testSubStandardDSLQ0() Integer x2 = x1 + 1 + ( rand() % 1000 ); Point A = D.lowestY( x1 ); Point B = D.lowestY( x2 ); - ++nb, nbok += checkSubStandardDSLQ0( D, A, B ) ? 1 : 0; + ++nb; nbok += checkSubStandardDSLQ0( D, A, B ) ? 1 : 0; if ( nb != nbok ) trace.info() << "(" << nbok << "/" << nb << ") correct reversedSmartDSS." << std::endl; @@ -773,7 +773,7 @@ bool testContinuedFractions() trace.beginBlock ( "Testing block: continued fraction." ); for ( unsigned int i = 0; i < nbtests; ++i ) { - ++nb, nbok += testContinuedFraction() ? 1 : 0; + ++nb; nbok += testContinuedFraction() ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ")" << " continued fractions." << std::endl; } @@ -819,40 +819,40 @@ testSimplestFractionInBetween() trace.beginBlock("Testing block: simplest fraction between two fractions"); // When the two fractions are not ancestors of one other f = Fraction(1,5); g = Fraction(3,4); - ++nb, nbok += f.simplestFractionInBetween(g) == Fraction(1,2) ? 1 : 0; + ++nb; nbok += f.simplestFractionInBetween(g) == Fraction(1,2) ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ")" << std::endl; f = Fraction(4,7); g = Fraction(5,7); - ++nb, nbok += f.simplestFractionInBetween(g) == Fraction(2,3) ? 1 : 0; + ++nb; nbok += f.simplestFractionInBetween(g) == Fraction(2,3) ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ")" << std::endl; f = Fraction(3,8); g = Fraction(7,4); - ++nb, nbok += f.simplestFractionInBetween(g) == Fraction(1,1) ? 1 : 0; + ++nb; nbok += f.simplestFractionInBetween(g) == Fraction(1,1) ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ")" << std::endl; f = Fraction(11,7); g = Fraction(7,4); - ++nb, nbok += f.simplestFractionInBetween(g) == Fraction(5,3) ? 1 : 0; + ++nb; nbok += f.simplestFractionInBetween(g) == Fraction(5,3) ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ")" << std::endl; f = Fraction(8,13); g = Fraction(7,11); - ++nb, nbok += f.simplestFractionInBetween(g) == Fraction(5,8) ? 1 : 0; + ++nb; nbok += f.simplestFractionInBetween(g) == Fraction(5,8) ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ")" << std::endl; // When f is an ancestor of g or conversely f = Fraction(2,5); g = Fraction(4,9); - ++nb, nbok += f.simplestFractionInBetween(g) == Fraction(3,7) ? 1 : 0; + ++nb; nbok += f.simplestFractionInBetween(g) == Fraction(3,7) ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ")" << std::endl; f = Fraction(2,3); g = Fraction(8,11); - ++nb, nbok += f.simplestFractionInBetween(g) == Fraction(5,7) ? 1 : 0; + ++nb; nbok += f.simplestFractionInBetween(g) == Fraction(5,7) ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ")" << std::endl; f = Fraction(1,2); g = Fraction(5,9); - ++nb, nbok += f.simplestFractionInBetween(g) == Fraction(6,11) ? 1 : 0; + ++nb; nbok += f.simplestFractionInBetween(g) == Fraction(6,11) ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ")" << std::endl; f = Fraction(5,9); g = Fraction(2,3); - ++nb, nbok += f.simplestFractionInBetween(g) == Fraction(3,5) ? 1 : 0; + ++nb; nbok += f.simplestFractionInBetween(g) == Fraction(3,5) ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ")" << std::endl; trace.endBlock(); diff --git a/tests/base/testBits.cpp b/tests/base/testBits.cpp index 0380ac8e61..539874789a 100644 --- a/tests/base/testBits.cpp +++ b/tests/base/testBits.cpp @@ -57,24 +57,26 @@ int main() { unsigned int nb = 0; unsigned int nbok = 0; - ++nb, nbok += Bits::nbSetBits( (DGtal::uint8_t)-1) == 8 ? 1 : 0; - ++nb, nbok += Bits::nbSetBits( (DGtal::uint16_t)-1) == 16 ? 1 : 0; - ++nb, nbok += Bits::nbSetBits( (DGtal::uint32_t)-1) == 32 ? 1 : 0; - ++nb, nbok += Bits::nbSetBits( (DGtal::uint64_t)-1) == 64 ? 1 : 0; - ++nb, nbok += Bits::nbSetBits( (DGtal::uint8_t)1) == 1 ? 1 : 0; - ++nb, nbok += Bits::nbSetBits( (DGtal::uint16_t)1) == 1 ? 1 : 0; - ++nb, nbok += Bits::nbSetBits( (DGtal::uint32_t)1) == 1 ? 1 : 0; - ++nb, nbok += Bits::nbSetBits( (DGtal::uint64_t)1) == 1 ? 1 : 0; - ++nb, nbok += Bits::nbSetBits( (DGtal::uint8_t)-2) == 7 ? 1 : 0; - ++nb, nbok += Bits::nbSetBits( (DGtal::uint16_t)-2) == 15 ? 1 : 0; - ++nb, nbok += Bits::nbSetBits( (DGtal::uint32_t)-2) == 31 ? 1 : 0; - ++nb, nbok += Bits::nbSetBits( (DGtal::uint64_t)-2) == 63 ? 1 : 0; + ++nb; nbok += Bits::nbSetBits( (DGtal::uint8_t)-1) == 8 ? 1 : 0; + ++nb; nbok += Bits::nbSetBits( (DGtal::uint16_t)-1) == 16 ? 1 : 0; + ++nb; nbok += Bits::nbSetBits( (DGtal::uint32_t)-1) == 32 ? 1 : 0; + ++nb; nbok += Bits::nbSetBits( (DGtal::uint64_t)-1) == 64 ? 1 : 0; + ++nb; nbok += Bits::nbSetBits( (DGtal::uint8_t)1) == 1 ? 1 : 0; + ++nb; nbok += Bits::nbSetBits( (DGtal::uint16_t)1) == 1 ? 1 : 0; + ++nb; nbok += Bits::nbSetBits( (DGtal::uint32_t)1) == 1 ? 1 : 0; + ++nb; nbok += Bits::nbSetBits( (DGtal::uint64_t)1) == 1 ? 1 : 0; + ++nb; nbok += Bits::nbSetBits( (DGtal::uint8_t)-2) == 7 ? 1 : 0; + ++nb; nbok += Bits::nbSetBits( (DGtal::uint16_t)-2) == 15 ? 1 : 0; + ++nb; nbok += Bits::nbSetBits( (DGtal::uint32_t)-2) == 31 ? 1 : 0; + ++nb; nbok += Bits::nbSetBits( (DGtal::uint64_t)-2) == 63 ? 1 : 0; for ( unsigned int i = 0; i < 100; ++i ) { DGtal::uint16_t n = (DGtal::uint16_t) ( rand() % 65536 ); for ( unsigned int b = 0; b < 16; ++b ) - ++nb, nbok += Bits::indexInSetBits( n, b ) == index( n, b ) ? 1 : 0; + { + ++nb; nbok += Bits::indexInSetBits( n, b ) == index( n, b ) ? 1 : 0; + } } std::cerr << "(" << nbok << "/" << nb << ")" << " tests." << std::endl; @@ -86,7 +88,7 @@ int main() { DGtal::uint32_t n = (DGtal::uint32_t) rand(); for ( unsigned int b = 0; b < 32; ++b ) - val += index( n, b ); + val += index( n, b ); } trace.info() << "- checksum = " << val << std::endl; trace.endBlock(); @@ -98,11 +100,11 @@ int main() { DGtal::uint32_t n = (DGtal::uint32_t) rand(); for ( unsigned int b = 0; b < 32; ++b ) - val2 += Bits::indexInSetBits( n, b ); + val2 += Bits::indexInSetBits( n, b ); } trace.info() << "- checksum = " << val2 << std::endl; trace.endBlock(); - ++nb, nbok += val == val2 ? 1 : 0; + ++nb; nbok += val == val2 ? 1 : 0; return ( nb == nbok ) ? 0 : 1; } /** @ingroup Tests **/ diff --git a/tests/base/testCountedConstPtrOrConstPtr.cpp b/tests/base/testCountedConstPtrOrConstPtr.cpp index 32032fec97..14bbbeb350 100644 --- a/tests/base/testCountedConstPtrOrConstPtr.cpp +++ b/tests/base/testCountedConstPtrOrConstPtr.cpp @@ -79,62 +79,62 @@ bool testCountedConstPtrOrConstPtrMemory() { CountedConstPtrOrConstPtr cptr; } - ++nb, nbok += A::nb == 0 ? 1 : 0; + ++nb; nbok += A::nb == 0 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "A::nb == 0" << std::endl; trace.endBlock(); trace.beginBlock ( "A CountedConstPtrOrConstPtr can be used as a simple pointer on an object without acquiring it." ); { A a( 17 ); - ++nb, nbok += A::nb == 1 ? 1 : 0; + ++nb; nbok += A::nb == 1 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "A::nb == 1" << std::endl; { CountedConstPtrOrConstPtr cptr( &a, false ); - ++nb, nbok += A::nb == 1 ? 1 : 0; + ++nb; nbok += A::nb == 1 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "A::nb == 1" << std::endl; - ++nb, nbok += cptr.isSimple() ? 1 : 0; + ++nb; nbok += cptr.isSimple() ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "cptr.isSimple()" << std::endl; } - ++nb, nbok += A::nb == 1 ? 1 : 0; + ++nb; nbok += A::nb == 1 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "A::nb == 1" << std::endl; } - ++nb, nbok += A::nb == 0 ? 1 : 0; + ++nb; nbok += A::nb == 0 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "A::nb == 0" << std::endl; trace.endBlock(); trace.beginBlock ( "CountedConstPtrOrConstPtr can be used as a smart pointer with acquisition and automatic deallocation." ); { CountedConstPtrOrConstPtr cptr( new A( 10 ) ); - ++nb, nbok += A::nb == 1 ? 1 : 0; + ++nb; nbok += A::nb == 1 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "A::nb == 1" << std::endl; - ++nb, nbok += cptr.isSmart() ? 1 : 0; + ++nb; nbok += cptr.isSmart() ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "cptr.isSmart()" << std::endl; } - ++nb, nbok += A::nb == 0 ? 1 : 0; + ++nb; nbok += A::nb == 0 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "A::nb == 0" << std::endl; trace.endBlock(); trace.beginBlock ( "CountedConstPtrOrConstPtr can be initialized with = CountedConstPtrOrConstPtr( pointer )." ); { CountedConstPtrOrConstPtr cptr = CountedConstPtrOrConstPtr( new A( 5 ) ); - ++nb, nbok += A::nb == 1 ? 1 : 0; + ++nb; nbok += A::nb == 1 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "A::nb == 1" << std::endl; - ++nb, nbok += cptr.isSmart() ? 1 : 0; + ++nb; nbok += cptr.isSmart() ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "cptr.isSmart()" << std::endl; } - ++nb, nbok += A::nb == 0 ? 1 : 0; + ++nb; nbok += A::nb == 0 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "A::nb == 0" << std::endl; trace.endBlock(); trace.beginBlock ( "CountedConstPtrOrConstPtr can be initialized with = CountedPtr( pointer )." ); { CountedConstPtrOrConstPtr cptr = CountedPtr( new A( 5 ) ); - ++nb, nbok += A::nb == 1 ? 1 : 0; + ++nb; nbok += A::nb == 1 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "A::nb == 1" << std::endl; - ++nb, nbok += cptr.isSmart() ? 1 : 0; + ++nb; nbok += cptr.isSmart() ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "cptr.isSmart()" << std::endl; } - ++nb, nbok += A::nb == 0 ? 1 : 0; + ++nb; nbok += A::nb == 0 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "A::nb == 0" << std::endl; trace.endBlock(); @@ -142,16 +142,16 @@ bool testCountedConstPtrOrConstPtrMemory() { CountedConstPtrOrConstPtr cptr( new A( 7 ) ); CountedConstPtrOrConstPtr cptr2 = cptr; - ++nb, nbok += A::nb == 1 ? 1 : 0; + ++nb; nbok += A::nb == 1 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "A::nb == 1" << std::endl; - ++nb, nbok += cptr.get() == cptr2.get() ? 1 : 0; + ++nb; nbok += cptr.get() == cptr2.get() ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "cptr.get() == cptr2.get()" << std::endl; - ++nb, nbok += cptr.count() == 2 ? 1 : 0; + ++nb; nbok += cptr.count() == 2 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "cptr.count() == 2" << std::endl; - ++nb, nbok += cptr2.count() == 2 ? 1 : 0; + ++nb; nbok += cptr2.count() == 2 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "cptr2.count() == 2" << std::endl; } - ++nb, nbok += A::nb == 0 ? 1 : 0; + ++nb; nbok += A::nb == 0 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "A::nb == 0" << std::endl; trace.endBlock(); @@ -159,16 +159,16 @@ bool testCountedConstPtrOrConstPtrMemory() { CountedPtr cptr( new A( 7 ) ); CountedConstPtrOrConstPtr cptr2 = cptr; - ++nb, nbok += A::nb == 1 ? 1 : 0; + ++nb; nbok += A::nb == 1 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "A::nb == 1" << std::endl; - ++nb, nbok += cptr.get() == cptr2.get() ? 1 : 0; + ++nb; nbok += cptr.get() == cptr2.get() ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "cptr.get() == cptr2.get()" << std::endl; - ++nb, nbok += cptr.count() == 2 ? 1 : 0; + ++nb; nbok += cptr.count() == 2 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "cptr.count() == 2" << std::endl; - ++nb, nbok += cptr2.count() == 2 ? 1 : 0; + ++nb; nbok += cptr2.count() == 2 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "cptr2.count() == 2" << std::endl; } - ++nb, nbok += A::nb == 0 ? 1 : 0; + ++nb; nbok += A::nb == 0 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "A::nb == 0" << std::endl; trace.endBlock(); @@ -176,16 +176,16 @@ bool testCountedConstPtrOrConstPtrMemory() { CountedPtrOrPtr cptr( new A( 7 ) ); CountedConstPtrOrConstPtr cptr2 = cptr; - ++nb, nbok += A::nb == 1 ? 1 : 0; + ++nb; nbok += A::nb == 1 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "A::nb == 1" << std::endl; - ++nb, nbok += cptr.get() == cptr2.get() ? 1 : 0; + ++nb; nbok += cptr.get() == cptr2.get() ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "cptr.get() == cptr2.get()" << std::endl; - ++nb, nbok += cptr.count() == 2 ? 1 : 0; + ++nb; nbok += cptr.count() == 2 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "cptr.count() == 2" << std::endl; - ++nb, nbok += cptr2.count() == 2 ? 1 : 0; + ++nb; nbok += cptr2.count() == 2 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "cptr2.count() == 2" << std::endl; } - ++nb, nbok += A::nb == 0 ? 1 : 0; + ++nb; nbok += A::nb == 0 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "A::nb == 0" << std::endl; trace.endBlock(); @@ -193,24 +193,24 @@ bool testCountedConstPtrOrConstPtrMemory() { CountedConstPtrOrConstPtr cptr( new A( 3 ) ); CountedConstPtrOrConstPtr cptr2( new A( 12 ) ); - ++nb, nbok += A::nb == 2 ? 1 : 0; + ++nb; nbok += A::nb == 2 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "A::nb == 2" << std::endl; - ++nb, nbok += cptr.get() != cptr2.get() ? 1 : 0; + ++nb; nbok += cptr.get() != cptr2.get() ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "cptr.get() != cptr2.get()" << std::endl; cptr = cptr2; - ++nb, nbok += A::nb == 1 ? 1 : 0; + ++nb; nbok += A::nb == 1 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "A::nb == 1" << std::endl; - ++nb, nbok += cptr.get()->a == 12 ? 1 : 0; + ++nb; nbok += cptr.get()->a == 12 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "cptr.get()->a == 12" << std::endl; // cptr.get()->a = 5; // does not compile. - ++nb, nbok += cptr.get() == cptr2.get() ? 1 : 0; + ++nb; nbok += cptr.get() == cptr2.get() ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "cptr.get() == cptr2.get()" << std::endl; - ++nb, nbok += cptr.count() == 2 ? 1 : 0; + ++nb; nbok += cptr.count() == 2 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "cptr.count() == 2" << std::endl; - ++nb, nbok += cptr2.count() == 2 ? 1 : 0; + ++nb; nbok += cptr2.count() == 2 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "cptr2.count() == 2" << std::endl; } - ++nb, nbok += A::nb == 0 ? 1 : 0; + ++nb; nbok += A::nb == 0 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "A::nb == 0" << std::endl; trace.endBlock(); @@ -218,23 +218,23 @@ bool testCountedConstPtrOrConstPtrMemory() { CountedConstPtrOrConstPtr cptr( new A( 3 ) ); CountedPtr cptr2( new A( 12 ) ); - ++nb, nbok += A::nb == 2 ? 1 : 0; + ++nb; nbok += A::nb == 2 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "A::nb == 2" << std::endl; - ++nb, nbok += cptr.get() != cptr2.get() ? 1 : 0; + ++nb; nbok += cptr.get() != cptr2.get() ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "cptr.get() != cptr2.get()" << std::endl; cptr = cptr2; - ++nb, nbok += A::nb == 1 ? 1 : 0; + ++nb; nbok += A::nb == 1 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "A::nb == 1" << std::endl; - ++nb, nbok += cptr.get()->a == 12 ? 1 : 0; + ++nb; nbok += cptr.get()->a == 12 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "cptr.get()->a == 12" << std::endl; - ++nb, nbok += cptr.get() == cptr2.get() ? 1 : 0; + ++nb; nbok += cptr.get() == cptr2.get() ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "cptr.get() == cptr2.get()" << std::endl; - ++nb, nbok += cptr.count() == 2 ? 1 : 0; + ++nb; nbok += cptr.count() == 2 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "cptr.count() == 2" << std::endl; - ++nb, nbok += cptr2.count() == 2 ? 1 : 0; + ++nb; nbok += cptr2.count() == 2 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "cptr2.count() == 2" << std::endl; } - ++nb, nbok += A::nb == 0 ? 1 : 0; + ++nb; nbok += A::nb == 0 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "A::nb == 0" << std::endl; trace.endBlock(); @@ -242,23 +242,23 @@ bool testCountedConstPtrOrConstPtrMemory() { CountedConstPtrOrConstPtr cptr( new A( 3 ) ); CountedPtrOrPtr cptr2( new A( 12 ) ); - ++nb, nbok += A::nb == 2 ? 1 : 0; + ++nb; nbok += A::nb == 2 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "A::nb == 2" << std::endl; - ++nb, nbok += cptr.get() != cptr2.get() ? 1 : 0; + ++nb; nbok += cptr.get() != cptr2.get() ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "cptr.get() != cptr2.get()" << std::endl; cptr = cptr2; - ++nb, nbok += A::nb == 1 ? 1 : 0; + ++nb; nbok += A::nb == 1 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "A::nb == 1" << std::endl; - ++nb, nbok += cptr.get()->a == 12 ? 1 : 0; + ++nb; nbok += cptr.get()->a == 12 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "cptr.get()->a == 12" << std::endl; - ++nb, nbok += cptr.get() == cptr2.get() ? 1 : 0; + ++nb; nbok += cptr.get() == cptr2.get() ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "cptr.get() == cptr2.get()" << std::endl; - ++nb, nbok += cptr.count() == 2 ? 1 : 0; + ++nb; nbok += cptr.count() == 2 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "cptr.count() == 2" << std::endl; - ++nb, nbok += cptr2.count() == 2 ? 1 : 0; + ++nb; nbok += cptr2.count() == 2 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "cptr2.count() == 2" << std::endl; } - ++nb, nbok += A::nb == 0 ? 1 : 0; + ++nb; nbok += A::nb == 0 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "A::nb == 0" << std::endl; trace.endBlock(); diff --git a/tests/base/testLabelledMap-benchmark.cpp b/tests/base/testLabelledMap-benchmark.cpp index b4b3412e55..dcdc4a0561 100644 --- a/tests/base/testLabelledMap-benchmark.cpp +++ b/tests/base/testLabelledMap-benchmark.cpp @@ -215,7 +215,7 @@ class ArrayXYOfMap { inline unsigned int nbLabels( unsigned int x, unsigned int y ) const { - return _data[ x ][ y ].size(); + return (unsigned int)_data[ x ][ y ].size(); } inline void display ( ostream & , unsigned int, unsigned int , unsigned int ) diff --git a/tests/base/testLabelledMap.cpp b/tests/base/testLabelledMap.cpp index d7ca96b576..ed5cf05c3c 100644 --- a/tests/base/testLabelledMap.cpp +++ b/tests/base/testLabelledMap.cpp @@ -114,49 +114,49 @@ int main() trace.beginBlock ( "Testing LabelledMap" ); MyLabelledMap l; map v; - ++nb, nbok += isEqual( v, l ) ? 1 : 0; + ++nb; nbok += isEqual( v, l ) ? 1 : 0; std::cout << "(" << nbok << "/" << nb << ") l=" << l << std::endl; insert( v, l, 3, 4.5 ); - ++nb, nbok += isEqual( v, l ) ? 1 : 0; + ++nb; nbok += isEqual( v, l ) ? 1 : 0; std::cout << "(" << nbok << "/" << nb << ") l=" << l << std::endl; insert( v, l, 0, 10.1 ); - ++nb, nbok += isEqual( v, l ) ? 1 : 0; + ++nb; nbok += isEqual( v, l ) ? 1 : 0; std::cout << "(" << nbok << "/" << nb << ") l=" << l << std::endl; insert( v, l, 1, 3.7 ); - ++nb, nbok += isEqual( v, l ) ? 1 : 0; + ++nb; nbok += isEqual( v, l ) ? 1 : 0; std::cout << "(" << nbok << "/" << nb << ") l=" << l << std::endl; insert( v, l, 2, 8.4 ); insert( v, l, 1, 2.1 ); - ++nb, nbok += isEqual( v, l ) ? 1 : 0; + ++nb; nbok += isEqual( v, l ) ? 1 : 0; std::cout << "(" << nbok << "/" << nb << ") l=" << l << std::endl; display( std::cout, v ); insert( v, l, 1, -3.0 ); - ++nb, nbok += isEqual( v, l ) ? 1 : 0; + ++nb; nbok += isEqual( v, l ) ? 1 : 0; std::cout << "(" << nbok << "/" << nb << ") l=" << l << std::endl; insert( v, l, 15, -13.1 ); - ++nb, nbok += isEqual( v, l ) ? 1 : 0; + ++nb; nbok += isEqual( v, l ) ? 1 : 0; std::cout << "(" << nbok << "/" << nb << ") l=" << l << std::endl; insert( v, l, 2, -7.1 ); - ++nb, nbok += isEqual( v, l ) ? 1 : 0; + ++nb; nbok += isEqual( v, l ) ? 1 : 0; std::cout << "(" << nbok << "/" << nb << ") l=" << l << std::endl; // MyLabelledMap::Iterator it = l.insert( l.begin(), std::make_pair( 7, 4.4 ) ); // std::cout << "(" << nbok << "/" << nb << ") l=" << l << std::endl; // it = l.insert( it, std::make_pair( 9, 5.5 ) ); // l.insert( it, std::make_pair( 9, 10.5 ) ); // std::cout << "(" << nbok << "/" << nb << ") l=" << l << std::endl; - ++nb, nbok += checkInsert( v, l, 1000 ) ? 1 : 0; + ++nb; nbok += checkInsert( v, l, 1000 ) ? 1 : 0; std::cout << "(" << nbok << "/" << nb << ") 1000 insertions l=" << l << std::endl; - ++nb, nbok += checkErase( v, l, 1000 ) ? 1 : 0; + ++nb; nbok += checkErase( v, l, 1000 ) ? 1 : 0; std::cout << "(" << nbok << "/" << nb << ") 1000 deletions l=" << l << std::endl; trace.endBlock(); trace.beginBlock ( "Testing LabelledMap" ); - ++nb, nbok += checkInsert( v, l, 10 ) ? 1 : 0; + ++nb; nbok += checkInsert( v, l, 10 ) ? 1 : 0; std::cout << "(" << nbok << "/" << nb << ") 10 deletions l=" << l << std::endl; std::pair< MyLabelledMap::Iterator, MyLabelledMap::Iterator > pair1 = l.equal_range( 7 ); std::cout << "Range(7)=[" << (*pair1.first).first << "," << (*pair1.second).first << ")" << std::endl; - ++nb, nbok += ( pair1.first == l.lower_bound( 7 ) ) ? 1 : 0; - ++nb, nbok += ( pair1.second == l.upper_bound( 7 ) ) ? 1 : 0; + ++nb; nbok += ( pair1.first == l.lower_bound( 7 ) ) ? 1 : 0; + ++nb; nbok += ( pair1.second == l.upper_bound( 7 ) ) ? 1 : 0; std::cout << "(" << nbok << "/" << nb << ") equal_range, lower_bound." << std::endl; trace.endBlock(); diff --git a/tests/base/testMultiMap-benchmark.cpp b/tests/base/testMultiMap-benchmark.cpp index 06b8373216..741c5ce181 100644 --- a/tests/base/testMultiMap-benchmark.cpp +++ b/tests/base/testMultiMap-benchmark.cpp @@ -227,7 +227,7 @@ class DynArrayXYOfMap { inline unsigned int erase( unsigned int l, unsigned int x, unsigned int y ) { - return _data[ offset( x, y ) ].erase( l ); + return static_cast(_data[ offset( x, y ) ].erase( l )); } inline @@ -258,7 +258,7 @@ class DynArrayXYOfMap { inline unsigned int nbLabels( unsigned int x, unsigned int y ) const { - return _data[ offset( x, y ) ].size(); + return static_cast(_data[ offset( x, y ) ].size()); } inline void display ( ostream & , unsigned int , unsigned int , unsigned int ) @@ -551,7 +551,7 @@ class DynArrayXYOfLabelledMap { inline unsigned int nbLabels( unsigned int x, unsigned int y ) const { - return _data[ offset( x, y ) ].size(); + return static_cast(_data[ offset( x, y ) ].size()); } inline void display ( ostream & , unsigned int , unsigned int x, unsigned int y ) { diff --git a/tests/geometry/curves/estimation/testEstimatorComparator.cpp b/tests/geometry/curves/estimation/testEstimatorComparator.cpp index db405fef84..a9dc6dc9df 100644 --- a/tests/geometry/curves/estimation/testEstimatorComparator.cpp +++ b/tests/geometry/curves/estimation/testEstimatorComparator.cpp @@ -180,7 +180,7 @@ bool testCompareEstimator(const std::string &name, Shape & aShape, double h) ok += (nb == nbok); } - catch ( InputException e ) + catch ( InputException& e ) { std::cerr << "[testCompareEstimator]" << " error in finding a bel." << std::endl; diff --git a/tests/geometry/curves/estimation/testLengthEstimators.cpp b/tests/geometry/curves/estimation/testLengthEstimators.cpp index 121eade6f8..389223bd0a 100644 --- a/tests/geometry/curves/estimation/testLengthEstimators.cpp +++ b/tests/geometry/curves/estimation/testLengthEstimators.cpp @@ -121,7 +121,7 @@ bool testLengthEstimatorsOnBall(double radius, double h) { bel = Surfaces::findABel( K, dig, 10000 ); } - catch ( InputException e ) + catch ( InputException& e ) { std::cerr << " " << " error in finding a bel." << std::endl; @@ -277,7 +277,7 @@ bool testDisplay(double radius, double h) board.saveSVG( "Ranges-Arrows.svg" ); } - catch ( InputException e ) + catch ( InputException& e ) { std::cerr << " " << " error in finding a bel." << std::endl; diff --git a/tests/geometry/curves/estimation/testTrueLocalEstimator.cpp b/tests/geometry/curves/estimation/testTrueLocalEstimator.cpp index 2fed3ef23c..a0663dc506 100644 --- a/tests/geometry/curves/estimation/testTrueLocalEstimator.cpp +++ b/tests/geometry/curves/estimation/testTrueLocalEstimator.cpp @@ -181,7 +181,7 @@ testTrueLocalEstimatorOnShapeDigitization( const string & name, << " " << kappa << std::endl; } } - catch ( InputException e ) + catch ( InputException& e ) { std::cerr << "[testTrueLocalEstimatorOnShapeDigitization]" << " error in finding a bel." << std::endl; diff --git a/tests/geometry/curves/testDSLSubsegment.cpp b/tests/geometry/curves/testDSLSubsegment.cpp index c79795b209..43533a80ca 100644 --- a/tests/geometry/curves/testDSLSubsegment.cpp +++ b/tests/geometry/curves/testDSLSubsegment.cpp @@ -216,7 +216,7 @@ int main() trace.info() << std::endl; Integer i = 1000; - srand(time(NULL)); + srand((unsigned int)time(NULL)); bool res = testDSLSubsegment(i); diff --git a/tests/geometry/curves/testStabbingCircleComputer.cpp b/tests/geometry/curves/testStabbingCircleComputer.cpp index b86a45911f..c38d3071e2 100644 --- a/tests/geometry/curves/testStabbingCircleComputer.cpp +++ b/tests/geometry/curves/testStabbingCircleComputer.cpp @@ -121,7 +121,7 @@ ballGenerator(double aCx, double aCy, double aR, bool aFlagIsCW) } return c; } - catch ( InputException e ) + catch ( InputException& e ) { std::cerr << " " << " error in finding a bel." << std::endl; diff --git a/tests/geometry/surfaces/testCOBAGenericNaivePlaneComputer-benchmark.cpp b/tests/geometry/surfaces/testCOBAGenericNaivePlaneComputer-benchmark.cpp index 1ad9afa9ae..d2e53024ca 100644 --- a/tests/geometry/surfaces/testCOBAGenericNaivePlaneComputer-benchmark.cpp +++ b/tests/geometry/surfaces/testCOBAGenericNaivePlaneComputer-benchmark.cpp @@ -96,7 +96,7 @@ checkGenericPlane( Integer a, Integer b, Integer c, Integer d, case 2: p[ 2 ] = NumberTraits::castToInt64_t( ic.ceilDiv( d - a * x - b * y, c ) ); break; } bool ok = plane.extend( p ); // should be ok - ++nb, nbok += ok ? 1 : 0; + ++nb; nbok += ok ? 1 : 0; if ( ! ok ) { std::cerr << "[ERROR] p=" << p << " NOT IN plane=" << plane << std::endl; @@ -129,7 +129,7 @@ checkGenericPlanes( unsigned int nbplanes, int diameter, unsigned int nbpoints, Integer d = getRandomInteger( (Integer) 0, (Integer) diameter / 2 ); if ( ( a != 0 ) || ( b != 0 ) || ( c != 0 ) ) { - ++nb, nbok += checkGenericPlane( a, b, c, d, diameter, nbpoints, stats ) ? 1 : 0; + ++nb; nbok += checkGenericPlane( a, b, c, d, diameter, nbpoints, stats ) ? 1 : 0; if ( nb != nbok ) { std::cerr << "[ERROR] for plane " << a << " * x + " diff --git a/tests/geometry/surfaces/testCOBAGenericStandardPlaneComputer.cpp b/tests/geometry/surfaces/testCOBAGenericStandardPlaneComputer.cpp index 925cd927f0..c3e1edf9ad 100644 --- a/tests/geometry/surfaces/testCOBAGenericStandardPlaneComputer.cpp +++ b/tests/geometry/surfaces/testCOBAGenericStandardPlaneComputer.cpp @@ -102,7 +102,7 @@ bool checkCOBAGenericStandardPlaneComputer mu = getRandomInteger( -diameter, diameter ); std::vector pts = pointsInStandardPlane( domain, a, b, c, mu ); computer.init( 2*diameter, 1, 1 ); - ++nb, nbok += computer.extend( pts.begin(), pts.end() ) ? 1 : 0; + ++nb; nbok += computer.extend( pts.begin(), pts.end() ) ? 1 : 0; trace.info() << "Primitive=" << computer.primitive() << std::endl; trace.info() << "(" << nbok << "/" << nb << ") extend " << pts.size() << " points of plane " @@ -110,7 +110,7 @@ bool checkCOBAGenericStandardPlaneComputer << " < " << (mu+a+b+c) << std::endl; computer.init( 2*diameter, 1, 1 ); std::random_shuffle( pts.begin(), pts.end() ); - ++nb, nbok += computer.extend( pts.begin(), pts.end() ) ? 1 : 0; + ++nb; nbok += computer.extend( pts.begin(), pts.end() ) ? 1 : 0; trace.info() << "Primitive=" << computer.primitive() << std::endl; trace.info() << "(" << nbok << "/" << nb << ") extend " << pts.size() << " shuffled points of plane " diff --git a/tests/geometry/surfaces/testCOBANaivePlaneComputer-benchmark.cpp b/tests/geometry/surfaces/testCOBANaivePlaneComputer-benchmark.cpp index bbeafd9795..43f6444d46 100644 --- a/tests/geometry/surfaces/testCOBANaivePlaneComputer-benchmark.cpp +++ b/tests/geometry/surfaces/testCOBANaivePlaneComputer-benchmark.cpp @@ -96,7 +96,7 @@ checkPlane( Integer a, Integer b, Integer c, Integer d, case 2: p[ 2 ] = NumberTraits::castToInt64_t( ic.ceilDiv( d - a * x - b * y, c ) ); break; } bool ok = plane.extend( p ); // should be ok - ++nb, nbok += ok ? 1 : 0; + ++nb; nbok += ok ? 1 : 0; if ( ! ok ) { std::cerr << "[ERROR] p=" << p << " NOT IN plane=" << plane << std::endl; @@ -129,7 +129,7 @@ checkPlanes( unsigned int nbplanes, int diameter, unsigned int nbpoints, Integer d = getRandomInteger( (Integer) 0, (Integer) diameter / 2 ); if ( ( a != 0 ) || ( b != 0 ) || ( c != 0 ) ) { - ++nb, nbok += checkPlane( a, b, c, d, diameter, nbpoints, stats ) ? 1 : 0; + ++nb; nbok += checkPlane( a, b, c, d, diameter, nbpoints, stats ) ? 1 : 0; if ( nb != nbok ) { std::cerr << "[ERROR] for plane " << a << " * x + " diff --git a/tests/geometry/surfaces/testCOBANaivePlaneComputer.cpp b/tests/geometry/surfaces/testCOBANaivePlaneComputer.cpp index 8d988d6d14..92c093033e 100644 --- a/tests/geometry/surfaces/testCOBANaivePlaneComputer.cpp +++ b/tests/geometry/surfaces/testCOBANaivePlaneComputer.cpp @@ -96,8 +96,8 @@ checkPlane( Integer a, Integer b, Integer c, Integer d, } bool ok_ext = plane.isExtendable( p ); // should be ok bool ok = plane.extend( p ); // should be ok - ++nb, nbok += ok_ext ? 1 : 0; - ++nb, nbok += ok ? 1 : 0; + ++nb; nbok += ok_ext ? 1 : 0; + ++nb; nbok += ok ? 1 : 0; if ( ! ok ) { std::cerr << "[ERROR] p=" << p << " NOT IN plane=" << plane << std::endl; @@ -131,8 +131,8 @@ checkPlane( Integer a, Integer b, Integer c, Integer d, p[ axis ] += tmp; bool ok_ext = ! plane.isExtendable( p ); // should *not* be ok bool ok = ! plane.extend( p ); // should *not* be ok - ++nb, nbok += ok ? 1 : 0; - ++nb, nbok += ok_ext ? 1 : 0; + ++nb; nbok += ok ? 1 : 0; + ++nb; nbok += ok_ext ? 1 : 0; if ( ! ok ) { std::cerr << "[ERROR] p=" << p << " IN plane=" << plane << std::endl; @@ -193,8 +193,8 @@ checkGenericPlane( Integer a, Integer b, Integer c, Integer d, } bool ok_ext = plane.isExtendable( p ); // should be ok bool ok = plane.extend( p ); // should be ok - ++nb, nbok += ok_ext ? 1 : 0; - ++nb, nbok += ok ? 1 : 0; + ++nb; nbok += ok_ext ? 1 : 0; + ++nb; nbok += ok ? 1 : 0; if ( ! ok ) { std::cerr << "[ERROR] p=" << p << " NOT IN plane=" << plane << std::endl; @@ -228,8 +228,8 @@ checkGenericPlane( Integer a, Integer b, Integer c, Integer d, p[ axis ] += tmp; bool ok_ext = ! plane.isExtendable( p ); // should *not* be ok bool ok = ! plane.extend( p ); // should *not* be ok - ++nb, nbok += ok ? 1 : 0; - ++nb, nbok += ok_ext ? 1 : 0; + ++nb; nbok += ok ? 1 : 0; + ++nb; nbok += ok_ext ? 1 : 0; if ( ! ok ) { std::cerr << "[ERROR] p=" << p << " IN plane=" << plane << std::endl; @@ -264,7 +264,7 @@ checkPlanes( unsigned int nbplanes, int diameter, unsigned int nbtries ) Integer d = getRandomInteger( (Integer) 0, (Integer) diameter / 2 ); if ( ( a != 0 ) || ( b != 0 ) || ( c != 0 ) ) { - ++nb, nbok += checkPlane( a, b, c, d, diameter, nbtries ) ? 1 : 0; + ++nb; nbok += checkPlane( a, b, c, d, diameter, nbtries ) ? 1 : 0; if ( nb != nbok ) { std::cerr << "[ERROR] for plane " << a << " * x + " @@ -307,30 +307,30 @@ bool testCOBANaivePlaneComputer() << std::endl; Point pt1( Point( 8, 1, 3 ) ); bool pt1_inside = plane.extend( pt1 ); - ++nb, nbok += pt1_inside == true ? 1 : 0; + ++nb; nbok += pt1_inside == true ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") add " << pt1 << " Plane=" << plane << std::endl; Point pt2( Point( 2, 7, 1 ) ); bool pt2_inside = plane.extend( pt2 ); - ++nb, nbok += pt2_inside == true ? 1 : 0; + ++nb; nbok += pt2_inside == true ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") add " << pt2 << " Plane=" << plane << std::endl; Point pt3( Point( 0, 5, 17 ) ); bool pt3_inside = plane.extend( pt3 ); - ++nb, nbok += pt3_inside == false ? 1 : 0; + ++nb; nbok += pt3_inside == false ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") add " << pt3 << " Plane=" << plane << std::endl; Point pt4( Point( -10, -10, 10 ) ); bool pt4_inside = plane.extend( pt4 ); - ++nb, nbok += pt4_inside == false ? 1 : 0; + ++nb; nbok += pt4_inside == false ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") add " << pt4 << " Plane=" << plane << std::endl; Point pt5 = pt0 + pt1 + pt2 + Point( 0, 0, 2 ); bool pt5_inside = plane.extend( pt5 ); - ++nb, nbok += pt5_inside == true ? 1 : 0; + ++nb; nbok += pt5_inside == true ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") add " << pt5 << " Plane=" << plane << std::endl; @@ -342,24 +342,24 @@ bool testCOBANaivePlaneComputer() trace.info() << "(" << nbok << "/" << nb << ") " << " Plane2=" << plane2 << std::endl; - ++nb, nbok += checkPlane( 11, 5, 19, 20, 100, 100 ) ? 1 : 0; + ++nb; nbok += checkPlane( 11, 5, 19, 20, 100, 100 ) ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") checkPlane( 11, 5, 19, 20, 100, 100 )" << std::endl; - ++nb, nbok += checkGenericPlane( 11, 5, 19, 20, 100, 100 ) ? 1 : 0; + ++nb; nbok += checkGenericPlane( 11, 5, 19, 20, 100, 100 ) ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") checkGenericPlane( 11, 5, 19, 20, 100, 100 )" << std::endl; - ++nb, nbok += checkGenericPlane( 17, 33, 7, 10, 100, 100 ) ? 1 : 0; + ++nb; nbok += checkGenericPlane( 17, 33, 7, 10, 100, 100 ) ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") checkGenericPlane( 17, 33, 7, 10, 100, 100 )" << std::endl; - ++nb, nbok += checkPlane( 15, 8, 13, 15, 100, 100 ) ? 1 : 0; + ++nb; nbok += checkPlane( 15, 8, 13, 15, 100, 100 ) ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") checkPlane( 15, 8, 13, 15, 100, 100 )" << std::endl; - ++nb, nbok += checkGenericPlane( 15, 8, 13, 15, 100, 100 ) ? 1 : 0; + ++nb; nbok += checkGenericPlane( 15, 8, 13, 15, 100, 100 ) ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") checkGenericPlane( 15, 8, 13, 15, 100, 100 )" << std::endl; @@ -379,7 +379,7 @@ checkManyPlanes( unsigned int diameter, stringstream ss (stringstream::out); ss << "Testing block: Diameter is " << diameter << ". Check " << nbplanes << " planes with " << nbpoints << " points each."; trace.beginBlock ( ss.str() ); - ++nb, nbok += checkPlanes( nbplanes, diameter, nbpoints ) ? 1 : 0; + ++nb; nbok += checkPlanes( nbplanes, diameter, nbpoints ) ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") checkPlanes()" << std::endl; @@ -447,7 +447,7 @@ checkExtendWithManyPoints( unsigned int diameter, } pts.push_back( p ); } - ++nb, nbok += plane.isExtendable( pts.begin(), pts.end() ); // should be ok + ++nb; nbok += plane.isExtendable( pts.begin(), pts.end() ); // should be ok trace.info() << "(" << nbok << "/" << nb << ") plane.isExtendable( pts.begin(), pts.end() )" << std::endl; @@ -458,18 +458,18 @@ checkExtendWithManyPoints( unsigned int diameter, Point & any2 = pts[ getRandomInteger( 0, pts.size() ) ]; pts.push_back( any2 + Point(0,0,1) ); bool check = ! plane.isExtendable( pts.begin(), pts.end() ); // should not be ok - ++nb, nbok += check ? 1 : 0; + ++nb; nbok += check ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") ! plane.isExtendable( pts.begin(), pts.end() )" << std::endl; if ( ! check ) trace.warning() << plane << " last=" << pts.back() << std::endl << "a=" << a << " b=" << b << " c=" << c << " d=" << d << std::endl; - ++nb, nbok += plane.extend( pts.begin(), pts.end() - 3 ); // should be ok + ++nb; nbok += plane.extend( pts.begin(), pts.end() - 3 ); // should be ok trace.info() << "(" << nbok << "/" << nb << ") plane.extend( pts.begin(), pts.end() - 3)" << std::endl; - ++nb, nbok += ! plane.extend( pts.end() - 3, pts.end() ); // should not be ok + ++nb; nbok += ! plane.extend( pts.end() - 3, pts.end() ); // should not be ok trace.info() << "(" << nbok << "/" << nb << ") ! plane.extend( pts.end() - 3, pts.end() )" << std::endl; diff --git a/tests/geometry/surfaces/testChordGenericStandardPlaneComputer.cpp b/tests/geometry/surfaces/testChordGenericStandardPlaneComputer.cpp index fcd99a7acb..0049e86dc5 100644 --- a/tests/geometry/surfaces/testChordGenericStandardPlaneComputer.cpp +++ b/tests/geometry/surfaces/testChordGenericStandardPlaneComputer.cpp @@ -102,7 +102,8 @@ bool checkChordGenericStandardPlaneComputer mu = getRandomInteger( -diameter, diameter ); std::vector pts = pointsInStandardPlane( domain, a, b, c, mu ); computer.init( 1, 1 ); - ++nb, nbok += computer.extend( pts.begin(), pts.end() ) ? 1 : 0; + ++nb; + nbok += computer.extend( pts.begin(), pts.end() ) ? 1 : 0; trace.info() << "Primitive=" << computer.primitive() << std::endl; trace.info() << "(" << nbok << "/" << nb << ") extend " << pts.size() << " points of plane " @@ -110,7 +111,8 @@ bool checkChordGenericStandardPlaneComputer << " < " << (mu+a+b+c) << std::endl; computer.init( 1, 1 ); std::random_shuffle( pts.begin(), pts.end() ); - ++nb, nbok += computer.extend( pts.begin(), pts.end() ) ? 1 : 0; + ++nb; + nbok += computer.extend( pts.begin(), pts.end() ) ? 1 : 0; trace.info() << "Primitive=" << computer.primitive() << std::endl; trace.info() << "(" << nbok << "/" << nb << ") extend " << pts.size() << " shuffled points of plane " diff --git a/tests/geometry/surfaces/testChordNaivePlaneComputer-benchmark.cpp b/tests/geometry/surfaces/testChordNaivePlaneComputer-benchmark.cpp index 64359bd88c..9231533530 100644 --- a/tests/geometry/surfaces/testChordNaivePlaneComputer-benchmark.cpp +++ b/tests/geometry/surfaces/testChordNaivePlaneComputer-benchmark.cpp @@ -94,7 +94,7 @@ checkPlane( Integer a, Integer b, Integer c, Integer d, case 2: p[ 2 ] = NumberTraits::castToInt64_t( ic.ceilDiv( d - a * x - b * y, c ) ); break; } bool ok = plane.extend( p ); // should be ok - ++nb, nbok += ok ? 1 : 0; + ++nb; nbok += ok ? 1 : 0; if ( ! ok ) { std::cerr << "[ERROR] p=" << p << " NOT IN plane=" << plane << std::endl; @@ -120,7 +120,7 @@ checkPlanes( unsigned int nbplanes, unsigned int diameter, unsigned int nbpoints Integer d = getRandomInteger( (Integer) 0, (Integer) diameter / 2 ); if ( ( a != 0 ) || ( b != 0 ) || ( c != 0 ) ) { - ++nb, nbok += checkPlane( a, b, c, d, diameter, nbpoints ) ? 1 : 0; + ++nb; nbok += checkPlane( a, b, c, d, diameter, nbpoints ) ? 1 : 0; if ( nb != nbok ) { std::cerr << "[ERROR] for plane " << a << " * x + " diff --git a/tests/geometry/surfaces/testChordNaivePlaneComputer.cpp b/tests/geometry/surfaces/testChordNaivePlaneComputer.cpp index cce6e6191b..868d527346 100644 --- a/tests/geometry/surfaces/testChordNaivePlaneComputer.cpp +++ b/tests/geometry/surfaces/testChordNaivePlaneComputer.cpp @@ -96,8 +96,8 @@ checkPlane( Integer a, Integer b, Integer c, Integer d, } bool ok_ext = plane.isExtendable( p ); // should be ok bool ok = plane.extend( p ); // should be ok - ++nb, nbok += ok_ext ? 1 : 0; - ++nb, nbok += ok ? 1 : 0; + ++nb; nbok += ok_ext ? 1 : 0; + ++nb; nbok += ok ? 1 : 0; if ( ! ok ) { std::cerr << "[ERROR] p=" << p << " NOT IN plane=" << plane << std::endl; @@ -141,8 +141,8 @@ checkPlane( Integer a, Integer b, Integer c, Integer d, p[ axis ] += tmp; bool ok_ext = ! plane.isExtendable( p ); // should *not* be ok bool ok = ! plane.extend( p ); // should *not* be ok - ++nb, nbok += ok ? 1 : 0; - ++nb, nbok += ok_ext ? 1 : 0; + ++nb; nbok += ok ? 1 : 0; + ++nb; nbok += ok_ext ? 1 : 0; if ( ! ok ) { std::cerr << "[ERROR] p=" << p << " IN plane=" << plane << std::endl; @@ -210,8 +210,8 @@ checkPlaneGroupExtension( Integer a, Integer b, Integer c, Integer d, } bool ok_ext = plane.isExtendable( points.begin(), points.end() ); // should be ok bool ok = plane.extend( points.begin(), points.end() ); // should be ok - ++nb, nbok += ok_ext ? 1 : 0; - ++nb, nbok += ok ? 1 : 0; + ++nb; nbok += ok_ext ? 1 : 0; + ++nb; nbok += ok ? 1 : 0; if ( ! ok ) { std::cerr << "[ERROR] p=" << points[ 0 ] << " NOT IN plane=" << plane << std::endl; @@ -255,8 +255,8 @@ checkPlaneGroupExtension( Integer a, Integer b, Integer c, Integer d, p[ axis ] += tmp; bool ok_ext = ! plane.isExtendable( p ); // should *not* be ok bool ok = ! plane.extend( p ); // should *not* be ok - ++nb, nbok += ok ? 1 : 0; - ++nb, nbok += ok_ext ? 1 : 0; + ++nb; nbok += ok ? 1 : 0; + ++nb; nbok += ok_ext ? 1 : 0; if ( ! ok ) { std::cerr << "[ERROR] p=" << p << " IN plane=" << plane << std::endl; @@ -318,8 +318,8 @@ checkGenericPlane( Integer a, Integer b, Integer c, Integer d, } bool ok_ext = plane.isExtendable( p ); // should be ok bool ok = plane.extend( p ); // should be ok - ++nb, nbok += ok_ext ? 1 : 0; - ++nb, nbok += ok ? 1 : 0; + ++nb; nbok += ok_ext ? 1 : 0; + ++nb; nbok += ok ? 1 : 0; if ( ! ok ) { std::cerr << "[ERROR] p=" << p << " NOT IN plane=" << plane << std::endl; @@ -363,8 +363,8 @@ checkGenericPlane( Integer a, Integer b, Integer c, Integer d, p[ axis ] += tmp; bool ok_ext = ! plane.isExtendable( p ); // should *not* be ok bool ok = ! plane.extend( p ); // should *not* be ok - ++nb, nbok += ok ? 1 : 0; - ++nb, nbok += ok_ext ? 1 : 0; + ++nb; nbok += ok ? 1 : 0; + ++nb; nbok += ok_ext ? 1 : 0; if ( ! ok ) { std::cerr << "[ERROR] p=" << p << " IN plane=" << plane << std::endl; @@ -399,14 +399,14 @@ checkPlanes( unsigned int nbplanes, int diameter, unsigned int nbtries ) Integer d = getRandomInteger( (Integer) 0, (Integer) diameter / 2 ); if ( ( a != 0 ) || ( b != 0 ) || ( c != 0 ) ) { - ++nb, nbok += checkPlane( a, b, c, d, diameter, nbtries ) ? 1 : 0; + ++nb; nbok += checkPlane( a, b, c, d, diameter, nbtries ) ? 1 : 0; if ( nb != nbok ) { std::cerr << "[ERROR] (Simple extension) for plane " << a << " * x + " << b << " * y + " << c << " * z = " << d << std::endl; break; } - ++nb, nbok += checkPlaneGroupExtension( a, b, c, d, diameter, nbtries ) ? 1 : 0; + ++nb; nbok += checkPlaneGroupExtension( a, b, c, d, diameter, nbtries ) ? 1 : 0; if ( nb != nbok ) { std::cerr << "[ERROR] (Group extension) for plane " << a << " * x + " @@ -479,10 +479,10 @@ checkWidth( Integer a, Integer b, Integer c, Integer d, if ( min < 0.0 ) min = wn/wd; else if ( wn/wd < min ) min = wn/wd; } - ++nb, nbok += (min < 1.0 ) ? 1 : 0; + ++nb; nbok += (min < 1.0 ) ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") min width = " << min << " < 1.0" << std::endl; - ++nb, nbok += (0.9 < min ) ? 1 : 0; + ++nb; nbok += (0.9 < min ) ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") min width = " << min << " > 0.9" << std::endl; trace.endBlock(); @@ -505,7 +505,7 @@ checkWidths( unsigned int nbplanes, int diameter, unsigned int nbtries ) Integer d = getRandomInteger( (Integer) 0, (Integer) diameter / 2 ); if ( ( a != 0 ) || ( b != 0 ) || ( c != 0 ) ) { - ++nb, nbok += checkWidth( a, b, c, d, diameter, nbtries ) ? 1 : 0; + ++nb; nbok += checkWidth( a, b, c, d, diameter, nbtries ) ? 1 : 0; if ( nb != nbok ) { std::cerr << "[ERROR] (checkWidth) for plane " << a << " * x + " @@ -544,41 +544,41 @@ bool testChordNaivePlaneComputer() Point pt0( 0, 0, 0 ); plane.init( 2, 1, 1 ); bool pt0_inside = plane.extend( pt0 ); - ++nb, nbok += pt0_inside == true ? 1 : 0; + ++nb; nbok += pt0_inside == true ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") Plane=" << plane << std::endl; Point pt1( Point( 2, 0, 0 ) ); bool pt1_inside = plane.extend( pt1 ); - ++nb, nbok += pt1_inside == true ? 1 : 0; + ++nb; nbok += pt1_inside == true ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") add " << pt1 << " Plane=" << plane << std::endl; Point pt2( Point( 0, 2, 2 ) ); bool pt2_inside = plane.extend( pt2 ); - ++nb, nbok += pt2_inside == true ? 1 : 0; + ++nb; nbok += pt2_inside == true ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") add " << pt2 << " Plane=" << plane << std::endl; Point pt3( Point( 1, 1, 1 ) ); bool pt3_inside = plane.extend( pt3 ); - ++nb, nbok += pt3_inside == true ? 1 : 0; + ++nb; nbok += pt3_inside == true ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") add " << pt3 << " Plane=" << plane << std::endl; Point pt4( Point( -10, -10, 10 ) ); bool pt4_inside = plane.extend( pt4 ); - ++nb, nbok += pt4_inside == false ? 1 : 0; + ++nb; nbok += pt4_inside == false ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") impossible add " << pt4 << " Plane=" << plane << std::endl; Point pt5 = pt2 + Point( 1, 0, 1 ); bool pt5_inside = plane.extend( pt5 ); - ++nb, nbok += pt5_inside == true ? 1 : 0; + ++nb; nbok += pt5_inside == true ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") add " << pt5 << " Plane=" << plane << std::endl; Point pt6 = pt5 + Point( 6, 0, 2 ); bool pt6_inside = plane.extend( pt6 ); - ++nb, nbok += pt6_inside == true ? 1 : 0; + ++nb; nbok += pt6_inside == true ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") add " << pt6 << " Plane=" << plane << std::endl; @@ -590,24 +590,24 @@ bool testChordNaivePlaneComputer() trace.info() << "(" << nbok << "/" << nb << ") " << " Plane2=" << plane2 << std::endl; - ++nb, nbok += checkPlane( 11, 5, 19, 20, 100, 100 ) ? 1 : 0; + ++nb; nbok += checkPlane( 11, 5, 19, 20, 100, 100 ) ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") checkPlane( 11, 5, 19, 20, 100, 100 )" << std::endl; - ++nb, nbok += checkGenericPlane( 11, 5, 19, 20, 100, 100 ) ? 1 : 0; + ++nb; nbok += checkGenericPlane( 11, 5, 19, 20, 100, 100 ) ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") checkGenericPlane( 11, 5, 19, 20, 100, 100 )" << std::endl; - ++nb, nbok += checkGenericPlane( 17, 33, 7, 10, 100, 100 ) ? 1 : 0; + ++nb; nbok += checkGenericPlane( 17, 33, 7, 10, 100, 100 ) ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") checkGenericPlane( 17, 33, 7, 10, 100, 100 )" << std::endl; - ++nb, nbok += checkPlane( 15, 8, 13, 15, 100, 100 ) ? 1 : 0; + ++nb; nbok += checkPlane( 15, 8, 13, 15, 100, 100 ) ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") checkPlane( 15, 8, 13, 15, 100, 100 )" << std::endl; - ++nb, nbok += checkGenericPlane( 15, 8, 13, 15, 100, 100 ) ? 1 : 0; + ++nb; nbok += checkGenericPlane( 15, 8, 13, 15, 100, 100 ) ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") checkGenericPlane( 15, 8, 13, 15, 100, 100 )" << std::endl; @@ -619,27 +619,27 @@ bool testChordNaivePlaneComputer() Point pppt0( 0, 0, 0 ); ppplane.init( 2, 5, 2 ); bool pppt0_inside = ppplane.extend( pppt0 ); - ++nb, nbok += pppt0_inside == true ? 1 : 0; + ++nb; nbok += pppt0_inside == true ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") Plane=" << ppplane << std::endl; Point pppt1( 3, 2, 2 ); bool pppt1_inside = ppplane.extend( pppt1 ); - ++nb, nbok += pppt1_inside == true ? 1 : 0; + ++nb; nbok += pppt1_inside == true ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") Plane=" << ppplane << std::endl; Point pppt2( 0, 0, 1 ); bool pppt2_inside = ppplane.extend( pppt2 ); - ++nb, nbok += pppt2_inside == true ? 1 : 0; + ++nb; nbok += pppt2_inside == true ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") Plane=" << ppplane << std::endl; Point pppt3 = pppt1 + Point( 0, 0, 1 ); bool pppt3_inside = ppplane.extend( pppt3 ); - ++nb, nbok += pppt3_inside == true ? 1 : 0; + ++nb; nbok += pppt3_inside == true ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") Plane=" << ppplane << std::endl; Point pppt4 = pppt3 + Point( 0, 0, 1 ); bool pppt4_inside = ppplane.extend( pt4 ); - ++nb, nbok += pppt4_inside == true ? 1 : 0; + ++nb; nbok += pppt4_inside == true ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") Plane=" << ppplane << std::endl; trace.endBlock(); @@ -651,17 +651,17 @@ bool testChordNaivePlaneComputer() pplane.init( 1, 1, 1 ); Point ppt0( -6, -3, 5 ); bool ppt0_inside = pplane.extend( ppt0 ); - ++nb, nbok += ppt0_inside == true ? 1 : 0; + ++nb; nbok += ppt0_inside == true ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") Plane=" << pplane << std::endl; Point ppt1( 4, 4, -5 ); bool ppt1_inside = pplane.extend( ppt1 ); - ++nb, nbok += ppt1_inside == true ? 1 : 0; + ++nb; nbok += ppt1_inside == true ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") Plane=" << pplane << std::endl; Point ppt2( -5, -2, 4 ); bool ppt2_inside = pplane.extend( ppt2 ); - ++nb, nbok += ppt2_inside == true ? 1 : 0; + ++nb; nbok += ppt2_inside == true ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") Plane=" << pplane << std::endl; trace.endBlock(); @@ -682,7 +682,7 @@ checkManyPlanes( unsigned int diameter, stringstream ss (stringstream::out); ss << "Testing block: Diameter is " << diameter << ". Check " << nbplanes << " planes with " << nbpoints << " points each."; trace.beginBlock ( ss.str() ); - ++nb, nbok += checkPlanes( nbplanes, diameter, nbpoints ) ? 1 : 0; + ++nb; nbok += checkPlanes( nbplanes, diameter, nbpoints ) ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") checkPlanes()" << std::endl; @@ -734,7 +734,7 @@ checkExtendWithManyPoints( unsigned int diameter, } pts.push_back( p ); } - ++nb, nbok += plane.isExtendable( pts.begin(), pts.end() ); // should be ok + ++nb; nbok += plane.isExtendable( pts.begin(), pts.end() ); // should be ok trace.info() << "(" << nbok << "/" << nb << ") plane.isExtendable( pts.begin(), pts.end() )" << std::endl; @@ -745,18 +745,18 @@ checkExtendWithManyPoints( unsigned int diameter, Point & any2 = pts[ getRandomInteger( 0, pts.size() ) ]; pts.push_back( any2 + Point(0,0,1) ); bool check = ! plane.isExtendable( pts.begin(), pts.end() ); // should not be ok - ++nb, nbok += check ? 1 : 0; + ++nb; nbok += check ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") ! plane.isExtendable( pts.begin(), pts.end() )" << std::endl; if ( ! check ) trace.warning() << plane << " last=" << pts.back() << std::endl << "a=" << a << " b=" << b << " c=" << c << " d=" << d << std::endl; - ++nb, nbok += plane.extend( pts.begin(), pts.end() - 3 ); // should be ok + ++nb; nbok += plane.extend( pts.begin(), pts.end() - 3 ); // should be ok trace.info() << "(" << nbok << "/" << nb << ") plane.extend( pts.begin(), pts.end() - 3)" << std::endl; - ++nb, nbok += ! plane.extend( pts.end() - 3, pts.end() ); // should not be ok + ++nb; nbok += ! plane.extend( pts.end() - 3, pts.end() ); // should not be ok trace.info() << "(" << nbok << "/" << nb << ") ! plane.extend( pts.end() - 3, pts.end() )" << std::endl; diff --git a/tests/geometry/volumes/distance/testFMM.cpp b/tests/geometry/volumes/distance/testFMM.cpp index 9f1bc1c9a1..47c222d7f5 100644 --- a/tests/geometry/volumes/distance/testFMM.cpp +++ b/tests/geometry/volumes/distance/testFMM.cpp @@ -158,7 +158,7 @@ ballGenerator(const int& size, double aCx, double aCy, double aR, GridCurve::track2DBoundaryPoints( points, K, SAdj, dig, bel ); gc.initFromVector(points); } - catch ( InputException e ) + catch ( InputException& e ) { std::cerr << " error in finding a bel." << std::endl; } diff --git a/tests/geometry/volumes/distance/testPowerMap.cpp b/tests/geometry/volumes/distance/testPowerMap.cpp index dcd9c85de8..d51442f008 100644 --- a/tests/geometry/volumes/distance/testPowerMap.cpp +++ b/tests/geometry/volumes/distance/testPowerMap.cpp @@ -265,7 +265,7 @@ bool testPowerMap( std::array const& aPeriodicity = {{ false, false }} std::cerr< const& aPeriodicity = {{ false, for(unsigned int j=0; j<11; j++) { Z2i::Point p(i,j); - DGtal::int32_t dist = (i-power(p)[0])*(i-power(p)[0]) + + auto dist = (i-power(p)[0])*(i-power(p)[0]) + ( j-power(p)[1])*(j-power(p)[1]) - image(power.projectPoint(power(p))); trace.info()<< dist; } @@ -132,7 +132,7 @@ bool testReducedMedialAxis( std::array const& aPeriodicity = {{ false, trace.info()< > MyImage; BOOST_CONCEPT_ASSERT(( concepts::CImage< MyImage > )); - nbok += true ? 1 : 0; + nbok ++; nb++; diff --git a/tests/shapes/testPolygonalSurface.cpp b/tests/shapes/testPolygonalSurface.cpp index 7333a3eece..01bd98220b 100644 --- a/tests/shapes/testPolygonalSurface.cpp +++ b/tests/shapes/testPolygonalSurface.cpp @@ -111,8 +111,8 @@ SCENARIO( "PolygonalSurface< RealPoint3 > build tests", "[polysurf][build]" ) THEN( "Breadth-first visiting the mesh from vertex 0, visit {0}, then {1,2,4}, then {3,5,6,9}, then {7,8}." ) { BreadthFirstVisitor< PolygonMesh > visitor( polymesh, 0 ); - std::vector vertices; - std::vector distances; + std::vector vertices; + std::vector distances; while ( ! visitor.finished() ) { vertices.push_back( visitor.current().first ); diff --git a/tests/shapes/testTriangulatedSurface.cpp b/tests/shapes/testTriangulatedSurface.cpp index 62702b66f4..6ed6328bd7 100644 --- a/tests/shapes/testTriangulatedSurface.cpp +++ b/tests/shapes/testTriangulatedSurface.cpp @@ -91,8 +91,8 @@ SCENARIO( "TriangulatedSurface< RealPoint3 > build tests", "[trisurf][build]" ) THEN( "Breadth-first visiting the mesh from vertex 3, visit 3, then {1,2}, then 0." ) { BreadthFirstVisitor< TriMesh > visitor( trimesh, 3 ); - std::vector vertices; - std::vector distances; + std::vector vertices; + std::vector distances; while ( ! visitor.finished() ) { vertices.push_back( visitor.current().first ); diff --git a/tests/topology/testDigitalSurface.cpp b/tests/topology/testDigitalSurface.cpp index 58b9b9a18a..42afd34381 100644 --- a/tests/topology/testDigitalSurface.cpp +++ b/tests/topology/testDigitalSurface.cpp @@ -589,7 +589,6 @@ bool testOrderingDigitalSurfaceFacesAroundVertex() { typedef KhalimskySpaceND<3> KSpace; typedef typename KSpace::Space Space; - typedef typename KSpace::Size Size; typedef typename Space::Point Point; typedef HyperRectDomain Domain; typedef typename DigitalSetSelector < Domain, BIG_DS + HIGH_ITER_DS + HIGH_BEL_DS >::Type @@ -602,12 +601,12 @@ bool testOrderingDigitalSurfaceFacesAroundVertex() unsigned int nbok = 0; unsigned int nb = 0; trace.beginBlock ( "Creating surface around one voxel" ); - Point p0; - Point p1 = Point::diagonal( -1 ); - Point p2 = Point::diagonal( 1 ); - Domain domain( p1, p2 ); + Point pt0; + Point pt1 = Point::diagonal( -1 ); + Point pt2 = Point::diagonal( 1 ); + Domain domain( pt1, pt2 ); DigitalSet dig_set( domain ); - dig_set.insert( p0 ); + dig_set.insert( pt0 ); KSpace K; nbok += K.init( domain.lowerBound(), domain.upperBound(), true ) ? 1 : 0; nb++; diff --git a/tests/topology/testHalfEdgeDataStructure.cpp b/tests/topology/testHalfEdgeDataStructure.cpp index e571a558c1..6ffb59ad6f 100644 --- a/tests/topology/testHalfEdgeDataStructure.cpp +++ b/tests/topology/testHalfEdgeDataStructure.cpp @@ -94,7 +94,7 @@ HalfEdgeDataStructure makeRibbonWithHole() triangles[4].v = { 4, 5, 0 }; triangles[5].v = { 0, 5, 1 }; std::vector< Edge > edges; - const int kNumVertices + const auto kNumVertices = HalfEdgeDataStructure::getUnorderedEdgesFromTriangles( triangles, edges ); HalfEdgeDataStructure mesh; mesh.build( kNumVertices, triangles, edges ); @@ -112,7 +112,7 @@ HalfEdgeDataStructure makeTriangulatedDisk() triangles[5].v = { 0, 5, 1 }; triangles[6].v = { 4, 0, 2 }; std::vector< Edge > edges; - const int kNumVertices + const auto kNumVertices = HalfEdgeDataStructure::getUnorderedEdgesFromTriangles( triangles, edges ); HalfEdgeDataStructure mesh; mesh.build( kNumVertices, triangles, edges ); diff --git a/tests/topology/testImplicitDigitalSurface-benchmark.cpp b/tests/topology/testImplicitDigitalSurface-benchmark.cpp index 6c0eb0ee2c..a0c47bd22d 100644 --- a/tests/topology/testImplicitDigitalSurface-benchmark.cpp +++ b/tests/topology/testImplicitDigitalSurface-benchmark.cpp @@ -69,7 +69,7 @@ namespace DGtal { ++nbsurfels; } trace.info() << nbsurfels << " surfels found." << std::endl; - nb++, nbok += nbsurfels == 354382 ? 1 : 0; + nb++; nbok += nbsurfels == 354382 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "nbsurfels == 354382" << std::endl; trace.endBlock(); diff --git a/tests/topology/testLightImplicitDigitalSurface-benchmark.cpp b/tests/topology/testLightImplicitDigitalSurface-benchmark.cpp index eb043ea19a..8f33eb26ae 100644 --- a/tests/topology/testLightImplicitDigitalSurface-benchmark.cpp +++ b/tests/topology/testLightImplicitDigitalSurface-benchmark.cpp @@ -68,7 +68,7 @@ namespace DGtal { ++nbsurfels; } trace.info() << nbsurfels << " surfels found." << std::endl; - nb++, nbok += nbsurfels == 354382 ? 1 : 0; + nb++; nbok += nbsurfels == 354382 ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << "nbsurfels == 354382" << std::endl; trace.endBlock(); diff --git a/tests/topology/testObject.cpp b/tests/topology/testObject.cpp index 9bb2d210e4..0c88ce4c7c 100644 --- a/tests/topology/testObject.cpp +++ b/tests/topology/testObject.cpp @@ -323,13 +323,13 @@ bool testObject3D() trace.beginBlock ( "Components of diamond.border() ..." ); vector objects2; back_insert_iterator< vector< ObjectType > > inserter2( objects2 ); - unsigned int nbc0 = objects[ 0 ].border().writeComponents( inserter2 ); + auto nbc0 = objects[ 0 ].border().writeComponents( inserter2 ); INBLOCK_TEST( nbc0 == 1 ); INBLOCK_TEST( objects[ 0 ].computeConnectedness() == CONNECTED ); trace.endBlock(); trace.beginBlock ( "Components of diamond_clone.border() ..." ); - unsigned int nbc1 = objects[ 1 ].border().writeComponents( inserter2 ); + auto nbc1 = objects[ 1 ].border().writeComponents( inserter2 ); INBLOCK_TEST( nbc1 == 3 ); trace.endBlock(); for ( vector::const_iterator it = objects2.begin(); diff --git a/tests/topology/testUmbrellaComputer.cpp b/tests/topology/testUmbrellaComputer.cpp index 917f5f817a..a45d0cbc98 100644 --- a/tests/topology/testUmbrellaComputer.cpp +++ b/tests/topology/testUmbrellaComputer.cpp @@ -115,7 +115,7 @@ bool testUmbrellaComputer() ++nb_backward; bel = umbrella.surfel(); } while ( bel != init_bel ); - nb++, nbok += nb_forward == nb_backward ? 1 : 0; + nb++; nbok += nb_forward == nb_backward ? 1 : 0; trace.info() << "(" << nbok << "/" << nb << ") " << " nb_forward(" << nb_forward diff --git a/tests/topology/testVoxelComplex.cpp b/tests/topology/testVoxelComplex.cpp index dc417bbd5c..bb7acbe89a 100644 --- a/tests/topology/testVoxelComplex.cpp +++ b/tests/topology/testVoxelComplex.cpp @@ -316,7 +316,7 @@ TEST_CASE_METHOD(Fixture_complex_diamond, "Test table wrappers", trace.beginBlock("loadTable"); vc.setSimplicityTable(functions::loadTable(simplicity::tableSimple26_6)); trace.endBlock(); - size_t dim_voxel = 3; + auto dim_voxel = 3; auto cit = vc.begin(dim_voxel); for (auto &&n : std::vector(10)) ++cit; @@ -540,12 +540,11 @@ TEST_CASE_METHOD(Fixture_complex_fig4, "Get All Critical Cliques of fig4", } } -/* zeroSurance and oneSurface */ +/* zeroSurface and oneSurface */ TEST_CASE_METHOD(Fixture_complex_fig4, "zeroSurface and oneSurface", "[isSurface][function]") { auto &vc = complex_fixture; using namespace DGtal::functions; - using Point = FixtureComplex::Point; vc.clear(); Point c(0, 0, 0); {