From fefa834a45ea6849b092bd0e702ff526d0d66f6c Mon Sep 17 00:00:00 2001 From: Matt Signorelli Date: Mon, 14 Aug 2023 16:32:14 -0400 Subject: [PATCH] All mad_mono, mad_desc, mad_tpsa, mad_ctpsa lowest-level methods implemented --- src/ComplexTPSA.jl | 2585 ++++++++++++++++++++++++++++++++++++++++++++ src/Descriptor.jl | 339 ++++++ src/Monomial.jl | 336 ++++++ src/RealTPSA.jl | 1868 ++++++++++++++++++++++++++++++++ src/TPSA.jl | 2545 +------------------------------------------ src/temp.jl | 117 ++ 6 files changed, 5246 insertions(+), 2544 deletions(-) create mode 100644 src/Monomial.jl create mode 100644 src/temp.jl diff --git a/src/ComplexTPSA.jl b/src/ComplexTPSA.jl index 6d014dd0..ed26dbf2 100644 --- a/src/ComplexTPSA.jl +++ b/src/ComplexTPSA.jl @@ -12,4 +12,2589 @@ mutable struct CTPSA{T} nam::NTuple{NAMSZ,Cuchar} # tpsa name coef::Ptr{ComplexF64} # warning: must be identical to ctpsa up to coef excluded end + + +""" + mad_ctpsa_newd(d::Ptr{Desc{RTPSA,CTPSA}}, mo::Cuchar)::Ptr{CTPSA{Desc}} + +Creates a complex TPSA defined by the specified descriptor and maximum order. If mad_ctpsa_DEFAULT +is passed for mo, the mo defined in the descriptor is used. If mo > d_mo, mo = d_mo. + +### Input +- `d` -- Descriptor +- `mo` -- Maximum order + +### Output +- `t` -- New complex TPSA defined by the descriptor +""" +function mad_ctpsa_newd(d::Ptr{Desc{RTPSA,CTPSA}}, mo::Cuchar)::Ptr{CTPSA{Desc}} + t = @ccall MAD_TPSA.mad_ctpsa_newd(d::Ptr{Desc{RTPSA,CTPSA}}, mo::Cuchar)::Ptr{CTPSA{Desc}} + return t +end + + +""" + mad_ctpsa_new(t::Ptr{CTPSA{Desc}}, mo::Cuchar)::Ptr{CTPSA{Desc}} + +Creates a complex TPSA copy of the inputted TPSA, with maximum order specified by mo. +If mad_ctpsa_SAME is passed for mo, the mo currently in t is used for the created TPSA. + ok with t=(tpsa_t*)ctpsa + +### Input +- `t` -- Complex TPSA to copy +- `mo` -- Maximum order of new TPSA + +### Output +- `ret` -- New complex TPSA with maximum order mo +""" +function mad_ctpsa_new(t::Ptr{CTPSA{Desc}}, mo::Cuchar)::Ptr{CTPSA{Desc}} + ret = @ccall MAD_TPSA.mad_ctpsa_new(t::Ptr{CTPSA{Desc}}, mo::Cuchar)::Ptr{CTPSA{Desc}} + return ret +end + + +""" + mad_ctpsa_del!(t::Ptr{CTPSA{Desc}}) + +Calls the destructor for the complex TPSA. + +### Input +- `t` -- Complex TPSA to destruct +""" +function mad_ctpsa_del!(t::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_del(t::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_desc(t::Ptr{CTPSA{Desc}})::Ptr{Desc{RTPSA,CTPSA}} + +Gets the descriptor for the complex TPSA. + +### Input +- `t` -- Complex TPSA + +### Output +- `ret` -- Descriptor for the TPSA +""" +function mad_ctpsa_desc(t::Ptr{CTPSA{Desc}})::Ptr{Desc{RTPSA,CTPSA}} + ret = @ccall MAD_TPSA.mad_ctpsa_desc(t::Ptr{CTPSA{Desc}})::Ptr{Desc{RTPSA,CTPSA}} + return ret +end + + +""" + mad_ctpsa_uid!(t::Ptr{CTPSA{Desc}}, uid_::Cint)::Cint + +Sets the TPSA uid if uid_ != 0, and returns the current (previous if set) TPSA uid. + +### Input +- `t` -- Complex TPSA +- `uid_` -- uid to set in the TPSA if uid_ != 0 + +### Output +- `ret` -- Current (previous if set) TPSA uid +""" +function mad_ctpsa_uid!(t::Ptr{CTPSA{Desc}}, uid_::Cint)::Cint + ret = @ccall MAD_TPSA.mad_ctpsa_uid(t::Ptr{CTPSA{Desc}}, uid_::Cint)::Cint + return ret +end + + +""" + mad_ctpsa_len(t::Ptr{CTPSA{Desc}})::Cint + +??? + +### Input +- `t` -- Complex TPSA + +### Output +- `ret` -- Monomials in CTPSA +""" +function mad_ctpsa_len(t::Ptr{CTPSA{Desc}})::Cint + ret = @ccall MAD_TPSA.mad_ctpsa_len(t::Ptr{CTPSA,CTPSA})::Cint + return ret +end + + +""" + mad_ctpsa_nam(t::Ptr{CTPSA{Desc}})::Cstring + +Get the name of the TPSA. + +### Input +- `t` -- Complex TPSA + +### Output +- `ret` -- Name of CTPSA (nul term in C) +""" +function mad_ctpsa_nam(t::Ptr{CTPSA{Desc}})::Cstring + ret = @ccall MAD_TPSA.mad_ctpsa_nam(t::Ptr{CTPSA{Desc}})::Cstring + return ret +end + + +""" + mad_ctpsa_ord(t::Ptr{CTPSA{Desc}})::Cuchar + +Gets the TPSA order. + +### Input +- `t` -- Complex TPSA + +### Output +- `ret` -- Order of TPSA +""" +function mad_ctpsa_ord(t::Ptr{CTPSA{Desc}})::Cuchar + ret = @ccall MAD_TPSA.mad_ctpsa_ord(t::Ptr{CTPSA{Desc}})::Cuchar + return ret +end + +""" + mad_ctpsa_ordv(t::Ptr{CTPSA{Desc}}, ts::Ptr{CTPSA{Desc}}...)::Cuchar + +??? + +### Input +- `t` -- TPSA +- `ts` + +### Output +- `mo` -- Order +""" +function mad_ctpsa_ordv(t::Ptr{CTPSA{Desc}}, ts::Ptr{CTPSA{Desc}}...)::Cuchar + mo = @ccall MAD_TPSA.mad_ctpsa_ordv(t::Ptr{CTPSA{Desc}}, ts::Ptr{CTPSA{Desc}}..., 0::Cint)::Cuchar # null pointer after args for safe use + return mo +end + + +""" + mad_ctpsa_ordn(n::Cint, t::Ptr{Ptr{CTPSA{Desc}}})::Cuchar + +Gets the max order of all TPSAs in t. + +### Input +- `n` -- Number of TPSAs +- `t` -- Array of TPSAs + +### Output +- `mo` -- Maximum order of all TPSAs +""" +function mad_ctpsa_ordn(n::Cint, t::Ptr{Ptr{CTPSA{Desc}}})::Cuchar + mo = @ccall MAD_TPSA.mad_ctpsa_ordn(n::Cint, t::Ptr{Ptr{CTPSA{Desc}}})::Cuchar + return mo +end + + +""" + mad_ctpsa_copy!(t::Ptr{CTPSA{Desc}}, r::Ptr{CTPSA{Desc}}) + +Makes a copy of the complex TPSA t to r. + +### Input +- `t` -- Source complex TPSA +- `r` -- Destination complex TPSA +""" +function mad_ctpsa_copy!(t::Ptr{CTPSA{Desc}}, r::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_copy(t::Ptr{CTPSA{Desc}}, r::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_sclord!(t::Ptr{CTPSA{Desc}}, r::Ptr{CTPSA{Desc}}, inv::Cuchar) + +??? + +### Input +- `t` -- Source complex TPSA +- `r` -- Destination complex TPSA +- `inv`-- scl by inverse +""" +function mad_ctpsa_sclord!(t::Ptr{CTPSA{Desc}}, r::Ptr{CTPSA{Desc}}, inv::Cuchar) + @ccall MAD_TPSA.mad_ctpsa_sclord(t::Ptr{CTPSA{Desc}}, r::Ptr{CTPSA{Desc}}, inv::Cuchar)::Cvoid +end + + +""" + mad_ctpsa_getord!(t::Ptr{CTPSA{Desc}}, r::Ptr{CTPSA{Desc}}, ord::Cuchar) + +??? +is ! ? + +### Input +- `t`` -- Source complex TPSA +- `r` -- Destination complex TPSA +- `ord` -- Order to retrieve +""" +function mad_ctpsa_getord!(t::Ptr{CTPSA{Desc}}, r::Ptr{CTPSA{Desc}}, ord::Cuchar) + @ccall MAD_TPSA.mad_ctpsa_getord(t::Ptr{CTPSA{Desc}}, r::Ptr{CTPSA{Desc}}, ord::Cuchar)::Cvoid +end + + +""" + mad_ctpsa_cutord!(t::Ptr{CTPSA{Desc}}, r::Ptr{CTPSA{Desc}}, ord::Cint) + +??? + +### Input +- `t` -- Source complex TPSA +- `r` -- Destination complex TPSA +- `ord` -- Cut order: 0..-ord or ord..mo +""" +function mad_ctpsa_cutord!(t::Ptr{CTPSA{Desc}}, r::Ptr{CTPSA{Desc}}, ord::Cint) + @ccall MAD_TPSA.mad_ctpsa_cutord(t::Ptr{CTPSA{Desc}}, r::Ptr{CTPSA{Desc}}, ord::Cint)::Cvoid +end + +""" + mad_ctpsa_maxord(t::Ptr{CTPSA{Desc}}, n::Cint, idx_::Ptr{Cint})::Cint + +??? + +### Input +- `t` -- Complex TPSA +- `n` -- Length of idx_ +- `idx_` + +### Output +- `mi` -- ? +""" +function mad_ctpsa_maxord(t::Ptr{CTPSA{Desc}}, n::Cint, idx_::Ptr{Cint})::Cint + mi = @ccall MAD_TPSA.mad_ctpsa_maxord(t::Ptr{CTPSA{Desc}}, n::Cint, idx_::Ptr{Cint})::Cint + return mi +end + +""" + mad_ctpsa_convert!(t::Ptr{CTPSA{Desc}}, r::Ptr{CTPSA{Desc}}, n::Cint, t2r_::Ptr{Cint}, pb::Cint) + +??? + +### Input +- `t` -- Source complex TPSA +- `r` -- Destination complex TPSA +- `n` -- Length of vector +- `t2r_` -- Vector of index lookup +- `pb` -- Poisson bracket, 0,1:fwd,-1:bwd +""" +function mad_ctpsa_convert!(t::Ptr{CTPSA{Desc}}, r::Ptr{CTPSA{Desc}}, n::Cint, t2r_::Ptr{Cint}, pb::Cint) + @ccall MAD_TPSA.mad_ctpsa_convert(t::Ptr{CTPSA{Desc}}, r::Ptr{CTPSA{Desc}}, n::Cint, t2r_::Ptr{Cint}, pb::Cint)::Cvoid +end + + +""" + mad_ctpsa_setvar!(t::Ptr{CTPSA{Desc}}, v::ComplexF64, iv_::Cint, scl_::ComplexF64) + +??? + +### Input +- `t` -- Complex TPSA +- `v` -- 0th order value +- `iv_` -- Variable index +- `scl_` -- 1st order variable value +""" +function mad_ctpsa_setvar!(t::Ptr{CTPSA{Desc}}, v::ComplexF64, iv_::Cint, scl_::ComplexF64) + @ccall MAD_TPSA.mad_ctpsa_setvar(t::Ptr{CTPSA{Desc}}, v::ComplexF64, iv_::Cint, scl_::ComplexF64)::Cvoid +end + +""" + mad_ctpsa_setvar_r!(t::Ptr{CTPSA{Desc}}, v_re::Cdouble, v_im::Cdouble, iv_::Cint, scl_re::Cdouble, scl_im::Cdouble) + +??? + +### Input +- `t` -- Complex TPSA +- `v_re` -- Real part of 0th order value +- `v_im` -- Imaginary part of 0th order value +- `iv_` -- Variable index +- `scl_re` -- Real part of 1st order variable value +- `scl_im` -- Imaginary part of 1st order variable value +""" +function mad_ctpsa_setvar_r!(t::Ptr{CTPSA{Desc}}, v_re::Cdouble, v_im::Cdouble, iv_::Cint, scl_re::Cdouble, scl_im::Cdouble) + @ccall MAD_TPSA.mad_ctpsa_setvar_r(t::Ptr{CTPSA{Desc}}, v_re::Cdouble, v_im::Cdouble, iv_::Cint, scl_re::Cdouble, scl_im::Cdouble)::Cvoid +end + + +""" + mad_ctpsa_setnam!(t::Ptr{CTPSA{Desc}}, nam::Cstring) + +Sets the name of the CTPSA. + +### Input +- `t` -- Complex TPSA +- `nam` -- Name to set for CTPSA +""" +function mad_ctpsa_setnam!(t::Ptr{CTPSA{Desc}}, nam::Cstring) + @ccall MAD_TPSA.mad_ctpsa_setnam(t::Ptr{CTPSA{Desc}}, nam::Cstring)::Cvoid +end + + +""" + mad_ctpsa_clear!(t::Ptr{CTPSA{Desc}}) + +Clears the TPSA (reset to 0) + +### Input +- `t` -- Complex TPSA +""" +function mad_ctpsa_clear!(t::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_clear(t::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_isnul(t::Ptr{CTPSA{Desc}})::Cuchar + +??? checks if null c2i? + +### Input +- `t` -- Complex TPSA to check + +### Output +- `ret` -- True or false +""" +function mad_ctpsa_isnul(t::Ptr{CTPSA{Desc}})::Cuchar + ret = @ccall MAD_TPSA.mad_ctpsa_isnul(t::Ptr{CTPSA{Desc}})::Cuchar + return ret +end + + + +""" + mad_ctpsa_cplx!(re_:Ptr{RTPSA{Desc}}, im_::Ptr{RTPSA{Desc}}, r::Ptr{CTPSA{Desc}}) + +Creates a CTPSA with real and imaginary parts from the RTPSAs re_ and im_ respectively. + +### Input +- `re_` -- Real part of CTPSA to make +- `im_` -- Imaginary part of CTPSA to make +- `r` -- Destination CTPSA with r = re_ + im*im_ +""" +function mad_ctpsa_cplx!(re_:Ptr{RTPSA{Desc}}, im_::Ptr{RTPSA{Desc}}, r::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_cplx(re_:Ptr{RTPSA{Desc}}, im_::Ptr{RTPSA{Desc}}, r::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_real!(t:Ptr{CTPSA{Desc}}, r::Ptr{RTPSA{Desc}}) + +Sets the RTPSA r equal to the real part of CTPSA t. + +### Input +- `t` -- Source CTPSA +- `r` -- Destination RTPSA with r = Re(t) +""" +function mad_ctpsa_real!(t:Ptr{CTPSA{Desc}}, r::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_real(t:Ptr{CTPSA{Desc}}, r::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_imag!(t:Ptr{CTPSA{Desc}}, r::Ptr{RTPSA{Desc}}) + +Sets the RTPSA r equal to the imaginary part of CTPSA t. + +### Input +- `t` -- Source CTPSA +- `r` -- Destination RTPSA with r = Im(t) +""" +function mad_ctpsa_imag!(t:Ptr{CTPSA{Desc}}, r::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_imag(t:Ptr{CTPSA{Desc}}, r::Ptr{RTPSA{Desc}})::Cvoid +end + +""" + mad_ctpsa_cabs!(t:Ptr{CTPSA{Desc}}, r::Ptr{RTPSA{Desc}}) + +Sets the RTPSA r equal to the aboslute value of CTPSA t + +### Input +- `t` -- Source CTPSA +- `r` -- Destination RTPSA with r = |t| +""" +function mad_ctpsa_cabs!(t:Ptr{CTPSA{Desc}}, r::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_cabs(t:Ptr{CTPSA{Desc}}, r::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_carg!(t:Ptr{CTPSA{Desc}}, r::Ptr{RTPSA{Desc}}) + +Sets the RTPSA r equal to the argument (phase) of CTPSA t + +### Input +- `t` -- Source CTPSA +- `r` -- Destination RTPSA with r = carg(t) +""" +function mad_ctpsa_carg!(t:Ptr{CTPSA{Desc}}, r::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_carg(t:Ptr{CTPSA{Desc}}, r::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_unit!(t:Ptr{CTPSA{Desc}}, r::Ptr{CTPSA{Desc}}) + +??? + +### Input +- `t` -- Source CTPSA +- `r` -- Destination CTPSA +""" +function mad_ctpsa_unit!(t:Ptr{CTPSA{Desc}}, r::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_unit(t:Ptr{CTPSA{Desc}}, r::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_rect!(t:Ptr{CTPSA{Desc}}, r::Ptr{CTPSA{Desc}}) + +??? + +### Input +- `t` -- Source CTPSA +- `r` -- Destination CTPSA +""" +function mad_ctpsa_rect!(t:Ptr{CTPSA{Desc}}, r::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_rect(t:Ptr{CTPSA{Desc}}, r::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_polar!(t:Ptr{CTPSA{Desc}}, r::Ptr{CTPSA{Desc}}) + +??? + +### Input +- `t` -- Source CTPSA +- `r` -- Destination CTPSA +""" +function mad_ctpsa_polar!(t:Ptr{CTPSA{Desc}}, r::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_polar(t:Ptr{CTPSA{Desc}}, r::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_mono(t::Ptr{CTPSA{Desc}}, i::Cint, n::Cint, m_::Ptr{Cuchar})::Cuchar + +### Input +- `t` +- `i` +- `n` +- `m_` + +### Output +- `ret` +""" +function mad_ctpsa_mono(t::Ptr{CTPSA{Desc}}, i::Cint, n::Cint, m_::Ptr{Cuchar})::Cuchar + ret = @ccall MAD_TPSA.mad_ctpsa_mono(t::Ptr{CTPSA{Desc}}, i::Cint, n::Cint, m_::Ptr{Cuchar})::Cuchar + return ret +end + + +""" + mad_ctpsa_idxs(t::Ptr{CTPSA{Desc}}, n::Cint, s::Cstring)::Cint + +### Input +- `t` +- `n` +- `s` + +### Output +- `ret` +""" +function mad_ctpsa_idxs(t::Ptr{CTPSA{Desc}}, n::Cint, s::Cstring)::Cint + ret = @ccall MAD_TPSA.mad_ctpsa_idxs(t::Ptr{CTPSA{Desc}}, n::Cint, s::Cstring)::Cint + return ret +end + + + +""" + mad_ctpsa_idxm(t::Ptr{CTPSA{Desc}}, n::Cint, m::Ptr{Cuchar})::Cint + + +??? + +### Input +- `t` +- `n` +- `m` + +### Output +- `ret` +""" +function mad_ctpsa_idxm(t::Ptr{CTPSA{Desc}}, n::Cint, m::Ptr{Cuchar})::Cint + ret = @ccall MAD_TPSA.mad_ctpsa_idxm(t::Ptr{CTPSA{Desc}}, n::Cint, m::Ptr{Cuchar})::Cint + return ret +end + + +""" + mad_ctpsa_idxsm(t::Ptr{CTPSA{Desc}}, n::Cint, m::Ptr{Cint})::Cint + +??? + +### Input +- `t` +- `n` +- `m` + +### Output +- `ret` +""" +function mad_ctpsa_idxsm(t::Ptr{CTPSA{Desc}}, n::Cint, m::Ptr{Cint})::Cint + ret = @ccall MAD_TPSA.mad_ctpsa_idxsm(t::Ptr{CTPSA{Desc}}, n::Cint, m::Ptr{Cint})::Cint + return ret +end + + +""" + mad_ctpsa_cycle(t::Ptr{CTPSA{Desc}}, i::Cint, n::Cint, m_::Ptr{Cuchar}, v_::Ptr{Cdouble})::Cint + +??? + +### Input +- `t` +- `i` +- `n` +- `m_` +- `v_` + +### Output +- `i` +""" +function mad_ctpsa_cycle(t::Ptr{CTPSA{Desc}}, i::Cint, n::Cint, m_::Ptr{Cuchar}, v_::Ptr{ComplexF64})::Cint + i = @ccall MAD_TPSA.mad_ctpsa_cycle(t::Ptr{CTPSA{Desc}}, i::Cint, n::Cint, m_::Ptr{Cuchar}, v_::Ptr{ComplexF64})::Cint + return i +end + + +""" + mad_ctpsa_get0(t::Ptr{CTPSA{Desc}})::ComplexF64 + +??? + +### Input +- `t` + +### Output +- `ret` +""" +function mad_ctpsa_get0(t::Ptr{CTPSA{Desc}})::ComplexF64 + ret = @ccall MAD_TPSA.mad_ctpsa_get0(t::Ptr{CTPSA{Desc}})::ComplexF64 + return ret +end + + +""" + mad_ctpsa_geti(t::Ptr{CTPSA{Desc}}, i::Cint)::ComplexF64 + +??? + +### Input +- `t` +- `i` + +### Output +- `ret` +""" +function mad_ctpsa_geti(t::Ptr{CTPSA{Desc}}, i::Cint)::ComplexF64 + ret = @ccall MAD_TPSA.mad_ctpsa_geti(t::Ptr{CTPSA{Desc}}, i::Cint)::ComplexF64 + return ret +end + + +""" + mad_ctpsa_gets(t::Ptr{CTPSA{Desc}}, n::Cint, s::Cstring)::ComplexF64 + +??? + +### Input +- `t` +- `n` +- `s` + +### Output +- `ret` +""" +function mad_ctpsa_gets(t::Ptr{CTPSA{Desc}}, n::Cint, s::Cstring)::ComplexF64 + ret = @ccall MAD_TPSA.mad_ctpsa_gets(t::Ptr{CTPSA{Desc}}, n::Cint, s::Cstring)::ComplexF64 + return ret +end + + +""" + mad_ctpsa_getm(t::Ptr{CTPSA{Desc}}, n::Cint, m::Ptr{Cuchar})::ComplexF64 + +??? + +### Input +- `t` +- `n` +- `m` + +### Output +- `ret` +""" +function mad_ctpsa_getm(t::Ptr{CTPSA{Desc}}, n::Cint, m::Ptr{Cuchar})::ComplexF64 + val = @ccall MAD_TPSA.mad_ctpsa_getm(t::Ptr{CTPSA{Desc}}, n::Cint, m::Ptr{Cuchar})::ComplexF64 + return ret +end + + +""" + mad_ctpsa_getsm(t::Ptr{CTPSA{Desc}}, n::Cint, m::Ptr{Cint})::ComplexF64 + +??? + +### Input +- `t` +- `n` +- `m` + +### Output +- `ret` +""" +function mad_ctpsa_getsm(t::Ptr{CTPSA{Desc}}, n::Cint, m::Ptr{Cint})::ComplexF64 + ret = @ccall MAD_TPSA.mad_ctpsa_getsm(t::Ptr{CTPSA{Desc}}, n::Cint, m::Ptr{Cint})::ComplexF64 + return ret +end + + +""" + mad_ctpsa_set0!(t::Ptr{CTPSA{Desc}}, a::ComplexF64, b::ComplexF64) + +??? + +### Input +- `t` +- `a` +- `b` +""" +function mad_ctpsa_set0!(t::Ptr{CTPSA{Desc}}, a::ComplexF64, b::ComplexF64) + @ccall MAD_TPSA.mad_ctpsa_set0(t::Ptr{CTPSA{Desc}}, a::ComplexF64, b::ComplexF64)::Cvoid +end + + +""" + mad_ctpsa_seti!(t::Ptr{CTPSA{Desc}}, i::Cint, a::ComplexF64, b::ComplexF64) + +??? + +### Input +- `t` +- `i` +- `a` +- `b` +""" +function mad_ctpsa_seti!(t::Ptr{CTPSA{Desc}}, i::Cint, a::ComplexF64, b::ComplexF64) + @ccall MAD_TPSA.mad_ctpsa_seti(t::Ptr{CTPSA{Desc}}, i::Cint, a::ComplexF64, b::ComplexF64)::Cvoid +end + + +""" + mad_ctpsa_sets!(t::Ptr{CTPSA{Desc}}, n::Cint, s::Cstring, a::ComplexF64, b::ComplexF64) + +??? + +### Input +- `t` +- `n` +- `s` +- `a` +- `b` +""" +function mad_ctpsa_sets!(t::Ptr{CTPSA{Desc}}, n::Cint, s::Cstring, a::ComplexF64, b::ComplexF64) + @ccall MAD_TPSA.mad_ctpsa_sets(t::Ptr{CTPSA{Desc}}, n::Cint, s::Cstring, a::ComplexF64, b::ComplexF64)::Cvoid +end + + +""" + mad_ctpsa_setm!(t::Ptr{CTPSA{Desc}}, n::Cint, m::Ptr{Cuchar}, a::ComplexF64, b::ComplexF64) + +??? + +### Input +- `t` +- `n` +- `m` +- `a` +- `b` +""" +function mad_ctpsa_setm!(t::Ptr{CTPSA{Desc}}, n::Cint, m::Ptr{Cuchar}, a::ComplexF64, b::ComplexF64) + @ccall MAD_TPSA.mad_ctpsa_setm(t::Ptr{CTPSA{Desc}}, n::Cint, m::Ptr{Cuchar}, a::ComplexF64, b::ComplexF64)::Cvoid +end + + +""" + mad_ctpsa_setsm!(t::Ptr{CTPSA{Desc}}, n::Cint, m::Ptr{Cint}, a::ComplexF64, b::ComplexF64) + +??? + +### Input +- `t` +- `n` +- `m` +- `a` +- `b` +""" +function mad_ctpsa_setsm!(t::Ptr{CTPSA{Desc}}, n::Cint, m::Ptr{Cint}, a::ComplexF64, b::ComplexF64) + @ccall MAD_TPSA.mad_ctpsa_setsm(t::Ptr{CTPSA{Desc}}, n::Cint, m::Ptr{Cint}, a::ComplexF64, b::ComplexF64)::Cvoid +end + + +# Accessors without complex-by-value +""" + mad_ctpsa_get0_r!(t::Ptr{CTPSA{Desc}}, r::Ptr{ComplexF64}) + +??? + +### Input +- `t` +- `r` +""" +function mad_ctpsa_get0_r!(t::Ptr{CTPSA{Desc}}, r::Ptr{ComplexF64}) + ret = @ccall MAD_TPSA.mad_ctpsa_get0_r(t::Ptr{CTPSA{Desc}}, r::Ptr{ComplexF64})::Cvoid + return ret +end + + +""" + mad_ctpsa_geti_r!(t::Ptr{CTPSA{Desc}}, i::Cint, r::Ptr{ComplexF64}) + +??? + +### Input +- `t` +- `i` +- `r` +""" +function mad_ctpsa_geti_r!(t::Ptr{CTPSA{Desc}}, i::Cint, r::Ptr{ComplexF64}) + ret = @ccall MAD_TPSA.mad_ctpsa_geti_r(t::Ptr{CTPSA{Desc}}, i::Cint, r::Ptr{ComplexF64})::Cvoid + return ret +end + + +""" + mad_ctpsa_gets_r!(t::Ptr{CTPSA{Desc}}, n::Cint, s::Cstring, r::Ptr{ComplexF64}) + +??? + +### Input +- `t` +- `n` +- `s` +- `r` +""" +function mad_ctpsa_gets_r!(t::Ptr{CTPSA{Desc}}, n::Cint, s::Cstring, r::Ptr{ComplexF64}) + ret = @ccall MAD_TPSA.mad_ctpsa_gets_r(t::Ptr{CTPSA{Desc}}, n::Cint, s::Cstring, r::Ptr{ComplexF64})::Cvoid + return ret +end + + +""" + mad_ctpsa_getm_r!(t::Ptr{CTPSA{Desc}}, n::Cint, m::Ptr{Cuchar}, r::Ptr{ComplexF64}) + +??? + +### Input +- `t` +- `n` +- `m` +- `r` +""" +function mad_ctpsa_getm_r!(t::Ptr{CTPSA{Desc}}, n::Cint, m::Ptr{Cuchar}, r::Ptr{ComplexF64}) + val = @ccall MAD_TPSA.mad_ctpsa_getm_r(t::Ptr{CTPSA{Desc}}, n::Cint, m::Ptr{Cuchar}, r::Ptr{ComplexF64})::Cvoid + return ret +end + + +""" + mad_ctpsa_getsm_r!(t::Ptr{CTPSA{Desc}}, n::Cint, m::Ptr{Cint}, r::Ptr{ComplexF64}) + +??? + +### Input +- `t` +- `n` +- `m` +- `r` +""" +function mad_ctpsa_getsm_r!(t::Ptr{CTPSA{Desc}}, n::Cint, m::Ptr{Cint}, r::Ptr{ComplexF64}) + ret = @ccall MAD_TPSA.mad_ctpsa_getsm_r(t::Ptr{CTPSA{Desc}}, n::Cint, m::Ptr{Cint}, r::Ptr{ComplexF64})::Cvoid + return ret +end + + +""" + mad_ctpsa_set0_r!(t::Ptr{CTPSA{Desc}}, a_re::Cdouble, a_im::Cdouble, b_re::Cdouble, b_im::Cdouble) + +??? + +### Input +- `t` +- `a_re` +- `a_im` +- `b_re` +- `b_im` +""" +function mad_ctpsa_set0_r!(t::Ptr{CTPSA{Desc}}, a_re::Cdouble, a_im::Cdouble, b_re::Cdouble, b_im::Cdouble) + @ccall MAD_TPSA.mad_ctpsa_set0_r(t::Ptr{CTPSA{Desc}}, a_re::Cdouble, a_im::Cdouble, b_re::Cdouble, b_im::Cdouble)::Cvoid +end + + +""" + mad_ctpsa_seti_r!(t::Ptr{CTPSA{Desc}}, i::Cint, a_re::Cdouble, a_im::Cdouble, b_re::Cdouble, b_im::Cdouble) + +??? + +### Input +- `t` +- `i` +- `a_re` +- `a_im` +- `b_re` +- `b_im` +""" +function mad_ctpsa_seti_r!(t::Ptr{CTPSA{Desc}}, i::Cint, a_re::Cdouble, a_im::Cdouble, b_re::Cdouble, b_im::Cdouble) + @ccall MAD_TPSA.mad_ctpsa_seti_r(t::Ptr{CTPSA{Desc}}, i::Cint, a_re::Cdouble, a_im::Cdouble, b_re::Cdouble, b_im::Cdouble)::Cvoid +end + + +""" + mad_ctpsa_sets_r!(t::Ptr{CTPSA{Desc}}, n::Cint, s::Cstring, a_re::Cdouble, a_im::Cdouble, b_re::Cdouble, b_im::Cdouble) + +??? + +### Input +- `t` +- `n` +- `s` +- `a` +- `b` +""" +function mad_ctpsa_sets_r!(t::Ptr{CTPSA{Desc}}, n::Cint, s::Cstring, a_re::Cdouble, a_im::Cdouble, b_re::Cdouble, b_im::Cdouble)) + @ccall MAD_TPSA.mad_ctpsa_sets_r(t::Ptr{CTPSA{Desc}}, n::Cint, s::Cstring, a_re::Cdouble, a_im::Cdouble, b_re::Cdouble, b_im::Cdouble)::Cvoid +end + + +""" + mad_ctpsa_setm_r!(t::Ptr{CTPSA{Desc}}, n::Cint, m::Ptr{Cuchar}, a_re::Cdouble, a_im::Cdouble, b_re::Cdouble, b_im::Cdouble) + +??? + +### Input +- `t` +- `n` +- `m` +- `a_re` +- `a_im` +- `b_re` +- `b_im` +""" +function mad_ctpsa_setm_r!(t::Ptr{CTPSA{Desc}}, n::Cint, m::Ptr{Cuchar}, a_re::Cdouble, a_im::Cdouble, b_re::Cdouble, b_im::Cdouble) + @ccall MAD_TPSA.mad_ctpsa_setm_r(t::Ptr{CTPSA{Desc}}, n::Cint, m::Ptr{Cuchar}, a_re::Cdouble, a_im::Cdouble, b_re::Cdouble, b_im::Cdouble)::Cvoid +end + + +""" + mad_ctpsa_setsm_r!(t::Ptr{CTPSA{Desc}}, n::Cint, m::Ptr{Cint}, a_re::Cdouble, a_im::Cdouble, b_re::Cdouble, b_im::Cdouble) + +??? + +### Input +- `t` +- `n` +- `m` +- `a_re` +- `a_im` +- `b_re` +- `b_im` +""" +function mad_ctpsa_setsm_r!(t::Ptr{CTPSA{Desc}}, n::Cint, m::Ptr{Cint}, a_re::Cdouble, a_im::Cdouble, b_re::Cdouble, b_im::Cdouble) + @ccall MAD_TPSA.mad_ctpsa_setsm_r(t::Ptr{CTPSA{Desc}}, n::Cint, m::Ptr{Cint}, a_re::Cdouble, a_im::Cdouble, b_re::Cdouble, b_im::Cdouble)::Cvoid +end + + +""" + mad_ctpsa_getv!(t::Ptr{CTPSA{Desc}}, i::Cint, n::Cint, v::Ptr{ComplexF64}) + +??? + +### Input +- `t` +- `i` +- `n` +- `v` +""" +function mad_ctpsa_getv!(t::Ptr{CTPSA{Desc}}, i::Cint, n::Cint, v::Ptr{ComplexF64}) + @ccall MAD_TPSA.mad_ctpsa_getv(t::Ptr{CTPSA{Desc}}, i::Cint, n::Cint, v::Ptr{ComplexF64})::Cvoid +end + + + +""" + mad_ctpsa_setv!(t::Ptr{CTPSA{Desc}}, i::Cint, n::Cint, v::Ptr{ComplexF64}) + +??? + +### Input +- `t` +- `i` +- `n` +- `v` +""" +function mad_ctpsa_setv!(t::Ptr{CTPSA{Desc}}, i::Cint, n::Cint, v::Ptr{ComplexF64}) + @ccall MAD_TPSA.mad_ctpsa_setv(t::Ptr{CTPSA{Desc}}, i::Cint, n::Cint, v::PtrComplexF64})::Cvoid +end + + +""" + mad_ctpsa_equ(a::Ptr{CTPSA{Desc}}, b::Ptr{CTPSA{Desc}}, tol_::Cdouble)::Cuchar + +Checks if the TPSAs a and b are equal within the specified tolerance tol_ + +### Input +- `a` -- TPSA a +- `b` -- TPSA b +- `tol_` -- difference below which the TPSAs are considered equal + +### Output +- `ret` - True if a == b within tol_ +""" +function mad_ctpsa_equ(a::Ptr{CTPSA{Desc}}, b::Ptr{CTPSA{Desc}}, tol_::Cdouble)::Cuchar + ret = @ccall MAD_TPSA.mad_ctpsa_equ(a::Ptr{CTPSA{Desc}}, b::Ptr{CTPSA{Desc}}, tol_::Cdouble)::Cuchar + return ret +end + + +""" + mad_ctpsa_dif!(a::Ptr{CTPSA{Desc}}, b::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + +??? // (a_i-b_i)/max(|a_i|,1) + +### Input +- `a` -- Source TPSA a +- `b` -- Source TPSA b +- `c` -- Destination TPSA c +""" +function mad_ctpsa_dif!(a::Ptr{CTPSA{Desc}}, b::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_dif(a::Ptr{CTPSA{Desc}}, b::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_add!(a::Ptr{CTPSA{Desc}}, b::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + +Sets the destination TPSA c = a + b + +### Input +- `a` -- Source TPSA a +- `b` -- Source TPSA b +- `c` -- Destination TPSA c = a + b +""" +function mad_ctpsa_add!(a::Ptr{CTPSA{Desc}}, b::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_add(a::Ptr{CTPSA{Desc}}, b::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_sub!(a::Ptr{CTPSA{Desc}}, b::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + +Sets the destination TPSA c = a - b + +### Input +- `a` -- Source TPSA a +- `b` -- Source TPSA b +- `c` -- Destination TPSA c = a - b +""" +function mad_ctpsa_sub!(a::Ptr{CTPSA{Desc}}, b::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_sub(a::Ptr{CTPSA{Desc}}, b::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_mul!(a::Ptr{CTPSA{Desc}}, b::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + +Sets the destination TPSA c = a * b + +### Input +- `a` -- Source TPSA a +- `b` -- Source TPSA b +- `c` -- Destination TPSA c = a * b +""" +function mad_ctpsa_mul!(a::Ptr{CTPSA{Desc}}, b::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_mul(a::Ptr{CTPSA{Desc}}, b::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_div!(a::Ptr{CTPSA{Desc}}, b::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + +Sets the destination TPSA c = a / b + +### Input +- `a` -- Source TPSA a +- `b` -- Source TPSA b +- `c` -- Destination TPSA c = a / b +""" +function mad_ctpsa_div!(a::Ptr{CTPSA{Desc}}, b::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_div(a::Ptr{CTPSA{Desc}}, b::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_pow!(a::Ptr{CTPSA{Desc}}, b::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + +Sets the destination TPSA c = a ^ b + +### Input +- `a` -- Source TPSA a +- `b` -- Source TPSA b +- `c` -- Destination TPSA c = a ^ b +""" +function mad_ctpsa_pow!(a::Ptr{CTPSA{Desc}}, b::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_pow(a::Ptr{CTPSA{Desc}}, b::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_powi!(a::Ptr{CTPSA{Desc}}, n::Cint, c::Ptr{CTPSA{Desc}}) + +Sets the destination TPSA c = a ^ n where n is an integer. + +### Input +- `a` -- Source TPSA a +- `n` -- Integer power +- `c` -- Destination TPSA c = a ^ n +""" +function mad_ctpsa_powi!(a::Ptr{CTPSA{Desc}}, n::Cint, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_powi(a::Ptr{CTPSA{Desc}}, n::Cint, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_pown!(a::Ptr{CTPSA{Desc}}, v::ComplexF64, c::Ptr{CTPSA{Desc}}) + +Sets the destination TPSA c = a ^ v where v is of double precision. + +### Input +- `a` -- Source TPSA a +- `v` -- Power, ComplexF64 +- `c` -- Destination TPSA c = a ^ v +""" +function mad_ctpsa_pown!(a::Ptr{CTPSA{Desc}}, v::ComplexF64, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_pown(a::Ptr{CTPSA{Desc}}, v::ComplexF64, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_pown_r!(a::Ptr{CTPSA{Desc}}, v_re::Cdouble, v_im::Cdouble, c::Ptr{CTPSA{Desc}}) + +Sets the destination TPSA c = a ^ v where v is of double precision. Without complex-by-power arguments. + +### Input +- `a` -- Source TPSA a +- `v_re` -- Real part of power +- `v_im` -- Imaginary part of power +- `c` -- Destination TPSA c = a ^ v +""" +function mad_ctpsa_pown!(a::Ptr{CTPSA{Desc}}, v_re::Cdouble, v_im::Cdouble, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_pown_r(a::Ptr{CTPSA{Desc}}, v_re::Cdouble, v_im::Cdouble, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_equt(a::Ptr{CTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, tol_::Cdouble)::Cuchar + +Checks if the CTPSA a is equal to the RTPSA b within the specified tolerance tol_ +(internal real-to-complex conversion). + +### Input +- `a` -- CTPSA a +- `b` -- RTPSA b +- `tol_` -- difference below which the TPSAs are considered equal + +### Output +- `ret` - True if a == b within tol_ +""" +function mad_ctpsa_equt(a::Ptr{CTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, tol_::Cdouble)::Cuchar + ret = @ccall MAD_TPSA.mad_ctpsa_equt(a::Ptr{CTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, tol_::Cdouble)::Cuchar + return ret +end + + +""" + mad_ctpsa_dift!(a::Ptr{CTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + +??? // (a_i-b_i)/max(|a_i|,1) +(internal real-to-complex conversion). + +### Input +- `a` -- Source CTPSA a +- `b` -- Source RTPSA b +- `c` -- Destination TPSA c +""" +function mad_ctpsa_dift!(a::Ptr{CTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_dift(a::Ptr{CTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_tdif!(a::Ptr{RTPSA{Desc}}, b::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + +??? // (a_i-b_i)/max(|a_i|,1) +(internal real-to-complex conversion). + +### Input +- `a` -- Source RTPSA a +- `b` -- Source CTPSA b +- `c` -- Destination TPSA c +""" +function mad_ctpsa_tdif!(a::Ptr{RTPSA{Desc}}, b::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_tdif(a::Ptr{RTPSA{Desc}}, b::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}})::Cvoid +end + +""" + mad_ctpsa_addt!(a::Ptr{CTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + +Sets the destination CTPSA c = a + b (internal real-to-complex conversion). + +### Input +- `a` -- Source CTPSA a +- `b` -- Source RTPSA b +- `c` -- Destination CTPSA c = a + b +""" +function mad_ctpsa_addt!(a::Ptr{CTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_addt(a::Ptr{CTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_subt!(a::Ptr{CTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + +Sets the destination CTPSA c = a - b (internal real-to-complex conversion). + +### Input +- `a` -- Source CTPSA a +- `b` -- Source RTPSA b +- `c` -- Destination CTPSA c = a - b +""" +function mad_ctpsa_subt!(a::Ptr{CTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_subt(a::Ptr{CTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_tsub!(a::Ptr{RTPSA{Desc}}, b::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + +Sets the destination CTPSA c = a - b (internal real-to-complex conversion). + +### Input +- `a` -- Source RTPSA a +- `b` -- Source CTPSA b +- `c` -- Destination CTPSA c = a - b +""" +function mad_ctpsa_tsub!(a::Ptr{RTPSA{Desc}}, b::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_tsub(a::Ptr{RTPSA{Desc}}, b::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_mult!(a::Ptr{CTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + +Sets the destination CTPSA c = a * b (internal real-to-complex conversion). + +### Input +- `a` -- Source CTPSA a +- `b` -- Source RTPSA b +- `c` -- Destination CTPSA c = a * b +""" +function mad_ctpsa_mult!(a::Ptr{CTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_mult(a::Ptr{CTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_divt!(a::Ptr{CTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + +Sets the destination CTPSA c = a / b (internal real-to-complex conversion). + +### Input +- `a` -- Source CTPSA a +- `b` -- Source RTPSA b +- `c` -- Destination CTPSA c = a / b +""" +function mad_ctpsa_divt!(a::Ptr{CTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_divt(a::Ptr{CTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_tdiv!(a::Ptr{RTPSA{Desc}}, b::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + +Sets the destination CTPSA c = a / b (internal real-to-complex conversion). + +### Input +- `a` -- Source RTPSA a +- `b` -- Source CTPSA b +- `c` -- Destination CTPSA c = a / b +""" +function mad_ctpsa_tdiv!(a::Ptr{RTPSA{Desc}}, b::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_tdiv(a::Ptr{RTPSA{Desc}}, b::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}})::Cvoid +end + +""" + mad_ctpsa_powt!(a::Ptr{CTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + +Sets the destination CTPSA c = a ^ b (internal real-to-complex conversion). + +### Input +- `a` -- Source CTPSA a +- `b` -- Source RTPSA b +- `c` -- Destination CTPSA c = a ^ b +""" +function mad_ctpsa_powt!(a::Ptr{CTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_powt(a::Ptr{CTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_tpow!(a::Ptr{RTPSA{Desc}}, b::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + +Sets the destination CTPSA c = a ^ b (internal real-to-complex conversion). + +### Input +- `a` -- Source RTPSA a +- `b` -- Source CTPSA b +- `c` -- Destination TPSA c = a ^ b +""" +function mad_ctpsa_tpow!(a::Ptr{RTPSA{Desc}}, b::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_tpow(a::Ptr{RTPSA{Desc}}, b::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_nrm(a::Ptr{CTPSA{Desc}})::ComplexF64 + +Calculates the norm of (which???) of TPSA a. + +### Input +- `a` -- TPSA + +### Output +- `nrm` -- Norm of TPSA a +""" +function mad_ctpsa_nrm(a::Ptr{CTPSA{Desc}})::ComplexF64 + nrm = @ccall MAD_TPSA.mad_ctpsa_nrm(a::Ptr{CTPSA{Desc}}, tpsa_b_::Ptr{CTPSA{Desc}})::ComplexF64 + return nrm +end + + +""" + mad_ctpsa_abs!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + +Sets TPSA c to the absolute value of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = |a| +""" +function mad_ctpsa_abs!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_abs(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_sqrt!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + +Sets TPSA c to the sqrt of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = sqrt(a) +""" +function mad_ctpsa_sqrt!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_sqrt(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_exp!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + +Sets TPSA c to the exponential of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = exp(a) +""" +function mad_ctpsa_exp!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_exp(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}})::Cvoid +end + + + +""" + mad_ctpsa_log!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + +Sets TPSA c to the log of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = log(a) +""" +function mad_ctpsa_log!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_log(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_sincos!(a::Ptr{CTPSA{Desc}}, s::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + +Sets TPSA s = sin(a) and TPSA c = cos(a) + +### Input +- `a` -- Source TPSA a +- `s` -- Destination TPSA s = sin(a) +- `c` -- Destination TPSA c = cos(a) +""" +function mad_ctpsa_sincos!(a::Ptr{CTPSA{Desc}}, s::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_sincos(a::Ptr{CTPSA{Desc}}, s::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_sin!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + +Sets TPSA c to the sin of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = sin(a) +""" +function mad_ctpsa_sin!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_sin(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_cos!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + +Sets TPSA c to the cos of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = cos(a) +""" +function mad_ctpsa_cos!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_cos(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_tan!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + +Sets TPSA c to the tan of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = tan(a) +""" +function mad_ctpsa_tan!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_tan(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_cot!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + +Sets TPSA c to the cot of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = cot(a) +""" +function mad_ctpsa_cot!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_cot(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_sinc!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + +Sets TPSA c to the sinc of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = sinc(a) +""" +function mad_ctpsa_sinc!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_sinc(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_sincosh!(a::Ptr{CTPSA{Desc}}, s::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + +Sets TPSA s = sinh(a) and TPSA c = cosh(a) + +### Input +- `a` -- Source TPSA a +- `s` -- Destination TPSA s = sinh(a) +- `c` -- Destination TPSA c = cosh(a) +""" +function mad_ctpsa_sincosh!(a::Ptr{CTPSA{Desc}}, s::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_sincosh(a::Ptr{CTPSA{Desc}}, s::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_sinh!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + + Sets TPSA c to the sinh of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = sinh(a) +""" +function mad_ctpsa_sinh!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_sinh(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_cosh!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + +Sets TPSA c to the cosh of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = cosh(a) +""" +function mad_ctpsa_cosh!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_cosh(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_tanh!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + +Sets TPSA c to the tanh of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = tanh(a) +""" +function mad_ctpsa_tanh!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_tanh(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_coth!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + +Sets TPSA c to the coth of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = coth(a) +""" +function mad_ctpsa_coth!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_coth(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_sinhc!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + +Sets TPSA c to the sinhc of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = sinhc(a) +""" +function mad_ctpsa_sinhc!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_sinhc(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_asin!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + +Sets TPSA c to the asin of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = asin(a) +""" +function mad_ctpsa_asin!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_asin(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_acos!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + +Sets TPSA c to the acos of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = acos(a) +""" +function mad_ctpsa_acos!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_acos(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_atan!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + +Sets TPSA c to the atan of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = atan(a) +""" +function mad_ctpsa_atan!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_atan(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_acot!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + +Sets TPSA c to the acot of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = acot(a) +""" +function mad_ctpsa_acot!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_acot(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}})::Cvoid +end + +""" + mad_ctpsa_asinc!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + +Sets TPSA c to the asinc of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = asinc(a) +""" +function mad_ctpsa_asinc!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_asinc(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_asinh!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + +Sets TPSA c to the asinh of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = asinh(a) +""" +function mad_ctpsa_asinh!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_asinh(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_acosh!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + +Sets TPSA c to the acosh of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = acosh(a) +""" +function mad_ctpsa_acosh!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_acosh(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_atanh!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + +Sets TPSA c to the atanh of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = atanh(a) +""" +function mad_ctpsa_atanh!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_atanh(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_acoth!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + +Sets TPSA c to the acoth of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = acoth(a) +""" +function mad_ctpsa_acoth!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_acoth(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_asinhc!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + +Sets TPSA c to the asinhc of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = asinhc(a) +""" +function mad_ctpsa_asinhc!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_asinhc(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_erf!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + +Sets TPSA c to the erf of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = erf(a) +""" +function mad_ctpsa_erf!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_erf(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_erfc!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + +Sets TPSA c to the erfc of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = erfc(a) +""" +function mad_ctpsa_erfc!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_erfc(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_acc!(a::Ptr{CTPSA{Desc}}, v::ComplexF64, c::Ptr{CTPSA{Desc}}) + +Adds a*v to TPSA c. Aliasing OK. + +### Input +- `a` -- Source TPSA a +- `v` -- Scalar with double precision +- `c` -- Destination TPSA c += v*a +""" +function mad_ctpsa_acc!(a::Ptr{CTPSA{Desc}}, v::ComplexF64, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_acc(a::Ptr{CTPSA{Desc}}, v::ComplexF64, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_scl!(a::Ptr{CTPSA{Desc}}, v::ComplexF64, c::Ptr{CTPSA{Desc}}) + +Sets TPSA c to v*a. + +### Input +- `a` -- Source TPSA a +- `v` -- Scalar with double precision +- `c` -- Destination TPSA c = v*a +""" +function mad_ctpsa_scl!(a::Ptr{CTPSA{Desc}}, v::ComplexF64, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_scl(a::Ptr{CTPSA{Desc}}, v::ComplexF64, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_inv!(a::Ptr{CTPSA{Desc}}, v::ComplexF64, c::Ptr{CTPSA{Desc}}) + +Sets TPSA c to v/a. + +### Input +- `a` -- Source TPSA a +- `v` -- Scalar with double precision +- `c` -- Destination TPSA c = v*a +""" +function mad_ctpsa_inv!(a::Ptr{CTPSA{Desc}}, v::ComplexF64, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_inv(a::Ptr{CTPSA{Desc}}, v::ComplexF64, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_invsqrt!(a::Ptr{CTPSA{Desc}}, v::ComplexF64, c::Ptr{CTPSA{Desc}}) + +Sets TPSA c to v/sqrt(a). + +### Input +- `a` -- Source TPSA a +- `v` -- Scalar with double precision +- `c` -- Destination TPSA c = v*a +""" +function mad_ctpsa_invsqrt!(a::Ptr{CTPSA{Desc}}, v::ComplexF64, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_invsqrt(a::Ptr{CTPSA{Desc}}, v::ComplexF64, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_hypot!(x::Ptr{CTPSA{Desc}}, y::Ptr{CTPSA{Desc}}, r::Ptr{CTPSA{Desc}}) + +Sets TPSA r to sqrt(x^2+y^2) + +### Input +- `x` -- Source TPSA x +- `y` -- Source TPSA y +- `r` -- Destination TPSA r = sqrt(x^2+y^2) +""" +function mad_ctpsa_hypot!(x::Ptr{CTPSA{Desc}}, y::Ptr{CTPSA{Desc}}, r::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_hypot(x::Ptr{CTPSA{Desc}}, y::Ptr{CTPSA{Desc}}, r::Ptr{CTPSA{Desc}})::Cvoid +end + +""" + mad_ctpsa_hypot3!(x::Ptr{CTPSA{Desc}}, y::Ptr{CTPSA{Desc}}, z::Ptr{CTPSA{Desc}}, r::Ptr{CTPSA{Desc}}) + +Sets TPSA r to sqrt(x^2+y^2+z^2) + +### Input +- `x` -- Source TPSA x +- `y` -- Source TPSA y +- `z` -- Source TPSA z +- `r` -- Destination TPSA r = sqrt(x^2+y^2+z^2) +""" +function mad_ctpsa_hypot3!(x::Ptr{CTPSA{Desc}}, y::Ptr{CTPSA{Desc}}, z::Ptr{CTPSA{Desc}}, r::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_hypot3(x::Ptr{CTPSA{Desc}}, y::Ptr{CTPSA{Desc}}, z::Ptr{CTPSA{Desc}}, r::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_integ!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}, iv::Cint) + +??? Integrates TPSA + +### Input +- `a` -- Source TPSA to integrate +- `c` -- Destination TPSA +- `iv` -- Domain +""" +function mad_ctpsa_integ!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}, iv::Cint) + @ccall MAD_TPSA.mad_ctpsa_integ(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}, iv::Cint)::Cvoid +end + + +""" + mad_ctpsa_deriv!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}, iv::Cint) + +??? Differentiates TPSA + +### Input +- `a` -- Source TPSA to differentiate +- `c` -- Destination TPSA +- `iv` -- Domain +""" +function mad_ctpsa_deriv!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}, iv::Cint) + @ccall MAD_TPSA.mad_ctpsa_deriv(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}, iv::Cint)::Cvoid +end + + +""" + mad_ctpsa_derivm!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}, n::Cint, m::Ptr{Cuchar}) + +??? + +### Input +- `a` +- `c` +- `n` +- `m` +""" +function mad_ctpsa_derivm!(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}, n::Cint, m::Ptr{Cuchar}) + @ccall MAD_TPSA.mad_ctpsa_derivm(a::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}, n::Cint, m::Ptr{Cuchar})::Cvoid +end + + +""" + mad_ctpsa_poisbra!(a::Ptr{CTPSA{Desc}}, b::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}, nv::Cint) + +Sets TPSA c to the poisson bracket of TPSAs a and b. + +### Input +- `a` -- Source TPSA a +- `b` -- Source TPSA b +- `c` -- Destination TPSA c = [a, b] +- `nv` -- Number of variables in the TPSA +""" +function mad_ctpsa_poisbra!(a::Ptr{CTPSA{Desc}}, b::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}, nv::Cint) + @ccall MAD_TPSA.mad_ctpsa_poisbra(a::Ptr{CTPSA{Desc}}, b::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}, nv::Cint)::Cvoid +end + + +""" + mad_ctpsa_taylor!(a::Ptr{CTPSA{Desc}}, n::Cint, coef::Ptr{ComplexF64}, c::Ptr{CTPSA{Desc}}) + +??? + +### Input +- `a` +- `n` +- `coef` +- `c` +""" +function mad_ctpsa_taylor!(a::Ptr{CTPSA{Desc}}, n::Cint, coef::Ptr{ComplexF64}, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_taylor(a::Ptr{CTPSA{Desc}}, n::Cint, coef::Ptr{ComplexF64}, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_poisbrat!(a::Ptr{CTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{CTPSA{Desc}}, nv::Cint) + +Sets TPSA c to the poisson bracket of CTPSA a and RTPSA b (internal real-to-complex conversion). + +### Input +- `a` -- Source CTPSA a +- `b` -- Source RTPSA b +- `c` -- Destination CTPSA c = [a, b] +- `nv` -- Number of variables in the TPSA +""" +function mad_ctpsa_poisbrat!(a::Ptr{CTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{CTPSA{Desc}}, nv::Cint) + @ccall MAD_TPSA.mad_ctpsa_poisbrat(a::Ptr{CTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{CTPSA{Desc}}, nv::Cint)::Cvoid +end + + +""" + mad_ctpsa_tpoisbra!(a::Ptr{RTPSA{Desc}}, b::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}, nv::Cint) + +Sets TPSA c to the poisson bracket of RTPSA a and CTPSA b (internal real-to-complex conversion). + +### Input +- `a` -- Source RTPSA a +- `b` -- Source CTPSA b +- `c` -- Destination TPSA c = [a, b] +- `nv` -- Number of variables in the TPSA +""" +function mad_ctpsa_tpoisbra!(a::Ptr{RTPSA{Desc}}, b::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}, nv::Cint) + @ccall MAD_TPSA.mad_ctpsa_tpoisbra(a::Ptr{RTPSA{Desc}}, b::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}, nv::Cint)::Cvoid +end + + +""" + mad_ctpsa_acc_r!(a::Ptr{CTPSA{Desc}}, v_re::Cdouble, v_im::Cdouble, c::Ptr{CTPSA{Desc}}) + +Adds a*v to TPSA c. Aliasing OK. Without complex-by-value arguments. + +### Input +- `a` -- Source TPSA a +- `v_re` -- Real part of scalar with double precision +- `v_im` -- Imaginary part of scalar with double precision +- `c` -- Destination TPSA c += v*a +""" +function mad_ctpsa_acc_r!(a::Ptr{CTPSA{Desc}}, v_re::Cdouble, v_im::Cdouble, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_acc_r(a::Ptr{CTPSA{Desc}}, v_re::Cdouble, v_im::Cdouble, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_scl_r!(a::Ptr{CTPSA{Desc}}, v_re::Cdouble, v_im::Cdouble,, c::Ptr{CTPSA{Desc}}) + +Sets TPSA c to v*a. Without complex-by-value arguments. + +### Input +- `a` -- Source TPSA a +- `v_re` -- Real part of scalar with double precision +- `v_im` -- Imaginary part of scalar with double precision +- `c` -- Destination TPSA c = v*a +""" +function mad_ctpsa_scl_r!(a::Ptr{CTPSA{Desc}}, v_re::Cdouble, v_im::Cdouble, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_scl_r(a::Ptr{CTPSA{Desc}}, v_re::Cdouble, v_im::Cdouble, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_inv_r!(a::Ptr{CTPSA{Desc}}, v_re::Cdouble, v_im::Cdouble, c::Ptr{CTPSA{Desc}}) + +Sets TPSA c to v/a. Without complex-by-value arguments. + +### Input +- `a` -- Source TPSA a +- `v_re` -- Real part of scalar with double precision +- `v_im` -- Imaginary part of scalar with double precision +- `c` -- Destination TPSA c = v*a +""" +function mad_ctpsa_inv_r!(a::Ptr{CTPSA{Desc}}, v_re::Cdouble, v_im::Cdouble, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_inv_r(a::Ptr{CTPSA{Desc}}, v_re::Cdouble, v_im::Cdouble, c::Ptr{CTPSA{Desc}})::Cvoid +end + +""" + mad_ctpsa_invsqrt_r!(a::Ptr{CTPSA{Desc}}, v_re::Cdouble, v_im::Cdouble, c::Ptr{CTPSA{Desc}}) + +Sets TPSA c to v/sqrt(a). Without complex-by-value arguments. + +### Input +- `a` -- Source TPSA a +- `v_re` -- Real part of scalar with double precision +- `v_im` -- Imaginary part of scalar with double precision +- `c` -- Destination TPSA c = v*a +""" +function mad_ctpsa_invsqrt_r!(a::Ptr{CTPSA{Desc}}, v_re::Cdouble, v_im::Cdouble, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_invsqrt_r(a::Ptr{CTPSA{Desc}}, v_re::Cdouble, v_im::Cdouble, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_axpb!(a::ComplexF64, x::Ptr{CTPSA{Desc}}, b::ComplexF64, r::Ptr{CTPSA{Desc}}) + +??? r = a*x/b? + +### Input +- `a` +- `x` +- `b` +- `r` +""" +function mad_ctpsa_axpb!(a::ComplexF64, x::Ptr{CTPSA{Desc}}, b::ComplexF64, r::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_axpb(a::ComplexF64, x::Ptr{CTPSA{Desc}}, b::ComplexF64, r::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_axpbypc!(a::ComplexF64, x::Ptr{CTPSA{Desc}}, b::ComplexF64, y::Ptr{CTPSA{Desc}}, c::ComplexF64, r::Ptr{CTPSA{Desc}}) + +### Input +- `a` +- `x` +- `b` +- `y` +- `c` +- `r` +""" +function mad_ctpsa_axpbypc!(a::ComplexF64, x::Ptr{CTPSA{Desc}}, b::ComplexF64, y::Ptr{CTPSA{Desc}}, c::ComplexF64, r::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_axpbypc(a::ComplexF64, x::Ptr{CTPSA{Desc}}, b::ComplexF64, y::Ptr{CTPSA{Desc}}, c::ComplexF64, r::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_axypb!(a::ComplexF64, x::Ptr{CTPSA{Desc}}, y::Ptr{CTPSA{Desc}}, b::ComplexF64, r::Ptr{CTPSA{Desc}}) + +??? + +### Input +- `a` +- `x` +- `y` +- `b` +- `r` +""" +function mad_ctpsa_axypb!(a::ComplexF64, x::Ptr{CTPSA{Desc}}, y::Ptr{CTPSA{Desc}}, b::ComplexF64, r::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_axypb(a::ComplexF64, x::Ptr{CTPSA{Desc}}, y::Ptr{CTPSA{Desc}}, b::ComplexF64, r::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_axypbzpc!(a::ComplexF64, x::Ptr{CTPSA{Desc}}, y::Ptr{CTPSA{Desc}}, b::ComplexF64, z::Ptr{CTPSA{Desc}}, c::ComplexF64, r::Ptr{CTPSA{Desc}}) + +??? + +### Input +- `a` +- `x` +- `y` +- `b` +- `z` +- `c` +- `r` +""" +function mad_ctpsa_axypbzpc!(a::ComplexF64, x::Ptr{CTPSA{Desc}}, y::Ptr{CTPSA{Desc}}, b::ComplexF64, z::Ptr{CTPSA{Desc}}, c::ComplexF64, r::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_axypbzpc(a::ComplexF64, x::Ptr{CTPSA{Desc}}, y::Ptr{CTPSA{Desc}}, b::ComplexF64, z::Ptr{CTPSA{Desc}}, c::ComplexF64, r::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_axypbvwpc!(a::ComplexF64, x::Ptr{CTPSA{Desc}}, y::Ptr{CTPSA{Desc}}, b::ComplexF64, v::Ptr{CTPSA{Desc}}, w::Ptr{CTPSA{Desc}}, c::ComplexF64, r::Ptr{CTPSA{Desc}}) + +??? + +### Input +- `a` +- `x` +- `y` +- `b` +- `v` +- `w` +- `c` +- `r` +""" +function mad_ctpsa_axypbvwpc!(a::ComplexF64, x::Ptr{CTPSA{Desc}}, y::Ptr{CTPSA{Desc}}, b::ComplexF64, v::Ptr{CTPSA{Desc}}, w::Ptr{CTPSA{Desc}}, c::ComplexF64, r::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_axypbvwpc(a::ComplexF64, x::Ptr{CTPSA{Desc}}, y::Ptr{CTPSA{Desc}}, b::ComplexF64, v::Ptr{CTPSA{Desc}}, w::Ptr{CTPSA{Desc}}, c::ComplexF64, r::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_ax2pby2pcz2!(a::ComplexF64, x::Ptr{CTPSA{Desc}}, b::ComplexF64, y::Ptr{CTPSA{Desc}}, c::ComplexF64, z::Ptr{CTPSA{Desc}}, r::Ptr{CTPSA{Desc}}) + +??? + +### Input +- `a` +- `x` +- `b` +- `y` +- `c` +- `z` +- `r` +""" +function mad_ctpsa_ax2pby2pcz2!(a::ComplexF64, x::Ptr{CTPSA{Desc}}, b::ComplexF64, y::Ptr{CTPSA{Desc}}, c::ComplexF64, z::Ptr{CTPSA{Desc}}, r::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_ax2pby2pcz2(a::ComplexF64, x::Ptr{CTPSA{Desc}}, b::ComplexF64, y::Ptr{CTPSA{Desc}}, c::ComplexF64, z::Ptr{CTPSA{Desc}}, r::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_axpsqrtbpcx2!(x::Ptr{CTPSA{Desc}}, a::ComplexF64, b::ComplexF64, c::ComplexF64, r::Ptr{CTPSA{Desc}}) + +??? + +### Input +- `x` +- `a` +- `b` +- `c` +- `r` +""" +function mad_ctpsa_axpsqrtbpcx2!(x::Ptr{CTPSA{Desc}}, a::ComplexF64, b::ComplexF64, c::ComplexF64, r::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_axpsqrtbpcx2(x::Ptr{CTPSA{Desc}}, a::ComplexF64, b::ComplexF64, c::ComplexF64, r::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_logaxpsqrtbpcx2!(x::Ptr{CTPSA{Desc}}, a::ComplexF64, b::ComplexF64, c::ComplexF64, r::Ptr{CTPSA{Desc}}) + +??? + +### Input +- `x` +- `a` +- `b` +- `c` +- `r` +""" +function mad_ctpsa_logaxpsqrtbpcx2!(x::Ptr{CTPSA{Desc}}, a::ComplexF64, b::ComplexF64, c::ComplexF64, r::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_logaxpsqrtbpcx2(x::Ptr{CTPSA{Desc}}, a::ComplexF64, b::ComplexF64, c::ComplexF64, r::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_logxdy!(x::Ptr{CTPSA{Desc}}, y::Ptr{CTPSA{Desc}}, r::Ptr{CTPSA{Desc}}) + +??? + +### Input +- `x` +- `y` +- `r` +""" +function mad_ctpsa_logxdy!(x::Ptr{CTPSA{Desc}}, y::Ptr{CTPSA{Desc}}, r::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_logxdy(x::Ptr{CTPSA{Desc}}, y::Ptr{CTPSA{Desc}}, r::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_axpb_r!(a_re::Cdouble, a_im::Cdouble, x::Ptr{CTPSA{Desc}}, b_re::Cdouble, b_im::Cdouble, r::Ptr{CTPSA{Desc}}) + +??? Without complex-by-value r = a*x/b? + +### Input +- `a_re` +- `a_im` +- `x` +- `b_re` +- `b_im` +- `r` +""" +function mad_ctpsa_axpb_r!(a_re::Cdouble, a_im::Cdouble, x::Ptr{CTPSA{Desc}}, b_re::Cdouble, b_im::Cdouble, r::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_axpb_r(a_re::Cdouble, a_im::Cdouble, x::Ptr{CTPSA{Desc}}, b_re::Cdouble, b_im::Cdouble, r::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_axpbypc_r!(a_re::Cdouble, a_im::Cdouble, x::Ptr{CTPSA{Desc}}, b_re::Cdouble, b_im::Cdouble, y::Ptr{CTPSA{Desc}}, c_re::Cdouble, c_im::Cdouble, r::Ptr{CTPSA{Desc}}) + +### Input +- `a_re` +- `a_im` +- `x` +- `b_re` +- `b_im` +- `y` +- `c_re` +- `c_im` +- `r` +""" +function mad_ctpsa_axpbypc_r!(a_re::Cdouble, a_im::Cdouble, x::Ptr{CTPSA{Desc}}, b_re::Cdouble, b_im::Cdouble, y::Ptr{CTPSA{Desc}}, c_re::Cdouble, c_im::Cdouble, r::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_axpbypc_r(a_re::Cdouble, a_im::Cdouble, x::Ptr{CTPSA{Desc}}, b_re::Cdouble, b_im::Cdouble, y::Ptr{CTPSA{Desc}}, c_re::Cdouble, c_im::Cdouble, r::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_axypb_r!(a_re::Cdouble, a_im::Cdouble, x::Ptr{CTPSA{Desc}}, y::Ptr{CTPSA{Desc}}, b_re::Cdouble, b_im::Cdouble, r::Ptr{CTPSA{Desc}}) + +??? Without complex-by-value + +### Input +- `a_re` +- `a_im` +- `x` +- `y` +- `b_re` +- `b_im` +- `r` +""" +function mad_ctpsa_axypb_r!(a_re::Cdouble, a_im::Cdouble, x::Ptr{CTPSA{Desc}}, y::Ptr{CTPSA{Desc}}, b_re::Cdouble, b_im::Cdouble, r::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_axypb_r(a_re::Cdouble, a_im::Cdouble, x::Ptr{CTPSA{Desc}}, y::Ptr{CTPSA{Desc}}, b_re::Cdouble, b_im::Cdouble, r::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_axypbzpc_r!(a_re::Cdouble, a_im::Cdouble, x::Ptr{CTPSA{Desc}}, y::Ptr{CTPSA{Desc}}, b_re::Cdouble, b_im::Cdouble, z::Ptr{CTPSA{Desc}}, c_re::Cdouble, c_im::Cdouble, r::Ptr{CTPSA{Desc}}) + +??? Without complex-by-value + +### Input +- `a_re` +- `a_im` +- `x` +- `y` +- `b_re` +- `b_im` +- `z` +- `c_re` +- `c_im` +- `r` +""" +function mad_ctpsa_axypbzpc_r!(a_re::Cdouble, a_im::Cdouble, x::Ptr{CTPSA{Desc}}, y::Ptr{CTPSA{Desc}}, b_re::Cdouble, b_im::Cdouble, z::Ptr{CTPSA{Desc}}, c_re::Cdouble, c_im::Cdouble, r::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_axypbzpc_r(a_re::Cdouble, a_im::Cdouble, x::Ptr{CTPSA{Desc}}, y::Ptr{CTPSA{Desc}}, b_re::Cdouble, b_im::Cdouble, z::Ptr{CTPSA{Desc}}, c_re::Cdouble, c_im::Cdouble, r::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_axypbvwpc_r!(a_re::Cdouble, a_im::Cdouble, x::Ptr{CTPSA{Desc}}, y::Ptr{CTPSA{Desc}}, b_re::Cdouble, b_im::Cdouble, v::Ptr{CTPSA{Desc}}, w::Ptr{CTPSA{Desc}}, c_re::Cdouble, c_im::Cdouble, r::Ptr{CTPSA{Desc}}) + +??? Without complex-by-value + +### Input +- `a_re` +- `a_im` +- `x` +- `y` +- `b_re` +- `b_im` +- `v` +- `w` +- `c_re` +- `c_im` +- `r` +""" +function mad_ctpsa_axypbvwpc_r!(a_re::Cdouble, a_im::Cdouble, x::Ptr{CTPSA{Desc}}, y::Ptr{CTPSA{Desc}}, b_re::Cdouble, b_im::Cdouble, v::Ptr{CTPSA{Desc}}, w::Ptr{CTPSA{Desc}}, c_re::Cdouble, c_im::Cdouble, r::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_axypbvwpc_r(a_re::Cdouble, a_im::Cdouble, x::Ptr{CTPSA{Desc}}, y::Ptr{CTPSA{Desc}}, b_re::Cdouble, b_im::Cdouble, v::Ptr{CTPSA{Desc}}, w::Ptr{CTPSA{Desc}}, c_re::Cdouble, c_im::Cdouble, r::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_ax2pby2pcz2_r!(a_re::Cdouble, a_im::Cdouble, x::Ptr{CTPSA{Desc}}, b_re::Cdouble, b_im::Cdouble, y::Ptr{CTPSA{Desc}}, c_re::Cdouble, c_im::Cdouble, z::Ptr{CTPSA{Desc}}, r::Ptr{CTPSA{Desc}}) + +??? Without complex-by-value + +### Input +- `a_re` +- `a_im` +- `x` +- `b_re` +- `b_im` +- `y` +- `c_re` +- `c_im` +- `z` +- `r` +""" +function mad_ctpsa_ax2pby2pcz2_r!(a_re::Cdouble, a_im::Cdouble, x::Ptr{CTPSA{Desc}}, b_re::Cdouble, b_im::Cdouble, y::Ptr{CTPSA{Desc}}, c_re::Cdouble, c_im::Cdouble, z::Ptr{CTPSA{Desc}}, r::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_ax2pby2pcz2_r(a_re::Cdouble, a_im::Cdouble, x::Ptr{CTPSA{Desc}}, b_re::Cdouble, b_im::Cdouble, y::Ptr{CTPSA{Desc}}, c_re::Cdouble, c_im::Cdouble, z::Ptr{CTPSA{Desc}}, r::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_axpsqrtbpcx2_r!(x::Ptr{CTPSA{Desc}}, a_re::Cdouble, a_im::Cdouble, b_re::Cdouble, b_im::Cdouble, c_re::Cdouble, c_im::Cdouble, r::Ptr{CTPSA{Desc}}) + +??? Without complex-by-value + +### Input +- `x` +- `a_re` +- `a_im` +- `b_re` +- `b_im` +- `c_re` +- `c_im` +- `r` +""" +function mad_ctpsa_axpsqrtbpcx2_r!(x::Ptr{CTPSA{Desc}}, a_re::Cdouble, a_im::Cdouble, b_re::Cdouble, b_im::Cdouble, c_re::Cdouble, c_im::Cdouble, r::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_axpsqrtbpcx2_r(x::Ptr{CTPSA{Desc}}, a_re::Cdouble, a_im::Cdouble, b_re::Cdouble, b_im::Cdouble, c_re::Cdouble, c_im::Cdouble, r::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_logaxpsqrtbpcx2_r!(x::Ptr{CTPSA{Desc}}, a_re::Cdouble, a_im::Cdouble, b_re::Cdouble, b_im::Cdouble, c_re::Cdouble, c_im::Cdouble, r::Ptr{CTPSA{Desc}}) + +??? Without complex-by-value + +### Input +- `x` +- `a_re` +- `a_im` +- `b_re` +- `b_im` +- `c_re` +- `c_im` +- `r` +""" +function mad_ctpsa_logaxpsqrtbpcx2_r!(x::Ptr{CTPSA{Desc}}, a_re::Cdouble, a_im::Cdouble, b_re::Cdouble, b_im::Cdouble, c_re::Cdouble, c_im::Cdouble, r::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_logaxpsqrtbpcx2_r(x::Ptr{CTPSA{Desc}}, a_re::Cdouble, a_im::Cdouble, b_re::Cdouble, b_im::Cdouble, c_re::Cdouble, c_im::Cdouble, r::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_vec2fld!(na::Cint, a::Ptr{CTPSA{Desc}}, mc::Ptr{Ptr{CTPSA{Desc}}}) + +??? + +### Input +- `na` +- `a` +- `mc` +""" +function mad_ctpsa_vec2fld!(na::Cint, a::Ptr{CTPSA{Desc}}, mc::Ptr{Ptr{CTPSA{Desc}}}) + @ccall MAD_TPSA.mad_ctpsa_vec2fld(na::Cint, a::Ptr{CTPSA{Desc}}, mc::Ptr{Ptr{CTPSA{Desc}}})::Cvoid +end + + +""" + mad_ctpsa_fld2vec!(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, c::Ptr{CTPSA{Desc}}) + +??? + +### Input +- `na` +- `ma` +- `c` +""" +function mad_ctpsa_fld2vec!(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_fld2vec(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_fgrad!(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, b::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + +??? + +### Input +- `na` +- `ma` +- `b` +- `c` +""" +function mad_ctpsa_fgrad!(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, b::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_fgrad(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, b::Ptr{CTPSA{Desc}}, c::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_liebra!(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, mb::Ptr{Ptr{CTPSA{Desc}}}, mc::Ptr{Ptr{CTPSA{Desc}}}) + +??? + +### Input +- `na` +- `ma` +- `mb` +- `mc` +""" +function mad_ctpsa_liebra!(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, mb::Ptr{Ptr{CTPSA{Desc}}}, mc::Ptr{Ptr{CTPSA{Desc}}}) + @ccall MAD_TPSA.mad_ctpsa_liebra(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, mb::Ptr{Ptr{CTPSA{Desc}}}, mc::Ptr{Ptr{CTPSA{Desc}}})::Cvoid +end + + +""" + mad_ctpsa_exppb!(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, mb::Ptr{Ptr{CTPSA{Desc}}}, mc::Ptr{Ptr{CTPSA{Desc}}}) + +??? + +### Input +- `na` +- `ma` +- `mb` +- `mc` +""" +function mad_ctpsa_exppb!(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, mb::Ptr{Ptr{CTPSA{Desc}}}, mc::Ptr{Ptr{CTPSA{Desc}}}) + @ccall MAD_TPSA.mad_ctpsa_exppb(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, mb::Ptr{Ptr{CTPSA{Desc}}}, mc::Ptr{Ptr{CTPSA{Desc}}})::Cvoid +end + + +""" + mad_ctpsa_logpb!(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, mb::Ptr{Ptr{CTPSA{Desc}}}, mc::Ptr{Ptr{CTPSA{Desc}}}) + +??? + +### Input +- `na` +- `ma` +- `mb` +- `mc` +""" +function mad_ctpsa_logpb!(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, mb::Ptr{Ptr{CTPSA{Desc}}}, mc::Ptr{Ptr{CTPSA{Desc}}}) + @ccall MAD_TPSA.mad_ctpsa_logpb(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, mb::Ptr{Ptr{CTPSA{Desc}}}, mc::Ptr{Ptr{CTPSA{Desc}}})::Cvoid +end + + +""" + mad_ctpsa_mnrm(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}})::Cdouble + +??? + +### Input +- `na` +- `ma` + +### Output +- `nrm` +""" +function mad_ctpsa_mnrm(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}})::Cdouble + nrm = @ccall MAD_TPSA.mad_ctpsa_mnrm(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}})::Cdouble + return nrm +end + + +""" + mad_ctpsa_minv!(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, mc::Ptr{Ptr{CTPSA{Desc}}}) + +??? + +### Input +- `na` +- `ma` +- `mc` +""" +function mad_ctpsa_minv!(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, mc::Ptr{Ptr{CTPSA{Desc}}}) + @ccall MAD_TPSA.mad_ctpsa_minv(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, mc::Ptr{Ptr{CTPSA{Desc}}})::Cvoid +end + + +""" + mad_ctpsa_pminv!(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, mc::Ptr{Ptr{CTPSA{Desc}}}, select::Ptr{Cint}) + +??? + +### Input +- `na` +- `ma` +- `mc` +- `select` +""" +function mad_ctpsa_pminv!(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, mc::Ptr{Ptr{CTPSA{Desc}}}, select::Ptr{Cint}) + @ccall MAD_TPSA.mad_ctpsa_pminv(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, mc::Ptr{Ptr{CTPSA{Desc}}}, select::Ptr{Cint})::Cvoid +end + + +""" + mad_ctpsa_compose!(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, nb::Cint, mb::Ptr{Ptr{CTPSA{Desc}}}, mc::Ptr{Ptr{CTPSA{Desc}}}) + +??? + +### Input +- `na` +- `ma` +- `nb` +- `mb` +- `mc` +""" +function mad_ctpsa_compose!(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, nb::Cint, mb::Ptr{Ptr{CTPSA{Desc}}}, mc::Ptr{Ptr{CTPSA{Desc}}}) + @ccall MAD_TPSA.mad_ctpsa_compose(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, nb::Cint, mb::Ptr{Ptr{CTPSA{Desc}}}, mc::Ptr{Ptr{CTPSA{Desc}}})::Cvoid +end + + +""" + mad_ctpsa_translate!(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, nb::Cint, tb::Ptr{ComplexF64}, mc::Ptr{CTPSA{Desc}}) + +??? + +### Input +- `na` +- `ma` +- `nb` +- `tb` +- `mc` +""" +function mad_ctpsa_translate!(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, nb::Cint, tb::Ptr{ComplexF64}, mc::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_translate(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, nb::Cint, tb::Ptr{ComplexF64}, mc::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_eval!(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, nb::Cint, tb::Ptr{ComplexF64}, tc::Ptr{ComplexF64}) + +??? + +### Input +- `na` +- `ma` +- `nb` +- `tb` +- `tc` +""" +function mad_ctpsa_eval!(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, nb::Cint, tb::Ptr{ComplexF64}, tc::Ptr{ComplexF64}) + @ccall MAD_TPSA.mad_ctpsa_eval(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, nb::Cint, tb::Ptr{ComplexF64}, tc::Ptr{ComplexF64})::Cvoid +end + + +""" + mad_ctpsa_mconv!(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, nc::Cint, mc::Ptr{Ptr{CTPSA{Desc}}}, n::Cint, t2r_::Ptr{Cint}, pb::Cint) + +??? + +### Input +- `na` +- `ma` +- `nc` +- `mc` +- `n` +- `t2r_` +- `pb` +""" +function mad_ctpsa_mconv!(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, nc::Cint, mc::Ptr{Ptr{CTPSA{Desc}}}, n::Cint, t2r_::Ptr{Cint}, pb::Cint) + @ccall MAD_TPSA.mad_ctpsa_mconv(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, nc::Cint, mc::Ptr{Ptr{CTPSA{Desc}}}, n::Cint, t2r_::Ptr{Cint}, pb::Cint)::Cvoid +end + + +""" + mad_ctpsa_print(t::Ptr{CTPSA{Desc}}, name_::Cstring, eps_::Cdouble, nohdr_::Cint, stream_::Ptr{Cvoid}) + +Prints the TPSA coefficients to stdout with precision eps_. If nohdr_ is not zero, +the header is not printed. + +### Input +- `t` -- TPSA to print +- `name_` -- Name of TPSA +- `eps_` -- Precision to output +- `nohdr_` -- If True, no header is printed +- `stream_` -- FILE pointer of output stream. If null, printed to stdout +""" +function mad_ctpsa_print(t::Ptr{CTPSA{Desc}}, name_::Cstring, eps_::Cdouble, nohdr_::Cint, stream_::Ptr{Cvoid}) + @ccall MAD_TPSA.mad_ctpsa_print(t::Ptr{CTPSA{Desc}}, name_::Cstring, eps_::Cdouble, nohdr_::Cint, stream_::Ptr{Cvoid})::Cvoid +end + + +""" + mad_ctpsa_scan(stream_::Ptr{Cvoid})::Ptr{CTPSA{Desc}} + +Scans in a TPSA from the stream_. + +### Input +- `stream_` -- C FILE pointer I/O stream from which to read the TPSA + +### Output +- `t` -- TPSA scanned from I/O stream_ +""" +function mad_ctpsa_scan(stream_::Ptr{Cvoid})::Ptr{CTPSA{Desc}} + t = @ccall MAD_TPSA.mad_ctpsa_scan(stream_::Ptr{Cvoid})::Ptr{CTPSA{Desc}} + return t +end + + +""" + mad_ctpsa_scan_hdr(kind_::Cint, name_::Cstring, stream_::Ptr{Cvoid})::Ptr{Desc{RTPSA,CTPSA}} + +??? + +### Input +- `kind_` +- `name_` +- `stream_` + +### Output +- `ret` +""" +function mad_ctpsa_scan_hdr(kind_::Cint, name_::Cstring, stream_::Ptr{Cvoid})::Ptr{Desc{RTPSA,CTPSA}} + desc = @ccall MAD_TPSA.mad_ctpsa_scan_hdr(kind_::Cint, name_::Cstring, stream_::Ptr{Cvoid})::Ptr{Desc{RTPSA,CTPSA}} + return ret +end + + +""" + mad_ctpsa_scan_coef!(t::Ptr{CTPSA{Desc}}, stream_::Ptr{Cvoid}) + +??? + +### Input +- `t` +- `stream_` +""" +function mad_ctpsa_scan_coef!(t::Ptr{CTPSA{Desc}}, stream_::Ptr{Cvoid}) + @ccall MAD_TPSA.mad_ctpsa_scan_coef(t::Ptr{CTPSA{Desc}}, stream_::Ptr{Cvoid})::Cvoid +end + + +""" + mad_ctpsa_debug(t::Ptr{CTPSA{Desc}}, name_::Cstring, fnam_::Cstring, line_::Cint, stream_::Ptr{Cvoid}) + +??? + +### Input +- `t` +- `name_` +- `fnam_` +- `line_` +- `stream_` +""" +function mad_ctpsa_debug(t::Ptr{CTPSA{Desc}}, name_::Cstring, fnam_::Cstring, line_::Cint, stream_::Ptr{Cvoid}) + @ccall MAD_TPSA.mad_ctpsa_debug(t::Ptr{CTPSA{Desc}}, name_::Cstring, fnam_::Cstring, line_::Cint, stream_::Ptr{Cvoid})::Cvoid +end + +""" + mad_ctpsa_isvalid(t::Ptr{CTPSA{Desc}})::Cuchar + +Sanity check of the TPSA integrity. + +### Input +- `t` -- Complex TPSA to check if valid + +### Output +- `ret` -- True if valid TPSA, false otherwise +""" +function mad_ctpsa_isvalid(t::Ptr{CTPSA{Desc}})::Cuchar + ret = @ccall MAD_TPSA.mad_ctpsa_isvalid(t::Ptr{CTPSA{Desc}})::Cuchar + return ret +end + + +""" + mad_ctpsa_init(t::Ptr{CTPSA{Desc}}, d::Ptr{Desc{RTPSA,CTPSA}}, mo::Cuchar)::Ptr{CTPSA{Desc}} + +UNSAFE OPERATION! (mo vs allocated!!) ??? + +### Input +- `t` +- `d` +- `mo` + +### Output +- `t` +""" +function mad_ctpsa_init!(t::Ptr{CTPSA{Desc}}, d::Ptr{Desc{RTPSA,CTPSA}}, mo::Cuchar)::Ptr{CTPSA{Desc}} + t = @ccall MAD_TPSA.mad_ctpsa_init(t::Ptr{CTPSA{Desc}}, d::Ptr{Desc{RTPSA,CTPSA}}, mo::Cuchar)::Ptr{CTPSA{Desc}} + return t +end + end diff --git a/src/Descriptor.jl b/src/Descriptor.jl index 7c6a9192..fb9efccc 100644 --- a/src/Descriptor.jl +++ b/src/Descriptor.jl @@ -36,4 +36,343 @@ struct Desc{T,C} ti::Ptr{Cint} # idx of tmp ised cti::Ptr{Cint} # idx of tmp used end + +""" + mad_desc_newv(nv::Cint, mo::Cuchar)::Ptr{Desc{RTPSA,CTPSA}} + +Creates a TPSA descriptor with the specified number of variables and maximum order. +The number of parameters is set to 0. + +### Input +- `nv` -- Number of variables in th +- `mo` -- Maximum order of TPSA, mo = max(1, mo) + +### Output +- `ret` -- Descriptor with the specified number of variables and maximum order +""" +function mad_desc_newv(nv::Cint, mo::Cuchar)::Ptr{Desc{RTPSA,CTPSA}} + ret = @ccall MAD_TPSA.mad_desc_newv(nv::Cint, mo::Cuchar)::Ptr{Desc{RTPSA,CTPSA}} + return ret +end + + +""" + mad_desc_newvp(nv::Cint, mo::Cuchar, np_::Cint, po_::Cuchar)::Ptr{Desc{RTPSA,CTPSA}} + +Creates a TPSA descriptor with the specifed number of variables, maximum order, number of +parameters, and parameter order. + +### Input +- `nv` -- Number of variables +- `mo` -- Maximum order of TPSA, mo = max(1, mo) +- `np_` -- Number of parameters +- `po_` -- Order of parameters, po = max(1, po_) + +### Output +- `ret` -- Descriptor with the specified nv, mo, np, and po. +""" +function mad_desc_newvp(nv::Cint, mo::Cuchar, np_::Cint, po_::Cuchar)::Ptr{Desc{RTPSA,CTPSA}} + ret = @ccall MAD_TPSA.mad_desc_newvp(nv::Cint, mo::Cuchar, np_::Cint, po_::Cuchar)::Ptr{Desc{RTPSA,CTPSA}} + return ret +end + + +""" + mad_desc_newvpo(nv::Cint, mo::Cuchar, np_::Cint, po_::Cuchar, no_::Ptr{Cuchar})::Ptr{Desc{RTPSA,CTPSA}} + +Creates a TPSA descriptor with the specifed number of variables, maximum order, number of parameters, +parameter order, and individual variable/parameter orders specified in no. The first nv entries in no +correspond to the variables' orders and the next np entries correspond the parameters' orders. + +### Input +- `nv` -- Number of variables +- `mo` -- Maximum order of TPSA (mo = max(mo , no[0 :nn-1]), nn = nv+np) +- `np_` -- Number of parameters +- `po_` -- Order of parameters (po = max(po_, no[nv:nn-1]), po <= mo) +- `no_` -- Array of orders of variables and parameters + +### Output +- `ret` -- Descriptor with the specified nv, mo, np, po, no. +""" +function mad_desc_newvpo(nv::Cint, mo::Cuchar, np_::Cint, po_::Cuchar, no_::Ptr{Cuchar})::Ptr{Desc{RTPSA,CTPSA}} + ret = @ccall MAD_TPSA.mad_desc_newvpo(nv::Cint, mo::Cuchar, np_::Cint, po_::Cuchar, no_::Ptr{Cuchar})::Ptr{Desc{RTPSA,CTPSA}} + return ret +end + + +""" + mad_desc_del!(d_::Ptr{Desc{RTPSA,CTPSA}}) + +Calls the destructor for the descriptor, or all descriptors if null pointer is passed. + +### Input +- `d_` -- Descriptor to destruct. If null, all registered descriptors will be deleted +""" +function mad_desc_del!(d_::Ptr{Desc{RTPSA,CTPSA}}) + @ccall MAD_TPSA.mad_desc_del(d_::Ptr{Desc{RTPSA,CTPSA}})::Cvoid +end + + +""" + mad_desc_getnv!(d::Ptr{Desc{RTPSA,CTPSA}}, mo_::Ptr{Cuchar}, np_::Ptr{Cint}, po_::Ptr{Cuchar)::Cint + +Returns the number of variables in the descriptor, and sets the passed mo_, np_, and po_ to the maximum +order, number of parameters, and parameter order respectively. ??? + +### Input +- `d` -- Descriptor +- `mo_` -- Maximum order to be set to that of the descriptor +- `np_` -- Number of parameters to be set to that of the descriptor +- `po_` -- Parameter order to be set to that of the descriptor + +### Output +- `ret` -- Number of variables in TPSA +""" +function mad_desc_getnv!(desc::Ptr{Desc{RTPSA,CTPSA}}, mo_::Ptr{Cuchar}, np_::Ptr{Cint}, po_::Ptr{Cuchar})::Cint + ret = @ccall MAD_TPSA.mad_desc_getnv(desc::Ptr{Desc{RTPSA,CTPSA}}, mo_::Cuchar, np_::Cint, po_::Cuchar)::Cint + return ret +end + + +""" + mad_desc_maxord(d::Ptr{Desc{RTPSA,CTPSA}}, nn::Cint, no_::Ptr{Cuchar})::Cuchar + +Sets the order of the variables and parameters of the TPSA to those specified in no_ and +returns the maximum order of the TPSA. + +### Input +- `d` -- Descriptor +- `nn` -- Number of variables + number of parameters, no_[1..nn] +- `no_` -- Orders of parameters to be filled if provided + +### Output +- `ret` -- Maximum order of TPSA +""" +function mad_desc_maxord(d::Ptr{Desc{RTPSA,CTPSA}}, nn::Cint, no_::Ptr{Cuchar})::Cuchar + ret = @ccall MAD_TPSA.mad_desc_maxord(d::Ptr{Desc{RTPSA,CTPSA}}, nn::Cint, no_::Ptr{Cuchar})::Cuchar + return ret +end + + +""" + mad_desc_maxlen(d::Ptr{Desc{RTPSA,CTPSA}}, mo::Cuchar)::Cint + +??? + +### Input +- `d` -- Descriptor +- `mo` -- ordlen(maxord) == maxlen + +### Output +- `ret` -- monomials in 0..order +""" +function mad_desc_maxlen(d::Ptr{Desc{RTPSA,CTPSA}}, mo::Cuchar)::Cint + ret = @ccall MAD_TPSA.mad_desc_maxlen(d::Ptr{Desc{RTPSA,CTPSA}}, mo::Cuchar)::Cint + return ret +end + + +""" + mad_desc_gtrunc!(d::Ptr{Desc{RTPSA,CTPSA}}, to::Cuchar)::Cuchar + +Sets the global truncation order (to) of the TPSA, and returns the old global truncation order. + +### Input +- `d` -- Descriptor +- `to` -- New global truncation order + +### Output +- `oldto` -- Old global truncation order +""" +function mad_desc_gtrunc!(d::Ptr{Desc{RTPSA,CTPSA}}, to::Cuchar)::Cuchar + oldto = @ccall MAD_TPSA.mad_desc_gtrunc(d::Ptr{Desc{RTPSA,CTPSA}}, to::Cuchar)::Cuchar + return oldto +end + + +""" + mad_desc_isvalids(d::Ptr{Desc{RTPSA,CTPSA}}, n::Cint, s::Cstring)::Cuchar + +??? + +### Input +- `d` -- Descriptor +- `n` -- String length of 0 (unknown) +- `s` -- Monomial as string "[0-9]*" + +### Output +- `ret` -- True or false +""" +function mad_desc_isvalids(d::Ptr{Desc{RTPSA,CTPSA}}, n::Cint, s::Cstring)::Cuchar + ret = @ccall MAD_TPSA.mad_desc_isvalids(d::Ptr{Desc{RTPSA,CTPSA}}, n::Cint, s::Cstring)::Cuchar + return ret +end + + +""" + mad_desc_isvalidm(d::Ptr{Desc{RTPSA,CTPSA}}, n::Cint, m::Ptr{Cuchar})::Cuchar + +??? + +### Input +- `d` -- Descriptor +- `n` -- Length of monomial +- `m` -- Monomial + +### Output +- `ret` -- True or false +""" +function mad_desc_isvalidm(d::Ptr{Desc{RTPSA,CTPSA}}, n::Cint, m::Ptr{Cuchar})::Cuchar + ret = @ccall MAD_TPSA.mad_desc_isvalidm(d::Ptr{Desc{RTPSA,CTPSA}}, n::Cint, m::Ptr{Cuchar})::Cuchar + return ret +end + + +""" + mad_desc_isvalidsm(d::Ptr{Desc{RTPSA,CTPSA}}, n::Cint, m::Ptr{Cint})::Cuchar + +??? why int isntead uint8 + +### Input +- `d` -- Descriptor +- `n` -- Length of monomial +- `m` -- Sparse monomial (idx, ord) + +### Output +- `ret` -- True or false. +""" +function mad_desc_isvalidsm(d::Ptr{Desc{RTPSA,CTPSA}}, n::Cint, m::Ptr{Cint})::Cuchar + ret = @ccall MAD_TPSA.mad_desc_isvalidsm(d::Ptr{Desc{RTPSA,CTPSA}}, n::Cint, m::Ptr{Cint})::Cuchar + return ret +end + + +""" + mad_desc_idxs(d::Ptr{Desc{RTPSA,CTPSA}}, n::Cint, s::Cstring)::Cint + +??? + +### Input +- `d` -- Descriptor +- `n` -- String length or 0 (unknown) +- `s` -- Monomial as string "[0-9]*" + +### Output +- `ret` -- Monomial index or -1 +""" +function mad_desc_idxs(d::Ptr{Desc{RTPSA,CTPSA}}, n::Cint, s::Cstring)::Cint + ret = @ccall MAD_TPSA.mad_desc_idxs(d::Ptr{Desc{RTPSA,CTPSA}}, n::Cint, s::Cstring)::Cint + return ret +end + + +""" + mad_desc_idxm(d::Ptr{Desc{RTPSA,CTPSA}}, n::Cint, m::Ptr{Cuchar})::Cint + +??? + +### Input +- `d` -- Descriptor +- `n` -- Monomial length +- `m` -- Monomial + +### Output +- `ret` -- Monomial index or -1 +""" +function mad_desc_idxm(d::Ptr{Desc{RTPSA,CTPSA}}, n::Cint, m::Ptr{Cuchar})::Cint + ret = @ccall MAD_TPSA.mad_desc_idxm(d::Ptr{Desc{RTPSA,CTPSA}}, n::Cint, m::Ptr{Cuchar})::Cint + return ret +end + + +""" + mad_desc_idxsm(d::Ptr{Desc{RTPSA,CTPSA}}, n::Cint, m::Ptr{Cint})::Cint + +??? Why int instead Uint8 + +### Input +- `d` -- Descriptor +- `n` -- Monomial length +- `m` -- Sparse monomial (idx,ord) + +### Output +- `ret` -- Monomial index or -1 +""" +function mad_desc_idxsm(d::Ptr{Desc{RTPSA,CTPSA}}, n::Cint, m::Ptr{Cint})::Cint + ret = @ccall MAD_TPSA.mad_desc_idxsm(d::Ptr{Desc{RTPSA,CTPSA}}, n::Cint, m::Ptr{Cint})::Cint + return ret +end + + +""" + mad_desc_nxtbyvar(d::Ptr{Desc{RTPSA,CTPSA}}, n::Cint, m::Ptr{Cuchar})::Cint + +??? + +### Input +- `d` -- Descriptor +- `n` -- Monomial length +- `m` -- Monomial + +### Output +- `idx` -- Monomial index or -1 +""" +function mad_desc_nxtbyvar(d::Ptr{Desc{RTPSA,CTPSA}}, n::Cint, m::Ptr{Cuchar})::Cint + idx = @ccall MAD_TPSA.mad_desc_nxtbyvar(d::Ptr{Desc{RTPSA,CTPSA}}, n::Cint, m::Ptr{Cuchar})::Cint + return idx +end + + +""" + mad_desc_nxtbyord(d::Ptr{Desc{RTPSA,CTPSA}}, n::Cint, m::Ptr{Cuchar})::Cint + +??? + +### Input +- `d` -- Descriptor +- `n` -- Monomial length +- `m` -- Monomial + +### Output +- `idx` -- Monomial index or -1 +""" +function mad_desc_nxtbyord(d::Ptr{Desc{RTPSA,CTPSA}}, n::Cint, m::Ptr{Cuchar})::Cint + idx = @ccall MAD_TPSA.mad_desc_nxtbyord(d::Ptr{Desc{RTPSA,CTPSA}}, n::Cint, m::Ptr{Cuchar})::Cint + return idx +end + + +""" + mad_desc_mono(d::Ptr{Desc{RTPSA,CTPSA}}, i::Cint, n::Cint, m_::Ptr{Cuchar})::Cuchar + +??? + +### Input +- `d` -- Descriptor +- `i` -- Slot index (must be valid) +- `n` -- Monomial length +- `m_` -- Monomial to fill (if provided) + +### Output +- `ret` -- Monomial order +""" +function mad_desc_mono(d::Ptr{Desc{RTPSA,CTPSA}}, i::Cint, n::Cint, m_::Ptr{Cuchar})::Cuchar + ret = @ccall MAD_TPSA.mad_desc_mono(d::Ptr{Desc{RTPSA,CTPSA}}, i::Cint, n::Cint, m_::Ptr{Cuchar})::Cuchar + return ret +end + +""" + mad_desc_info(d::Ptr{Desc{RTPSA,CTPSA}}, fp::Ptr{Cvoid}) + +For debugging. + +### Input +- `d` -- Descriptor to debug +- `fp` -- File to write to. If null, will write to stdout +""" +function mad_desc_info(d::Ptr{Desc{RTPSA,CTPSA}}, fp::Ptr{Cvoid}) + @ccall MAD_TPSA.mad_desc_info(d::Ptr{Desc{RTPSA,CTPSA}}, fp::Ptr{Cvoid})::Cvoid +end + + end \ No newline at end of file diff --git a/src/Monomial.jl b/src/Monomial.jl new file mode 100644 index 00000000..18175da2 --- /dev/null +++ b/src/Monomial.jl @@ -0,0 +1,336 @@ +module Monomial + + +""" + mad_mono_str(n::Cint, a::Ptr{Cuchar}, s::Cstring)::Cint + +??? + +### Input +- `n` -- Monomial and string length +- `a` -- Monomial +- `s` -- Monomial as string "[0-9]*" + +### Output +- `i` -- Adjusted size n if "\0" found +""" +function mad_mono_str(n::Cint, mono_a::Ptr{Cuchar}, s::Cstring)::Cint + i = @ccall MAD_TPSA.mad_mono_str(n::Cint, mono_a::Ptr{Cuchar}, s::Cstring)::Cint + return i +end + + +""" + mad_mono_prt(n::Cint, a::Ptr{Cuchar}, s::Cstring)::Cstring + +??? + +### Input +- `n` -- Monomial and string length +- `a` -- Monomial +- `s` -- Monomial as string + +### Output +- `s` -- Monomial as string +""" +function mad_mono_prt(n::Cint, a::Ptr{Cuchar}, s::Cstring)::Cstring + s = @ccall MAD_TPSA.mad_mono_prt(n::Cint, a::Ptr{Cuchar}, s::Cstring)::Cstring + return s +end + + +""" + mad_mono_fill!(n::Cint, a::Ptr{Cuchar}, v::Cuchar) + +Fills the monomial a with the value v. + +### Input +- `n` -- Monomial length +- `a` -- Monomial +- `v` -- Value +""" +function mad_mono_fill!(n::Cint, a::Ptr{Cuchar}, v::Cuchar) + @ccall MAD_TPSA.mad_mono_fill(n::Cint, a::Ptr{Cuchar}, v::Cuchar)::Cvoid +end + + +""" + mad_mono_copy!(n::Cint, a::Ptr{Cuchar}, r::Ptr{Cuchar}) + +Copies monomial a to monomial r. + +### Input +- `n` -- Length of monomials +- `a` -- Source monomial +- `r` -- Destination monomial +""" +function mad_mono_copy!(n::Cint, a::Ptr{Cuchar}, r::Ptr{Cuchar}) + @ccall MAD_TPSA.mad_mono_copy(n::Cint, a::Ptr{Cuchar}, r::Ptr{Cuchar})::Cvoid +end + + +""" + mad_mono_min(n::Cint, a::Ptr{Cuchar})::Cuchar + +??? min of monomial? + +### Input +- `n` -- Length of monomial +- `a` -- Monomial + +### Output +- `mo` -- Min??? +""" +function mad_mono_min(n::Cint, a::Ptr{Cuchar})::Cuchar + mo = @ccall MAD_TPSA.mad_mono_min(n::Cint, a::Ptr{Cuchar})::Cuchar + return mo +end + + +""" + mad_mono_max(n::Cint, a::Ptr{Cuchar})::Cuchar + +??? max of monomial? + +### Input +- `n` -- Length of monomial +- `a` -- Monomial + +### Output +- `mo` -- Max??? +""" +function mad_mono_max(n::Cint, a::Ptr{Cuchar})::Cuchar + mo = @ccall MAD_TPSA.mad_mono_max(n::Cint, a::Ptr{Cuchar})::Cuchar + return mo +end + + +""" + mad_mono_ord(n::Cint, a::Ptr{Cuchar})::Cint + +Returns the sum of the orders of the monomial a. + +### Input +- `n` -- Monomial length +- `a` -- Monomial + +### Output +- `s` -- Sum of orders of monomial +""" +function mad_mono_ord(n::Cint, a::Ptr{Cuchar})::Cint + s = @ccall MAD_TPSA.mad_mono_ord(n::Cint, a::Ptr{Cuchar})::Cint + return s +end + + +""" + mad_mono_ordp(n::Cint, a::Ptr{Cuchar}, stp::Cint)::Cdouble + +Returns the product of the orders of the monomial a. + +### Input +- `n` -- Monomial length +- `a` -- Monomial +- `stp` -- ???? + +### Output +- `p` -- Product of orders of monomial +""" +function mad_mono_ordp(n::Cint, a::Ptr{Cuchar}, stp::Cint)::Cdouble + p = @ccall MAD_TPSA.mad_mono_ordp(n::Cint, a::Ptr{Cuchar})::Cdouble + return p +end + + +""" + mad_mono_ordpf(n::Cint, a::Ptr{Cuchar}, stp::Cint)::Cdouble + +Returns the product of factorials of orders of the monomial a. + +### Input +- `n` -- Monomial length +- `a` -- Monomial +- `stp` -- ???? + +### Output +- `p` -- Product of factorials of orders of monomial +""" +function mad_mono_ordpf(n::Cint, a::Ptr{Cuchar}, stp::Cint)::Cdouble + p = @ccall MAD_TPSA.mad_mono_ordpf(n::Cint, a::Ptr{Cuchar})::Cdouble + return p +end + + +""" + mad_mono_eq(n::Cint, a::Ptr{Cuchar}, b::Ptr{Cuchar})::Cuchar + +Checks if the monomial a is equal to the monomial b. + +### Input +- `n` -- Length of monomials +- `a` -- Monomial a +- `b` -- Monomial b + +### Output +- `ret` -- True if the monomials are equal, false if otherwise +""" +function mad_mono_eq(n::Cint, a::Ptr{Cuchar}, b::Ptr{Cuchar})::Cuchar + ret = @ccall MAD_TPSA.mad_mono_eq(n::Cint, a::Ptr{Cuchar}, b::Ptr{Cuchar})::Cuchar + return ret +end + + +""" + mad_mono_lt(n::Cint, a::Ptr{Cuchar}, b::Ptr{Cuchar})::Cuchar + +Checks if monomial a is less than monomial b. + +### Input +- `n` -- Length of monomials +- `a` -- Monomial a +- `b` -- Monomial b + +### Output +- `ret` -- True if a < b, false otherwise +""" +function mad_mono_lt(n::Cint, a::Ptr{Cuchar}, b::Ptr{Cuchar})::Cuchar + ret = @ccall MAD_TPSA.mad_mono_lt(n::Cint, a::Ptr{Cuchar}, b::Ptr{Cuchar})::Cuchar + return ret +end + + +""" + mad_mono_le(n::Cint, a::Ptr{Cuchar}, b::Ptr{Cuchar})::Cuchar + +Checks if monomial a is less than or equal to monomial b. + +### Input +- `n` -- Length of monomials +- `a` -- Monomial a +- `b` -- Monomial b + +### Output +- `ret` -- True if a <= mono_b, false otherwise +""" +function mad_mono_le(n::Cint, a::Ptr{Cuchar}, b::Ptr{Cuchar})::Cuchar + ret = @ccall MAD_TPSA.mad_mono_le(n::Cint, a::Ptr{Cuchar}, b::Ptr{Cuchar})::Cuchar + return ret +end + + +""" + mad_mono_cmp(n::Cint, a::Ptr{Cuchar}, b::Ptr{Cuchar})::Cint + +??? + +### Input +- `n` -- Length of monomials +- `a` -- Monomial a +- `b` -- Monomial b + +### Output +- `ret` -- First a[i]-b[i] != 0 +""" +function mad_mono_cmp(n::Cint, a::Ptr{Cuchar}, b::Ptr{Cuchar})::Cint + ret = @ccall MAD_TPSA.mad_mono_cmp(n::Cint, a::Ptr{Cuchar}, b::Ptr{Cuchar})::Cint + return ret +end + + +""" + mad_mono_rcmp(n::Cint, a::Ptr{Cuchar}, b::Ptr{Cuchar})::Cint + +Compare from end. ??? + +### Input +- `n` -- Length of monomials +- `a` -- Monomial a +- `b` -- Monomial b + +### Output +- `ret` -- First a[i]-b[i] != 0 +""" +function mad_mono_rcmp(n::Cint, a::Ptr{Cuchar}, b::Ptr{Cuchar})::Cint + ret = @ccall MAD_TPSA.mad_mono_rcmp(n::Cint, a::Ptr{Cuchar}, b::Ptr{Cuchar})::Cint + return ret +end + + +""" + mad_mono_add!(n::Cint, a::Ptr{Cuchar}, b::Ptr{Cuchar}, r::Ptr{Cuchar}) + +Sets monomial r = a + b. + +### Input +- `n` -- Length of monomials +- `a` -- Source monomial a +- `b` -- Source monomial b +- `r` -- Destination monomial, r = a + b +""" +function mad_mono_add!(n::Cint, a::Ptr{Cuchar}, b::Ptr{Cuchar}, r::Ptr{Cuchar}) + @ccall MAD_TPSA.mad_mono_add(n::Cint, a::Ptr{Cuchar},b::Ptr{Cuchar}, r::Ptr{Cuchar})::Cvoid +end + + +""" + mad_mono_sub!(n::Cint, a::Ptr{Cuchar}, b::Ptr{Cuchar}, r::Ptr{Cuchar}) + +Sets monomial r = a - b. + +### Input +- `n` -- Length of monomials +- `a` -- Source monomial a +- `b` -- Source monomial b +- `r` -- Destination monomial, r = a - b +""" +function mad_mono_sub!(n::Cint, a::Ptr{Cuchar}, b::Ptr{Cuchar}, r::Ptr{Cuchar}) + @ccall MAD_TPSA.mad_mono_sub(n::Cint, a::Ptr{Cuchar}, b::Ptr{Cuchar}, r::Ptr{Cuchar})::Cvoid +end + + +""" + mad_mono_cat!(n::Cint, a::Ptr{Cuchar}, m::Cint, b::Ptr{Cuchar}, r::Ptr{Cuchar}) + +Sets monomial r equal to the concatenation of the monomials a and b + +### Input +- `n` -- Length of monomonial a +- `a` -- Source monomial a +- `m` -- Length of monomial b +- `b` -- Source monomial b +- `r` -- Destination monomial of concatenation of a and b (length n+m) +""" +function mad_mono_cat!(n::Cint, a::Ptr{Cuchar}, m::Cint, b::Ptr{Cuchar}, r::Ptr{Cuchar}) + @ccall MAD_TPSA.mad_mono_cat(n::Cint, a::Ptr{Cuchar}, m::Cint, b::Ptr{Cuchar}, r::Ptr{Cuchar})::Cvoid +end + +""" + mad_mono_rev!(n::Cint, a::Ptr{Cuchar}, r::Ptr{Cuchar}) + +Sets destination monomial r equal to the reverse of source monomial a. + +### Input +- `n` -- Lengths of Monomials +- `a` -- Source monomial a +- `r` -- Destination monomial of reverse monomial a +""" +function mad_mono_rev!(n::Cint, a::Ptr{Cuchar}, r::Ptr{Cuchar}) + @ccall MAD_TPSA.mad_mono_rev(n::Cint, a::Ptr{Cuchar}, r::Ptr{Cuchar})::Cvoid +end + + +""" + mad_mono_print(n::Cint, a::Ptr{Cuchar}, fp::Ptr{Cvoid}) + +Prints the monomial to stdout. + +### Input +- `n` -- Length of monomial +- `a` -- Source monomial to print to stdout +- `fp` -- C FILE pointer, if null will print to stdout +""" +function mad_mono_print(n::Cint, a::Ptr{Cuchar}, fp::Ptr{Cvoid}) + @ccall MAD_TPSA.mad_mono_print(n::Cint, a::Ptr{Cuchar}, fp::Ptr{Cvoid})::Cvoid +end + +end \ No newline at end of file diff --git a/src/RealTPSA.jl b/src/RealTPSA.jl index 6a58336c..b44661e5 100644 --- a/src/RealTPSA.jl +++ b/src/RealTPSA.jl @@ -12,4 +12,1872 @@ mutable struct RTPSA{T} nam::NTuple{NAMSZ,Cuchar} # tpsa name max string length 16 NAMSZ coef::Ptr{Cdouble} # warning: must be identical to ctpsa up to coef excluded end + + +""" + mad_tpsa_newd(d::Ptr{Desc{RTPSA,CTPSA}}, mo::Cuchar)::Ptr{RTPSA{Desc}} + +Creates a real TPSA defined by the specified descriptor and maximum order. If MAD_TPSA_DEFAULT +is passed for mo, the mo defined in the descriptor is used. If mo > d_mo, mo = d_mo. + +### Input +- `d` -- Descriptor +- `mo` -- Maximum order + +### Output +- `t` -- New real TPSA defined by the descriptor +""" +function mad_tpsa_newd(d::Ptr{Desc{RTPSA,CTPSA}}, mo::Cuchar)::Ptr{RTPSA{Desc}} + t = @ccall MAD_TPSA.mad_tpsa_newd(d::Ptr{Desc{RTPSA,CTPSA}}, mo::Cuchar)::Ptr{RTPSA{Desc}} + return t +end + + +""" + mad_tpsa_new(t::Ptr{RTPSA{Desc}}, mo::Cuchar)::Ptr{RTPSA{Desc}} + +Creates a real TPSA copy of the inputted TPSA, with maximum order specified by mo. +If MAD_TPSA_SAME is passed for mo, the mo currently in t is used for the created TPSA. + ok with t=(tpsa_t*)ctpsa + +### Input +- `t` -- Real TPSA to copy +- `mo` -- Maximum order of new TPSA + +### Output +- `ret` -- New real TPSA with maximum order mo +""" +function mad_tpsa_new(t::Ptr{RTPSA{Desc}}, mo::Cuchar)::Ptr{RTPSA{Desc}} + ret = @ccall MAD_TPSA.mad_tpsa_new(t::Ptr{RTPSA{Desc}}, mo::Cuchar)::Ptr{RTPSA{Desc}} + return ret +end + + +""" + mad_tpsa_del!(t::Ptr{RTPSA{Desc}}) + +Calls the destructor for the real TPSA. + +### Input +- `t` -- Real TPSA to destruct +""" +function mad_tpsa_del!(t::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_del(t::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_desc(t::Ptr{RTPSA{Desc}})::Ptr{Desc{RTPSA,CTPSA}} + +Gets the descriptor for the real TPSA. + +### Input +- `t` -- Real TPSA + +### Output +- `ret` -- Descriptor for the RTPSA +""" +function mad_tpsa_desc(t::Ptr{RTPSA{Desc}})::Ptr{Desc{RTPSA,CTPSA}} + ret = @ccall MAD_TPSA.mad_tpsa_desc(t::Ptr{RTPSA{Desc}})::Ptr{Desc{RTPSA,CTPSA}} + return ret +end + + +""" + mad_tpsa_uid!(t::Ptr{RTPSA{Desc}}, uid_::Cint)::Cint + +Sets the TPSA uid if uid_ != 0, and returns the current (previous if set) TPSA uid. + +### Input +- `t` -- Real TPSA +- `uid_` -- uid to set in the TPSA if uid_ != 0 + +### Output +- `ret` -- Current (previous if set) TPSA uid +""" +function mad_tpsa_uid!(t::Ptr{RTPSA{Desc}}, uid_::Cint)::Cint + ret = @ccall MAD_TPSA.mad_tpsa_uid(t::Ptr{RTPSA{Desc}}, uid_::Cint)::Cint + return ret +end + + +""" + mad_tpsa_len(t::Ptr{RTPSA{Desc}})::Cint + +??? + +### Input +- `t` -- Real TPSA + +### Output +- `ret` -- Monomials in RTPSA +""" +function mad_tpsa_len(t::Ptr{RTPSA{Desc}})::Cint + ret = @ccall MAD_TPSA.mad_tpsa_len(t::Ptr{RTPSA,CTPSA})::Cint + return ret +end + + +""" + mad_tpsa_nam(t::Ptr{RTPSA{Desc}})::Cstring + +Get the name of the TPSA. + +### Input +- `t` -- Real TPSA + +### Output +- `ret` -- Name of RTPSA (nul term in C) +""" +function mad_tpsa_nam(t::Ptr{RTPSA{Desc}})::Cstring + ret = @ccall MAD_TPSA.mad_tpsa_nam(t::Ptr{RTPSA{Desc}})::Cstring + return ret +end + + +""" + mad_tpsa_ord(t::Ptr{RTPSA{Desc}})::Cuchar + +Gets the TPSA order. + +### Input +- `t` -- Real TPSA + +### Output +- `ret` -- Order of TPSA +""" +function mad_tpsa_ord(t::Ptr{RTPSA{Desc}})::Cuchar + ret = @ccall MAD_TPSA.mad_tpsa_ord(t::Ptr{RTPSA{Desc}})::Cuchar + return ret +end + +""" + mad_tpsa_ordv(t::Ptr{RTPSA{Desc}}, ts::Ptr{RTPSA{Desc}}...)::Cuchar + +??? + +### Input +- `t` -- TPSA +- `ts` + +### Output +- `mo` -- Order +""" +function mad_tpsa_ordv(t::Ptr{RTPSA{Desc}}, ts::Ptr{RTPSA{Desc}}...)::Cuchar + mo = @ccall MAD_TPSA.mad_tpsa_ordv(t::Ptr{RTPSA{Desc}}, ts::Ptr{RTPSA{Desc}}..., 0::Cint)::Cuchar # null pointer after args for safe use + return mo +end + + +""" + mad_tpsa_ordn(n::Cint, t::Ptr{Ptr{RTPSA{Desc}}})::Cuchar + +Gets the max order of all TPSAs in t. + +### Input +- `n` -- Number of TPSAs +- `t` -- Array of TPSAs + +### Output +- `mo` -- Maximum order of all TPSAs +""" +function mad_tpsa_ordn(n::Cint, t::Ptr{Ptr{RTPSA{Desc}}})::Cuchar + mo = @ccall MAD_TPSA.mad_tpsa_ordn(n::Cint, t::Ptr{Ptr{RTPSA{Desc}}})::Cuchar + return mo +end + + +""" + mad_tpsa_copy!(t::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}) + +Makes a copy of the real TPSA t to r. + +### Input +- `t` -- Source real TPSA +- `r` -- Destination real TPSA +""" +function mad_tpsa_copy!(t::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_copy(t::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_sclord!(t::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}, inv::Cuchar) + +??? + +### Input +- `t` -- Source real TPSA +- `r` -- Destination real TPSA +- `inv`-- scl by inverse +""" +function mad_tpsa_sclord!(t::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}, inv::Cuchar) + @ccall MAD_TPSA.mad_tpsa_sclord(t::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}, inv::Cuchar)::Cvoid +end + + +""" + mad_tpsa_getord!(t::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}, ord::Cuchar) + +??? +is ! ? + +### Input +- `t`` -- Source real TPSA +- `r` -- Destination real TPSA +- `ord` -- Order to retrieve +""" +function mad_tpsa_getord!(t::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}, ord::Cuchar) + @ccall MAD_TPSA.mad_tpsa_getord(t::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}, ord::Cuchar)::Cvoid +end + + +""" + mad_tpsa_cutord!(t::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}, ord::Cint) + +??? + +### Input +- `t` -- Source real TPSA +- `r` -- Destination real TPSA +- `ord` -- Cut order: 0..-ord or ord..mo +""" +function mad_tpsa_cutord!(t::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}, ord::Cint) + @ccall MAD_TPSA.mad_tpsa_cutord(t::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}, ord::Cint)::Cvoid +end + +""" + mad_tpsa_maxord(t::Ptr{RTPSA{Desc}}, n::Cint, idx_::Ptr{Cint})::Cint + +??? + +### Input +- `t` -- Real TPSA +- `n` -- Length of idx_ +- `idx_` + +### Output +- `mi` -- ? +""" +function mad_tpsa_maxord(t::Ptr{RTPSA{Desc}}, n::Cint, idx_::Ptr{Cint})::Cint + mi = @ccall MAD_TPSA.mad_tpsa_maxord(t::Ptr{RTPSA{Desc}}, n::Cint, idx_::Ptr{Cint})::Cint + return mi +end + +""" + mad_tpsa_convert!(t::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}, n::Cint, t2r_::Ptr{Cint}, pb::Cint) + +??? + +### Input +- `t` -- Source real TPSA +- `r` -- Destination real TPSA +- `n` -- Length of vector +- `t2r_` -- Vector of index lookup +- `pb` -- Poisson bracket, 0,1:fwd,-1:bwd +""" +function mad_tpsa_convert!(t::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}, n::Cint, t2r_::Ptr{Cint}, pb::Cint) + @ccall MAD_TPSA.mad_tpsa_convert(t::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}, n::Cint, t2r_::Ptr{Cint}, pb::Cint)::Cvoid +end + + +""" + mad_tpsa_setvar!(t::Ptr{RTPSA{Desc}}, v::Cdouble, iv_::Cint, scl_::Cdouble) + +??? + +### Input +- `t` -- Real TPSA +- `v` -- 0th order value +- `iv_` -- Variable index +- `scl_` -- 1st order variable value +""" +function mad_tpsa_setvar!(t::Ptr{RTPSA{Desc}}, v::Cdouble, iv_::Cint, scl_::Cdouble) + @ccall MAD_TPSA.mad_tpsa_setvar(t::Ptr{RTPSA{Desc}}, v::Cdouble, iv_::Cint, scl_::Cdouble)::Cvoid +end + + +""" + mad_tpsa_setnam!(t::Ptr{RTPSA{Desc}}, nam::Cstring) + +Sets the name of the RTPSA. + +### Input +- `t` -- Real TPSA +- `nam` -- Name to set for RTPSA +""" +function mad_tpsa_setnam!(t::Ptr{RTPSA{Desc}}, nam::Cstring) + @ccall MAD_TPSA.mad_tpsa_setnam(t::Ptr{RTPSA{Desc}}, nam::Cstring)::Cvoid +end + + +""" + mad_tpsa_clear!(t::Ptr{RTPSA{Desc}}) + +Clears the TPSA (reset to 0) + +### Input +- `t` -- Real TPSA +""" +function mad_tpsa_clear!(t::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_clear(t::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_isnul(t::Ptr{RTPSA{Desc}})::Cuchar + +??? checks if null c2i? + +### Input +- `t` -- Real TPSA to check + +### Output +- `ret` -- True or false +""" +function mad_tpsa_isnul(t::Ptr{RTPSA{Desc}})::Cuchar + ret = @ccall MAD_TPSA.mad_tpsa_isnul(t::Ptr{RTPSA{Desc}})::Cuchar + return ret +end + + +""" + mad_tpsa_mono(t::Ptr{RTPSA{Desc}}, i::Cint, n::Cint, m_::Ptr{Cuchar})::Cuchar + +### Input +- `t` +- `i` +- `n` +- `m_` + +### Output +- `ret` +""" +function mad_tpsa_mono(t::Ptr{RTPSA{Desc}}, i::Cint, n::Cint, m_::Ptr{Cuchar})::Cuchar + ret = @ccall MAD_TPSA.mad_tpsa_mono(t::Ptr{RTPSA{Desc}}, i::Cint, n::Cint, m_::Ptr{Cuchar})::Cuchar + return ret +end + + +""" + mad_tpsa_idxs(t::Ptr{RTPSA{Desc}}, n::Cint, s::Cstring)::Cint + +### Input +- `t` +- `n` +- `s` + +### Output +- `ret` +""" +function mad_tpsa_idxs(t::Ptr{RTPSA{Desc}}, n::Cint, s::Cstring)::Cint + ret = @ccall MAD_TPSA.mad_tpsa_idxs(t::Ptr{RTPSA{Desc}}, n::Cint, s::Cstring)::Cint + return ret +end + + + +""" + mad_tpsa_idxm(t::Ptr{RTPSA{Desc}}, n::Cint, m::Ptr{Cuchar})::Cint + + +??? + +### Input +- `t` +- `n` +- `m` + +### Output +- `ret` +""" +function mad_tpsa_idxm(t::Ptr{RTPSA{Desc}}, n::Cint, m::Ptr{Cuchar})::Cint + ret = @ccall MAD_TPSA.mad_tpsa_idxm(t::Ptr{RTPSA{Desc}}, n::Cint, m::Ptr{Cuchar})::Cint + return ret +end + + +""" + mad_tpsa_idxsm(t::Ptr{RTPSA{Desc}}, n::Cint, m::Ptr{Cint})::Cint + +??? + +### Input +- `t` +- `n` +- `m` + +### Output +- `ret` +""" +function mad_tpsa_idxsm(t::Ptr{RTPSA{Desc}}, n::Cint, m::Ptr{Cint})::Cint + ret = @ccall MAD_TPSA.mad_tpsa_idxsm(t::Ptr{RTPSA{Desc}}, n::Cint, m::Ptr{Cint})::Cint + return ret +end + + +""" + mad_tpsa_cycle(t::Ptr{RTPSA{Desc}}, i::Cint, n::Cint, m_::Ptr{Cuchar}, v_::Ptr{Cdouble})::Cint + +??? + +### Input +- `t` +- `i` +- `n` +- `m_` +- `v_` + +### Output +- `i` +""" +function mad_tpsa_cycle(t::Ptr{RTPSA{Desc}}, i::Cint, n::Cint, m_::Ptr{Cuchar}, v_::Ptr{Cdouble})::Cint + i = @ccall MAD_TPSA.mad_tpsa_cycle(t::Ptr{RTPSA{Desc}}, i::Cint, n::Cint, m_::Ptr{Cuchar}, v_::Ptr{Cdouble})::Cint + return i +end + + +""" + mad_tpsa_get0(t::Ptr{RTPSA{Desc}})::Cdouble + +??? + +### Input +- `t` + +### Output +- `ret` +""" +function mad_tpsa_get0(t::Ptr{RTPSA{Desc}})::Cdouble + ret = @ccall MAD_TPSA.mad_tpsa_get0(t::Ptr{RTPSA{Desc}})::Cdouble + return ret +end + + +""" + mad_tpsa_geti(t::Ptr{RTPSA{Desc}}, i::Cint)::Cdouble + +??? + +### Input +- `t` +- `i` + +### Output +- `ret` +""" +function mad_tpsa_geti(t::Ptr{RTPSA{Desc}}, i::Cint)::Cdouble + ret = @ccall MAD_TPSA.mad_tpsa_geti(t::Ptr{RTPSA{Desc}}, i::Cint)::Cdouble + return ret +end + + +""" + mad_tpsa_gets(t::Ptr{RTPSA{Desc}}, n::Cint, s::Cstring)::Cdouble + +??? + +### Input +- `t` +- `n` +- `s` + +### Output +- `ret` +""" +function mad_tpsa_gets(t::Ptr{RTPSA{Desc}}, n::Cint, s::Cstring)::Cdouble + ret = @ccall MAD_TPSA.mad_tpsa_gets(t::Ptr{RTPSA{Desc}}, n::Cint, s::Cstring)::Cdouble + return ret +end + + +""" + mad_tpsa_getm(t::Ptr{RTPSA{Desc}}, n::Cint, m::Ptr{Cuchar})::Cdouble + +??? + +### Input +- `t` +- `n` +- `m` + +### Output +- `ret` +""" +function mad_tpsa_getm(t::Ptr{RTPSA{Desc}}, n::Cint, m::Ptr{Cuchar})::Cdouble + val = @ccall MAD_TPSA.mad_tpsa_getm(t::Ptr{RTPSA{Desc}}, n::Cint, m::Ptr{Cuchar})::Cdouble + return ret +end + + +""" + mad_tpsa_getsm(t::Ptr{RTPSA{Desc}}, n::Cint, m::Ptr{Cint})::Cdouble + +??? + +### Input +- `t` +- `n` +- `m` + +### Output +- `ret` +""" +function mad_tpsa_getsm(t::Ptr{RTPSA{Desc}}, n::Cint, m::Ptr{Cint})::Cdouble + ret = @ccall MAD_TPSA.mad_tpsa_getsm(t::Ptr{RTPSA{Desc}}, n::Cint, m::Ptr{Cint})::Cdouble + return ret +end + + +""" + mad_tpsa_set0!(t::Ptr{RTPSA{Desc}}, a::Cdouble, b::Cdouble) + +??? + +### Input +- `t` +- `a` +- `b` +""" +function mad_tpsa_set0!(t::Ptr{RTPSA{Desc}}, a::Cdouble, b::Cdouble) + @ccall MAD_TPSA.mad_tpsa_set0(t::Ptr{RTPSA{Desc}}, a::Cdouble, b::Cdouble)::Cvoid +end + + +""" + mad_tpsa_seti!(t::Ptr{RTPSA{Desc}}, i::Cint, a::Cdouble, b::Cdouble) + +??? + +### Input +- `t` +- `i` +- `a` +- `b` +""" +function mad_tpsa_seti!(t::Ptr{RTPSA{Desc}}, i::Cint, a::Cdouble, b::Cdouble) + @ccall MAD_TPSA.mad_tpsa_seti(t::Ptr{RTPSA{Desc}}, i::Cint, a::Cdouble, b::Cdouble)::Cvoid +end + + +""" + mad_tpsa_sets!(t::Ptr{RTPSA{Desc}}, n::Cint, s::Cstring, a::Cdouble, b::Cdouble) + +??? + +### Input +- `t` +- `n` +- `s` +- `a` +- `b` +""" +function mad_tpsa_sets!(t::Ptr{RTPSA{Desc}}, n::Cint, s::Cstring, a::Cdouble, b::Cdouble) + @ccall MAD_TPSA.mad_tpsa_sets(t::Ptr{RTPSA{Desc}}, n::Cint, s::Cstring, a::Cdouble, b::Cdouble)::Cvoid +end + + +""" + mad_tpsa_setm!(t::Ptr{RTPSA{Desc}}, n::Cint, m::Ptr{Cuchar}, a::Cdouble, b::Cdouble) + +??? + +### Input +- `t` +- `n` +- `m` +- `a` +- `b` +""" +function mad_tpsa_setm!(t::Ptr{RTPSA{Desc}}, n::Cint, m::Ptr{Cuchar}, a::Cdouble, b::Cdouble) + @ccall MAD_TPSA.mad_tpsa_setm(t::Ptr{RTPSA{Desc}}, n::Cint, m::Ptr{Cuchar}, a::Cdouble, b::Cdouble)::Cvoid +end + + +""" + mad_tpsa_setsm!(t::Ptr{RTPSA{Desc}}, n::Cint, m::Ptr{Cint}, a::Cdouble, b::Cdouble) + +??? + +### Input +- `t` +- `n` +- `m` +- `a` +- `b` +""" +function mad_tpsa_setsm!(t::Ptr{RTPSA{Desc}}, n::Cint, m::Ptr{Cint}, a::Cdouble, b::Cdouble) + @ccall MAD_TPSA.mad_tpsa_setsm(t::Ptr{RTPSA{Desc}}, n::Cint, m::Ptr{Cint}, a::Cdouble, b::Cdouble)::Cvoid +end + + +""" + mad_tpsa_getv!(t::Ptr{RTPSA{Desc}}, i::Cint, n::Cint, v::Ptr{Cdouble}) + +??? + +### Input +- `t` +- `i` +- `n` +- `v` +""" +function mad_tpsa_getv!(t::Ptr{RTPSA{Desc}}, i::Cint, n::Cint, v::Ptr{Cdouble}) + @ccall MAD_TPSA.mad_tpsa_getv(t::Ptr{RTPSA{Desc}}, i::Cint, n::Cint, v::Ptr{Cdouble})::Cvoid +end + + + +""" + mad_tpsa_setv!(t::Ptr{RTPSA{Desc}}, i::Cint, n::Cint, v::Ptr{Cdouble}) + +??? + +### Input +- `t` +- `i` +- `n` +- `v` +""" +function mad_tpsa_setv!(t::Ptr{RTPSA{Desc}}, i::Cint, n::Cint, v::Ptr{Cdouble}) + @ccall MAD_TPSA.mad_tpsa_setv(t::Ptr{RTPSA{Desc}}, i::Cint, n::Cint, v::Ptr{Cdouble})::Cvoid +end + + +""" + mad_tpsa_equ(a::Ptr{RTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, tol_::Cdouble)::Cuchar + +Checks if the TPSAs a and b are equal within the specified tolerance tol_ + +### Input +- `a` -- TPSA a +- `b` -- TPSA b +- `tol_` -- difference below which the TPSAs are considered equal + +### Output +- `ret` - True if a == b within tol_ +""" +function mad_tpsa_equ(a::Ptr{RTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, tol_::Cdouble)::Cuchar + ret = @ccall MAD_TPSA.mad_tpsa_equ(a::Ptr{RTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, tol_::Cdouble)::Cuchar + return ret +end + + +""" + mad_tpsa_dif!(a::Ptr{RTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + +??? // (a_i-b_i)/max(|a_i|,1) + +### Input +- `a` -- Source TPSA a +- `b` -- Source TPSA b +- `c` -- Destination TPSA c +""" +function mad_tpsa_dif!(a::Ptr{RTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_dif(a::Ptr{RTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_add!(a::Ptr{RTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + +Sets the destination TPSA c = a + b + +### Input +- `a` -- Source TPSA a +- `b` -- Source TPSA b +- `c` -- Destination TPSA c = a + b +""" +function mad_tpsa_add!(a::Ptr{RTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_add(a::Ptr{RTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_sub!(a::Ptr{RTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + +Sets the destination TPSA c = a - b + +### Input +- `a` -- Source TPSA a +- `b` -- Source TPSA b +- `c` -- Destination TPSA c = a - b +""" +function mad_tpsa_sub!(a::Ptr{RTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_sub(a::Ptr{RTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_mul!(a::Ptr{RTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + +Sets the destination TPSA c = a * b + +### Input +- `a` -- Source TPSA a +- `b` -- Source TPSA b +- `c` -- Destination TPSA c = a * b +""" +function mad_tpsa_mul!(a::Ptr{RTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_mul(a::Ptr{RTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_div!(a::Ptr{RTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + +Sets the destination TPSA c = a / b + +### Input +- `a` -- Source TPSA a +- `b` -- Source TPSA b +- `c` -- Destination TPSA c = a / b +""" +function mad_tpsa_div!(a::Ptr{RTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_div(a::Ptr{RTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_pow!(a::Ptr{RTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + +Sets the destination TPSA c = a ^ b + +### Input +- `a` -- Source TPSA a +- `b` -- Source TPSA b +- `c` -- Destination TPSA c = a ^ b +""" +function mad_tpsa_pow!(a::Ptr{RTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_pow(a::Ptr{RTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_powi!(a::Ptr{RTPSA{Desc}}, n::Cint, c::Ptr{RTPSA{Desc}}) + +Sets the destination TPSA c = a ^ n where n is an integer. + +### Input +- `a` -- Source TPSA a +- `n` -- Integer power +- `c` -- Destination TPSA c = a ^ n +""" +function mad_tpsa_powi!(a::Ptr{RTPSA{Desc}}, n::Cint, c::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_powi(a::Ptr{RTPSA{Desc}}, n::Cint, c::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_pown!(a::Ptr{RTPSA{Desc}}, v::Cdouble, c::Ptr{RTPSA{Desc}}) + +Sets the destination TPSA c = a ^ v where v is of double precision. + +### Input +- `a` -- Source TPSA a +- `v` -- "double" precision power +- `c` -- Destination TPSA c = a ^ v +""" +function mad_tpsa_pown!(a::Ptr{RTPSA{Desc}}, v::Cdouble, c::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_pown(a::Ptr{RTPSA{Desc}}, v::Cdouble, c::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_nrm(a::Ptr{RTPSA{Desc}})::Cdouble + +Calculates the norm of (which???) of TPSA a. + +### Input +- `a` -- TPSA + +### Output +- `nrm` -- Norm of TPSA a +""" +function mad_tpsa_nrm(a::Ptr{RTPSA{Desc}})::Cdouble + nrm = @ccall MAD_TPSA.mad_tpsa_nrm(a::Ptr{RTPSA{Desc}}, tpsa_b_::Ptr{RTPSA{Desc}})::Cdouble + return nrm +end + + +""" + mad_tpsa_abs!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + +Sets TPSA c to the absolute value of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = |a| +""" +function mad_tpsa_abs!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_abs(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_sqrt!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + +Sets TPSA c to the sqrt of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = sqrt(a) +""" +function mad_tpsa_sqrt!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_sqrt(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_exp!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + +Sets TPSA c to the exponential of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = exp(a) +""" +function mad_tpsa_exp!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_exp(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid +end + + + +""" + mad_tpsa_log!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + +Sets TPSA c to the log of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = log(a) +""" +function mad_tpsa_log!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_log(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_sincos!(a::Ptr{RTPSA{Desc}}, s::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + +Sets TPSA s = sin(a) and TPSA c = cos(a) + +### Input +- `a` -- Source TPSA a +- `s` -- Destination TPSA s = sin(a) +- `c` -- Destination TPSA c = cos(a) +""" +function mad_tpsa_sincos!(a::Ptr{RTPSA{Desc}}, s::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_sincos(a::Ptr{RTPSA{Desc}}, s::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_sin!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + +Sets TPSA c to the sin of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = sin(a) +""" +function mad_tpsa_sin!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_sin(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_cos!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + +Sets TPSA c to the cos of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = cos(a) +""" +function mad_tpsa_cos!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_cos(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_tan!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + +Sets TPSA c to the tan of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = tan(a) +""" +function mad_tpsa_tan!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_tan(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_cot!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + +Sets TPSA c to the cot of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = cot(a) +""" +function mad_tpsa_cot!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_cot(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_sinc!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + +Sets TPSA c to the sinc of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = sinc(a) +""" +function mad_tpsa_sinc!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_sinc(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_sincosh!(a::Ptr{RTPSA{Desc}}, s::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + +Sets TPSA s = sinh(a) and TPSA c = cosh(a) + +### Input +- `a` -- Source TPSA a +- `s` -- Destination TPSA s = sinh(a) +- `c` -- Destination TPSA c = cosh(a) +""" +function mad_tpsa_sincosh!(a::Ptr{RTPSA{Desc}}, s::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_sincosh(a::Ptr{RTPSA{Desc}}, s::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_sinh!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + + Sets TPSA c to the sinh of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = sinh(a) +""" +function mad_tpsa_sinh!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_sinh(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_cosh!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + +Sets TPSA c to the cosh of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = cosh(a) +""" +function mad_tpsa_cosh!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_cosh(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_tanh!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + +Sets TPSA c to the tanh of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = tanh(a) +""" +function mad_tpsa_tanh!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_tanh(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_coth!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + +Sets TPSA c to the coth of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = coth(a) +""" +function mad_tpsa_coth!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_coth(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_sinhc!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + +Sets TPSA c to the sinhc of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = sinhc(a) +""" +function mad_tpsa_sinhc!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_sinhc(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_asin!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + +Sets TPSA c to the asin of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = asin(a) +""" +function mad_tpsa_asin!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_asin(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_acos!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + +Sets TPSA c to the acos of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = acos(a) +""" +function mad_tpsa_acos!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_acos(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_atan!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + +Sets TPSA c to the atan of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = atan(a) +""" +function mad_tpsa_atan!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_atan(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_acot!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + +Sets TPSA c to the acot of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = acot(a) +""" +function mad_tpsa_acot!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_acot(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid +end + +""" + mad_tpsa_asinc!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + +Sets TPSA c to the asinc of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = asinc(a) +""" +function mad_tpsa_asinc!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_asinc(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_asinh!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + +Sets TPSA c to the asinh of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = asinh(a) +""" +function mad_tpsa_asinh!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_asinh(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_acosh!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + +Sets TPSA c to the acosh of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = acosh(a) +""" +function mad_tpsa_acosh!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_acosh(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_atanh!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + +Sets TPSA c to the atanh of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = atanh(a) +""" +function mad_tpsa_atanh!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_atanh(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_acoth!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + +Sets TPSA c to the acoth of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = acoth(a) +""" +function mad_tpsa_acoth!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_acoth(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_asinhc!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + +Sets TPSA c to the asinhc of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = asinhc(a) +""" +function mad_tpsa_asinhc!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_asinhc(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_erf!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + +Sets TPSA c to the erf of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = erf(a) +""" +function mad_tpsa_erf!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_erf(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_erfc!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + +Sets TPSA c to the erfc of TPSA a. + +### Input +- `a` -- Source TPSA a +- `c` -- Destination TPSA c = erfc(a) +""" +function mad_tpsa_erfc!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_erfc(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_acc!(a::Ptr{RTPSA{Desc}}, v::Cdouble, c::Ptr{RTPSA{Desc}}) + +Adds a*v to TPSA c. Aliasing OK. + +### Input +- `a` -- Source TPSA a +- `v` -- Scalar with double precision +- `c` -- Destination TPSA c += v*a +""" +function mad_tpsa_acc!(a::Ptr{RTPSA{Desc}}, v::Cdouble, c::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_acc(a::Ptr{RTPSA{Desc}}, v::Cdouble, c::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_scl!(a::Ptr{RTPSA{Desc}}, v::Cdouble, c::Ptr{RTPSA{Desc}}) + +Sets TPSA c to v*a. + +### Input +- `a` -- Source TPSA a +- `v` -- Scalar with double precision +- `c` -- Destination TPSA c = v*a +""" +function mad_tpsa_scl!(a::Ptr{RTPSA{Desc}}, v::Cdouble, c::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_scl(a::Ptr{RTPSA{Desc}}, v::Cdouble, c::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_inv!(a::Ptr{RTPSA{Desc}}, v::Cdouble, c::Ptr{RTPSA{Desc}}) + +Sets TPSA c to v/a. + +### Input +- `a` -- Source TPSA a +- `v` -- Scalar with double precision +- `c` -- Destination TPSA c = v*a +""" +function mad_tpsa_inv!(a::Ptr{RTPSA{Desc}}, v::Cdouble, c::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_inv(a::Ptr{RTPSA{Desc}}, v::Cdouble, c::Ptr{RTPSA{Desc}})::Cvoid +end + +""" + mad_tpsa_invsqrt!(a::Ptr{RTPSA{Desc}}, v::Cdouble, c::Ptr{RTPSA{Desc}}) + +Sets TPSA c to v/sqrt(a). + +### Input +- `a` -- Source TPSA a +- `v` -- Scalar with double precision +- `c` -- Destination TPSA c = v*a +""" +function mad_tpsa_invsqrt!(a::Ptr{RTPSA{Desc}}, v::Cdouble, c::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_invsqrt(a::Ptr{RTPSA{Desc}}, v::Cdouble, c::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_unit!(x::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}) + +??? + +### Input +- `x` -- Source TPSA x +- `r` -- Destination TPSA r +""" +function mad_tpsa_unit!(x::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_unit(x::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_atan2!(x::Ptr{RTPSA{Desc}}, y::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}) + +Sets TPSA r to atan2(x,y) + +### Input +- `x` -- Source TPSA x +- `y` -- Source TPSA y +- `r` -- Destination TPSA r = atan2(x,y) +""" +function mad_tpsa_atan2!(x::Ptr{RTPSA{Desc}}, y::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_atan2(x::Ptr{RTPSA{Desc}}, y::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}})::Cvoid +end + +""" + mad_tpsa_hypot!(x::Ptr{RTPSA{Desc}}, y::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}) + +Sets TPSA r to sqrt(x^2+y^2) + +### Input +- `x` -- Source TPSA x +- `y` -- Source TPSA y +- `r` -- Destination TPSA r = sqrt(x^2+y^2) +""" +function mad_tpsa_hypot!(x::Ptr{RTPSA{Desc}}, y::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_hypot(x::Ptr{RTPSA{Desc}}, y::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}})::Cvoid +end + +""" + mad_tpsa_hypot3!(x::Ptr{RTPSA{Desc}}, y::Ptr{RTPSA{Desc}}, z::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}) + +Sets TPSA r to sqrt(x^2+y^2+z^2) + +### Input +- `x` -- Source TPSA x +- `y` -- Source TPSA y +- `z` -- Source TPSA z +- `r` -- Destination TPSA r = sqrt(x^2+y^2+z^2) +""" +function mad_tpsa_hypot3!(x::Ptr{RTPSA{Desc}}, y::Ptr{RTPSA{Desc}}, z::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_hypot3(x::Ptr{RTPSA{Desc}}, y::Ptr{RTPSA{Desc}}, z::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}})::Cvoid +end + + + +""" + mad_tpsa_integ!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}, iv::Cint) + +??? Integrates TPSA + +### Input +- `a` -- Source TPSA to integrate +- `c` -- Destination TPSA +- `iv` -- Domain +""" +function mad_tpsa_integ!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}, iv::Cint) + @ccall MAD_TPSA.mad_tpsa_integ(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}, iv::Cint)::Cvoid +end + + +""" + mad_tpsa_deriv!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}, iv::Cint) + +??? Differentiates TPSA + +### Input +- `a` -- Source TPSA to differentiate +- `c` -- Destination TPSA +- `iv` -- Domain +""" +function mad_tpsa_deriv!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}, iv::Cint) + @ccall MAD_TPSA.mad_tpsa_deriv(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}, iv::Cint)::Cvoid +end + + +""" + mad_tpsa_derivm!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}, n::Cint, m::Ptr{Cuchar}) + +??? + +### Input +- `a` +- `c` +- `n` +- `m` +""" +function mad_tpsa_derivm!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}, n::Cint, m::Ptr{Cuchar}) + @ccall MAD_TPSA.mad_tpsa_derivm(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}, n::Cint, m::Ptr{Cuchar})::Cvoid +end + + +""" + mad_tpsa_poisbra!(a::Ptr{RTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}, nv::Cint) + +Sets TPSA c to the poisson bracket of TPSAs a and b. + +### Input +- `a` -- Source TPSA a +- `b` -- Source TPSA b +- `c` -- Destination TPSA c = [a, b] +- `nv` -- Number of variables in the TPSA +""" +function mad_tpsa_poisbra!(a::Ptr{RTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}, nv::Cint) + @ccall MAD_TPSA.mad_tpsa_poisbra(a::Ptr{RTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}, nv::Cint)::Cvoid +end + + +""" + mad_tpsa_taylor!(a::Ptr{RTPSA{Desc}}, n::Cint, coef::Ptr{Cdouble}, c::Ptr{RTPSA{Desc}}) + +??? + +### Input +- `a` +- `n` +- `coef` +- `c` +""" +function mad_tpsa_taylor!(a::Ptr{RTPSA{Desc}}, n::Cint, coef::Ptr{Cdouble}, c::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_taylor(a::Ptr{RTPSA{Desc}}, n::Cint, coef::Ptr{Cdouble}, c::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_axpb!(a::Cdouble, x::Ptr{RTPSA{Desc}}, b::Cdouble, r::Ptr{RTPSA{Desc}}) + +??? r = a*x/b? + +### Input +- `a` +- `x` +- `b` +- `r` +""" +function mad_tpsa_axpb!(a::Cdouble, x::Ptr{RTPSA{Desc}}, b::Cdouble, r::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_axpb(a::Cdouble, x::Ptr{RTPSA{Desc}}, b::Cdouble, r::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_axpbypc!(a::Cdouble, x::Ptr{RTPSA{Desc}}, b::Cdouble, y::Ptr{RTPSA{Desc}}, c::Cdouble, r::Ptr{RTPSA{Desc}}) + +### Input +- `a` +- `x` +- `b` +- `y` +- `c` +- `r` +""" +function mad_tpsa_axpbypc!(a::Cdouble, x::Ptr{RTPSA{Desc}}, b::Cdouble, y::Ptr{RTPSA{Desc}}, c::Cdouble, r::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_axpbypc(a::Cdouble, x::Ptr{RTPSA{Desc}}, b::Cdouble, y::Ptr{RTPSA{Desc}}, c::Cdouble, r::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_axypb!(a::Cdouble, x::Ptr{RTPSA{Desc}}, y::Ptr{RTPSA{Desc}}, b::Cdouble, r::Ptr{RTPSA{Desc}}) + +??? + +### Input +- `a` +- `x` +- `y` +- `b` +- `r` +""" +function mad_tpsa_axypb!(a::Cdouble, x::Ptr{RTPSA{Desc}}, y::Ptr{RTPSA{Desc}}, b::Cdouble, r::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_axypb(a::Cdouble, x::Ptr{RTPSA{Desc}}, y::Ptr{RTPSA{Desc}}, b::Cdouble, r::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_axypbzpc!(a::Cdouble, x::Ptr{RTPSA{Desc}}, y::Ptr{RTPSA{Desc}}, b::Cdouble, z::Ptr{RTPSA{Desc}}, c::Cdouble, r::Ptr{RTPSA{Desc}}) + +??? + +### Input +- `a` +- `x` +- `y` +- `b` +- `z` +- `c` +- `r` +""" +function mad_tpsa_axypbzpc!(a::Cdouble, x::Ptr{RTPSA{Desc}}, y::Ptr{RTPSA{Desc}}, b::Cdouble, z::Ptr{RTPSA{Desc}}, c::Cdouble, r::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_axypbzpc(a::Cdouble, x::Ptr{RTPSA{Desc}}, y::Ptr{RTPSA{Desc}}, b::Cdouble, z::Ptr{RTPSA{Desc}}, c::Cdouble, r::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_axypbvwpc!(a::Cdouble, x::Ptr{RTPSA{Desc}}, y::Ptr{RTPSA{Desc}}, b::Cdouble, v::Ptr{RTPSA{Desc}}, w::Ptr{RTPSA{Desc}}, c::Cdouble, r::Ptr{RTPSA{Desc}}) + +??? + +### Input +- `a` +- `x` +- `y` +- `b` +- `v` +- `w` +- `c` +- `r` +""" +function mad_tpsa_axypbvwpc!(a::Cdouble, x::Ptr{RTPSA{Desc}}, y::Ptr{RTPSA{Desc}}, b::Cdouble, v::Ptr{RTPSA{Desc}}, w::Ptr{RTPSA{Desc}}, c::Cdouble, r::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_axypbvwpc(a::Cdouble, x::Ptr{RTPSA{Desc}}, y::Ptr{RTPSA{Desc}}, b::Cdouble, v::Ptr{RTPSA{Desc}}, w::Ptr{RTPSA{Desc}}, c::Cdouble, r::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_ax2pby2pcz2!(a::Cdouble, x::Ptr{RTPSA{Desc}}, b::Cdouble, y::Ptr{RTPSA{Desc}}, c::Cdouble, z::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}) + +??? + +### Input +- `a` +- `x` +- `b` +- `y` +- `c` +- `z` +- `r` +""" +function mad_tpsa_ax2pby2pcz2!(a::Cdouble, x::Ptr{RTPSA{Desc}}, b::Cdouble, y::Ptr{RTPSA{Desc}}, c::Cdouble, z::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_ax2pby2pcz2(a::Cdouble, x::Ptr{RTPSA{Desc}}, b::Cdouble, y::Ptr{RTPSA{Desc}}, c::Cdouble, z::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_axpsqrtbpcx2!(x::Ptr{RTPSA{Desc}}, a::Cdouble, b::Cdouble, c::Cdouble, r::Ptr{RTPSA{Desc}}) + +??? + +### Input +- `x` +- `a` +- `b` +- `c` +- `r` +""" +function mad_tpsa_axpsqrtbpcx2!(x::Ptr{RTPSA{Desc}}, a::Cdouble, b::Cdouble, c::Cdouble, r::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_axpsqrtbpcx2(x::Ptr{RTPSA{Desc}}, a::Cdouble, b::Cdouble, c::Cdouble, r::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_logaxpsqrtbpcx2!(x::Ptr{RTPSA{Desc}}, a::Cdouble, b::Cdouble, c::Cdouble, r::Ptr{RTPSA{Desc}}) + +??? + +### Input +- `x` +- `a` +- `b` +- `c` +- `r` +""" +function mad_tpsa_logaxpsqrtbpcx2!(x::Ptr{RTPSA{Desc}}, a::Cdouble, b::Cdouble, c::Cdouble, r::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_logaxpsqrtbpcx2(x::Ptr{RTPSA{Desc}}, a::Cdouble, b::Cdouble, c::Cdouble, r::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_logxdy!(x::Ptr{RTPSA{Desc}}, y::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}) + +??? + +### Input +- `x` +- `y` +- `r` +""" +function mad_tpsa_logxdy!(x::Ptr{RTPSA{Desc}}, y::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_logxdy(x::Ptr{RTPSA{Desc}}, y::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_vec2fld!(na::Cint, a::Ptr{RTPSA{Desc}}, mc::Ptr{Ptr{RTPSA{Desc}}}) + +??? + +### Input +- `na` +- `a` +- `mc` +""" +function mad_tpsa_vec2fld!(na::Cint, a::Ptr{RTPSA{Desc}}, mc::Ptr{Ptr{RTPSA{Desc}}}) + @ccall MAD_TPSA.mad_tpsa_vec2fld(na::Cint, a::Ptr{RTPSA{Desc}}, mc::Ptr{Ptr{RTPSA{Desc}}})::Cvoid +end + + +""" + mad_tpsa_fld2vec!(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, c::Ptr{RTPSA{Desc}}) + +??? + +### Input +- `na` +- `ma` +- `c` +""" +function mad_tpsa_fld2vec!(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, c::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_fld2vec(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, c::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_fgrad!(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, b::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + +??? + +### Input +- `na` +- `ma` +- `b` +- `c` +""" +function mad_tpsa_fgrad!(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, b::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_fgrad(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, b::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_liebra!(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, mb::Ptr{Ptr{RTPSA{Desc}}}, mc::Ptr{Ptr{RTPSA{Desc}}}) + +??? + +### Input +- `na` +- `ma` +- `mb` +- `mc` +""" +function mad_tpsa_liebra!(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, mb::Ptr{Ptr{RTPSA{Desc}}}, mc::Ptr{Ptr{RTPSA{Desc}}}) + @ccall MAD_TPSA.mad_tpsa_liebra(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, mb::Ptr{Ptr{RTPSA{Desc}}}, mc::Ptr{Ptr{RTPSA{Desc}}})::Cvoid +end + + +""" + mad_tpsa_exppb!(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, mb::Ptr{Ptr{RTPSA{Desc}}}, mc::Ptr{Ptr{RTPSA{Desc}}}) + +??? + +### Input +- `na` +- `ma` +- `mb` +- `mc` +""" +function mad_tpsa_exppb!(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, mb::Ptr{Ptr{RTPSA{Desc}}}, mc::Ptr{Ptr{RTPSA{Desc}}}) + @ccall MAD_TPSA.mad_tpsa_exppb(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, mb::Ptr{Ptr{RTPSA{Desc}}}, mc::Ptr{Ptr{RTPSA{Desc}}})::Cvoid +end + + +""" + mad_tpsa_logpb!(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, mb::Ptr{Ptr{RTPSA{Desc}}}, mc::Ptr{Ptr{RTPSA{Desc}}}) + +??? + +### Input +- `na` +- `ma` +- `mb` +- `mc` +""" +function mad_tpsa_logpb!(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, mb::Ptr{Ptr{RTPSA{Desc}}}, mc::Ptr{Ptr{RTPSA{Desc}}}) + @ccall MAD_TPSA.mad_tpsa_logpb(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, mb::Ptr{Ptr{RTPSA{Desc}}}, mc::Ptr{Ptr{RTPSA{Desc}}})::Cvoid +end + + + +""" + mad_tpsa_mnrm(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}})::Cdouble + +??? + +### Input +- `na` +- `ma` + +### Output +- `nrm` +""" +function mad_tpsa_mnrm(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}})::Cdouble + nrm = @ccall MAD_TPSA.mad_tpsa_mnrm(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}})::Cdouble + return nrm +end + + +""" + mad_tpsa_minv!(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, mc::Ptr{Ptr{RTPSA{Desc}}}) + +??? + +### Input +- `na` +- `ma` +- `mc` +""" +function mad_tpsa_minv!(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, mc::Ptr{Ptr{RTPSA{Desc}}}) + @ccall MAD_TPSA.mad_tpsa_minv(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, mc::Ptr{Ptr{RTPSA{Desc}}})::Cvoid +end + + +""" + mad_tpsa_pminv!(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, mc::Ptr{Ptr{RTPSA{Desc}}}, select::Ptr{Cint}) + +??? + +### Input +- `na` +- `ma` +- `mc` +- `select` +""" +function mad_tpsa_pminv!(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, mc::Ptr{Ptr{RTPSA{Desc}}}, select::Ptr{Cint}) + @ccall MAD_TPSA.mad_tpsa_pminv(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, mc::Ptr{Ptr{RTPSA{Desc}}}, select::Ptr{Cint})::Cvoid +end + + +""" + mad_tpsa_compose!(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, nb::Cint, mb::Ptr{Ptr{RTPSA{Desc}}}, mc::Ptr{Ptr{RTPSA{Desc}}}) + +??? + +### Input +- `na` +- `ma` +- `nb` +- `mb` +- `mc` +""" +function mad_tpsa_compose!(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, nb::Cint, mb::Ptr{Ptr{RTPSA{Desc}}}, mc::Ptr{Ptr{RTPSA{Desc}}}) + @ccall MAD_TPSA.mad_tpsa_compose(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, nb::Cint, mb::Ptr{Ptr{RTPSA{Desc}}}, mc::Ptr{Ptr{RTPSA{Desc}}})::Cvoid +end + + +""" + mad_tpsa_translate!(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, nb::Cint, tb::Ptr{Cdouble}, mc::Ptr{RTPSA{Desc}}) + +??? + +### Input +- `na` +- `ma` +- `nb` +- `tb` +- `mc` +""" +function mad_tpsa_translate!(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, nb::Cint, tb::Ptr{Cdouble}, mc::Ptr{RTPSA{Desc}}) + @ccall MAD_TPSA.mad_tpsa_translate(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, nb::Cint, tb::Ptr{Cdouble}, mc::Ptr{RTPSA{Desc}})::Cvoid +end + + +""" + mad_tpsa_eval!(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, nb::Cint, tb::Ptr{Cdouble}, tc::Ptr{Cdouble}) + +??? + +### Input +- `na` +- `ma` +- `nb` +- `tb` +- `tc` +""" +function mad_tpsa_eval!(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, nb::Cint, tb::Ptr{Cdouble}, tc::Ptr{Cdouble}) + @ccall MAD_TPSA.mad_tpsa_eval(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, nb::Cint, tb::Ptr{Cdouble}, tc::Ptr{Cdouble})::Cvoid +end + + +""" + mad_tpsa_mconv!(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, nc::Cint, mc::Ptr{Ptr{RTPSA{Desc}}}, n::Cint, t2r_::Ptr{Cint}, pb::Cint) + +??? + +### Input +- `na` +- `ma` +- `nc` +- `mc` +- `n` +- `t2r_` +- `pb` +""" +function mad_tpsa_mconv!(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, nc::Cint, mc::Ptr{Ptr{RTPSA{Desc}}}, n::Cint, t2r_::Ptr{Cint}, pb::Cint) + @ccall MAD_TPSA.mad_tpsa_mconv(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, nc::Cint, mc::Ptr{Ptr{RTPSA{Desc}}}, n::Cint, t2r_::Ptr{Cint}, pb::Cint)::Cvoid +end + + +""" + mad_tpsa_print(t::Ptr{RTPSA{Desc}}, name_::Cstring, eps_::Cdouble, nohdr_::Cint, stream_::Ptr{Cvoid}) + +Prints the TPSA coefficients to stdout with precision eps_. If nohdr_ is not zero, +the header is not printed. + +### Input +- `t` -- TPSA to print +- `name_` -- Name of TPSA +- `eps_` -- Precision to output +- `nohdr_` -- If True, no header is printed +- `stream_` -- FILE pointer of output stream. If null, printed to stdout +""" +function mad_tpsa_print(t::Ptr{RTPSA{Desc}}, name_::Cstring, eps_::Cdouble, nohdr_::Cint, stream_::Ptr{Cvoid}) + @ccall MAD_TPSA.mad_tpsa_print(t::Ptr{RTPSA{Desc}}, name_::Cstring, eps_::Cdouble, nohdr_::Cint, stream_::Ptr{Cvoid})::Cvoid +end + + +""" + mad_tpsa_scan(stream_::Ptr{Cvoid})::Ptr{RTPSA{Desc}} + +Scans in a TPSA from the stream_. + +### Input +- `stream_` -- C FILE pointer I/O stream from which to read the TPSA + +### Output +- `t` -- TPSA scanned from I/O stream_ +""" +function mad_tpsa_scan(stream_::Ptr{Cvoid})::Ptr{RTPSA{Desc}} + t = @ccall MAD_TPSA.mad_tpsa_scan(stream_::Ptr{Cvoid})::Ptr{RTPSA{Desc}} + return t +end + + +""" + mad_tpsa_scan_hdr(kind_::Cint, name_::Cstring, stream_::Ptr{Cvoid})::Ptr{Desc{RTPSA,CTPSA}} + +??? + +### Input +- `kind_` +- `name_` +- `stream_` + +### Output +- `ret` +""" +function mad_tpsa_scan_hdr(kind_::Cint, name_::Cstring, stream_::Ptr{Cvoid})::Ptr{Desc{RTPSA,CTPSA}} + desc = @ccall MAD_TPSA.mad_tpsa_scan_hdr(kind_::Cint, name_::Cstring, stream_::Ptr{Cvoid})::Ptr{Desc{RTPSA,CTPSA}} + return ret +end + + +""" + mad_tpsa_scan_coef!(t::Ptr{RTPSA{Desc}}, stream_::Ptr{Cvoid}) + +??? + +### Input +- `t` +- `stream_` +""" +function mad_tpsa_scan_coef!(t::Ptr{RTPSA{Desc}}, stream_::Ptr{Cvoid}) + @ccall MAD_TPSA.mad_tpsa_scan_coef(t::Ptr{RTPSA{Desc}}, stream_::Ptr{Cvoid})::Cvoid +end + + +""" + mad_tpsa_debug(t::Ptr{RTPSA{Desc}}, name_::Cstring, fnam_::Cstring, line_::Cint, stream_::Ptr{Cvoid}) + +??? + +### Input +- `t` +- `name_` +- `fnam_` +- `line_` +- `stream_` +""" +function mad_tpsa_debug(t::Ptr{RTPSA{Desc}}, name_::Cstring, fnam_::Cstring, line_::Cint, stream_::Ptr{Cvoid}) + @ccall MAD_TPSA.mad_tpsa_debug(t::Ptr{RTPSA{Desc}}, name_::Cstring, fnam_::Cstring, line_::Cint, stream_::Ptr{Cvoid})::Cvoid +end + +""" + mad_tpsa_isvalid(t::Ptr{RTPSA{Desc}})::Cuchar + +Sanity check of the TPSA integrity. + +### Input +- `t` -- Real TPSA to check if valid + +### Output +- `ret` -- True if valid TPSA, false otherwise +""" +function mad_tpsa_isvalid(t::Ptr{RTPSA{Desc}})::Cuchar + ret = @ccall MAD_TPSA.mad_tpsa_isvalid(t::Ptr{RTPSA{Desc}})::Cuchar + return ret +end + + +""" + mad_tpsa_init(t::Ptr{RTPSA{Desc}}, d::Ptr{Desc{RTPSA,CTPSA}}, mo::Cuchar)::Ptr{RTPSA{Desc}} + +UNSAFE OPERATION! (mo vs allocated!!) ??? + +### Input +- `t` +- `d` +- `mo` + +### Output +- `t` +""" +function mad_tpsa_init!(t::Ptr{RTPSA{Desc}}, d::Ptr{Desc{RTPSA,CTPSA}}, mo::Cuchar)::Ptr{RTPSA{Desc}} + t = @ccall MAD_TPSA.mad_tpsa_init(t::Ptr{RTPSA{Desc}}, d::Ptr{Desc{RTPSA,CTPSA}}, mo::Cuchar)::Ptr{RTPSA{Desc}} + return t +end + + end diff --git a/src/TPSA.jl b/src/TPSA.jl index d19e9e9d..7be26a2c 100644 --- a/src/TPSA.jl +++ b/src/TPSA.jl @@ -1,4 +1,5 @@ module TPSA +include("Monomial.jl") include("Descriptor.jl") include("RealTPSA.jl") include("ComplexTPSA.jl") @@ -13,8 +14,6 @@ const MAD_TPSA = :("libmad_tpsa") const MAD_TPSA_DEFAULT::Cuchar = 255 const MAD_TPSA_SAME::Cuchar = 254 -# ------------------------------------------------------------------------------------------ -# LOW LEVEL FUNCTIONS: """ Variable type conversions: "ord_t": "Cuchar", @@ -27,2549 +26,7 @@ Variable type conversions: "c_ptr tpsa": "Ptr{RTPSA{Desc}}", "c_ptr ctpsa": "Ptr{CTPSA{Desc}}" """ -# ------------------------------------------------------------------------------------------ -# mad_mono: - -""" - mad_mono_str(n::Cint, a::Ptr{Cuchar}, s::Cstring)::Cint - -??? - -### Input -- `n` -- Monomial and string length -- `a` -- Monomial -- `s` -- Monomial as string "[0-9]*" - -### Output -- `i` -- Adjusted size n if "\0" found -""" -function mad_mono_str(n::Cint, mono_a::Ptr{Cuchar}, s::Cstring)::Cint - i = @ccall MAD_TPSA.mad_mono_str(n::Cint, mono_a::Ptr{Cuchar}, s::Cstring)::Cint - return i -end - - -""" - mad_mono_prt(n::Cint, a::Ptr{Cuchar}, s::Cstring)::Cstring - -??? - -### Input -- `n` -- Monomial and string length -- `a` -- Monomial -- `s` -- Monomial as string - -### Output -- `s` -- Monomial as string -""" -function mad_mono_prt(n::Cint, a::Ptr{Cuchar}, s::Cstring)::Cstring - s = @ccall MAD_TPSA.mad_mono_prt(n::Cint, a::Ptr{Cuchar}, s::Cstring)::Cstring - return s -end - - -""" - mad_mono_fill!(n::Cint, a::Ptr{Cuchar}, v::Cuchar) - -Fills the monomial a with the value v. - -### Input -- `n` -- Monomial length -- `a` -- Monomial -- `v` -- Value -""" -function mad_mono_fill!(n::Cint, a::Ptr{Cuchar}, v::Cuchar) - @ccall MAD_TPSA.mad_mono_fill(n::Cint, a::Ptr{Cuchar}, v::Cuchar)::Cvoid -end - - -""" - mad_mono_copy!(n::Cint, a::Ptr{Cuchar}, r::Ptr{Cuchar}) - -Copies monomial a to monomial r. - -### Input -- `n` -- Length of monomials -- `a` -- Source monomial -- `r` -- Destination monomial -""" -function mad_mono_copy!(n::Cint, a::Ptr{Cuchar}, r::Ptr{Cuchar}) - @ccall MAD_TPSA.mad_mono_copy(n::Cint, a::Ptr{Cuchar}, r::Ptr{Cuchar})::Cvoid -end - - -""" - mad_mono_min(n::Cint, a::Ptr{Cuchar})::Cuchar - -??? min of monomial? - -### Input -- `n` -- Length of monomial -- `a` -- Monomial - -### Output -- `mo` -- Min??? -""" -function mad_mono_min(n::Cint, a::Ptr{Cuchar})::Cuchar - mo = @ccall MAD_TPSA.mad_mono_min(n::Cint, a::Ptr{Cuchar})::Cuchar - return mo -end - - -""" - mad_mono_max(n::Cint, a::Ptr{Cuchar})::Cuchar - -??? max of monomial? - -### Input -- `n` -- Length of monomial -- `a` -- Monomial - -### Output -- `mo` -- Max??? -""" -function mad_mono_max(n::Cint, a::Ptr{Cuchar})::Cuchar - mo = @ccall MAD_TPSA.mad_mono_max(n::Cint, a::Ptr{Cuchar})::Cuchar - return mo -end - - -""" - mad_mono_ord(n::Cint, a::Ptr{Cuchar})::Cint - -Returns the sum of the orders of the monomial a. - -### Input -- `n` -- Monomial length -- `a` -- Monomial - -### Output -- `s` -- Sum of orders of monomial -""" -function mad_mono_ord(n::Cint, a::Ptr{Cuchar})::Cint - s = @ccall MAD_TPSA.mad_mono_ord(n::Cint, a::Ptr{Cuchar})::Cint - return s -end - - -""" - mad_mono_ordp(n::Cint, a::Ptr{Cuchar}, stp::Cint)::Cdouble - -Returns the product of the orders of the monomial a. - -### Input -- `n` -- Monomial length -- `a` -- Monomial -- `stp` -- ???? - -### Output -- `p` -- Product of orders of monomial -""" -function mad_mono_ordp(n::Cint, a::Ptr{Cuchar}, stp::Cint)::Cdouble - p = @ccall MAD_TPSA.mad_mono_ordp(n::Cint, a::Ptr{Cuchar})::Cdouble - return p -end - - -""" - mad_mono_ordpf(n::Cint, a::Ptr{Cuchar}, stp::Cint)::Cdouble - -Returns the product of factorials of orders of the monomial a. - -### Input -- `n` -- Monomial length -- `a` -- Monomial -- `stp` -- ???? - -### Output -- `p` -- Product of factorials of orders of monomial -""" -function mad_mono_ordpf(n::Cint, a::Ptr{Cuchar}, stp::Cint)::Cdouble - p = @ccall MAD_TPSA.mad_mono_ordpf(n::Cint, a::Ptr{Cuchar})::Cdouble - return p -end - - -""" - mad_mono_eq(n::Cint, a::Ptr{Cuchar}, b::Ptr{Cuchar})::Cuchar - -Checks if the monomial a is equal to the monomial b. - -### Input -- `n` -- Length of monomials -- `a` -- Monomial a -- `b` -- Monomial b - -### Output -- `ret` -- True if the monomials are equal, false if otherwise -""" -function mad_mono_eq(n::Cint, a::Ptr{Cuchar}, b::Ptr{Cuchar})::Cuchar - ret = @ccall MAD_TPSA.mad_mono_eq(n::Cint, a::Ptr{Cuchar}, b::Ptr{Cuchar})::Cuchar - return ret -end - - -""" - mad_mono_lt(n::Cint, a::Ptr{Cuchar}, b::Ptr{Cuchar})::Cuchar - -Checks if monomial a is less than monomial b. - -### Input -- `n` -- Length of monomials -- `a` -- Monomial a -- `b` -- Monomial b - -### Output -- `ret` -- True if a < b, false otherwise -""" -function mad_mono_lt(n::Cint, a::Ptr{Cuchar}, b::Ptr{Cuchar})::Cuchar - ret = @ccall MAD_TPSA.mad_mono_lt(n::Cint, a::Ptr{Cuchar}, b::Ptr{Cuchar})::Cuchar - return ret -end - - -""" - mad_mono_le(n::Cint, a::Ptr{Cuchar}, b::Ptr{Cuchar})::Cuchar - -Checks if monomial a is less than or equal to monomial b. - -### Input -- `n` -- Length of monomials -- `a` -- Monomial a -- `b` -- Monomial b - -### Output -- `ret` -- True if a <= mono_b, false otherwise -""" -function mad_mono_le(n::Cint, a::Ptr{Cuchar}, b::Ptr{Cuchar})::Cuchar - ret = @ccall MAD_TPSA.mad_mono_le(n::Cint, a::Ptr{Cuchar}, b::Ptr{Cuchar})::Cuchar - return ret -end - - -""" - mad_mono_cmp(n::Cint, a::Ptr{Cuchar}, b::Ptr{Cuchar})::Cint - -??? - -### Input -- `n` -- Length of monomials -- `a` -- Monomial a -- `b` -- Monomial b - -### Output -- `ret` -- First a[i]-b[i] != 0 -""" -function mad_mono_cmp(n::Cint, a::Ptr{Cuchar}, b::Ptr{Cuchar})::Cint - ret = @ccall MAD_TPSA.mad_mono_cmp(n::Cint, a::Ptr{Cuchar}, b::Ptr{Cuchar})::Cint - return ret -end - - -""" - mad_mono_rcmp(n::Cint, a::Ptr{Cuchar}, b::Ptr{Cuchar})::Cint - -Compare from end. ??? - -### Input -- `n` -- Length of monomials -- `a` -- Monomial a -- `b` -- Monomial b - -### Output -- `ret` -- First a[i]-b[i] != 0 -""" -function mad_mono_rcmp(n::Cint, a::Ptr{Cuchar}, b::Ptr{Cuchar})::Cint - ret = @ccall MAD_TPSA.mad_mono_rcmp(n::Cint, a::Ptr{Cuchar}, b::Ptr{Cuchar})::Cint - return ret -end - - -""" - mad_mono_add!(n::Cint, a::Ptr{Cuchar}, b::Ptr{Cuchar}, r::Ptr{Cuchar}) - -Sets monomial r = a + b. - -### Input -- `n` -- Length of monomials -- `a` -- Source monomial a -- `b` -- Source monomial b -- `r` -- Destination monomial, r = a + b -""" -function mad_mono_add!(n::Cint, a::Ptr{Cuchar}, b::Ptr{Cuchar}, r::Ptr{Cuchar}) - @ccall MAD_TPSA.mad_mono_add(n::Cint, a::Ptr{Cuchar},b::Ptr{Cuchar}, r::Ptr{Cuchar})::Cvoid -end - - -""" - mad_mono_sub!(n::Cint, a::Ptr{Cuchar}, b::Ptr{Cuchar}, r::Ptr{Cuchar}) - -Sets monomial r = a - b. - -### Input -- `n` -- Length of monomials -- `a` -- Source monomial a -- `b` -- Source monomial b -- `r` -- Destination monomial, r = a - b -""" -function mad_mono_sub!(n::Cint, a::Ptr{Cuchar}, b::Ptr{Cuchar}, r::Ptr{Cuchar}) - @ccall MAD_TPSA.mad_mono_sub(n::Cint, a::Ptr{Cuchar}, b::Ptr{Cuchar}, r::Ptr{Cuchar})::Cvoid -end - - -""" - mad_mono_cat!(n::Cint, a::Ptr{Cuchar}, m::Cint, b::Ptr{Cuchar}, r::Ptr{Cuchar}) - -Sets monomial r equal to the concatenation of the monomials a and b - -### Input -- `n` -- Length of monomonial a -- `a` -- Source monomial a -- `m` -- Length of monomial b -- `b` -- Source monomial b -- `r` -- Destination monomial of concatenation of a and b (length n+m) -""" -function mad_mono_cat!(n::Cint, a::Ptr{Cuchar}, m::Cint, b::Ptr{Cuchar}, r::Ptr{Cuchar}) - @ccall MAD_TPSA.mad_mono_cat(n::Cint, a::Ptr{Cuchar}, m::Cint, b::Ptr{Cuchar}, r::Ptr{Cuchar})::Cvoid -end - -""" - mad_mono_rev!(n::Cint, a::Ptr{Cuchar}, r::Ptr{Cuchar}) - -Sets destination monomial r equal to the reverse of source monomial a. - -### Input -- `n` -- Lengths of Monomials -- `a` -- Source monomial a -- `r` -- Destination monomial of reverse monomial a -""" -function mad_mono_rev!(n::Cint, a::Ptr{Cuchar}, r::Ptr{Cuchar}) - @ccall MAD_TPSA.mad_mono_rev(n::Cint, a::Ptr{Cuchar}, r::Ptr{Cuchar})::Cvoid -end - - -""" - mad_mono_print(n::Cint, a::Ptr{Cuchar}, fp::Ptr{Cvoid}) - -Prints the monomial to stdout. - -### Input -- `n` -- Length of monomial -- `a` -- Source monomial to print to stdout -- `fp` -- C FILE pointer, if null will print to stdout -""" -function mad_mono_print(n::Cint, a::Ptr{Cuchar}, fp::Ptr{Cvoid}) - @ccall MAD_TPSA.mad_mono_print(n::Cint, a::Ptr{Cuchar}, fp::Ptr{Cvoid})::Cvoid -end - -# ------------------------------------------------------------------------------------------ -# mad_desc: - -""" - mad_desc_newv(nv::Cint, mo::Cuchar)::Ptr{Desc{RTPSA,CTPSA}} - -Creates a TPSA descriptor with the specified number of variables and maximum order. -The number of parameters is set to 0. - -### Input -- `nv` -- Number of variables in th -- `mo` -- Maximum order of TPSA, mo = max(1, mo) - -### Output -- `ret` -- Descriptor with the specified number of variables and maximum order -""" -function mad_desc_newv(nv::Cint, mo::Cuchar)::Ptr{Desc{RTPSA,CTPSA}} - ret = @ccall MAD_TPSA.mad_desc_newv(nv::Cint, mo::Cuchar)::Ptr{Desc{RTPSA,CTPSA}} - return ret -end - - -""" - mad_desc_newvp(nv::Cint, mo::Cuchar, np_::Cint, po_::Cuchar)::Ptr{Desc{RTPSA,CTPSA}} - -Creates a TPSA descriptor with the specifed number of variables, maximum order, number of -parameters, and parameter order. - -### Input -- `nv` -- Number of variables -- `mo` -- Maximum order of TPSA, mo = max(1, mo) -- `np_` -- Number of parameters -- `po_` -- Order of parameters, po = max(1, po_) - -### Output -- `ret` -- Descriptor with the specified nv, mo, np, and po. -""" -function mad_desc_newvp(nv::Cint, mo::Cuchar, np_::Cint, po_::Cuchar)::Ptr{Desc{RTPSA,CTPSA}} - ret = @ccall MAD_TPSA.mad_desc_newvp(nv::Cint, mo::Cuchar, np_::Cint, po_::Cuchar)::Ptr{Desc{RTPSA,CTPSA}} - return ret -end - - -""" - mad_desc_newvpo(nv::Cint, mo::Cuchar, np_::Cint, po_::Cuchar, no_::Ptr{Cuchar})::Ptr{Desc{RTPSA,CTPSA}} - -Creates a TPSA descriptor with the specifed number of variables, maximum order, number of parameters, -parameter order, and individual variable/parameter orders specified in no. The first nv entries in no -correspond to the variables' orders and the next np entries correspond the parameters' orders. - -### Input -- `nv` -- Number of variables -- `mo` -- Maximum order of TPSA (mo = max(mo , no[0 :nn-1]), nn = nv+np) -- `np_` -- Number of parameters -- `po_` -- Order of parameters (po = max(po_, no[nv:nn-1]), po <= mo) -- `no_` -- Array of orders of variables and parameters - -### Output -- `ret` -- Descriptor with the specified nv, mo, np, po, no. -""" -function mad_desc_newvpo(nv::Cint, mo::Cuchar, np_::Cint, po_::Cuchar, no_::Ptr{Cuchar})::Ptr{Desc{RTPSA,CTPSA}} - ret = @ccall MAD_TPSA.mad_desc_newvpo(nv::Cint, mo::Cuchar, np_::Cint, po_::Cuchar, no_::Ptr{Cuchar})::Ptr{Desc{RTPSA,CTPSA}} - return ret -end - - -""" - mad_desc_del!(d_::Ptr{Desc{RTPSA,CTPSA}}) - -Calls the destructor for the descriptor, or all descriptors if null pointer is passed. - -### Input -- `d_` -- Descriptor to destruct. If null, all registered descriptors will be deleted -""" -function mad_desc_del!(d_::Ptr{Desc{RTPSA,CTPSA}}) - @ccall MAD_TPSA.mad_desc_del(d_::Ptr{Desc{RTPSA,CTPSA}})::Cvoid -end - - -""" - mad_desc_getnv!(d::Ptr{Desc{RTPSA,CTPSA}}, mo_::Ptr{Cuchar}, np_::Ptr{Cint}, po_::Ptr{Cuchar)::Cint - -Returns the number of variables in the descriptor, and sets the passed mo_, np_, and po_ to the maximum -order, number of parameters, and parameter order respectively. ??? - -### Input -- `d` -- Descriptor -- `mo_` -- Maximum order to be set to that of the descriptor -- `np_` -- Number of parameters to be set to that of the descriptor -- `po_` -- Parameter order to be set to that of the descriptor - -### Output -- `ret` -- Number of variables in TPSA -""" -function mad_desc_getnv!(desc::Ptr{Desc{RTPSA,CTPSA}}, mo_::Ptr{Cuchar}, np_::Ptr{Cint}, po_::Ptr{Cuchar})::Cint - ret = @ccall MAD_TPSA.mad_desc_getnv(desc::Ptr{Desc{RTPSA,CTPSA}}, mo_::Cuchar, np_::Cint, po_::Cuchar)::Cint - return ret -end - - -""" - mad_desc_maxord(d::Ptr{Desc{RTPSA,CTPSA}}, nn::Cint, no_::Ptr{Cuchar})::Cuchar - -Sets the order of the variables and parameters of the TPSA to those specified in no_ and -returns the maximum order of the TPSA. - -### Input -- `d` -- Descriptor -- `nn` -- Number of variables + number of parameters, no_[1..nn] -- `no_` -- Orders of parameters to be filled if provided - -### Output -- `ret` -- Maximum order of TPSA -""" -function mad_desc_maxord(d::Ptr{Desc{RTPSA,CTPSA}}, nn::Cint, no_::Ptr{Cuchar})::Cuchar - ret = @ccall MAD_TPSA.mad_desc_maxord(d::Ptr{Desc{RTPSA,CTPSA}}, nn::Cint, no_::Ptr{Cuchar})::Cuchar - return ret -end - - -""" - mad_desc_maxlen(d::Ptr{Desc{RTPSA,CTPSA}}, mo::Cuchar)::Cint - -??? - -### Input -- `d` -- Descriptor -- `mo` -- ordlen(maxord) == maxlen - -### Output -- `ret` -- monomials in 0..order -""" -function mad_desc_maxlen(d::Ptr{Desc{RTPSA,CTPSA}}, mo::Cuchar)::Cint - ret = @ccall MAD_TPSA.mad_desc_maxlen(d::Ptr{Desc{RTPSA,CTPSA}}, mo::Cuchar)::Cint - return ret -end - -""" - mad_desc_gtrunc!(d::Ptr{Desc{RTPSA,CTPSA}}, to::Cuchar)::Cuchar - -Sets the global truncation order (to) of the TPSA, and returns the old global truncation order. - -### Input -- `d` -- Descriptor -- `to` -- New global truncation order - -### Output -- `oldto` -- Old global truncation order -""" -function mad_desc_gtrunc!(d::Ptr{Desc{RTPSA,CTPSA}}, to::Cuchar)::Cuchar - oldto = @ccall MAD_TPSA.mad_desc_gtrunc(d::Ptr{Desc{RTPSA,CTPSA}}, to::Cuchar)::Cuchar - return oldto -end - - -""" - mad_desc_isvalids(d::Ptr{Desc{RTPSA,CTPSA}}, n::Cint, s::Cstring)::Cuchar - -??? - -### Input -- `d` -- Descriptor -- `n` -- String length of 0 (unknown) -- `s` -- Monomial as string "[0-9]*" - -### Output -- `ret` -- True or false -""" -function mad_desc_isvalids(d::Ptr{Desc{RTPSA,CTPSA}}, n::Cint, s::Cstring)::Cuchar - ret = @ccall MAD_TPSA.mad_desc_isvalids(d::Ptr{Desc{RTPSA,CTPSA}}, n::Cint, s::Cstring)::Cuchar - return ret -end - - -""" - mad_desc_isvalidm(d::Ptr{Desc{RTPSA,CTPSA}}, n::Cint, m::Ptr{Cuchar})::Cuchar - -??? - -### Input -- `d` -- Descriptor -- `n` -- Length of monomial -- `m` -- Monomial - -### Output -- `ret` -- True or false -""" -function mad_desc_isvalidm(d::Ptr{Desc{RTPSA,CTPSA}}, n::Cint, m::Ptr{Cuchar})::Cuchar - ret = @ccall MAD_TPSA.mad_desc_isvalidm(d::Ptr{Desc{RTPSA,CTPSA}}, n::Cint, m::Ptr{Cuchar})::Cuchar - return ret -end - - -""" - mad_desc_isvalidsm(d::Ptr{Desc{RTPSA,CTPSA}}, n::Cint, m::Ptr{Cint})::Cuchar - -??? why int isntead uint8 - -### Input -- `d` -- Descriptor -- `n` -- Length of monomial -- `m` -- Sparse monomial (idx, ord) - -### Output -- `ret` -- True or false. -""" -function mad_desc_isvalidsm(d::Ptr{Desc{RTPSA,CTPSA}}, n::Cint, m::Ptr{Cint})::Cuchar - ret = @ccall MAD_TPSA.mad_desc_isvalidsm(d::Ptr{Desc{RTPSA,CTPSA}}, n::Cint, m::Ptr{Cint})::Cuchar - return ret -end - - -""" - mad_desc_idxs(d::Ptr{Desc{RTPSA,CTPSA}}, n::Cint, s::Cstring)::Cint - -??? - -### Input -- `d` -- Descriptor -- `n` -- String length or 0 (unknown) -- `s` -- Monomial as string "[0-9]*" - -### Output -- `ret` -- Monomial index or -1 -""" -function mad_desc_idxs(d::Ptr{Desc{RTPSA,CTPSA}}, n::Cint, s::Cstring)::Cint - ret = @ccall MAD_TPSA.mad_desc_idxs(d::Ptr{Desc{RTPSA,CTPSA}}, n::Cint, s::Cstring)::Cint - return ret -end - - -""" - mad_desc_idxm(d::Ptr{Desc{RTPSA,CTPSA}}, n::Cint, m::Ptr{Cuchar})::Cint - -??? - -### Input -- `d` -- Descriptor -- `n` -- Monomial length -- `m` -- Monomial - -### Output -- `ret` -- Monomial index or -1 -""" -function mad_desc_idxm(d::Ptr{Desc{RTPSA,CTPSA}}, n::Cint, m::Ptr{Cuchar})::Cint - ret = @ccall MAD_TPSA.mad_desc_idxm(d::Ptr{Desc{RTPSA,CTPSA}}, n::Cint, m::Ptr{Cuchar})::Cint - return ret -end - - -""" - mad_desc_idxsm(d::Ptr{Desc{RTPSA,CTPSA}}, n::Cint, m::Ptr{Cint})::Cint - -??? Why int instead Uint8 - -### Input -- `d` -- Descriptor -- `n` -- Monomial length -- `m` -- Sparse monomial (idx,ord) - -### Output -- `ret` -- Monomial index or -1 -""" -function mad_desc_idxsm(d::Ptr{Desc{RTPSA,CTPSA}}, n::Cint, m::Ptr{Cint})::Cint - ret = @ccall MAD_TPSA.mad_desc_idxsm(d::Ptr{Desc{RTPSA,CTPSA}}, n::Cint, m::Ptr{Cint})::Cint - return ret -end - - -""" - mad_desc_nxtbyvar(d::Ptr{Desc{RTPSA,CTPSA}}, n::Cint, m::Ptr{Cuchar})::Cint - -??? - -### Input -- `d` -- Descriptor -- `n` -- Monomial length -- `m` -- Monomial - -### Output -- `idx` -- Monomial index or -1 -""" -function mad_desc_nxtbyvar(d::Ptr{Desc{RTPSA,CTPSA}}, n::Cint, m::Ptr{Cuchar})::Cint - idx = @ccall MAD_TPSA.mad_desc_nxtbyvar(d::Ptr{Desc{RTPSA,CTPSA}}, n::Cint, m::Ptr{Cuchar})::Cint - return idx -end - - -""" - mad_desc_nxtbyord(d::Ptr{Desc{RTPSA,CTPSA}}, n::Cint, m::Ptr{Cuchar})::Cint - -??? - -### Input -- `d` -- Descriptor -- `n` -- Monomial length -- `m` -- Monomial - -### Output -- `idx` -- Monomial index or -1 -""" -function mad_desc_nxtbyord(d::Ptr{Desc{RTPSA,CTPSA}}, n::Cint, m::Ptr{Cuchar})::Cint - idx = @ccall MAD_TPSA.mad_desc_nxtbyord(d::Ptr{Desc{RTPSA,CTPSA}}, n::Cint, m::Ptr{Cuchar})::Cint - return idx -end - - -""" - mad_desc_mono(d::Ptr{Desc{RTPSA,CTPSA}}, i::Cint, n::Cint, m_::Ptr{Cuchar})::Cuchar - -??? - -### Input -- `d` -- Descriptor -- `i` -- Slot index (must be valid) -- `n` -- Monomial length -- `m_` -- Monomial to fill (if provided) - -### Output -- `ret` -- Monomial order -""" -function mad_desc_mono(d::Ptr{Desc{RTPSA,CTPSA}}, i::Cint, n::Cint, m_::Ptr{Cuchar})::Cuchar - ret = @ccall MAD_TPSA.mad_desc_mono(d::Ptr{Desc{RTPSA,CTPSA}}, i::Cint, n::Cint, m_::Ptr{Cuchar})::Cuchar - return ret -end - -""" - mad_desc_info(d::Ptr{Desc{RTPSA,CTPSA}}, fp::Ptr{Cvoid}) - -For debugging. - -### Input -- `d` -- Descriptor to debug -- `fp` -- File to write to. If null, will write to stdout -""" -function mad_desc_info(d::Ptr{Desc{RTPSA,CTPSA}}, fp::Ptr{Cvoid}) - @ccall MAD_TPSA.mad_desc_info(d::Ptr{Desc{RTPSA,CTPSA}}, fp::Ptr{Cvoid})::Cvoid -end - -# ------------------------------------------------------------------------------------------ -# mad_tpsa: - - -""" - mad_tpsa_newd(d::Ptr{Desc{RTPSA,CTPSA}}, mo::Cuchar)::Ptr{RTPSA{Desc}} - -Creates a real TPSA defined by the specified descriptor and maximum order. If MAD_TPSA_DEFAULT -is passed for mo, the mo defined in the descriptor is used. If mo > d_mo, mo = d_mo. - -### Input -- `d` -- Descriptor -- `mo` -- Maximum order - -### Output -- `t` -- New real TPSA defined by the descriptor -""" -function mad_tpsa_newd(d::Ptr{Desc{RTPSA,CTPSA}}, mo::Cuchar)::Ptr{RTPSA{Desc}} - t = @ccall MAD_TPSA.mad_tpsa_newd(d::Ptr{Desc{RTPSA,CTPSA}}, mo::Cuchar)::Ptr{RTPSA{Desc}} - return t -end - - -""" - mad_tpsa_new(t::Ptr{RTPSA{Desc}}, mo::Cuchar)::Ptr{RTPSA{Desc}} - -Creates a real TPSA copy of the inputted TPSA, with maximum order specified by mo. -If MAD_TPSA_SAME is passed for mo, the mo currently in tpsa is used for the created TPSA. - ok with t=(tpsa_t*)ctpsa - -### Input -- `t` -- Real TPSA to copy -- `mo` -- Maximum order of new TPSA - -### Output -- `ret` -- New real TPSA with maximum order mo -""" -function mad_tpsa_new(t::Ptr{RTPSA{Desc}}, mo::Cuchar)::Ptr{RTPSA{Desc}} - ret = @ccall MAD_TPSA.mad_tpsa_new(t::Ptr{RTPSA{Desc}}, mo::Cuchar)::Ptr{RTPSA{Desc}} - return ret -end - - -""" - mad_tpsa_del!(t::Ptr{RTPSA{Desc}}) - -Calls the destructor for the real TPSA. - -### Input -- `t` -- Real TPSA to destruct -""" -function mad_tpsa_del!(t::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_del(t::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_desc(t::Ptr{RTPSA{Desc}})::Ptr{Desc{RTPSA,CTPSA}} - -Gets the descriptor for the real TPSA. - -### Input -- `t` -- Real TPSA - -### Output -- `ret` -- Descriptor for the tpsa -""" -function mad_tpsa_desc(t::Ptr{RTPSA{Desc}})::Ptr{Desc{RTPSA,CTPSA}} - ret = @ccall MAD_TPSA.mad_tpsa_desc(t::Ptr{RTPSA{Desc}})::Ptr{Desc{RTPSA,CTPSA}} - return ret -end - - -""" - mad_tpsa_uid!(t::Ptr{RTPSA{Desc}}, uid_::Cint)::Cint - -Sets the TPSA uid if uid_ != 0, and returns the current (previous if set) TPSA uid. - -### Input -- `t` -- Real TPSA -- `uid_` -- uid to set in the TPSA if uid_ != 0 - -### Output -- `ret` -- Current (previous if set) TPSA uid -""" -function mad_tpsa_uid!(t::Ptr{RTPSA{Desc}}, uid_::Cint)::Cint - ret = @ccall MAD_TPSA.mad_tpsa_uid(t::Ptr{RTPSA{Desc}}, uid_::Cint)::Cint - return ret -end - - -""" - mad_tpsa_len(t::Ptr{RTPSA{Desc}})::Cint - -??? - -### Input -- `t` -- Real TPSA - -### Output -- `ret` -- Monomials in tpsa -""" -function mad_tpsa_len(t::Ptr{RTPSA{Desc}})::Cint - ret = @ccall MAD_TPSA.mad_tpsa_len(t::Ptr{RTPSA,CTPSA})::Cint - return ret -end - - -""" - mad_tpsa_nam(t::Ptr{RTPSA{Desc}})::Cstring - -Get the name of the TPSA. - -### Input -- `t` -- Real TPSA - -### Output -- `ret` -- Name of tpsa (nul term in C) -""" -function mad_tpsa_nam(t::Ptr{RTPSA{Desc}})::Cstring - ret = @ccall MAD_TPSA.mad_tpsa_nam(t::Ptr{RTPSA{Desc}})::Cstring - return ret -end - - -""" - mad_tpsa_ord(t::Ptr{RTPSA{Desc}})::Cuchar - -Gets the TPSA order. - -### Input -- `t` -- Real TPSA - -### Output -- `ret` -- Order of TPSA -""" -function mad_tpsa_ord(t::Ptr{RTPSA{Desc}})::Cuchar - ret = @ccall MAD_TPSA.mad_tpsa_ord(t::Ptr{RTPSA{Desc}})::Cuchar - return ret -end - -""" - mad_tpsa_ordv(t::Ptr{RTPSA{Desc}}, ts::Ptr{RTPSA{Desc}}...)::Cuchar - -??? - -### Input -- `t` -- TPSA -- `ts` - -### Output -- `mo` -- Order -""" -function mad_tpsa_ordv(t::Ptr{RTPSA{Desc}}, ts::Ptr{RTPSA{Desc}}...)::Cuchar - mo = @ccall MAD_TPSA.mad_tpsa_ordv(t::Ptr{RTPSA{Desc}}, ts::Ptr{RTPSA{Desc}}..., 0::Cint)::Cuchar # null pointer after args for safe use - return mo -end - - -""" - mad_tpsa_ordn(n::Cint, t::Ptr{Ptr{RTPSA{Desc}}})::Cuchar - -Gets the max order of all TPSAs in t. - -### Input -- `n` -- Number of TPSAs -- `t` -- Array of TPSAs - -### Output -- `mo` -- Maximum order of all TPSAs -""" -function mad_tpsa_ordn(n::Cint, t::Ptr{Ptr{RTPSA{Desc}}})::Cuchar - mo = @ccall MAD_TPSA.mad_tpsa_ordn(n::Cint, t::Ptr{Ptr{RTPSA{Desc}}})::Cuchar - return mo -end - - -""" - mad_tpsa_copy!(t::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}) - -Makes a copy of the real TPSA t to r. - -### Input -- `t` -- Source real TPSA -- `r` -- Destination real TPSA -""" -function mad_tpsa_copy!(t::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_copy(t::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_sclord!(t::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}, inv::Cuchar) - -??? - -### Input -- `t` -- Source real TPSA -- `r` -- Destination real TPSA -- `inv`-- scl by inverse -""" -function mad_tpsa_sclord!(t::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}, inv::Cuchar) - @ccall MAD_TPSA.mad_tpsa_sclord(t::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}, inv::Cuchar)::Cvoid -end - - -""" - mad_tpsa_getord!(t::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}, ord::Cuchar) - -??? -is ! ? - -### Input -- `t`` -- Source real TPSA -- `r` -- Destination real TPSA -- `ord` -- Order to retrieve -""" -function mad_tpsa_getord!(t::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}, ord::Cuchar) - @ccall MAD_TPSA.mad_tpsa_getord(t::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}, ord::Cuchar)::Cvoid -end - - -""" - mad_tpsa_cutord!(t::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}, ord::Cint) - -??? - -### Input -- `t` -- Source real TPSA -- `r` -- Destination real TPSA -- `ord` -- Cut order: 0..-ord or ord..mo -""" -function mad_tpsa_cutord!(t::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}, ord::Cint) - @ccall MAD_TPSA.mad_tpsa_cutord(t::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}, ord::Cint)::Cvoid -end - -""" - mad_tpsa_maxord(t::Ptr{RTPSA{Desc}}, n::Cint, idx_::Ptr{Cint})::Cint - -??? - -### Input -- `t` -- Real TPSA -- `n` -- Length of idx_ -- `idx_` - -### Output -- `mi` -- ? -""" -function mad_tpsa_maxord(t::Ptr{RTPSA{Desc}}, n::Cint, idx_::Ptr{Cint})::Cint - mi = @ccall MAD_TPSA.mad_tpsa_maxord(t::Ptr{RTPSA{Desc}}, n::Cint, idx_::Ptr{Cint})::Cint - return mi -end - -""" - mad_tpsa_convert!(t::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}, n::Cint, t2r_::Ptr{Cint}, pb::Cint) - -??? - -### Input -- `t` -- Source real TPSA -- `r` -- Destination real TPSA -- `n` -- Length of vector -- `t2r_` -- Vector of index lookup -- `pb` -- Poisson bracket, 0,1:fwd,-1:bwd -""" -function mad_tpsa_convert!(t::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}, n::Cint, t2r_::Ptr{Cint}, pb::Cint) - @ccall MAD_TPSA.mad_tpsa_convert(t::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}, n::Cint, t2r_::Ptr{Cint}, pb::Cint)::Cvoid -end - - -""" - mad_tpsa_setvar!(t::Ptr{RTPSA{Desc}}, v::Cdouble, iv_::Cint, scl_::Cdouble) - -??? - -### Input -- `t` -- Real TPSA -- `v` -- 0th order value -- `iv_` -- Variable index -- `scl_` -- 1st order variable value -""" -function mad_tpsa_setvar!(t::Ptr{RTPSA{Desc}}, v::Cdouble, iv_::Cint, scl_::Cdouble) - @ccall MAD_TPSA.mad_tpsa_setvar(t::Ptr{RTPSA{Desc}}, v::Cdouble, iv_::Cint, scl_::Cdouble)::Cvoid -end - - -""" - mad_tpsa_setnam!(t::Ptr{RTPSA{Desc}}, nam::Cstring) - -Sets the name of the tpsa. - -### Input -- `t` -- Real TPSA -- `nam` -- Name to set for tpsa -""" -function mad_tpsa_setnam!(t::Ptr{RTPSA{Desc}}, nam::Cstring) - @ccall MAD_TPSA.mad_tpsa_setnam(t::Ptr{RTPSA{Desc}}, nam::Cstring)::Cvoid -end - - -""" - mad_tpsa_clear!(tpsa::Ptr{RTPSA{Desc}}) - -Clears the TPSA (reset to 0) - -### Input -- `t` -- Real TPSA -""" -function mad_tpsa_clear!(t::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_clear(t::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_isnul(t::Ptr{RTPSA{Desc}})::Cuchar - -??? checks if null c2i? - -### Input -- `t` -- Real TPSA to check - -### Output -- `ret` -- True or false -""" -function mad_tpsa_isnul(t::Ptr{RTPSA{Desc}})::Cuchar - ret = @ccall MAD_TPSA.mad_tpsa_isnul(t::Ptr{RTPSA{Desc}})::Cuchar - return ret -end - - -""" - mad_tpsa_mono(t::Ptr{RTPSA{Desc}}, i::Cint, n::Cint, m_::Ptr{Cuchar})::Cuchar - -### Input -- `t` -- `i` -- `n` -- `m_` - -### Output -- `ret` -""" -function mad_tpsa_mono(t::Ptr{RTPSA{Desc}}, i::Cint, n::Cint, m_::Ptr{Cuchar})::Cuchar - ret = @ccall MAD_TPSA.mad_tpsa_mono(t::Ptr{RTPSA{Desc}}, i::Cint, n::Cint, m_::Ptr{Cuchar})::Cuchar - return ret -end - - -""" - mad_tpsa_idxs(t::Ptr{RTPSA{Desc}}, n::Cint, s::Cstring)::Cint - -### Input -- `t` -- `n` -- `s` - -### Output -- `ret` -""" -function mad_tpsa_idxs(t::Ptr{RTPSA{Desc}}, n::Cint, s::Cstring)::Cint - ret = @ccall MAD_TPSA.mad_tpsa_idxs(t::Ptr{RTPSA{Desc}}, n::Cint, s::Cstring)::Cint - return ret -end - - - -""" - mad_tpsa_idxm(t::Ptr{RTPSA{Desc}}, n::Cint, m::Ptr{Cuchar})::Cint - - -??? - -### Input -- `t` -- `n` -- `m` - -### Output -- `ret` -""" -function mad_tpsa_idxm(t::Ptr{RTPSA{Desc}}, n::Cint, m::Ptr{Cuchar})::Cint - ret = @ccall MAD_TPSA.mad_tpsa_idxm(t::Ptr{RTPSA{Desc}}, n::Cint, m::Ptr{Cuchar})::Cint - return ret -end - - -""" - mad_tpsa_idxsm(t::Ptr{RTPSA{Desc}}, n::Cint, m::Ptr{Cint})::Cint - -??? - -### Input -- `t` -- `n` -- `m` - -### Output -- `ret` -""" -function mad_tpsa_idxsm(t::Ptr{RTPSA{Desc}}, n::Cint, m::Ptr{Cint})::Cint - ret = @ccall MAD_TPSA.mad_tpsa_idxsm(t::Ptr{RTPSA{Desc}}, n::Cint, m::Ptr{Cint})::Cint - return ret -end - - -""" - mad_tpsa_cycle(t::Ptr{RTPSA{Desc}}, i::Cint, n::Cint, m_::Ptr{Cuchar}, v_::Ptr{Cdouble})::Cint - -??? - -### Input -- `t` -- `i` -- `n` -- `m_` -- `v_` - -### Output -- `i` -""" -function mad_tpsa_cycle(t::Ptr{RTPSA{Desc}}, i::Cint, n::Cint, m_::Ptr{Cuchar}, v_::Ptr{Cdouble})::Cint - i = @ccall MAD_TPSA.mad_tpsa_cycle(t::Ptr{RTPSA{Desc}}, i::Cint, n::Cint, m_::Ptr{Cuchar}, v_::Ptr{Cdouble})::Cint - return i -end - - -""" - mad_tpsa_get0(t::Ptr{RTPSA{Desc}})::Cdouble - -??? - -### Input -- `t` - -### Output -- `ret` -""" -function mad_tpsa_get0(t::Ptr{RTPSA{Desc}})::Cdouble - ret = @ccall MAD_TPSA.mad_tpsa_get0(t::Ptr{RTPSA{Desc}})::Cdouble - return ret -end - - -""" - mad_tpsa_geti(t::Ptr{RTPSA{Desc}}, i::Cint)::Cdouble - -??? - -### Input -- `t` -- `i` - -### Output -- `ret` -""" -function mad_tpsa_geti(t::Ptr{RTPSA{Desc}}, i::Cint)::Cdouble - ret = @ccall MAD_TPSA.mad_tpsa_geti(t::Ptr{RTPSA{Desc}}, i::Cint)::Cdouble - return ret -end - - -""" - mad_tpsa_gets(t::Ptr{RTPSA{Desc}}, n::Cint, s::Cstring)::Cdouble - -??? - -### Input -- `t` -- `n` -- `s` - -### Output -- `ret` -""" -function mad_tpsa_gets(t::Ptr{RTPSA{Desc}}, n::Cint, s::Cstring)::Cdouble - ret = @ccall MAD_TPSA.mad_tpsa_gets(t::Ptr{RTPSA{Desc}}, n::Cint, s::Cstring)::Cdouble - return ret -end - - -""" - mad_tpsa_getm(t::Ptr{RTPSA{Desc}}, n::Cint, m::Ptr{Cuchar})::Cdouble - -??? - -### Input -- `t` -- `n` -- `m` - -### Output -- `ret` -""" -function mad_tpsa_getm(t::Ptr{RTPSA{Desc}}, n::Cint, m::Ptr{Cuchar})::Cdouble - val = @ccall MAD_TPSA.mad_tpsa_getm(t::Ptr{RTPSA{Desc}}, n::Cint, m::Ptr{Cuchar})::Cdouble - return ret -end - - -""" - mad_tpsa_getsm(t::Ptr{RTPSA{Desc}}, n::Cint, m::Ptr{Cint})::Cdouble - -??? - -### Input -- `t` -- `n` -- `m` - -### Output -- `ret` -""" -function mad_tpsa_getsm(t::Ptr{RTPSA{Desc}}, n::Cint, m::Ptr{Cint})::Cdouble - ret = @ccall MAD_TPSA.mad_tpsa_getsm(t::Ptr{RTPSA{Desc}}, n::Cint, m::Ptr{Cint})::Cdouble - return ret -end - - -""" - mad_tpsa_set0!(t::Ptr{RTPSA{Desc}}, a::Cdouble, b::Cdouble) - -??? - -### Input -- `t` -- `a` -- `b` -""" -function mad_tpsa_set0!(t::Ptr{RTPSA{Desc}}, a::Cdouble, b::Cdouble) - @ccall MAD_TPSA.mad_tpsa_set0(t::Ptr{RTPSA{Desc}}, a::Cdouble, b::Cdouble)::Cvoid -end - - -""" - mad_tpsa_seti!(t::Ptr{RTPSA{Desc}}, i::Cint, a::Cdouble, b::Cdouble) - -??? - -### Input -- `t` -- `i` -- `a` -- `b` -""" -function mad_tpsa_seti!(t::Ptr{RTPSA{Desc}}, i::Cint, a::Cdouble, b::Cdouble) - @ccall MAD_TPSA.mad_tpsa_seti(t::Ptr{RTPSA{Desc}}, i::Cint, a::Cdouble, b::Cdouble)::Cvoid -end - - -""" - mad_tpsa_sets!(t::Ptr{RTPSA{Desc}}, n::Cint, s::Cstring, a::Cdouble, b::Cdouble) - -??? - -### Input -- `t` -- `n` -- `s` -- `a` -- `b` -""" -function mad_tpsa_sets!(t::Ptr{RTPSA{Desc}}, n::Cint, s::Cstring, a::Cdouble, b::Cdouble) - @ccall MAD_TPSA.mad_tpsa_sets(t::Ptr{RTPSA{Desc}}, n::Cint, s::Cstring, a::Cdouble, b::Cdouble)::Cvoid -end - - -""" - mad_tpsa_setm!(t::Ptr{RTPSA{Desc}}, n::Cint, m::Ptr{Cuchar}, a::Cdouble, b::Cdouble) - -??? - -### Input -- `t` -- `n` -- `m` -- `a` -- `b` -""" -function mad_tpsa_setm!(t::Ptr{RTPSA{Desc}}, n::Cint, m::Ptr{Cuchar}, a::Cdouble, b::Cdouble) - @ccall MAD_TPSA.mad_tpsa_setm(t::Ptr{RTPSA{Desc}}, n::Cint, m::Ptr{Cuchar}, a::Cdouble, b::Cdouble)::Cvoid -end - - -""" - mad_tpsa_setsm!(t::Ptr{RTPSA{Desc}}, n::Cint, m::Ptr{Cint}, a::Cdouble, b::Cdouble) - -??? - -### Input -- `t` -- `n` -- `m` -- `a` -- `b` -""" -function mad_tpsa_setsm!(t::Ptr{RTPSA{Desc}}, n::Cint, m::Ptr{Cint}, a::Cdouble, b::Cdouble) - @ccall MAD_TPSA.mad_tpsa_setsm(t::Ptr{RTPSA{Desc}}, n::Cint, m::Ptr{Cint}, a::Cdouble, b::Cdouble)::Cvoid -end - - -""" - mad_tpsa_getv!(t::Ptr{RTPSA{Desc}}, i::Cint, n::Cint, v::Ptr{Cdouble}) - -??? - -### Input -- `t` -- `i` -- `n` -- `v` -""" -function mad_tpsa_getv!(t::Ptr{RTPSA{Desc}}, i::Cint, n::Cint, v::Ptr{Cdouble}) - @ccall MAD_TPSA.mad_tpsa_getv(t::Ptr{RTPSA{Desc}}, i::Cint, n::Cint, v::Ptr{Cdouble})::Cvoid -end - - - -""" - mad_tpsa_setv!(t::Ptr{RTPSA{Desc}}, i::Cint, n::Cint, v::Ptr{Cdouble}) - -??? - -### Input -- `t` -- `i` -- `n` -- `v` -""" -function mad_tpsa_setv!(t::Ptr{RTPSA{Desc}}, i::Cint, n::Cint, v::Ptr{Cdouble}) - @ccall MAD_TPSA.mad_tpsa_setv(t::Ptr{RTPSA{Desc}}, i::Cint, n::Cint, v::Ptr{Cdouble})::Cvoid -end - - -""" - mad_tpsa_equ(a::Ptr{RTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, tol_::Cdouble)::Cuchar - -Checks if the TPSAs a and b are equal within the specified tolerance tol_ - -### Input -- `a` -- TPSA a -- `b` -- TPSA b -- `tol_` -- difference below which the TPSAs are considered equal - -### Output -- `ret` - True if a == b within tol_ -""" -function mad_tpsa_equ(a::Ptr{RTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, tol_::Cdouble)::Cuchar - ret = @ccall MAD_TPSA.mad_tpsa_equ(a::Ptr{RTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, tol_::Cdouble)::Cuchar - return ret -end - - -""" - mad_tpsa_dif!(a::Ptr{RTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - -??? // (a_i-b_i)/max(|a_i|,1) - -### Input -- `a` -- Source TPSA a -- `b` -- Source TPSA b -- `c` -- Destination TPSA c -""" -function mad_tpsa_dif!(a::Ptr{RTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_dif(a::Ptr{RTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_add!(a::Ptr{RTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - -Sets the destination TPSA c = a + b - -### Input -- `a` -- Source TPSA a -- `b` -- Source TPSA b -- `c` -- Destination TPSA c = a + b -""" -function mad_tpsa_add!(a::Ptr{RTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_add(a::Ptr{RTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_sub!(a::Ptr{RTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - -Sets the destination TPSA c = a - b - -### Input -- `a` -- Source TPSA a -- `b` -- Source TPSA b -- `c` -- Destination TPSA c = a - b -""" -function mad_tpsa_sub!(a::Ptr{RTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_sub(a::Ptr{RTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_mul!(a::Ptr{RTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - -Sets the destination TPSA c = a * b - -### Input -- `a` -- Source TPSA a -- `b` -- Source TPSA b -- `c` -- Destination TPSA c = a * b -""" -function mad_tpsa_mul!(a::Ptr{RTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_mul(a::Ptr{RTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_div!(a::Ptr{RTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - -Sets the destination TPSA c = a / b - -### Input -- `a` -- Source TPSA a -- `b` -- Source TPSA b -- `c` -- Destination TPSA c = a / b -""" -function mad_tpsa_div!(a::Ptr{RTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_div(a::Ptr{RTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_pow!(a::Ptr{RTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - -Sets the destination TPSA c = a ^ b - -### Input -- `a` -- Source TPSA a -- `b` -- Source TPSA b -- `c` -- Destination TPSA c = a ^ b -""" -function mad_tpsa_pow!(a::Ptr{RTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_pow(a::Ptr{RTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_powi!(a::Ptr{RTPSA{Desc}}, n::Cint, c::Ptr{RTPSA{Desc}}) - -Sets the destination TPSA c = a ^ n where n is an integer. - -### Input -- `a` -- Source TPSA a -- `n` -- Integer power -- `c` -- Destination TPSA c = a ^ n -""" -function mad_tpsa_powi!(a::Ptr{RTPSA{Desc}}, n::Cint, c::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_powi(a::Ptr{RTPSA{Desc}}, n::Cint, c::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_pown!(a::Ptr{RTPSA{Desc}}, v::Cdouble, c::Ptr{RTPSA{Desc}}) - -Sets the destination TPSA c = a ^ v where v is of double precision. - -### Input -- `a` -- Source TPSA a -- `v` -- "double" precision power -- `c` -- Destination TPSA c = a ^ v -""" -function mad_tpsa_pown!(a::Ptr{RTPSA{Desc}}, v::Cdouble, c::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_pown(a::Ptr{RTPSA{Desc}}, v::Cdouble, c::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_nrm(a::Ptr{RTPSA{Desc}})::Cdouble - -Calculates the norm of (which???) of TPSA a. - -### Input -- `a` -- TPSA - -### Output -- `nrm` -- Norm of TPSA a -""" -function mad_tpsa_nrm(a::Ptr{RTPSA{Desc}})::Cdouble - nrm = @ccall MAD_TPSA.mad_tpsa_nrm(a::Ptr{RTPSA{Desc}}, tpsa_b_::Ptr{RTPSA{Desc}})::Cdouble - return nrm -end - - -""" - mad_tpsa_abs!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - -Sets TPSA c to the absolute value of TPSA a. - -### Input -- `a` -- Source TPSA a -- `c` -- Destination TPSA c = |a| -""" -function mad_tpsa_abs!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_abs(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_sqrt!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - -Sets TPSA c to the sqrt of TPSA a. - -### Input -- `a` -- Source TPSA a -- `c` -- Destination TPSA c = sqrt(a) -""" -function mad_tpsa_sqrt!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_sqrt(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_exp!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - -Sets TPSA c to the exponential of TPSA a. - -### Input -- `a` -- Source TPSA a -- `c` -- Destination TPSA c = exp(a) -""" -function mad_tpsa_exp!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_exp(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid -end - - - -""" - mad_tpsa_log!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - -Sets TPSA c to the log of TPSA a. - -### Input -- `a` -- Source TPSA a -- `c` -- Destination TPSA c = log(a) -""" -function mad_tpsa_log!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_log(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_sincos!(a::Ptr{RTPSA{Desc}}, s::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - -Sets TPSA s = sin(a) and TPSA c = cos(a) - -### Input -- `a` -- Source TPSA a -- `s` -- Destination TPSA s = sin(a) -- `c` -- Destination TPSA c = cos(a) -""" -function mad_tpsa_sincos!(a::Ptr{RTPSA{Desc}}, s::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_sincos(a::Ptr{RTPSA{Desc}}, s::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_sin!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - -Sets TPSA c to the sin of TPSA a. - -### Input -- `a` -- Source TPSA a -- `c` -- Destination TPSA c = sin(a) -""" -function mad_tpsa_sin!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_sin(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_cos!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - -Sets TPSA c to the cos of TPSA a. - -### Input -- `a` -- Source TPSA a -- `c` -- Destination TPSA c = cos(a) -""" -function mad_tpsa_cos!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_cos(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_tan!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - -Sets TPSA c to the tan of TPSA a. - -### Input -- `a` -- Source TPSA a -- `c` -- Destination TPSA c = tan(a) -""" -function mad_tpsa_tan!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_tan(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_cot!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - -Sets TPSA c to the cot of TPSA a. - -### Input -- `a` -- Source TPSA a -- `c` -- Destination TPSA c = cot(a) -""" -function mad_tpsa_cot!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_cot(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_sinc!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - -Sets TPSA c to the sinc of TPSA a. - -### Input -- `a` -- Source TPSA a -- `c` -- Destination TPSA c = sinc(a) -""" -function mad_tpsa_sinc!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_sinc(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_sincosh!(a::Ptr{RTPSA{Desc}}, s::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - -Sets TPSA s = sinh(a) and TPSA c = cosh(a) - -### Input -- `a` -- Source TPSA a -- `s` -- Destination TPSA s = sinh(a) -- `c` -- Destination TPSA c = cosh(a) -""" -function mad_tpsa_sincosh!(a::Ptr{RTPSA{Desc}}, s::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_sincosh(a::Ptr{RTPSA{Desc}}, s::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_sinh!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - - Sets TPSA c to the sinh of TPSA a. - -### Input -- `a` -- Source TPSA a -- `c` -- Destination TPSA c = sinh(a) -""" -function mad_tpsa_sinh!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_sinh(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_cosh!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - -Sets TPSA c to the cosh of TPSA a. - -### Input -- `a` -- Source TPSA a -- `c` -- Destination TPSA c = cosh(a) -""" -function mad_tpsa_cosh!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_cosh(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_tanh!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - -Sets TPSA c to the tanh of TPSA a. - -### Input -- `a` -- Source TPSA a -- `c` -- Destination TPSA c = tanh(a) -""" -function mad_tpsa_tanh!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_tanh(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_coth!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - -Sets TPSA c to the coth of TPSA a. - -### Input -- `a` -- Source TPSA a -- `c` -- Destination TPSA c = coth(a) -""" -function mad_tpsa_coth!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_coth(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_sinhc!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - -Sets TPSA c to the sinhc of TPSA a. - -### Input -- `a` -- Source TPSA a -- `c` -- Destination TPSA c = sinhc(a) -""" -function mad_tpsa_sinhc!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_sinhc(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_asin!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - -Sets TPSA c to the asin of TPSA a. - -### Input -- `a` -- Source TPSA a -- `c` -- Destination TPSA c = asin(a) -""" -function mad_tpsa_asin!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_asin(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_acos!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - -Sets TPSA c to the acos of TPSA a. - -### Input -- `a` -- Source TPSA a -- `c` -- Destination TPSA c = acos(a) -""" -function mad_tpsa_acos!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_acos(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_atan!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - -Sets TPSA c to the atan of TPSA a. - -### Input -- `a` -- Source TPSA a -- `c` -- Destination TPSA c = atan(a) -""" -function mad_tpsa_atan!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_atan(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_acot!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - -Sets TPSA c to the acot of TPSA a. - -### Input -- `a` -- Source TPSA a -- `c` -- Destination TPSA c = acot(a) -""" -function mad_tpsa_acot!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_acot(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid -end - -""" - mad_tpsa_asinc!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - -Sets TPSA c to the asinc of TPSA a. - -### Input -- `a` -- Source TPSA a -- `c` -- Destination TPSA c = asinc(a) -""" -function mad_tpsa_asinc!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_asinc(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_asinh!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - -Sets TPSA c to the asinh of TPSA a. - -### Input -- `a` -- Source TPSA a -- `c` -- Destination TPSA c = asinh(a) -""" -function mad_tpsa_asinh!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_asinh(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_acosh!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - -Sets TPSA c to the acosh of TPSA a. - -### Input -- `a` -- Source TPSA a -- `c` -- Destination TPSA c = acosh(a) -""" -function mad_tpsa_acosh!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_acosh(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_atanh!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - -Sets TPSA c to the atanh of TPSA a. - -### Input -- `a` -- Source TPSA a -- `c` -- Destination TPSA c = atanh(a) -""" -function mad_tpsa_atanh!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_atanh(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_acoth!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - -Sets TPSA c to the acoth of TPSA a. - -### Input -- `a` -- Source TPSA a -- `c` -- Destination TPSA c = acoth(a) -""" -function mad_tpsa_acoth!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_acoth(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_asinhc!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - -Sets TPSA c to the asinhc of TPSA a. - -### Input -- `a` -- Source TPSA a -- `c` -- Destination TPSA c = asinhc(a) -""" -function mad_tpsa_asinhc!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_asinhc(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_erf!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - -Sets TPSA c to the erf of TPSA a. - -### Input -- `a` -- Source TPSA a -- `c` -- Destination TPSA c = erf(a) -""" -function mad_tpsa_erf!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_erf(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_erfc!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - -Sets TPSA c to the erfc of TPSA a. - -### Input -- `a` -- Source TPSA a -- `c` -- Destination TPSA c = erfc(a) -""" -function mad_tpsa_erfc!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_erfc(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_acc!(a::Ptr{RTPSA{Desc}}, v::Cdouble, c::Ptr{RTPSA{Desc}}) - -Adds a*v to TPSA c. Aliasing OK. - -### Input -- `a` -- Source TPSA a -- `v` -- Scalar with double precision -- `c` -- Destination TPSA c += v*a -""" -function mad_tpsa_acc!(a::Ptr{RTPSA{Desc}}, v::Cdouble, c::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_acc(a::Ptr{RTPSA{Desc}}, v::Cdouble, c::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_scl!(a::Ptr{RTPSA{Desc}}, v::Cdouble, c::Ptr{RTPSA{Desc}}) - -Sets TPSA c to v*a. - -### Input -- `a` -- Source TPSA a -- `v` -- Scalar with double precision -- `c` -- Destination TPSA c = v*a -""" -function mad_tpsa_scl!(a::Ptr{RTPSA{Desc}}, v::Cdouble, c::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_scl(a::Ptr{RTPSA{Desc}}, v::Cdouble, c::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_inv!(a::Ptr{RTPSA{Desc}}, v::Cdouble, c::Ptr{RTPSA{Desc}}) - -Sets TPSA c to v/a. - -### Input -- `a` -- Source TPSA a -- `v` -- Scalar with double precision -- `c` -- Destination TPSA c = v*a -""" -function mad_tpsa_inv!(a::Ptr{RTPSA{Desc}}, v::Cdouble, c::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_inv(a::Ptr{RTPSA{Desc}}, v::Cdouble, c::Ptr{RTPSA{Desc}})::Cvoid -end - -""" - mad_tpsa_invsqrt!(a::Ptr{RTPSA{Desc}}, v::Cdouble, c::Ptr{RTPSA{Desc}}) - -Sets TPSA c to v/sqrt(a). - -### Input -- `a` -- Source TPSA a -- `v` -- Scalar with double precision -- `c` -- Destination TPSA c = v*a -""" -function mad_tpsa_invsqrt!(a::Ptr{RTPSA{Desc}}, v::Cdouble, c::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_invsqrt(a::Ptr{RTPSA{Desc}}, v::Cdouble, c::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_unit!(x::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}) - -??? - -### Input -- `x` -- Source TPSA x -- `r` -- Destination TPSA r -""" -function mad_tpsa_unit!(x::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA. mad_tpsa_unit(x::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_atan2!(x::Ptr{RTPSA{Desc}}, y::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}) - -Sets TPSA r to atan2(x,y) - -### Input -- `x` -- Source TPSA x -- `y` -- Source TPSA y -- `r` -- Destination TPSA r = atan2(x,y) -""" -function mad_tpsa_atan2!(x::Ptr{RTPSA{Desc}}, y::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA. mad_tpsa_atan2(x::Ptr{RTPSA{Desc}}, y::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}})::Cvoid -end - -""" - mad_tpsa_hypot!(x::Ptr{RTPSA{Desc}}, y::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}) - -Sets TPSA r to sqrt(x^2+y^2) - -### Input -- `x` -- Source TPSA x -- `y` -- Source TPSA y -- `r` -- Destination TPSA r = sqrt(x^2+y^2) -""" -function mad_tpsa_hypot!(x::Ptr{RTPSA{Desc}}, y::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA. mad_tpsa_hypot(x::Ptr{RTPSA{Desc}}, y::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}})::Cvoid -end - -""" - mad_tpsa_hypot3!(x::Ptr{RTPSA{Desc}}, y::Ptr{RTPSA{Desc}}, z::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}) - -Sets TPSA r to sqrt(x^2+y^2+z^2) - -### Input -- `x` -- Source TPSA x -- `y` -- Source TPSA y -- `z` -- Source TPSA z -- `r` -- Destination TPSA r = sqrt(x^2+y^2) -""" -function mad_tpsa_hypot3!(x::Ptr{RTPSA{Desc}}, y::Ptr{RTPSA{Desc}}, z::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA. mad_tpsa_hypot3(x::Ptr{RTPSA{Desc}}, y::Ptr{RTPSA{Desc}}, z::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}})::Cvoid -end - - - -""" - mad_tpsa_integ!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}, iv::Cint) - -??? Integrates TPSA - -### Input -- `a` -- Source TPSA to integrate -- `c` -- Destination TPSA -- `iv` -- Domain -""" -function mad_tpsa_integ!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}, iv::Cint) - @ccall MAD_TPSA.mad_tpsa_integ(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}, iv::Cint)::Cvoid -end - - -""" - mad_tpsa_deriv!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}, iv::Cint) - -??? Differentiates TPSA - -### Input -- `a` -- Source TPSA to differentiate -- `c` -- Destination TPSA -- `iv` -- Domain -""" -function mad_tpsa_deriv!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}, iv::Cint) - @ccall MAD_TPSA.mad_tpsa_deriv(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}, iv::Cint)::Cvoid -end - - -""" - mad_tpsa_derivm!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}, n::Cint, m::Ptr{Cuchar}) - -??? - -### Input -- `a` -- `c` -- `n` -- `m` -""" -function mad_tpsa_derivm!(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}, n::Cint, m::Ptr{Cuchar}) - @ccall MAD_TPSA.mad_tpsa_derivm(a::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}, n::Cint, m::Ptr{Cuchar})::Cvoid -end - - -""" - mad_tpsa_poisbra!(a::Ptr{RTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}, nv::Cint) - -Sets TPSA c to the poisson bracket of TPSAs a and b. - -### Input -- `a` -- Source TPSA a -- `b` -- Source TPSA b -- `c` -- Destination TPSA c = [a, b] -- `nv` -- Number of variables in the TPSA -""" -function mad_tpsa_poisbra!(a::Ptr{RTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}, nv::Cint) - @ccall MAD_TPSA.mad_tpsa_poisbra(a::Ptr{RTPSA{Desc}}, b::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}, nv::Cint)::Cvoid -end - - -""" - mad_tpsa_taylor!(a::Ptr{RTPSA{Desc}}, n::Cint, coef::Ptr{Cdouble}, c::Ptr{RTPSA{Desc}}) - -??? - -### Input -- `a` -- `n` -- `coef` -- `c` -""" -function mad_tpsa_taylor!(a::Ptr{RTPSA{Desc}}, n::Cint, coef::Ptr{Cdouble}, c::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_taylor(a::Ptr{RTPSA{Desc}}, n::Cint, coef::Ptr{Cdouble}, c::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_axpb!(a::Cdouble, x::Ptr{RTPSA{Desc}}, b::Cdouble, r::Ptr{RTPSA{Desc}}) - -??? r = a*x/b? - -### Input -- `a` -- `x` -- `b` -- `r` -""" -function mad_tpsa_axpb!(a::Cdouble, x::Ptr{RTPSA{Desc}}, b::Cdouble, r::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_axpb(a::Cdouble, x::Ptr{RTPSA{Desc}}, b::Cdouble, r::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_axpbypc!(a::Cdouble, x::Ptr{RTPSA{Desc}}, b::Cdouble, y::Ptr{RTPSA{Desc}}, c::Cdouble, r::Ptr{RTPSA{Desc}}) - -### Input -- `a` -- `x` -- `b` -- `y` -- `c` -- `r` -""" -function mad_tpsa_axpbypc!(a::Cdouble, x::Ptr{RTPSA{Desc}}, b::Cdouble, y::Ptr{RTPSA{Desc}}, c::Cdouble, r::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_axpbypc(a::Cdouble, x::Ptr{RTPSA{Desc}}, b::Cdouble, y::Ptr{RTPSA{Desc}}, c::Cdouble, r::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_axypb!(a::Cdouble, x::Ptr{RTPSA{Desc}}, y::Ptr{RTPSA{Desc}}, b::Cdouble, r::Ptr{RTPSA{Desc}}) - -??? - -### Input -- `a` -- `x` -- `y` -- `b` -- `r` -""" -function mad_tpsa_axypb!(a::Cdouble, x::Ptr{RTPSA{Desc}}, y::Ptr{RTPSA{Desc}}, b::Cdouble, r::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_axypb(a::Cdouble, x::Ptr{RTPSA{Desc}}, y::Ptr{RTPSA{Desc}}, b::Cdouble, r::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_axypbzpc!(a::Cdouble, x::Ptr{RTPSA{Desc}}, y::Ptr{RTPSA{Desc}}, b::Cdouble, z::Ptr{RTPSA{Desc}}, c::Cdouble, r::Ptr{RTPSA{Desc}}) - -??? - -### Input -- `a` -- `x` -- `y` -- `b` -- `z` -- `c` -- `r` -""" -function mad_tpsa_axypbzpc!(a::Cdouble, x::Ptr{RTPSA{Desc}}, y::Ptr{RTPSA{Desc}}, b::Cdouble, z::Ptr{RTPSA{Desc}}, c::Cdouble, r::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_axypbzpc(a::Cdouble, x::Ptr{RTPSA{Desc}}, y::Ptr{RTPSA{Desc}}, b::Cdouble, z::Ptr{RTPSA{Desc}}, c::Cdouble, r::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_axypbvwpc!(a::Cdouble, x::Ptr{RTPSA{Desc}}, y::Ptr{RTPSA{Desc}}, b::Cdouble, v::Ptr{RTPSA{Desc}}, w::Ptr{RTPSA{Desc}}, c::Cdouble, r::Ptr{RTPSA{Desc}}) - -??? - -### Input -- `a` -- `x` -- `y` -- `b` -- `v` -- `w` -- `c` -- `r` -""" -function mad_tpsa_axypbvwpc!(a::Cdouble, x::Ptr{RTPSA{Desc}}, y::Ptr{RTPSA{Desc}}, b::Cdouble, v::Ptr{RTPSA{Desc}}, w::Ptr{RTPSA{Desc}}, c::Cdouble, r::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_axypbvwpc(a::Cdouble, x::Ptr{RTPSA{Desc}}, y::Ptr{RTPSA{Desc}}, b::Cdouble, v::Ptr{RTPSA{Desc}}, w::Ptr{RTPSA{Desc}}, c::Cdouble, r::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_ax2pby2pcz2!(a::Cdouble, x::Ptr{RTPSA{Desc}}, b::Cdouble, y::Ptr{RTPSA{Desc}}, c::Cdouble, z::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}) - -??? - -### Input -- `a` -- `x` -- `b` -- `y` -- `c` -- `z` -- `r` -""" -function mad_tpsa_ax2pby2pcz2!(a::Cdouble, x::Ptr{RTPSA{Desc}}, b::Cdouble, y::Ptr{RTPSA{Desc}}, c::Cdouble, z::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_ax2pby2pcz2(a::Cdouble, x::Ptr{RTPSA{Desc}}, b::Cdouble, y::Ptr{RTPSA{Desc}}, c::Cdouble, z::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_axpsqrtbpcx2!(x::Ptr{RTPSA{Desc}}, a::Cdouble, b::Cdouble, c::Cdouble, r::Ptr{RTPSA{Desc}}) - -??? - -### Input -- `x` -- `a` -- `b` -- `c` -- `r` -""" -function mad_tpsa_axpsqrtbpcx2!(x::Ptr{RTPSA{Desc}}, a::Cdouble, b::Cdouble, c::Cdouble, r::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_axpsqrtbpcx2(x::Ptr{RTPSA{Desc}}, a::Cdouble, b::Cdouble, c::Cdouble, r::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_logaxpsqrtbpcx2!(x::Ptr{RTPSA{Desc}}, a::Cdouble, b::Cdouble, c::Cdouble, r::Ptr{RTPSA{Desc}}) - -??? - -### Input -- `x` -- `a` -- `b` -- `c` -- `r` -""" -function mad_tpsa_logaxpsqrtbpcx2!(x::Ptr{RTPSA{Desc}}, a::Cdouble, b::Cdouble, c::Cdouble, r::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_logaxpsqrtbpcx2(x::Ptr{RTPSA{Desc}}, a::Cdouble, b::Cdouble, c::Cdouble, r::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_logxdy!(x::Ptr{RTPSA{Desc}}, y::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}) - -??? - -### Input -- `x` -- `y` -- `r` -""" -function mad_tpsa_logxdy!(x::Ptr{RTPSA{Desc}}, y::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_logxdy(x::Ptr{RTPSA{Desc}}, y::Ptr{RTPSA{Desc}}, r::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_vec2fld!(na::Cint, a::Ptr{RTPSA{Desc}}, mc::Ptr{Ptr{RTPSA{Desc}}}) - -??? - -### Input -- `na` -- `a` -- `mc` -""" -function mad_tpsa_vec2fld!(na::Cint, a::Ptr{RTPSA{Desc}}, mc::Ptr{Ptr{RTPSA{Desc}}}) - @ccall MAD_TPSA.mad_tpsa_vec2fld(na::Cint, a::Ptr{RTPSA{Desc}}, mc::Ptr{Ptr{RTPSA{Desc}}})::Cvoid -end - - -""" - mad_tpsa_fld2vec!(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, c::Ptr{RTPSA{Desc}}) - -??? - -### Input -- `na` -- `ma` -- `c` -""" -function mad_tpsa_fld2vec!(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, c::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_fld2vec(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, c::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_fgrad!(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, b::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - -??? - -### Input -- `na` -- `ma` -- `b` -- `c` -""" -function mad_tpsa_fgrad!(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, b::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_fgrad(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, b::Ptr{RTPSA{Desc}}, c::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_liebra!(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, mb::Ptr{Ptr{RTPSA{Desc}}}, mc::Ptr{Ptr{RTPSA{Desc}}}) - -??? - -### Input -- `na` -- `ma` -- `mb` -- `mc` -""" -function mad_tpsa_liebra!(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, mb::Ptr{Ptr{RTPSA{Desc}}}, mc::Ptr{Ptr{RTPSA{Desc}}}) - @ccall MAD_TPSA.mad_tpsa_liebra(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, mb::Ptr{Ptr{RTPSA{Desc}}}, mc::Ptr{Ptr{RTPSA{Desc}}})::Cvoid -end - - -""" - mad_tpsa_exppb!(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, mb::Ptr{Ptr{RTPSA{Desc}}}, mc::Ptr{Ptr{RTPSA{Desc}}}) - -??? - -### Input -- `na` -- `ma` -- `mb` -- `mc` -""" -function mad_tpsa_exppb!(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, mb::Ptr{Ptr{RTPSA{Desc}}}, mc::Ptr{Ptr{RTPSA{Desc}}}) - @ccall MAD_TPSA.mad_tpsa_exppb(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, mb::Ptr{Ptr{RTPSA{Desc}}}, mc::Ptr{Ptr{RTPSA{Desc}}})::Cvoid -end - - -""" - mad_tpsa_logpb!(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, mb::Ptr{Ptr{RTPSA{Desc}}}, mc::Ptr{Ptr{RTPSA{Desc}}}) - -??? - -### Input -- `na` -- `ma` -- `mb` -- `mc` -""" -function mad_tpsa_logpb!(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, mb::Ptr{Ptr{RTPSA{Desc}}}, mc::Ptr{Ptr{RTPSA{Desc}}}) - @ccall MAD_TPSA.mad_tpsa_logpb(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, mb::Ptr{Ptr{RTPSA{Desc}}}, mc::Ptr{Ptr{RTPSA{Desc}}})::Cvoid -end - - - -""" - mad_tpsa_mnrm(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}})::Cdouble - -??? - -### Input -- `na` -- `ma` - -### Output -- `nrm` -""" -function mad_tpsa_mnrm(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}})::Cdouble - nrm = @ccall MAD_TPSA.mad_tpsa_mnrm(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}})::Cdouble - return nrm -end - - -""" - mad_tpsa_minv!(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, mc::Ptr{Ptr{RTPSA{Desc}}}) - -??? - -### Input -- `na` -- `ma` -- `mc` -""" -function mad_tpsa_minv!(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, mc::Ptr{Ptr{RTPSA{Desc}}}) - @ccall MAD_TPSA.mad_tpsa_minv(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, mc::Ptr{Ptr{RTPSA{Desc}}})::Cvoid -end - - -""" - mad_tpsa_pminv!(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, mc::Ptr{Ptr{RTPSA{Desc}}}, select::Ptr{Cint}) - -??? - -### Input -- `na` -- `ma` -- `mc` -- `select` -""" -function mad_tpsa_pminv!(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, mc::Ptr{Ptr{RTPSA{Desc}}}, select::Ptr{Cint}) - @ccall MAD_TPSA.mad_tpsa_pminv(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, mc::Ptr{Ptr{RTPSA{Desc}}}, select::Ptr{Cint})::Cvoid -end - - -""" - mad_tpsa_compose!(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, nb::Cint, mb::Ptr{Ptr{RTPSA{Desc}}}, mc::Ptr{Ptr{RTPSA{Desc}}}) - -??? - -### Input -- `na` -- `ma` -- `nb` -- `mb` -- `mc` -""" -function mad_tpsa_compose!(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, nb::Cint, mb::Ptr{Ptr{RTPSA{Desc}}}, mc::Ptr{Ptr{RTPSA{Desc}}}) - @ccall MAD_TPSA.mad_tpsa_compose(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, nb::Cint, mb::Ptr{Ptr{RTPSA{Desc}}}, mc::Ptr{Ptr{RTPSA{Desc}}})::Cvoid -end - - -""" - mad_tpsa_translate!(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, nb::Cint, tb::Ptr{Cdouble}, mc::Ptr{RTPSA{Desc}}) - -??? - -### Input -- `na` -- `ma` -- `nb` -- `tb` -- `mc` -""" -function mad_tpsa_translate!(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, nb::Cint, tb::Ptr{Cdouble}, mc::Ptr{RTPSA{Desc}}) - @ccall MAD_TPSA.mad_tpsa_translate(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, nb::Cint, tb::Ptr{Cdouble}, mc::Ptr{RTPSA{Desc}})::Cvoid -end - - -""" - mad_tpsa_eval!(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, nb::Cint, tb::Ptr{Cdouble}, tc::Ptr{Cdouble}) - -??? - -### Input -- `na` -- `ma` -- `nb` -- `tb` -- `tc` -""" -function mad_tpsa_eval!(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, nb::Cint, tb::Ptr{Cdouble}, tc::Ptr{Cdouble}) - @ccall MAD_TPSA.mad_tpsa_eval(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, nb::Cint, tb::Ptr{Cdouble}, tc::Ptr{Cdouble})::Cvoid -end - - -""" - mad_tpsa_mconv!(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, nc::Cint, mc::Ptr{Ptr{RTPSA{Desc}}}, n::Cint, t2r_::Ptr{Cint}, pb::Cint) - -??? - -### Input -- `na` -- `ma` -- `nc` -- `mc` -- `n` -- `t2r_` -- `pb` -""" -function mad_tpsa_mconv!(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, nc::Cint, mc::Ptr{Ptr{RTPSA{Desc}}}, n::Cint, t2r_::Ptr{Cint}, pb::Cint) - @ccall MAD_TPSA.mad_tpsa_mconv(na::Cint, ma::Ptr{Ptr{RTPSA{Desc}}}, nc::Cint, mc::Ptr{Ptr{RTPSA{Desc}}}, n::Cint, t2r_::Ptr{Cint}, pb::Cint)::Cvoid -end - - -""" - mad_tpsa_print(t::Ptr{RTPSA{Desc}}, name_::Cstring, eps_::Cdouble, nohdr_::Cint, stream_::Ptr{Cvoid}) - -Prints the TPSA coefficients to stdout with precision eps_. If nohdr_ is not zero, -the header is not printed. - -### Input -- `t` -- TPSA to print -- `name_` -- Name of TPSA -- `eps_` -- Precision to output -- `nohdr_` -- If True, no header is printed -- `stream_` -- FILE pointer of output stream. If null, printed to stdout -""" -function mad_tpsa_print(t::Ptr{RTPSA{Desc}}, name_::Cstring, eps_::Cdouble, nohdr_::Cint, stream_::Ptr{Cvoid}) - @ccall MAD_TPSA.mad_tpsa_print(t::Ptr{RTPSA{Desc}}, name_::Cstring, eps_::Cdouble, nohdr_::Cint, stream_::Ptr{Cvoid})::Cvoid -end - - -""" - mad_tpsa_scan(stream_::Ptr{Cvoid})::Ptr{RTPSA{Desc}} - -Scans in a TPSA from the stream_. - -### Input -- `stream_` -- C FILE pointer I/O stream from which to read the TPSA - -### Output -- `t` -- TPSA scanned from I/O stream_ -""" -function mad_tpsa_scan(stream_::Ptr{Cvoid})::Ptr{RTPSA{Desc}} - t = @ccall MAD_TPSA.mad_tpsa_scan(stream_::Ptr{Cvoid})::Ptr{RTPSA{Desc}} - return t -end - - -""" - mad_tpsa_scan_hdr(kind_::Cint, name_::Cstring, stream_::Ptr{Cvoid})::Ptr{Desc{RTPSA,CTPSA}} - -??? - -### Input -- `kind_` -- `name_` -- `stream_` - -### Output -- `ret` -""" -function mad_tpsa_scan_hdr(kind_::Cint, name_::Cstring, stream_::Ptr{Cvoid})::Ptr{Desc{RTPSA,CTPSA}} - desc = @ccall MAD_TPSA.mad_tpsa_scan_hdr(kind_::Cint, name_::Cstring, stream_::Ptr{Cvoid})::Ptr{Desc{RTPSA,CTPSA}} - return ret -end - - -""" - mad_tpsa_scan_coef!(t::Ptr{RTPSA{Desc}}, stream_::Ptr{Cvoid}) - -??? - -### Input -- `t` -- `stream_` -""" -function mad_tpsa_scan_coef!(t::Ptr{RTPSA{Desc}}, stream_::Ptr{Cvoid}) - @ccall MAD_TPSA.mad_tpsa_scan_coef(t::Ptr{RTPSA{Desc}}, stream_::Ptr{Cvoid})::Cvoid -end - - -""" - mad_tpsa_debug(t::Ptr{RTPSA{Desc}}, name_::Cstring, fnam_::Cstring, line_::Cint, stream_::Ptr{Cvoid}) - -??? - -### Input -- `t` -- `name_` -- `fnam_` -- `line_` -- `stream_` -""" -function mad_tpsa_debug(t::Ptr{RTPSA{Desc}}, name_::Cstring, fnam_::Cstring, line_::Cint, stream_::Ptr{Cvoid}) - @ccall MAD_TPSA.mad_tpsa_debug(t::Ptr{RTPSA{Desc}}, name_::Cstring, fnam_::Cstring, line_::Cint, stream_::Ptr{Cvoid})::Cvoid -end - -""" - mad_tpsa_isvalid(t::Ptr{RTPSA{Desc}})::Cuchar - -Sanity check of the TPSA integrity. - -### Input -- `t` -- Real TPSA to check if valid - -### Output -- `ret` -- True if valid TPSA, false otherwise -""" -function mad_tpsa_isvalid(t::Ptr{RTPSA{Desc}})::Cuchar - ret = @ccall MAD_TPSA.mad_tpsa_isvalid(t::Ptr{RTPSA{Desc}})::Cuchar - return ret -end - - -""" - mad_tpsa_init(t::Ptr{RTPSA{Desc}}, d::Ptr{Desc{RTPSA,CTPSA}}, mo::Cuchar)::Ptr{RTPSA{Desc}} - -UNSAFE OPERATION! (mo vs allocated!!) ??? - -### Input -- `t` -- `d` -- `mo` - -### Output -- `t` -""" -function mad_tpsa_init!(t::Ptr{RTPSA{Desc}}, d::Ptr{Desc{RTPSA,CTPSA}}, mo::Cuchar)::Ptr{RTPSA{Desc}} - t = @ccall MAD_TPSA.mad_tpsa_init(t::Ptr{RTPSA{Desc}}, d::Ptr{Desc{RTPSA,CTPSA}}, mo::Cuchar)::Ptr{RTPSA{Desc}} - return t -end # ------------------------------------------------------------------------------------------ diff --git a/src/temp.jl b/src/temp.jl new file mode 100644 index 00000000..7a7246f3 --- /dev/null +++ b/src/temp.jl @@ -0,0 +1,117 @@ +""" + mad_ctpsa_mnrm(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}})::Cdouble + +??? + +### Input +- `na` +- `ma` + +### Output +- `nrm` +""" +function mad_ctpsa_mnrm(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}})::Cdouble + nrm = @ccall MAD_TPSA.mad_ctpsa_mnrm(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}})::Cdouble + return nrm +end + + +""" + mad_ctpsa_minv!(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, mc::Ptr{Ptr{CTPSA{Desc}}}) + +??? + +### Input +- `na` +- `ma` +- `mc` +""" +function mad_ctpsa_minv!(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, mc::Ptr{Ptr{CTPSA{Desc}}}) + @ccall MAD_TPSA.mad_ctpsa_minv(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, mc::Ptr{Ptr{CTPSA{Desc}}})::Cvoid +end + + +""" + mad_ctpsa_pminv!(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, mc::Ptr{Ptr{CTPSA{Desc}}}, select::Ptr{Cint}) + +??? + +### Input +- `na` +- `ma` +- `mc` +- `select` +""" +function mad_ctpsa_pminv!(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, mc::Ptr{Ptr{CTPSA{Desc}}}, select::Ptr{Cint}) + @ccall MAD_TPSA.mad_ctpsa_pminv(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, mc::Ptr{Ptr{CTPSA{Desc}}}, select::Ptr{Cint})::Cvoid +end + + +""" + mad_ctpsa_compose!(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, nb::Cint, mb::Ptr{Ptr{CTPSA{Desc}}}, mc::Ptr{Ptr{CTPSA{Desc}}}) + +??? + +### Input +- `na` +- `ma` +- `nb` +- `mb` +- `mc` +""" +function mad_ctpsa_compose!(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, nb::Cint, mb::Ptr{Ptr{CTPSA{Desc}}}, mc::Ptr{Ptr{CTPSA{Desc}}}) + @ccall MAD_TPSA.mad_ctpsa_compose(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, nb::Cint, mb::Ptr{Ptr{CTPSA{Desc}}}, mc::Ptr{Ptr{CTPSA{Desc}}})::Cvoid +end + + +""" + mad_ctpsa_translate!(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, nb::Cint, tb::Ptr{ComplexF64}, mc::Ptr{CTPSA{Desc}}) + +??? + +### Input +- `na` +- `ma` +- `nb` +- `tb` +- `mc` +""" +function mad_ctpsa_translate!(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, nb::Cint, tb::Ptr{ComplexF64}, mc::Ptr{CTPSA{Desc}}) + @ccall MAD_TPSA.mad_ctpsa_translate(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, nb::Cint, tb::Ptr{ComplexF64}, mc::Ptr{CTPSA{Desc}})::Cvoid +end + + +""" + mad_ctpsa_eval!(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, nb::Cint, tb::Ptr{ComplexF64}, tc::Ptr{ComplexF64}) + +??? + +### Input +- `na` +- `ma` +- `nb` +- `tb` +- `tc` +""" +function mad_ctpsa_eval!(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, nb::Cint, tb::Ptr{ComplexF64}, tc::Ptr{ComplexF64}) + @ccall MAD_TPSA.mad_ctpsa_eval(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, nb::Cint, tb::Ptr{ComplexF64}, tc::Ptr{ComplexF64})::Cvoid +end + + +""" + mad_ctpsa_mconv!(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, nc::Cint, mc::Ptr{Ptr{CTPSA{Desc}}}, n::Cint, t2r_::Ptr{Cint}, pb::Cint) + +??? + +### Input +- `na` +- `ma` +- `nc` +- `mc` +- `n` +- `t2r_` +- `pb` +""" +function mad_ctpsa_mconv!(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, nc::Cint, mc::Ptr{Ptr{CTPSA{Desc}}}, n::Cint, t2r_::Ptr{Cint}, pb::Cint) + @ccall MAD_TPSA.mad_ctpsa_mconv(na::Cint, ma::Ptr{Ptr{CTPSA{Desc}}}, nc::Cint, mc::Ptr{Ptr{CTPSA{Desc}}}, n::Cint, t2r_::Ptr{Cint}, pb::Cint)::Cvoid +end \ No newline at end of file