changeset 7124:d07cb867891b

[project @ 2007-11-08 01:09:44 by jwe]
author jwe
date Thu, 08 Nov 2007 01:09:44 +0000
parents 0b5807019172
children f084ba47812b
files liboctave/CMatrix.cc liboctave/ChangeLog liboctave/dMatrix.cc
diffstat 3 files changed, 21 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/CMatrix.cc	Wed Nov 07 22:03:34 2007 +0000
+++ b/liboctave/CMatrix.cc	Thu Nov 08 01:09:44 2007 +0000
@@ -2498,10 +2498,12 @@
       // We compute the size of rwork and iwork because ZGELSD in
       // older versions of LAPACK does not return them on a query
       // call.
+      double dminmn = static_cast<double> (minmn);
+      double dsmlsizp1 = static_cast<double> (smlsiz+1);
 #if defined (HAVE_LOG2)
-      double tmp = log2 (minmn) / static_cast<double> (smlsiz+1) + 1;
+      double tmp = log2 (dminmn) / dsmlsizp1 + 1;
 #else
-      double tmp = log (minmn) / static_cast<double> (smlsiz+1) / log (2) + 1;
+      double tmp = log (dminmn) / dsmlsizp1 / log (2.0) + 1;
 #endif
       octave_idx_type nlvl = static_cast<int> (tmp);
       if (nlvl < 0)
@@ -2668,10 +2670,12 @@
       // We compute the size of rwork and iwork because ZGELSD in
       // older versions of LAPACK does not return them on a query
       // call.
+      double dminmn = static_cast<double> (minmn);
+      double dsmlsizp1 = static_cast<double> (smlsiz+1);
 #if defined (HAVE_LOG2)
-      double tmp = log2 (minmn) / static_cast<double> (smlsiz+1) + 1;
+      double tmp = log2 (dminmn) / dsmlsizp1 + 1;
 #else
-      double tmp = log (minmn) / static_cast<double> (smlsiz+1) / log (2) + 1;
+      double tmp = log (dminmn) / dsmlsizp1 / log (2.0) + 1;
 #endif
       octave_idx_type nlvl = static_cast<int> (tmp);
       if (nlvl < 0)
--- a/liboctave/ChangeLog	Wed Nov 07 22:03:34 2007 +0000
+++ b/liboctave/ChangeLog	Thu Nov 08 01:09:44 2007 +0000
@@ -1,3 +1,8 @@
+2007-11-07  Michael Goffioul <michael.goffioul@gmail.com>
+
+	* dMatrix.cc, CMatrix.cc: Help MSVC compiler to resolve
+	ambiguities related to math functions (in C++ mode).
+
 2007-11-06  David Bateman  <dbateman@free.fr>
 
 	* intNDArray.cc (intNDArray<T> intNDArray<T>::sum (int) const):
--- a/liboctave/dMatrix.cc	Wed Nov 07 22:03:34 2007 +0000
+++ b/liboctave/dMatrix.cc	Thu Nov 08 01:09:44 2007 +0000
@@ -2108,10 +2108,12 @@
 
       // We compute the size of iwork because DGELSD in older versions
       // of LAPACK does not return it on a query call.
+      double dminmn = static_cast<double> (minmn);
+      double dsmlsizp1 = static_cast<double> (smlsiz+1);
 #if defined (HAVE_LOG2)
-      double tmp = log2 (minmn) / static_cast<double> (smlsiz+1) + 1;
+      double tmp = log2 (dminmn) / dsmlsizp1 + 1;
 #else
-      double tmp = log (minmn) / static_cast<double> (smlsiz+1) / log (2) + 1;
+      double tmp = log (dminmn) / dsmlsizp1 / log (2.0) + 1;
 #endif
       octave_idx_type nlvl = static_cast<int> (tmp);
       if (nlvl < 0)
@@ -2271,10 +2273,12 @@
 
       // We compute the size of iwork because DGELSD in older versions
       // of LAPACK does not return it on a query call.
+      double dminmn = static_cast<double> (minmn);
+      double dsmlsizp1 = static_cast<double> (smlsiz+1);
 #if defined (HAVE_LOG2)
-      double tmp = log2 (minmn) / static_cast<double> (smlsiz+1) + 1;
+      double tmp = log2 (dminmn) / dsmlsizp1 + 1;
 #else
-      double tmp = log (minmn) / static_cast<double> (smlsiz+1) / log (2) + 1;
+      double tmp = log (dminmn) / dsmlsizp1 / log (2.0) + 1;
 #endif
       octave_idx_type nlvl = static_cast<int> (tmp);
       if (nlvl < 0)