- Scilab Help
- Optimization and Simulation
- Optimization base
- optimbase_cget
- optimbase_checkbounds
- optimbase_checkcostfun
- optimbase_checkx0
- optimbase_configure
- optimbase_destroy
- optimbase_function
- optimbase_get
- optimbase_hasbounds
- optimbase_hasconstraints
- optimbase_hasnlcons
- optimbase_histget
- optimbase_histset
- optimbase_incriter
- optimbase_isfeasible
- optimbase_isinbounds
- optimbase_isinnonlincons
- optimbase_log
- optimbase_new
- optimbase_outputcmd
- optimbase_outstruct
- overview
- optimbase_proj2bnds
- optimbase_set
- optimbase_stoplog
- optimbase_terminate
Please note that the recommended version of Scilab is 2025.0.0. This page might be outdated.
See the recommended documentation of this function
optimbase_checkcostfun
Checks the cost function.
Syntax
opt = optimbase_checkcostfun(opt)
Argument
- opt
The object of TOPTIM type (tlist).
Description
The optimbase_checkcostfun
function checks that the cost function
is correctly connected. This function generates an error if the cost function is not
connected.
This function takes into account for the cost function at the initial guess x0 only.
She checks that all values of the index argument are valid. If there are non-linear
constraints, optimbase_checkcostfun
checks that the matrix has the
correct shape.
This function requires at least one call to the cost function to make the necessary checks.
Example
function [y, index]=rosenbrock(x, index) y = 100*(x(2)-x(1)^2)^2 + (1-x(1))^2; endfunction opt = optimbase_new (); opt = optimbase_configure(opt,"-numberofvariables",2); opt = optimbase_configure(opt,"-x0",[1.1 1.1]'); opt = optimbase_configure(opt,"-function",rosenbrock); opt = optimbase_checkcostfun(opt) opt = optimbase_destroy(opt);
See also
- optimbase_function — Calls cost function.
- optimbase_configure — Configures the current object.
- optimbase_new — Creates a new optimization object.
Report an issue | ||
<< optimbase_checkbounds | Optimization base | optimbase_checkx0 >> |