void Function::jacobian(const IntervalVector& box, IntervalMatrix& J, const VarSet& set) const { assert(J.nb_cols()==set.nb_var); assert(box.size()==nb_var()); assert(J.nb_rows()==image_dim()); IntervalVector g(nb_var()); // calculate the gradient of each component of f for (int i=0; i<image_dim(); i++) { (*this)[i].gradient(box,g); J.set_row(i,set.var_box(g)); } }
void Function::hansen_matrix(const IntervalVector& box, IntervalMatrix& H, const VarSet& set) const { int n=set.nb_var; int m=image_dim(); assert(H.nb_cols()==n); assert(box.size()==nb_var()); assert(H.nb_rows()==m); IntervalVector var_box=set.var_box(box); IntervalVector param_box=set.param_box(box); IntervalVector x=var_box.mid(); IntervalMatrix J(m,n); for (int var=0; var<n; var++) { //var=tab[i]; x[var]=var_box[var]; jacobian(set.full_box(x,param_box),J,set); H.set_col(var,J.col(var)); } }