From c98bce4c16c70db131091ece64a7f4192ee2c3af Mon Sep 17 00:00:00 2001 From: Matt Signorelli Date: Wed, 8 Jan 2025 12:31:38 -0500 Subject: [PATCH] signbit --- docs/src/man/n_all.md | 2 +- src/GTPSA.jl | 1 + src/operators.jl | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/src/man/n_all.md b/docs/src/man/n_all.md index 925cc051..d9ec9c72 100644 --- a/docs/src/man/n_all.md +++ b/docs/src/man/n_all.md @@ -7,7 +7,7 @@ acos, atan, acsc, asec, acot, asinh, acosh, atanh, acsch, asech, acoth, zero, zeros, one, ones, real, imag, conj, angle, complex, promote_rule, getindex, setindex!, ==, <, >, <=, >=, !=, isequal, isless, isinf, isnan, show, copy!, lastindex, firstindex, rand, -unsafe_convert, eps, floatmin, floatmax +unsafe_convert, eps, floatmin, floatmax, signbit ``` `zeros` and `ones` are overloaded from Base so that allocated `TPS`s are placed in each element. Because of the mutability of `TPS`, if we didn't explicity overload these functions every element would correspond to the exact same heap-allocated TPS. diff --git a/src/GTPSA.jl b/src/GTPSA.jl index c5220183..4fbf4ba0 100644 --- a/src/GTPSA.jl +++ b/src/GTPSA.jl @@ -72,6 +72,7 @@ import Base: +, eps, floatmin, floatmax, + signbit, delete! import LinearAlgebra: norm, mul!, copy_oftype, copymutable_oftype diff --git a/src/operators.jl b/src/operators.jl index d1adb0c2..e947c613 100644 --- a/src/operators.jl +++ b/src/operators.jl @@ -94,6 +94,7 @@ isnan(t1::TPS) = isnan(geti(t1, 0)) eps(t1::TPS) = eps(numtype(t1)) floatmin(t1::TPS) = floatmin(numtype(t1)) floatmax(t1::TPS) = floatmax(numtype(t1)) +signbit(t1::TPS) = signbit(geti(t1, 0)) # --- Compare entire TPS (monomial-by-monomial) --- isequal(t1::TPS{Float64}, t2::TPS{Float64}) = equ(t1, t2, 0)