@@ -34,18 +34,14 @@ function throw_missing_specialization(n)
3434end
3535
3636"""
37- `build_function`
37+ build_function(ex, args...;
38+ expression = Val{true},
39+ target = JuliaTarget(),
40+ parallel=nothing,
41+ kwargs...)
3842
3943Generates a numerically-usable function from a Symbolics `Num`.
4044
41- ```julia
42- build_function(ex, args...;
43- expression = Val{true},
44- target = JuliaTarget(),
45- parallel=nothing,
46- kwargs...)
47- ```
48-
4945Arguments:
5046
5147- `ex`: The `Num` to compile
@@ -220,16 +216,16 @@ end
220216Build function target: `JuliaTarget`
221217
222218```julia
223- function _build_function(target::JuliaTarget, rhss, args...;
224- conv = toexpr,
225- expression = Val{true},
226- checkbounds = false,
227- linenumbers = false,
228- headerfun = addheader, outputidxs=nothing,
229- convert_oop = true, force_SA = false,
230- skipzeros = outputidxs===nothing,
231- fillzeros = skipzeros && !(typeof(rhss)<:SparseMatrixCSC),
232- parallel=SerialForm(), kwargs...)
219+ _build_function(target::JuliaTarget, rhss, args...;
220+ conv = toexpr,
221+ expression = Val{true},
222+ checkbounds = false,
223+ linenumbers = false,
224+ headerfun = addheader, outputidxs=nothing,
225+ convert_oop = true, force_SA = false,
226+ skipzeros = outputidxs===nothing,
227+ fillzeros = skipzeros && !(typeof(rhss)<:SparseMatrixCSC),
228+ parallel=SerialForm(), kwargs...)
233229```
234230
235231Generates a Julia function which can then be utilized for further evaluations.
@@ -676,11 +672,11 @@ end
676672Build function target: `CTarget`
677673
678674```julia
679- function _build_function(target::CTarget, eqs::Array{<:Equation}, args...;
680- conv = toexpr, expression = Val{true},
681- fname = :diffeqf,
682- lhsname=:du,rhsnames=[Symbol("RHS\$ i") for i in 1:length(args)],
683- libpath=tempname(),compiler=:gcc)
675+ _build_function(target::CTarget, eqs::Array{<:Equation}, args...;
676+ conv = toexpr, expression = Val{true},
677+ fname = :diffeqf,
678+ lhsname=:du,rhsnames=[Symbol("RHS\$ i") for i in 1:length(args)],
679+ libpath=tempname(), compiler=:gcc)
684680```
685681
686682This builds an in-place C function. Only works on arrays of equations. If
@@ -689,7 +685,7 @@ and returns a lambda to that compiled function. These special keyword arguments
689685control the compilation:
690686
691687- libpath: the path to store the binary. Defaults to a temporary path.
692- - compiler: which C compiler to use. Defaults to :gcc, which is currently the
688+ - compiler: which C compiler to use. Defaults to ` :gcc` , which is currently the
693689 only available option.
694690"""
695691function _build_function (target:: CTarget , eqs:: Array{<:Equation} , args... ;
@@ -736,15 +732,15 @@ end
736732Build function target: `CTarget`
737733
738734```julia
739- function _build_function(target::CTarget, ex::AbstractArray, args...;
740- columnmajor = true,
741- conv = toexpr,
742- expression = Val{true},
743- fname = :diffeqf,
744- lhsname = :du,
745- rhsnames = [Symbol("RHS\$ i") for i in 1:length(args)],
746- libpath = tempname(),
747- compiler = :gcc)
735+ _build_function(target::CTarget, ex::AbstractArray, args...;
736+ columnmajor = true,
737+ conv = toexpr,
738+ expression = Val{true},
739+ fname = :diffeqf,
740+ lhsname = :du,
741+ rhsnames = [Symbol("RHS\$ i") for i in 1:length(args)],
742+ libpath = tempname(),
743+ compiler = :gcc)
748744```
749745
750746This builds an in-place C function. Only works on expressions. If
@@ -823,14 +819,14 @@ _build_function(target::CTarget, ex::Num, args...; kwargs...) = _build_function(
823819Build function target: `StanTarget`
824820
825821```julia
826- function _build_function(target::StanTarget, eqs::Array{<:Equation}, vs, ps, iv;
827- conv = toexpr, expression = Val{true},
828- fname = :diffeqf, lhsname=:internal_var___du,
829- rhsnames=[:internal_var___u,:internal_var___p,:internal_var___t])
822+ _build_function(target::StanTarget, eqs::Array{<:Equation}, vs, ps, iv;
823+ conv = toexpr, expression = Val{true},
824+ fname = :diffeqf, lhsname=:internal_var___du,
825+ rhsnames=[:internal_var___u,:internal_var___p,:internal_var___t])
830826```
831827
832828This builds an in-place Stan function compatible with the Stan differential equation solvers.
833- Unlike other build targets, this one requires (vs, ps, iv) as the function arguments.
829+ Unlike other build targets, this one requires ` (vs, ps, iv)` as the function arguments.
834830Only allowed on arrays of equations.
835831"""
836832function _build_function (target:: StanTarget , eqs:: Array{<:Equation} , vs, ps, iv;
@@ -862,16 +858,16 @@ end
862858Build function target: `StanTarget`
863859
864860```julia
865- function _build_function(target::StanTarget, ex::AbstractArray, vs, ps, iv;
866- columnmajor = true,
867- conv = toexpr,
868- expression = Val{true},
869- fname = :diffeqf, lhsname=:internal_var___du,
870- rhsnames = [:internal_var___u,:internal_var___p,:internal_var___t])
861+ _build_function(target::StanTarget, ex::AbstractArray, vs, ps, iv;
862+ columnmajor = true,
863+ conv = toexpr,
864+ expression = Val{true},
865+ fname = :diffeqf, lhsname=:internal_var___du,
866+ rhsnames = [:internal_var___u,:internal_var___p,:internal_var___t])
871867```
872868
873869This builds an in-place Stan function compatible with the Stan differential equation solvers.
874- Unlike other build targets, this one requires (vs, ps, iv) as the function arguments.
870+ Unlike other build targets, this one requires ` (vs, ps, iv)` as the function arguments.
875871Only allowed on expressions, and arrays of expressions.
876872"""
877873function _build_function (target:: StanTarget , ex:: AbstractArray , vs, ps, iv;
@@ -920,13 +916,13 @@ _build_function(target::StanTarget, ex::Num, vs, ps, iv; kwargs...) = _build_fun
920916Build function target: `MATLABTarget`
921917
922918```julia
923- function _build_function(target::MATLABTarget, eqs::Array{<:Equation}, args...;
924- conv = toexpr, expression = Val{true},
925- lhsname=:internal_var___du,
926- rhsnames=[:internal_var___u,:internal_var___p,:internal_var___t])
919+ _build_function(target::MATLABTarget, eqs::Array{<:Equation}, args...;
920+ conv = toexpr, expression = Val{true},
921+ lhsname=:internal_var___du,
922+ rhsnames=[:internal_var___u,:internal_var___p,:internal_var___t])
927923```
928924
929- This builds an out of place anonymous function @(t,rhsnames[1]) to be used in MATLAB.
925+ This builds an out of place anonymous function ` @(t,rhsnames[1])` to be used in MATLAB.
930926Compatible with the MATLAB differential equation solvers. Only allowed on expressions,
931927and arrays of expressions.
932928"""
@@ -953,13 +949,13 @@ end
953949Build function target: `MATLABTarget`
954950
955951```julia
956- function _build_function(target::MATLABTarget, ex::AbstractArray, args...;
957- columnmajor = true,
958- conv = toexpr,
959- expression = Val{true},
960- fname = :diffeqf,
961- lhsname = :internal_var___du,
962- rhsnames = [:internal_var___u,:internal_var___p,:internal_var___t])
952+ _build_function(target::MATLABTarget, ex::AbstractArray, args...;
953+ columnmajor = true,
954+ conv = toexpr,
955+ expression = Val{true},
956+ fname = :diffeqf,
957+ lhsname = :internal_var___du,
958+ rhsnames = [:internal_var___u,:internal_var___p,:internal_var___t])
963959```
964960
965961This builds an out of place anonymous function @(t,rhsnames[1]) to be used in MATLAB.
0 commit comments