Osnaps.dot
— Methoddot(x, A, y)
Compute the dot product x' * A * y
between two vectors x
and y
.
Osnaps.minimize!
— Methodminimize!(o::GenericMinimizer, fn::Function, lb::NTuple{ND}, ub::NTuple{ND}; itmax::Int=210*ND, dmax::Real=1e-7, avgtimes::Int=1)
An interface function to proceed the minimization.
Arguments:
obj
: An object for the minimization created byminimizer(...)
.fn
: Objective function to be minimized.fn
should be callable with only one argument offn(x::Vector)
. If you have any additional arguments need to pass into it, dispatch the function byfcall(fn, x) = fn(x; kwargs...)
lb
: Lower bounds of minimization which are forced to be feasible.ub
: Upper bounds of minimization which are forced to be feasible.itmax
: Maximum of minimizg iteration (optional).dmax
: An Euclidean distance acts as a criterion to prevent the population falling into local minimal (optional).avgtimes
: Number of average times of the whole minimization process (optional).
Osnaps.minimizer
— Methodminimizer(ND::Int; NP::Int=35*ND, NE::Int=ND+1)
An interface function to create/initialize an object for the minimization.
Arguments:
ND
: Dimension of parameters to be minimized.NP
: Desired population size (optional).NE
: Desired size of elites (optional).
Osnaps.tr
— Methodtr(A)
Matrix trace. Sums the diagonal elements of A
. A
must be a square matrix.