Commit 3230ca63 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Fixes after merge with develop branch.

parent d863d7b7
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -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
+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 {
+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>
+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

+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>
@@ -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
@@ -57,6 +69,9 @@ public:

    /* DESTRUCTOR */
    ~MultiPrecision();
    
    mpf_t number;
#endif
};

MultiPrecision abs(const MultiPrecision);
Loading