MCPcopy Create free account
hub / github.com/davisking/dlib / der_apq

Function der_apq

dlib/test/optimization.cpp:61–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

xFunction · 0.85
nrMethod · 0.45
ncMethod · 0.45

Tested by

no test coverage detected