[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] odd/brent 682f2ac 01/11: Relocate a function templat
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] odd/brent 682f2ac 01/11: Relocate a function template |
Date: |
Tue, 22 Jun 2021 16:54:04 -0400 (EDT) |
branch: odd/brent
commit 682f2ac0a21cb0061ad1f37f69e2afa8b41ad48d
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Relocate a function template
* zero2.hpp: Removed signum().
* zero3.hpp: Removed signum().
* zero.hpp: Moved signum() here, to define it OAOO.
Brent didn't use signum(), but Scherer did. It appeared in two headers,
so the unit test built but lmi didn't link. Moved it to a physically
appropriate header (which doesn't use it) to avoid that problem.
---
zero.hpp | 6 ++++++
zero2.hpp | 6 ------
zero3.hpp | 8 --------
3 files changed, 6 insertions(+), 14 deletions(-)
diff --git a/zero.hpp b/zero.hpp
index 30436c2..f7b8525 100644
--- a/zero.hpp
+++ b/zero.hpp
@@ -33,6 +33,12 @@
#include <limits>
#include <ostream>
+template<typename T>
+inline T signum(T t)
+{
+ return (0 == t) ? 0 : std::signbit(t) ? -1 : 1;
+}
+
enum root_bias
{bias_none // Return root z with f(z) closest to 0.0 .
,bias_lower // Require f(z) <= 0.0 .
diff --git a/zero2.hpp b/zero2.hpp
index c513e63..eb0171a 100644
--- a/zero2.hpp
+++ b/zero2.hpp
@@ -37,12 +37,6 @@
#include <iostream>
#include <limits>
-template<typename T>
-inline T signum(T t)
-{
- return (0 == t) ? 0 : std::signbit(t) ? -1 : 1;
-}
-
/// A C++ equivalent of Brent's algol60 original, for reference only.
#if 0
/// A C++ equivalent of Brent's algol60 original, for reference only.
diff --git a/zero3.hpp b/zero3.hpp
index 4ec6ce3..278ed3a 100644
--- a/zero3.hpp
+++ b/zero3.hpp
@@ -39,14 +39,6 @@
#include <iostream>
#include <limits>
-#if 0
-template<typename T>
-inline T signum(T t)
-{
- return (0 == t) ? 0 : std::signbit(t) ? -1 : 1;
-}
-#endif // 0
-
template<typename FunctionalType>
double chand
(double a
- [lmi-commits] [lmi] odd/brent updated (e2b9e33 -> 662390c), Greg Chicares, 2021/06/22
- [lmi-commits] [lmi] odd/brent 682f2ac 01/11: Relocate a function template,
Greg Chicares <=
- [lmi-commits] [lmi] odd/brent e83e0c6 04/11: Suppress suppression of secant technique, Greg Chicares, 2021/06/22
- [lmi-commits] [lmi] odd/brent 37cf014 08/11: Define a macro to choose IQI criterion, Greg Chicares, 2021/06/22
- [lmi-commits] [lmi] odd/brent b77190e 02/11: Print a trace of all lmi solves, Greg Chicares, 2021/06/22
- [lmi-commits] [lmi] odd/brent abbcf94 06/11: Remove a few stray commented-out lines, Greg Chicares, 2021/06/22
- [lmi-commits] [lmi] odd/brent b07c9d3 03/11: Experimentally suppress secant technique, Greg Chicares, 2021/06/22
- [lmi-commits] [lmi] odd/brent 083aae0 05/11: Remove an obsolete idea, Greg Chicares, 2021/06/22
- [lmi-commits] [lmi] odd/brent 117a974 09/11: Suppress detailed IQI comparison for the moment, Greg Chicares, 2021/06/22
- [lmi-commits] [lmi] odd/brent 335316f 07/11: Rewrite 'static constexpr' in branch as in master, Greg Chicares, 2021/06/22
- [lmi-commits] [lmi] odd/brent 662390c 11/11: Test Brent's method with Chandrupatla's IQI criterion, Greg Chicares, 2021/06/22
- [lmi-commits] [lmi] odd/brent a007bd6 10/11: Document a pessimization, Greg Chicares, 2021/06/22