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

Function optimization_test

dlib/test/optimization.cpp:765–919  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

763// ----------------------------------------------------------------------------------------
764
765 void optimization_test (
766 )
767 /*!
768 ensures
769 - runs tests on the optimization stuff compliance with the specs
770 !*/
771 {
772 matrix<double,0,1> p;
773
774 print_spinner();
775
776 p.set_size(2);
777
778 // test with single_variable_function
779 test_single_variable_function(0);
780 test_single_variable_function(1);
781 test_single_variable_function(-10);
782 test_single_variable_function(-100);
783 test_single_variable_function(900.53);
784
785 // test with the rosen function
786 p(0) = 9;
787 p(1) = -4.9;
788 test_rosen(p);
789 test_neg_rosen(p);
790
791 p(0) = 0;
792 p(1) = 0;
793 test_rosen(p);
794
795 p(0) = 5323;
796 p(1) = 98248;
797 test_rosen(p);
798
799 // test with the simple function
800 p(0) = 1;
801 p(1) = 1;
802 test_simple(p);
803
804 p(0) = 0.5;
805 p(1) = -9;
806 test_simple(p);
807
808 p(0) = 645;
809 p(1) = 839485;
810 test_simple(p);
811
812 print_spinner();
813
814 // test with the apq function
815 p.set_size(5);
816
817 p(0) = 1;
818 p(1) = 1;
819 p(2) = 1;
820 p(3) = 1;
821 p(4) = 1;
822 test_apq(p);

Callers 1

perform_testMethod · 0.85

Calls 15

print_spinnerFunction · 0.85
test_rosenFunction · 0.85
test_neg_rosenFunction · 0.85
test_simpleFunction · 0.85
test_apqFunction · 0.85
test_powellFunction · 0.85
der_rosenFunction · 0.85
absFunction · 0.85
neg_rosenFunction · 0.85
negate_functionFunction · 0.85

Tested by

no test coverage detected