From 15df0acf4673cac38a5dadaa5a113600c973386b Mon Sep 17 00:00:00 2001 From: mattsignorelli Date: Fri, 12 Jul 2024 12:40:54 -0400 Subject: [PATCH] length -> lengthTPS --- docs/src/man/k_methods.md | 1 + docs/src/man/o_all.md | 4 ++-- src/GTPSA.jl | 2 +- src/getset.jl | 12 ++---------- src/low_level/rtpsa.jl | 4 ++-- src/methods.jl | 2 -- src/operators.jl | 2 +- 7 files changed, 9 insertions(+), 18 deletions(-) diff --git a/docs/src/man/k_methods.md b/docs/src/man/k_methods.md index e32f32d7..06d5fcfd 100644 --- a/docs/src/man/k_methods.md +++ b/docs/src/man/k_methods.md @@ -15,6 +15,7 @@ getord getord! integ integ! +lengthTPS scalar setTPS! translate diff --git a/docs/src/man/o_all.md b/docs/src/man/o_all.md index 04e64adb..71867655 100644 --- a/docs/src/man/o_all.md +++ b/docs/src/man/o_all.md @@ -1,12 +1,12 @@ # [All Overloaded Functions](@id all) -The following functions from Base have been overloaded for operations with `TPS`/`ComplexTPS`, and also maps: +The following functions from Base have been overloaded for operations with `TPS`/`ComplexTPS`: ``` +, -, *, /, ^, ∘, inv, atan, hypot, abs, sqrt, exp, log, sin, cos, tan, csc, sec, cot, sinc, sinh, cosh, tanh, csch, sech, coth, asin, 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, show, copy!, length, lastindex, firstindex, +>, <=, >=, !=, isequal, show, copy!, lastindex, firstindex, rand ``` diff --git a/src/GTPSA.jl b/src/GTPSA.jl index 92e79e35..e35a4643 100644 --- a/src/GTPSA.jl +++ b/src/GTPSA.jl @@ -61,7 +61,6 @@ import Base: +, isequal, show, copy!, - length, lastindex, firstindex, rand @@ -123,6 +122,7 @@ export par, scalar, setTPS!, + lengthTPS, # Temporaries: @FastGTPSA, diff --git a/src/getset.jl b/src/getset.jl index 8605a3c0..933dc0fd 100644 --- a/src/getset.jl +++ b/src/getset.jl @@ -126,12 +126,12 @@ len(t::Ptr{RTPSA}) = mad_tpsa_len(t,false) len(t::Ptr{CTPSA}) = mad_ctpsa_len(t,false) """ - length(t::Union{TPS,ComplexTPS} + lengthTPS(t::Union{TPS,ComplexTPS} Returns the maximum number of monomials (including the scalar part) in the `TPS`/`ComplexTPS` given its `Descriptor`. """ -length(t::Union{TPS,ComplexTPS}) = len(t.tpsa) +lengthTPS(t::Union{TPS,ComplexTPS}) = len(t.tpsa) firstindex(t::Union{TPS,ComplexTPS}) = 0 lastindex(t::Union{TPS,ComplexTPS}) = length(t)-1 @@ -511,14 +511,6 @@ function jacobiant(m::AbstractVector{<:Union{TPS,ComplexTPS}}; include_params=fa return result end -#= -""" - -""" -function uniform_hessian!() - -end -=# """ GTPSA.hessian!(result, t::Union{TPS,ComplexTPS}; include_params=false) diff --git a/src/low_level/rtpsa.jl b/src/low_level/rtpsa.jl index 89e91547..339ba987 100644 --- a/src/low_level/rtpsa.jl +++ b/src/low_level/rtpsa.jl @@ -148,7 +148,7 @@ end """ - mad_tpsa_nam(t::Ptr{RTPSA}, nam_::Cstring)::Cstring + mad_tpsa_nam(t::Ptr{RTPSA}, nam_)::Cstring Get the name of the TPSA, and will optionally set if `nam_ != null` @@ -159,7 +159,7 @@ Get the name of the TPSA, and will optionally set if `nam_ != null` ### Output - `ret` -- Name of RTPSA (null terminated in C) """ -function mad_tpsa_nam(t::Ptr{RTPSA}, nam_::Cstring)::Cstring +function mad_tpsa_nam(t::Ptr{RTPSA}, nam_)::Cstring ret = @ccall MAD_TPSA.mad_tpsa_nam(t::Ptr{RTPSA}, nam_::Cstring)::Cstring return ret end diff --git a/src/methods.jl b/src/methods.jl index 99a9a741..92eada37 100644 --- a/src/methods.jl +++ b/src/methods.jl @@ -529,8 +529,6 @@ function ∘(ma::Vector{<:Union{TPS,ComplexTPS}}, mb::Vector{<:Union{TPS,Complex return mc end -compose = ∘ - # --- translate --- translate!(na::Cint, ma::Vector{Ptr{RTPSA}}, nb::Cint, tb::Vector{Float64}, mc::Vector{Ptr{RTPSA}}) = mad_tpsa_translate!(na, ma, nb, tb, mc) translate!(na::Cint, ma::Vector{Ptr{CTPSA}}, nb::Cint, tb::Vector{ComplexF64}, mc::Vector{Ptr{CTPSA}}) = mad_ctpsa_translate!(na, ma, nb, tb, mc) diff --git a/src/operators.jl b/src/operators.jl index 4fcd4776..426cd331 100644 --- a/src/operators.jl +++ b/src/operators.jl @@ -64,7 +64,7 @@ Generate a `TPS`/`ComplexTPS` with all random coefficients. """ function rand(::Type{T}; use::Union{Descriptor,TPS,ComplexTPS}=GTPSA.desc_current) where {T<:Union{TPS,ComplexTPS}} t = T(use=use) - len = length(t) + len = lengthTPS(t) for i=0:len-1 t[i] = rand(numtype(T)) end