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

Function apq

dlib/test/optimization.cpp:45–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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)

Callers 1

test_apqFunction · 0.85

Calls 3

xFunction · 0.85
nrMethod · 0.45
ncMethod · 0.45

Tested by

no test coverage detected