Loading CMakeLists.txt +8 −3 Original line number Diff line number Diff line Loading @@ -243,9 +243,14 @@ find_library(GMP_LIBRARIES gmp PATHS $ENV{GMPDIR} ${LIB_INSTALL_DIR}) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(GMP DEFAULT_MSG GMP_INCLUDES GMP_LIBRARIES) if( ${GMP_INCLUDES} STREQUAL "GMP_INCLUDES-NOTFOUND" OR ${GMP_LIBRARIES} STREQUAL "GMP_LIBRARIES-NOTFOUND" ) message( "GMP was not found. Some tests for higher precision arithmetics will not be passed." ) else() set( HAVE_GMP ) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I${GMP_INCLUDES} -DHAVE_GMP" ) set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${GMP_LIBRARIES}" ) mark_as_advanced(GMP_INCLUDES GMP_LIBRARIES) endif() #### # Check for some system header Loading src/TNL/Experimental/Arithmetics/Double.h +17 −6 Original line number Diff line number Diff line /************************************************** * filename: Double.h * * created: December 6, 2017 * * author: Daniel Simon * * mail: dansimon93@gmail.com * ***************************************************/ /*************************************************************************** Double.h - description ------------------- begin : Dec 6, 2017 copyright : (C) 2017 by Tomas Oberhuber email : tomas.oberhuber@fjfi.cvut.cz ***************************************************************************/ /* See Copyright Notice in tnl/Copyright */ /*** * Authors: * Oberhuber Tomas, tomas.oberhuber@fjfi.cvut.cz * Daniel Simon, dansimon93@gmail.com */ #pragma once namespace TNL { namespace Arithmetics { Loading src/TNL/Experimental/Arithmetics/Double_impl.h +17 −6 Original line number Diff line number Diff line /************************************************** * filename: Double_impl.h * * created: December 6, 2017 * * author: Daniel Simon * * mail: dansimon93@gmail.com * ***************************************************/ /*************************************************************************** Double_impl.h - description ------------------- begin : Dec 6, 2017 copyright : (C) 2017 by Tomas Oberhuber email : tomas.oberhuber@fjfi.cvut.cz ***************************************************************************/ /* See Copyright Notice in tnl/Copyright */ /*** * Authors: * Oberhuber Tomas, tomas.oberhuber@fjfi.cvut.cz * Daniel Simon, dansimon93@gmail.com */ #pragma once #include <cmath> #include <cstdio> Loading src/TNL/Experimental/Arithmetics/MultiPrecision.cpp +15 −6 Original line number Diff line number Diff line /************************************************** * filename: MultiPrecision.cpp * * created: November 11, 2017 * * author: Daniel Simon * * mail: dansimon93@gmail.com * ***************************************************/ /*************************************************************************** MultiPrecision.cpp - description ------------------- begin : Nov 11, 2017 copyright : (C) 2017 by Tomas Oberhuber email : tomas.oberhuber@fjfi.cvut.cz ***************************************************************************/ /* See Copyright Notice in tnl/Copyright */ /*** * Authors: * Oberhuber Tomas, tomas.oberhuber@fjfi.cvut.cz * Daniel Simon, dansimon93@gmail.com */ #ifdef HAVE_GMP Loading src/TNL/Experimental/Arithmetics/MultiPrecision.h +27 −12 Original line number Diff line number Diff line /************************************************** * filename: MultiPrecision.h * * created: November 11, 2017 * * author: Daniel Simon * * mail: dansimon93@gmail.com * ***************************************************/ /*************************************************************************** MultiPrecision.h - description ------------------- begin : Nov 11, 2017 copyright : (C) 2017 by Tomas Oberhuber email : tomas.oberhuber@fjfi.cvut.cz ***************************************************************************/ /*IMPLEMENTATION OF GMP LIBRARY - FLOATING POINT FUNCTIONS*/ /* Source: https://gmplib.org/ */ /* See Copyright Notice in tnl/Copyright */ /*** * Authors: * Oberhuber Tomas, tomas.oberhuber@fjfi.cvut.cz * Daniel Simon, dansimon93@gmail.com */ /**** * Wrapper class for GMP library: https://gmplib.org/ */ #pragma once #ifdef HAVE_GMP #include <gmp.h> Loading @@ -15,11 +27,11 @@ namespace TNL { namespace Arithmetics { class MultiPrecision{ class MultiPrecision { public: /* NUMBER */ mpf_t number; #ifdef HAVE_GMP /* CONSTRUCTORS */ MultiPrecision(); // initialize number to 0 explicit MultiPrecision(int); // assignment of signed long integer Loading Loading @@ -57,6 +69,9 @@ public: /* DESTRUCTOR */ ~MultiPrecision(); mpf_t number; #endif }; MultiPrecision abs(const MultiPrecision); Loading Loading
CMakeLists.txt +8 −3 Original line number Diff line number Diff line Loading @@ -243,9 +243,14 @@ find_library(GMP_LIBRARIES gmp PATHS $ENV{GMPDIR} ${LIB_INSTALL_DIR}) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(GMP DEFAULT_MSG GMP_INCLUDES GMP_LIBRARIES) if( ${GMP_INCLUDES} STREQUAL "GMP_INCLUDES-NOTFOUND" OR ${GMP_LIBRARIES} STREQUAL "GMP_LIBRARIES-NOTFOUND" ) message( "GMP was not found. Some tests for higher precision arithmetics will not be passed." ) else() set( HAVE_GMP ) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I${GMP_INCLUDES} -DHAVE_GMP" ) set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${GMP_LIBRARIES}" ) mark_as_advanced(GMP_INCLUDES GMP_LIBRARIES) endif() #### # Check for some system header Loading
src/TNL/Experimental/Arithmetics/Double.h +17 −6 Original line number Diff line number Diff line /************************************************** * filename: Double.h * * created: December 6, 2017 * * author: Daniel Simon * * mail: dansimon93@gmail.com * ***************************************************/ /*************************************************************************** Double.h - description ------------------- begin : Dec 6, 2017 copyright : (C) 2017 by Tomas Oberhuber email : tomas.oberhuber@fjfi.cvut.cz ***************************************************************************/ /* See Copyright Notice in tnl/Copyright */ /*** * Authors: * Oberhuber Tomas, tomas.oberhuber@fjfi.cvut.cz * Daniel Simon, dansimon93@gmail.com */ #pragma once namespace TNL { namespace Arithmetics { Loading
src/TNL/Experimental/Arithmetics/Double_impl.h +17 −6 Original line number Diff line number Diff line /************************************************** * filename: Double_impl.h * * created: December 6, 2017 * * author: Daniel Simon * * mail: dansimon93@gmail.com * ***************************************************/ /*************************************************************************** Double_impl.h - description ------------------- begin : Dec 6, 2017 copyright : (C) 2017 by Tomas Oberhuber email : tomas.oberhuber@fjfi.cvut.cz ***************************************************************************/ /* See Copyright Notice in tnl/Copyright */ /*** * Authors: * Oberhuber Tomas, tomas.oberhuber@fjfi.cvut.cz * Daniel Simon, dansimon93@gmail.com */ #pragma once #include <cmath> #include <cstdio> Loading
src/TNL/Experimental/Arithmetics/MultiPrecision.cpp +15 −6 Original line number Diff line number Diff line /************************************************** * filename: MultiPrecision.cpp * * created: November 11, 2017 * * author: Daniel Simon * * mail: dansimon93@gmail.com * ***************************************************/ /*************************************************************************** MultiPrecision.cpp - description ------------------- begin : Nov 11, 2017 copyright : (C) 2017 by Tomas Oberhuber email : tomas.oberhuber@fjfi.cvut.cz ***************************************************************************/ /* See Copyright Notice in tnl/Copyright */ /*** * Authors: * Oberhuber Tomas, tomas.oberhuber@fjfi.cvut.cz * Daniel Simon, dansimon93@gmail.com */ #ifdef HAVE_GMP Loading
src/TNL/Experimental/Arithmetics/MultiPrecision.h +27 −12 Original line number Diff line number Diff line /************************************************** * filename: MultiPrecision.h * * created: November 11, 2017 * * author: Daniel Simon * * mail: dansimon93@gmail.com * ***************************************************/ /*************************************************************************** MultiPrecision.h - description ------------------- begin : Nov 11, 2017 copyright : (C) 2017 by Tomas Oberhuber email : tomas.oberhuber@fjfi.cvut.cz ***************************************************************************/ /*IMPLEMENTATION OF GMP LIBRARY - FLOATING POINT FUNCTIONS*/ /* Source: https://gmplib.org/ */ /* See Copyright Notice in tnl/Copyright */ /*** * Authors: * Oberhuber Tomas, tomas.oberhuber@fjfi.cvut.cz * Daniel Simon, dansimon93@gmail.com */ /**** * Wrapper class for GMP library: https://gmplib.org/ */ #pragma once #ifdef HAVE_GMP #include <gmp.h> Loading @@ -15,11 +27,11 @@ namespace TNL { namespace Arithmetics { class MultiPrecision{ class MultiPrecision { public: /* NUMBER */ mpf_t number; #ifdef HAVE_GMP /* CONSTRUCTORS */ MultiPrecision(); // initialize number to 0 explicit MultiPrecision(int); // assignment of signed long integer Loading Loading @@ -57,6 +69,9 @@ public: /* DESTRUCTOR */ ~MultiPrecision(); mpf_t number; #endif }; MultiPrecision abs(const MultiPrecision); Loading