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

Function chebyquad_solution

dlib/test/optimization_test_functions.cpp:135–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133 // ----------------------------------------------------------------------------------------
134
135 matrix<double,0,1> chebyquad_solution (int n)
136 {
137 matrix<double,0,1> x(n);
138
139 x = 0;
140 switch (n)
141 {
142 case 2:
143 x = 0.2113249E+00, 0.7886751E+00;
144 break;
145 case 4:
146 x = 0.1026728E+00, 0.4062037E+00, 0.5937963E+00, 0.8973272E+00;
147 break;
148 case 6:
149 x = 0.066877E+00, 0.288741E+00, 0.366682E+00, 0.633318E+00, 0.711259E+00, 0.933123E+00;
150 break;
151 case 8:
152 x = 0.043153E+00, 0.193091E+00, 0.266329E+00, 0.500000E+00, 0.500000E+00, 0.733671E+00, 0.806910E+00, 0.956847E+00;
153 break;
154 default:
155 std::ostringstream sout;
156 sout << "don't know chebyquad solution for n = " << n;
157 throw dlib::error(sout.str());
158 break;
159 }
160
161 return x;
162 }
163
164 // ----------------------------------------------------------------------------------------
165

Callers 2

test_problemsFunction · 0.85
test_with_chebyquadFunction · 0.85

Calls 2

errorClass · 0.85
strMethod · 0.45

Tested by

no test coverage detected