mono
/complexmono
Creates a TPS corresponding to a specific monomial
Syntax
m = mono(orders [, use=(descriptor|tps)])
m = mono([vars_sparse_mono] [, params=params_sparse_mono] [, use=(descriptor|tps)])
m = mono(idx [, use=(descriptor|tps)])
m = mono(param=param_idx [, use=(descriptor|tps)])
m = complexmono(...)
Description
Indexing by Order
m = mono(orders)
creates a TPS
equal to the monomial specified by the indexing-by-order vector/tuple orders
using the Descriptor
in GTPSA.desc_current
Indexing by Sparse Monomial
m = mono(vars_sparse_mono, params=params_sparse_mono)
creates a TPS
equal to the monomial specified by the indexing-by-sparse monomial vector/tuple vars_sparse_mono
and params_sparse_mono
using the Descriptor
in GTPSA.desc_current
Indexing by Monomial Index
m = mono(idx)
creates a TPS
equal to the monomial specified by idx
and the Descriptor
in GTPSA.desc_current
m = mono(param=param_idx)
creates a TPS
equal to the monomial specified by param_idx + nv
where nv
is the number of variables in the GTPSA, using the Descriptor
in GTPSA.desc_current
Optional Keyword Argument
use=(descriptor|tps)
creates a mono using any of the above methods but using the Descriptor
specified by use
Complex Monomial
complexmono
will create a ComplexTPS64
using any of the above methods without the overhead of creating a TPS
and converting it to a ComplexTPS64
Examples
julia> d1 = Descriptor(3, 15, 2, 15); # 3 vars, 2 params, all to order 15
julia> x1 = mono(1)
TPS64: Coefficient Order Exponent 1.0000000000000000e+00 1 1 0 0 | 0 0
julia> k1 = mono(param=1)
TPS64: Coefficient Order Exponent 1.0000000000000000e+00 1 0 0 0 | 1 0
julia> m312 = mono([3,1,2])
TPS64: Coefficient Order Exponent 1.0000000000000000e+00 6 3 1 2 | 0 0
julia> m31221 = mono((3,1,2,2,1)) # Tuples allowed for indexing
TPS64: Coefficient Order Exponent 1.0000000000000000e+00 9 3 1 2 | 2 1
julia> m312 = mono([1=>3, 2=>1, 3=>3])
TPS64: Coefficient Order Exponent 1.0000000000000000e+00 7 3 1 3 | 0 0
julia> m31221 = mono((1=>3, 2=>1, 3=>2), params=(1=>2, 2=>1))
TPS64: Coefficient Order Exponent 1.0000000000000000e+00 9 3 1 2 | 2 1
Documentation
GTPSA.mono
— Functionmono(v::Union{Integer, Vector{<:Union{<:Pair{<:Integer,<:Integer},<:Integer}}, Nothing}=nothing; param::Union{Integer,Nothing}=nothing, params::Union{Vector{<:Pair{<:Integer,<:Integer}}, Nothing}=nothing, use::Descriptor=GTPSA.desc_current)
Returns a TPS{Float64}
corresponding to a specific monomial, specified using the variable/parameter index, or monomial indexing-by-order OR monomial indexing-by-sparse monomial.
Input
v
– An integer (for variable index), an array of orders for each variable (for indexing-by-order), or an array of pairs (sparse monomial)param
– (Keyword argument, optional) An integer for the parameter indexparams
– (Keyword argument, optional) An array of pairs for sparse-monomial indexinguse
– (Keyword argument, optional) The descriptor to use to generate the monomial. Default is most recently-defined.
Examples: Variable/Parameter Index:
julia> d = Descriptor(3,10,2,10);
julia> mono(1)
TPS{Float64}:
Coefficient Order Exponent
1.0000000000000000e+00 1 1 0 0 0 0
julia> mono(2, use=d)
TPS{Float64}:
Coefficient Order Exponent
1.0000000000000000e+00 1 0 1 0 0 0
julia> mono(param=2)
TPS{Float64}:
Coefficient Order Exponent
1.0000000000000000e+00 1 0 0 0 0 1
Examples: Monomial Index-by-Order
julia> mono([1])
TPS{Float64}:
Coefficient Order Exponent
1.0000000000000000e+00 1 1 0 0 0 0
julia> mono([0,1])
TPS{Float64}:
Coefficient Order Exponent
1.0000000000000000e+00 1 0 1 0 0 0
julia> mono([0,0,0,0,1], use=d)
TPS{Float64}:
Coefficient Order Exponent
1.0000000000000000e+00 1 0 0 0 0 1
julia> mono([1,0,0,0,1])
TPS{Float64}:
Coefficient Order Exponent
1.0000000000000000e+00 2 1 0 0 0 1
Examples: Monomial Index-by-Sparse Monomial
julia> mono([1=>1])
TPS{Float64}:
Coefficient Order Exponent
1.0000000000000000e+00 1 1 0 0 0 0
julia> mono([2=>1])
TPS{Float64}:
Coefficient Order Exponent
1.0000000000000000e+00 1 0 1 0 0 0
julia> mono([1=>1], params=[2=>1], use=d)
TPS{Float64}:
Coefficient Order Exponent
1.0000000000000000e+00 2 1 0 0 0 1