35 #ifndef TEMPLATE_LAPACK_LAMCH_HEADER
36 #define TEMPLATE_LAPACK_LAMCH_HEADER
49 x = (*a >= 0 ? *a : - *a);
50 return( *b >= 0 ? x : -x);
55 #define log10e 0.43429448190325182765
71 Treal *scale, Treal *sumsq)
135 i__1 = (*n - 1) * *incx + 1;
137 for (ix = 1; i__2 < 0 ? ix >= i__1 : ix <= i__1; ix += i__2) {
139 absxi = (d__1 = x[ix],
absMACRO(d__1));
140 if (*scale < absxi) {
142 d__1 = *scale / absxi;
143 *sumsq = *sumsq * (d__1 * d__1) + 1;
147 d__1 = absxi / *scale;
148 *sumsq += d__1 * d__1;
164 template<
class Treal>
198 template<
class Treal>
245 Treal rmach, ret_val;
250 rmach = std::numeric_limits<Treal>::epsilon();
258 rmach = 2.0 * std::numeric_limits<Treal>::epsilon();
260 std::cout <<
"ERROR in template_lapack_lamch: case N not implemented." << std::endl;
261 throw "ERROR in template_lapack_lamch: case N not implemented.";
263 std::cout <<
"ERROR in template_lapack_lamch: case R not implemented." << std::endl;
264 throw "ERROR in template_lapack_lamch: case R not implemented.";
266 std::cout <<
"ERROR in template_lapack_lamch: case M not implemented." << std::endl;
267 throw "ERROR in template_lapack_lamch: case M not implemented.";
269 std::cout <<
"ERROR in template_lapack_lamch: case U not implemented." << std::endl;
270 throw "ERROR in template_lapack_lamch: case U not implemented.";
272 std::cout <<
"ERROR in template_lapack_lamch: case L not implemented." << std::endl;
273 throw "ERROR in template_lapack_lamch: case L not implemented.";
275 std::cout <<
"ERROR in template_lapack_lamch: case O not implemented." << std::endl;
276 throw "ERROR in template_lapack_lamch: case O not implemented.";