| 59 | |
| 60 | template <typename T> |
| 61 | T der_apq ( const T& x) |
| 62 | { |
| 63 | DLIB_ASSERT(x.nr() > 1 && x.nc() == 1,""); |
| 64 | COMPILE_TIME_ASSERT(is_matrix<T>::value); |
| 65 | T temp(x.nr()); |
| 66 | for (long r = 0; r < x.nr(); ++r) |
| 67 | { |
| 68 | temp(r) = 2*(r+1)*x(r) ; |
| 69 | } |
| 70 | |
| 71 | temp(0) += 1/50.0*(x(0) + x(x.nr()-1)); |
| 72 | temp(x.nr()-1) += 1/50.0*(x(0) + x(x.nr()-1)); |
| 73 | |
| 74 | ++total_count; |
| 75 | |
| 76 | return temp; |
| 77 | } |
| 78 | |
| 79 | // ---------------------------------------------------------------------------------------- |
| 80 |