comparison liboctave/array/dMatrix.cc @ 18881:ff4da3c8ed16 stable

use gnulib log2 modules (bug #42583) * bootstrap.conf (gnulib_modules): Include log2, log2f, log2-ieee, and log2f-ieee, in the list. * lo-mappers.cc (xlog2): Use gnulib:: versions of log2 and log2f. * CMatrix.cc, dMatrix.cc, fCMatrix.cc, fMatrix.cc: Use xlog2.
author John W. Eaton <jwe@octave.org>
date Thu, 19 Jun 2014 15:49:14 -0400
parents 49a5a4be04a1
children b314efd58072
comparison
equal deleted inserted replaced
18879:161b11e7da2d 18881:ff4da3c8ed16
2318 2318
2319 // We compute the size of iwork because DGELSD in older versions 2319 // We compute the size of iwork because DGELSD in older versions
2320 // of LAPACK does not return it on a query call. 2320 // of LAPACK does not return it on a query call.
2321 double dminmn = static_cast<double> (minmn); 2321 double dminmn = static_cast<double> (minmn);
2322 double dsmlsizp1 = static_cast<double> (smlsiz+1); 2322 double dsmlsizp1 = static_cast<double> (smlsiz+1);
2323 #if defined (HAVE_LOG2) 2323 double tmp = xlog2 (dminmn / dsmlsizp1);
2324 double tmp = log2 (dminmn / dsmlsizp1); 2324
2325 #else
2326 double tmp = log (dminmn / dsmlsizp1) / log (2.0);
2327 #endif
2328 octave_idx_type nlvl = static_cast<octave_idx_type> (tmp) + 1; 2325 octave_idx_type nlvl = static_cast<octave_idx_type> (tmp) + 1;
2329 if (nlvl < 0) 2326 if (nlvl < 0)
2330 nlvl = 0; 2327 nlvl = 0;
2331 2328
2332 octave_idx_type liwork = 3 * minmn * nlvl + 11 * minmn; 2329 octave_idx_type liwork = 3 * minmn * nlvl + 11 * minmn;
2509 2506
2510 // We compute the size of iwork because DGELSD in older versions 2507 // We compute the size of iwork because DGELSD in older versions
2511 // of LAPACK does not return it on a query call. 2508 // of LAPACK does not return it on a query call.
2512 double dminmn = static_cast<double> (minmn); 2509 double dminmn = static_cast<double> (minmn);
2513 double dsmlsizp1 = static_cast<double> (smlsiz+1); 2510 double dsmlsizp1 = static_cast<double> (smlsiz+1);
2514 #if defined (HAVE_LOG2) 2511 double tmp = xlog2 (dminmn / dsmlsizp1);
2515 double tmp = log2 (dminmn / dsmlsizp1); 2512
2516 #else
2517 double tmp = log (dminmn / dsmlsizp1) / log (2.0);
2518 #endif
2519 octave_idx_type nlvl = static_cast<octave_idx_type> (tmp) + 1; 2513 octave_idx_type nlvl = static_cast<octave_idx_type> (tmp) + 1;
2520 if (nlvl < 0) 2514 if (nlvl < 0)
2521 nlvl = 0; 2515 nlvl = 0;
2522 2516
2523 octave_idx_type liwork = 3 * minmn * nlvl + 11 * minmn; 2517 octave_idx_type liwork = 3 * minmn * nlvl + 11 * minmn;