Skip to content

Commit

Permalink
length -> lengthTPS
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsignorelli committed Jul 12, 2024
1 parent 689ee9e commit 15df0ac
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 18 deletions.
1 change: 1 addition & 0 deletions docs/src/man/k_methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ getord
getord!
integ
integ!
lengthTPS
scalar
setTPS!
translate
Expand Down
4 changes: 2 additions & 2 deletions docs/src/man/o_all.md
Original file line number Diff line number Diff line change
@@ -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
```

Expand Down
2 changes: 1 addition & 1 deletion src/GTPSA.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ import Base: +,
isequal,
show,
copy!,
length,
lastindex,
firstindex,
rand
Expand Down Expand Up @@ -123,6 +122,7 @@ export
par,
scalar,
setTPS!,
lengthTPS,

# Temporaries:
@FastGTPSA,
Expand Down
12 changes: 2 additions & 10 deletions src/getset.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/low_level/rtpsa.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand All @@ -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
Expand Down
2 changes: 0 additions & 2 deletions src/methods.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/operators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 15df0ac

Please sign in to comment.