| 43 | |
| 44 | template <typename T> |
| 45 | double apq ( const T& x) |
| 46 | { |
| 47 | DLIB_ASSERT(x.nr() > 1 && x.nc() == 1,""); |
| 48 | COMPILE_TIME_ASSERT(is_matrix<T>::value); |
| 49 | double temp = 0; |
| 50 | for (long r = 0; r < x.nr(); ++r) |
| 51 | { |
| 52 | temp += (r+1)*x(r)*x(r); |
| 53 | } |
| 54 | |
| 55 | ++total_count; |
| 56 | |
| 57 | return temp + 1/100.0*(x(0) + x(x.nr()-1))*(x(0) + x(x.nr()-1)); |
| 58 | } |
| 59 | |
| 60 | template <typename T> |
| 61 | T der_apq ( const T& x) |