# HG changeset patch # User jwe # Date 1194484184 0 # Node ID d07cb867891b6313a292444eb69f3667287b9318 # Parent 0b58070191725c94539ee8a60d8415ea08758d65 [project @ 2007-11-08 01:09:44 by jwe] diff -r 0b5807019172 -r d07cb867891b liboctave/CMatrix.cc --- 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 (minmn); + double dsmlsizp1 = static_cast (smlsiz+1); #if defined (HAVE_LOG2) - double tmp = log2 (minmn) / static_cast (smlsiz+1) + 1; + double tmp = log2 (dminmn) / dsmlsizp1 + 1; #else - double tmp = log (minmn) / static_cast (smlsiz+1) / log (2) + 1; + double tmp = log (dminmn) / dsmlsizp1 / log (2.0) + 1; #endif octave_idx_type nlvl = static_cast (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 (minmn); + double dsmlsizp1 = static_cast (smlsiz+1); #if defined (HAVE_LOG2) - double tmp = log2 (minmn) / static_cast (smlsiz+1) + 1; + double tmp = log2 (dminmn) / dsmlsizp1 + 1; #else - double tmp = log (minmn) / static_cast (smlsiz+1) / log (2) + 1; + double tmp = log (dminmn) / dsmlsizp1 / log (2.0) + 1; #endif octave_idx_type nlvl = static_cast (tmp); if (nlvl < 0) diff -r 0b5807019172 -r d07cb867891b liboctave/ChangeLog --- 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 + + * dMatrix.cc, CMatrix.cc: Help MSVC compiler to resolve + ambiguities related to math functions (in C++ mode). + 2007-11-06 David Bateman * intNDArray.cc (intNDArray intNDArray::sum (int) const): diff -r 0b5807019172 -r d07cb867891b liboctave/dMatrix.cc --- 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 (minmn); + double dsmlsizp1 = static_cast (smlsiz+1); #if defined (HAVE_LOG2) - double tmp = log2 (minmn) / static_cast (smlsiz+1) + 1; + double tmp = log2 (dminmn) / dsmlsizp1 + 1; #else - double tmp = log (minmn) / static_cast (smlsiz+1) / log (2) + 1; + double tmp = log (dminmn) / dsmlsizp1 / log (2.0) + 1; #endif octave_idx_type nlvl = static_cast (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 (minmn); + double dsmlsizp1 = static_cast (smlsiz+1); #if defined (HAVE_LOG2) - double tmp = log2 (minmn) / static_cast (smlsiz+1) + 1; + double tmp = log2 (dminmn) / dsmlsizp1 + 1; #else - double tmp = log (minmn) / static_cast (smlsiz+1) / log (2) + 1; + double tmp = log (dminmn) / dsmlsizp1 / log (2.0) + 1; #endif octave_idx_type nlvl = static_cast (tmp); if (nlvl < 0)