16 template<
int InputDim,
int OutputDim>
18 const Eigen::Matrix<double, OutputDim, InputDim> & jac,
19 const Eigen::Matrix<double, InputDim, 1> & dir)
22 for(
int i = 0; i < func.size(); i++)
26 deriv += jac.row(i).transpose().dot(dir);
30 deriv += -1 * jac.row(i).transpose().dot(dir);
34 deriv += std::abs(jac.row(i).transpose().dot(dir));
double l1NormDirectionalDeriv(const Eigen::Matrix< double, OutputDim, 1 > &func, const Eigen::Matrix< double, OutputDim, InputDim > &jac, const Eigen::Matrix< double, InputDim, 1 > &dir)
Compute the directional derivative of the L1-norm of the function.