|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r73660 - in sandbox/big_number: boost/math/big_number libs/math/test
From: john_at_[hidden]
Date: 2011-08-11 12:09:25
Author: johnmaddock
Date: 2011-08-11 12:09:23 EDT (Thu, 11 Aug 2011)
New Revision: 73660
URL: http://svn.boost.org/trac/boost/changeset/73660
Log:
Fix code to compile with GCC.
Text files modified:
sandbox/big_number/boost/math/big_number/gmp.hpp | 10 +++++-----
sandbox/big_number/libs/math/test/linpack-benchmark.cpp | 38 ++++++++++++++++----------------------
2 files changed, 21 insertions(+), 27 deletions(-)
Modified: sandbox/big_number/boost/math/big_number/gmp.hpp
==============================================================================
--- sandbox/big_number/boost/math/big_number/gmp.hpp (original)
+++ sandbox/big_number/boost/math/big_number/gmp.hpp 2011-08-11 12:09:23 EDT (Thu, 11 Aug 2011)
@@ -313,9 +313,9 @@
{
mpf_init2(this->m_data, ((digits10 + 1) * 1000L) / 301L);
}
- gmp_real(const gmp_real& o) : gmp_real_imp(o) {}
+ gmp_real(const gmp_real& o) : detail::gmp_real_imp<digits10>(o) {}
#ifndef BOOST_NO_RVALUE_REFERENCES
- gmp_real(gmp_real&& o) : gmp_real_imp(o) {}
+ gmp_real(gmp_real&& o) : detail::gmp_real_imp<digits10>(o) {}
#endif
gmp_real& operator=(const gmp_real& o)
{
@@ -348,9 +348,9 @@
{
mpf_init2(this->m_data, ((digits10 + 1) * 1000L) / 301L);
}
- gmp_real(const gmp_real& o) : gmp_real_imp(o) {}
+ gmp_real(const gmp_real& o) : detail::gmp_real_imp<0>(o) {}
#ifndef BOOST_NO_RVALUE_REFERENCES
- gmp_real(gmp_real&& o) : gmp_real_imp(o) {}
+ gmp_real(gmp_real&& o) : detail::gmp_real_imp<0>(o) {}
#endif
gmp_real(const gmp_real& o, unsigned digits10)
{
@@ -467,7 +467,7 @@
big_number<gmp_real<Digits10> > frexp(const big_number<gmp_real<Digits10> >& val, long* e)
{
mpf_get_d_2exp(e, val.backend().data());
- return ldexp(val, -*v);
+ return ldexp(val, -*e);
}
struct gmp_int
Modified: sandbox/big_number/libs/math/test/linpack-benchmark.cpp
==============================================================================
--- sandbox/big_number/libs/math/test/linpack-benchmark.cpp (original)
+++ sandbox/big_number/libs/math/test/linpack-benchmark.cpp 2011-08-11 12:09:23 EDT (Thu, 11 Aug 2011)
@@ -17,6 +17,7 @@
#include <boost/lexical_cast.hpp>
#include <iostream>
#include <iomanip>
+#include <cmath>
#ifdef TEST_BIG_NUMBER
#include <boost/math/big_number/gmp.hpp>
typedef boost::math::mpf_real_100 real_type;
@@ -82,8 +83,20 @@
return ((double)(clock())) / CLOCKS_PER_SEC;
}
+int dgefa_(real_type *, integer *, integer *, integer *, integer *), dgesl_(real_type *, integer *, integer *, integer *, real_type *, integer *);
+int dmxpy_(integer *, real_type *, integer *, integer *, real_type *, real_type *);
+int matgen_(real_type *, integer *, integer *, real_type *, real_type *);
+real_type epslon_(real_type *);
+real_type ran_(integer *);
+int dscal_(integer *, real_type *, real_type *, integer *);
+int daxpy_(integer *, real_type *, real_type *, integer *, real_type *, integer *);
+integer idamax_(integer *, real_type *, integer *);
+real_type ddot_(integer *, real_type *, integer *, real_type *, integer *);
+int daxpy_(integer *, real_type *, real_type *, integer *, real_type *, integer *);
+int dmxpy_(integer *, real_type *, integer *, integer *, real_type *, real_type *);
-int main()
+
+extern "C" int MAIN__()
{
#ifdef TEST_BIG_NUMBER
std::cout << "Testing big_number<mpf_real<100> >" << std::endl;
@@ -133,17 +146,9 @@
static integer info;
static double time[6], cray, total;
static integer ipvt[1000];
- extern /* Subroutine */ int dgefa_(real_type *, integer *, integer *,
- integer *, integer *), dgesl_(real_type *, integer *, integer *,
- integer *, real_type *, integer *);
static real_type resid, norma;
- extern /* Subroutine */ int dmxpy_(integer *, real_type *, integer *,
- integer *, real_type *, real_type *);
static real_type normx;
- extern /* Subroutine */ int matgen_(real_type *, integer *, integer *,
- real_type *, real_type *);
static real_type residn;
- extern real_type epslon_(real_type *);
/* Fortran I/O blocks */
static cilist io___4 = { 0, 6, 0, fmt_1, 0 };
@@ -270,7 +275,6 @@
/* Local variables */
static integer i__, j;
- extern real_type ran_(integer *);
static integer init[4];
@@ -325,10 +329,6 @@
static integer j, k, l;
static real_type t;
static integer kp1, nm1;
- extern /* Subroutine */ int dscal_(integer *, real_type *, real_type *,
- integer *), daxpy_(integer *, real_type *, real_type *, integer
- *, real_type *, integer *);
- extern integer idamax_(integer *, real_type *, integer *);
/* dgefa factors a double precision matrix by gaussian elimination. */
@@ -465,10 +465,6 @@
static integer k, l;
static real_type t;
static integer kb, nm1;
- extern real_type ddot_(integer *, real_type *, integer *, real_type *,
- integer *);
- extern /* Subroutine */ int daxpy_(integer *, real_type *, real_type *,
- integer *, real_type *, integer *);
/* dgesl solves the double precision system */
@@ -917,9 +913,9 @@
real_type epslon_(real_type *x)
{
#ifdef TEST_BIG_NUMBER
- return ldexp(1.0, 1 - ((100 + 1) * 1000L) / 301L);
+ return std::ldexp(1.0, 1 - ((100 + 1) * 1000L) / 301L);
#elif defined(TEST_GMPXX)
- return ldexp(1.0, 1 - ((100 + 1) * 1000L) / 301L);
+ return std::ldexp(1.0, 1 - ((100 + 1) * 1000L) / 301L);
#else
return CAST_TO_RT(std::numeric_limits<real_type>::epsilon());
#endif
@@ -934,8 +930,6 @@
/* Local variables */
static integer i__, j;
- extern /* Subroutine */ int dmxpy_(integer *, real_type *, integer *,
- integer *, real_type *, real_type *);
/* purpose: */
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk