[−][src]Function icasadi_test::icasadi_cost
pub fn icasadi_cost(
u: &[f64],
casadi_static_params: &[f64],
cost_value: &mut f64
) -> c_int
Consume the cost function written in C
Example
fn tst_call_casadi_cost() { let u = [1.0, 2.0, 3.0, -5.0, 1.0, 10.0, 14.0, 17.0, 3.0, 5.0]; let p = [1.0, -1.0]; let mut cost_value = 0.0; icasadi::icasadi_cost(&u, &p, &mut cost_value); }
Panics
This method does not panic (on purpose). However, users need to be
careful when providing the arguments u
and casadi_static_params
as they must be arrays of appropriate size.
As a safety measure, you may check whether
u.len() >= NUM_DECISION_VARIABLES
casadi_static_params.len() >= NUM_STATIC_PARAMETERS