| 119 | return r; |
| 120 | } |
| 121 | double gradCheck( EnergyFunction & efun, const VectorXf & x, float EPS ) { |
| 122 | VectorXf ng = numericGradient( efun, x, EPS ); |
| 123 | VectorXf g( x.rows() ); |
| 124 | efun.gradient( x, g ); |
| 125 | return (ng-g).norm(); |
| 126 | } |
| 127 | |
| 128 | VectorXf computeFunction( EnergyFunction & efun, const VectorXf & x, const VectorXf & dx, int n_samples ) { |
| 129 | VectorXf r( n_samples ); |