├── doc ├── html │ ├── doc.png │ ├── bc_s.png │ ├── bdwn.png │ ├── nav_f.png │ ├── nav_g.png │ ├── nav_h.png │ ├── open.png │ ├── tab_a.png │ ├── tab_b.png │ ├── tab_h.png │ ├── tab_s.png │ ├── classCos.png │ ├── classExp.png │ ├── classLog.png │ ├── classSin.png │ ├── closed.png │ ├── doxygen.png │ ├── splitbar.png │ ├── sync_off.png │ ├── sync_on.png │ ├── arrowdown.png │ ├── arrowright.png │ ├── classPower.png │ ├── classSqrt.png │ ├── folderopen.png │ ├── classAbsolute.png │ ├── classAddition.png │ ├── classC__Load.png │ ├── classDivision.png │ ├── classX__Load.png │ ├── folderclosed.png │ ├── search │ │ ├── close.png │ │ ├── mag_sel.png │ │ ├── search_l.png │ │ ├── search_m.png │ │ ├── search_r.png │ │ ├── all_1.js │ │ ├── classes_9.js │ │ ├── files_3.js │ │ ├── pages_0.js │ │ ├── classes_c.js │ │ ├── classes_2.js │ │ ├── classes_b.js │ │ ├── files_1.js │ │ ├── classes_4.js │ │ ├── classes_7.js │ │ ├── files_0.js │ │ ├── files_2.js │ │ ├── variables_5.js │ │ ├── all_11.js │ │ ├── functions_e.js │ │ ├── classes_1.js │ │ ├── all_13.js │ │ ├── classes_6.js │ │ ├── variables_1.js │ │ ├── variables_c.js │ │ ├── functions_a.js │ │ ├── variables_4.js │ │ ├── variables_2.js │ │ ├── functions_8.js │ │ ├── functions_d.js │ │ ├── variables_8.js │ │ ├── classes_3.js │ │ ├── classes_8.js │ │ ├── all_c.js │ │ ├── all_10.js │ │ ├── classes_5.js │ │ ├── variables_b.js │ │ ├── variables_9.js │ │ ├── functions_6.js │ │ ├── functions_9.js │ │ ├── classes_a.js │ │ ├── all_12.js │ │ ├── functions_7.js │ │ ├── classes_0.js │ │ ├── all_8.js │ │ ├── variables_a.js │ │ ├── variables_0.js │ │ ├── functions_5.js │ │ ├── variables_3.js │ │ ├── all_9.js │ │ ├── nomatches.html │ │ ├── variables_7.js │ │ ├── searchdata.js │ │ ├── all_f.js │ │ ├── functions_0.js │ │ ├── functions_1.js │ │ ├── all_7.js │ │ ├── all_5.js │ │ ├── functions_c.js │ │ ├── functions_b.js │ │ ├── all_2.js │ │ ├── all_b.js │ │ ├── all_d.js │ │ ├── variables_6.js │ │ ├── all_a.js │ │ ├── all_0.html │ │ ├── all_1.html │ │ ├── all_10.html │ │ ├── all_11.html │ │ ├── all_12.html │ │ ├── all_13.html │ │ ├── all_2.html │ │ ├── all_3.html │ │ ├── all_4.html │ │ ├── all_5.html │ │ ├── all_6.html │ │ ├── all_7.html │ │ ├── all_8.html │ │ ├── all_9.html │ │ ├── all_a.html │ │ ├── all_b.html │ │ ├── all_c.html │ │ ├── all_d.html │ │ ├── all_e.html │ │ ├── all_f.html │ │ ├── classes_0.html │ │ ├── classes_1.html │ │ ├── classes_2.html │ │ ├── classes_3.html │ │ ├── classes_4.html │ │ ├── classes_5.html │ │ ├── classes_6.html │ │ ├── classes_7.html │ │ ├── classes_8.html │ │ ├── classes_9.html │ │ ├── classes_a.html │ │ ├── classes_b.html │ │ ├── classes_c.html │ │ ├── files_0.html │ │ ├── files_1.html │ │ ├── files_2.html │ │ ├── files_3.html │ │ ├── pages_0.html │ │ ├── functions_0.html │ │ ├── functions_1.html │ │ ├── functions_2.html │ │ ├── functions_3.html │ │ ├── functions_4.html │ │ ├── functions_5.html │ │ ├── functions_6.html │ │ ├── functions_7.html │ │ ├── functions_8.html │ │ ├── functions_9.html │ │ ├── functions_a.html │ │ ├── functions_b.html │ │ ├── functions_c.html │ │ ├── functions_d.html │ │ ├── functions_e.html │ │ ├── variables_0.html │ │ ├── variables_1.html │ │ ├── variables_2.html │ │ ├── variables_3.html │ │ ├── variables_4.html │ │ ├── variables_5.html │ │ ├── variables_6.html │ │ ├── variables_7.html │ │ ├── variables_8.html │ │ ├── variables_9.html │ │ ├── variables_a.html │ │ ├── variables_b.html │ │ ├── variables_c.html │ │ ├── all_e.js │ │ ├── all_0.js │ │ ├── functions_2.js │ │ ├── all_3.js │ │ ├── functions_3.js │ │ ├── all_4.js │ │ └── functions_4.js │ ├── classOperation.png │ ├── classSubtraction.png │ ├── structTrainingData.png │ ├── classMultiplication.png │ ├── structFitnessMetric.png │ ├── structImplicitRegression.png │ ├── structStandardRegression.png │ ├── structExplicitTrainingData.png │ ├── structImplicitTrainingData.png │ └── tabs.css └── latex │ ├── classCos.pdf │ ├── classExp.pdf │ ├── classLog.pdf │ ├── classSin.pdf │ ├── classSqrt.pdf │ ├── classC__Load.pdf │ ├── classPower.pdf │ ├── classX__Load.pdf │ ├── classAbsolute.pdf │ ├── classAddition.pdf │ ├── classDivision.pdf │ ├── classOperation.pdf │ ├── classSubtraction.pdf │ ├── classMultiplication.pdf │ ├── structFitnessMetric.pdf │ ├── structTrainingData.pdf │ ├── structImplicitRegression.pdf │ ├── structStandardRegression.pdf │ ├── structExplicitTrainingData.pdf │ ├── structImplicitTrainingData.pdf │ ├── dir_68267d1309a1af8e8297ef4c3efbcdba.tex │ ├── dir_d44c64559bbebec7f509842c48db8b23.tex │ ├── Makefile │ ├── dir_dcbc573d067b13a200a39ad3adabc01a.tex │ ├── training__data_8h.tex │ ├── graph__manip_8h.tex │ ├── fitness__metric_8h.tex │ ├── files.tex │ ├── classOperatorInterface.tex │ └── hierarchy.tex ├── media └── logo.png ├── .astylerc ├── .gitmodules ├── tests ├── test_main.cpp ├── utility_function_tests.cpp └── testing_utils.h ├── .gitignore ├── include ├── bingocpp │ ├── version.h │ ├── version.h.in │ ├── agraph │ │ ├── simplification_backend │ │ │ ├── template.h │ │ │ ├── constant_expressions.h │ │ │ └── simplification_backend.h │ │ ├── constants.h │ │ └── evaluation_backend │ │ │ └── operator_eval.h │ ├── gradient_mixin.h │ └── training_data.h ├── benchmarking │ ├── benchmark_logging.h │ ├── benchmark_data.h │ ├── benchmark_logging.cpp │ └── benchmark_data.cpp └── python │ ├── py_equation.h │ ├── py_gradient_mixin.h │ └── py_fitness_function.h ├── cmake ├── Colors.cmake └── ConfigSafeGuards.cmake ├── __init__.py ├── src ├── gradient_mixin.cpp ├── explicit_regression.cpp ├── agraph │ └── simplification_backend │ │ └── simplification_backend.cpp └── implicit_regression.cpp ├── .travis.yml ├── app ├── fitness_function_pymodule.cpp ├── test-agraph-consts.csv ├── simplification_backend_pymodule.cpp ├── evaluation_backend_pymodule.cpp ├── bingocpp_pymodule.cpp ├── utils_pymodule.cpp └── fitness_benchmarks.cpp └── depricated ├── fitness_metric.cpp └── acyclic_graph_nodes.h /doc/html/doc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/html/doc.png -------------------------------------------------------------------------------- /media/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/media/logo.png -------------------------------------------------------------------------------- /doc/html/bc_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/html/bc_s.png -------------------------------------------------------------------------------- /doc/html/bdwn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/html/bdwn.png -------------------------------------------------------------------------------- /doc/html/nav_f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/html/nav_f.png -------------------------------------------------------------------------------- /doc/html/nav_g.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/html/nav_g.png -------------------------------------------------------------------------------- /doc/html/nav_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/html/nav_h.png -------------------------------------------------------------------------------- /doc/html/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/html/open.png -------------------------------------------------------------------------------- /doc/html/tab_a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/html/tab_a.png -------------------------------------------------------------------------------- /doc/html/tab_b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/html/tab_b.png -------------------------------------------------------------------------------- /doc/html/tab_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/html/tab_h.png -------------------------------------------------------------------------------- /doc/html/tab_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/html/tab_s.png -------------------------------------------------------------------------------- /doc/html/classCos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/html/classCos.png -------------------------------------------------------------------------------- /doc/html/classExp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/html/classExp.png -------------------------------------------------------------------------------- /doc/html/classLog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/html/classLog.png -------------------------------------------------------------------------------- /doc/html/classSin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/html/classSin.png -------------------------------------------------------------------------------- /doc/html/closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/html/closed.png -------------------------------------------------------------------------------- /doc/html/doxygen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/html/doxygen.png -------------------------------------------------------------------------------- /doc/html/splitbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/html/splitbar.png -------------------------------------------------------------------------------- /doc/html/sync_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/html/sync_off.png -------------------------------------------------------------------------------- /doc/html/sync_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/html/sync_on.png -------------------------------------------------------------------------------- /doc/html/arrowdown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/html/arrowdown.png -------------------------------------------------------------------------------- /doc/html/arrowright.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/html/arrowright.png -------------------------------------------------------------------------------- /doc/html/classPower.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/html/classPower.png -------------------------------------------------------------------------------- /doc/html/classSqrt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/html/classSqrt.png -------------------------------------------------------------------------------- /doc/html/folderopen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/html/folderopen.png -------------------------------------------------------------------------------- /doc/latex/classCos.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/latex/classCos.pdf -------------------------------------------------------------------------------- /doc/latex/classExp.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/latex/classExp.pdf -------------------------------------------------------------------------------- /doc/latex/classLog.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/latex/classLog.pdf -------------------------------------------------------------------------------- /doc/latex/classSin.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/latex/classSin.pdf -------------------------------------------------------------------------------- /doc/latex/classSqrt.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/latex/classSqrt.pdf -------------------------------------------------------------------------------- /doc/html/classAbsolute.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/html/classAbsolute.png -------------------------------------------------------------------------------- /doc/html/classAddition.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/html/classAddition.png -------------------------------------------------------------------------------- /doc/html/classC__Load.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/html/classC__Load.png -------------------------------------------------------------------------------- /doc/html/classDivision.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/html/classDivision.png -------------------------------------------------------------------------------- /doc/html/classX__Load.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/html/classX__Load.png -------------------------------------------------------------------------------- /doc/html/folderclosed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/html/folderclosed.png -------------------------------------------------------------------------------- /doc/html/search/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/html/search/close.png -------------------------------------------------------------------------------- /doc/latex/classC__Load.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/latex/classC__Load.pdf -------------------------------------------------------------------------------- /doc/latex/classPower.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/latex/classPower.pdf -------------------------------------------------------------------------------- /doc/latex/classX__Load.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/latex/classX__Load.pdf -------------------------------------------------------------------------------- /doc/html/classOperation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/html/classOperation.png -------------------------------------------------------------------------------- /doc/html/search/mag_sel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/html/search/mag_sel.png -------------------------------------------------------------------------------- /doc/html/search/search_l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/html/search/search_l.png -------------------------------------------------------------------------------- /doc/html/search/search_m.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/html/search/search_m.png -------------------------------------------------------------------------------- /doc/html/search/search_r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/html/search/search_r.png -------------------------------------------------------------------------------- /doc/latex/classAbsolute.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/latex/classAbsolute.pdf -------------------------------------------------------------------------------- /doc/latex/classAddition.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/latex/classAddition.pdf -------------------------------------------------------------------------------- /doc/latex/classDivision.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/latex/classDivision.pdf -------------------------------------------------------------------------------- /doc/latex/classOperation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/latex/classOperation.pdf -------------------------------------------------------------------------------- /doc/html/classSubtraction.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/html/classSubtraction.png -------------------------------------------------------------------------------- /doc/html/search/all_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['bingocpp',['BingoCpp',['../index.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/structTrainingData.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/html/structTrainingData.png -------------------------------------------------------------------------------- /doc/latex/classSubtraction.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/latex/classSubtraction.pdf -------------------------------------------------------------------------------- /doc/html/classMultiplication.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/html/classMultiplication.png -------------------------------------------------------------------------------- /doc/html/search/classes_9.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['power',['Power',['../classPower.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/files_3.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['utils_2eh',['utils.h',['../utils_8h.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/pages_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['bingocpp',['BingoCpp',['../index.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/structFitnessMetric.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/html/structFitnessMetric.png -------------------------------------------------------------------------------- /doc/latex/classMultiplication.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/latex/classMultiplication.pdf -------------------------------------------------------------------------------- /doc/latex/structFitnessMetric.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/latex/structFitnessMetric.pdf -------------------------------------------------------------------------------- /doc/latex/structTrainingData.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/latex/structTrainingData.pdf -------------------------------------------------------------------------------- /doc/html/search/classes_c.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['x_5fload',['X_Load',['../classX__Load.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/classes_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['division',['Division',['../classDivision.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/structImplicitRegression.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/html/structImplicitRegression.png -------------------------------------------------------------------------------- /doc/html/structStandardRegression.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/html/structStandardRegression.png -------------------------------------------------------------------------------- /doc/latex/structImplicitRegression.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/latex/structImplicitRegression.pdf -------------------------------------------------------------------------------- /doc/latex/structStandardRegression.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/latex/structStandardRegression.pdf -------------------------------------------------------------------------------- /doc/html/structExplicitTrainingData.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/html/structExplicitTrainingData.png -------------------------------------------------------------------------------- /doc/html/structImplicitTrainingData.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/html/structImplicitTrainingData.png -------------------------------------------------------------------------------- /doc/latex/structExplicitTrainingData.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/latex/structExplicitTrainingData.pdf -------------------------------------------------------------------------------- /doc/latex/structImplicitTrainingData.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/bingocpp/master/doc/latex/structImplicitTrainingData.pdf -------------------------------------------------------------------------------- /doc/html/search/classes_b.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['trainingdata',['TrainingData',['../structTrainingData.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/files_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['graph_5fmanip_2eh',['graph_manip.h',['../graph__manip_8h.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/classes_4.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['fitnessmetric',['FitnessMetric',['../structFitnessMetric.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/classes_7.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['multiplication',['Multiplication',['../classMultiplication.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/files_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['fitness_5fmetric_2eh',['fitness_metric.h',['../fitness__metric_8h.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/files_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['training_5fdata_2eh',['training_data.h',['../training__data_8h.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/variables_5.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['m',['m',['../structLMFunctor.html#a090d075bceebea8c93aa70a99e7620d5',1,'LMFunctor']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/all_11.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['values',['values',['../structLMFunctor.html#a928ebbc0ae61ab4fe5e9ffa0111f38e7',1,'LMFunctor']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/functions_e.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['values',['values',['../structLMFunctor.html#a928ebbc0ae61ab4fe5e9ffa0111f38e7',1,'LMFunctor']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/classes_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['c_5fload',['C_Load',['../classC__Load.html',1,'']]], 4 | ['cos',['Cos',['../classCos.html',1,'']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /doc/html/search/all_13.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['y',['y',['../structExplicitTrainingData.html#a0a1ca87e118aa4261a910b54cf29d0ee',1,'ExplicitTrainingData']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/classes_6.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['lmfunctor',['LMFunctor',['../structLMFunctor.html',1,'']]], 4 | ['log',['Log',['../classLog.html',1,'']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /doc/html/search/variables_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['constants',['constants',['../classAcyclicGraph.html#a06e93c34292ca14a3e963b2c2cc4b57a',1,'AcyclicGraph']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/variables_c.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['y',['y',['../structExplicitTrainingData.html#a0a1ca87e118aa4261a910b54cf29d0ee',1,'ExplicitTrainingData']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/functions_a.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['print_5fstack',['print_stack',['../classAcyclicGraph.html#abea4470f8df7e67cca412973a2b7bb17',1,'AcyclicGraph']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/variables_4.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['genetic_5fage',['genetic_age',['../classAcyclicGraph.html#a01d384f2d87fbfe3948ecd58a2b34e31',1,'AcyclicGraph']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/variables_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['dx_5fdt',['dx_dt',['../structImplicitTrainingData.html#a46e7205b1b43da1e0b6b582b3d127a2e',1,'ImplicitTrainingData']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/functions_8.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['needs_5foptimization',['needs_optimization',['../classAcyclicGraph.html#a4ca2be7ca5d026f3535634c94535e342',1,'AcyclicGraph']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/functions_d.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['utilized_5fcommands',['utilized_commands',['../classAcyclicGraph.html#a9be943e53aa4257ca1ba960868e2a3da',1,'AcyclicGraph']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/variables_8.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['required_5fparams',['required_params',['../structImplicitRegression.html#a5f25461dae2b71ad79eaf7fb91c86696',1,'ImplicitRegression']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/classes_3.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['exp',['Exp',['../classExp.html',1,'']]], 4 | ['explicittrainingdata',['ExplicitTrainingData',['../structExplicitTrainingData.html',1,'']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /doc/html/search/classes_8.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['operation',['Operation',['../classOperation.html',1,'']]], 4 | ['operatorinterface',['OperatorInterface',['../classOperatorInterface.html',1,'']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /doc/html/search/all_c.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['power',['Power',['../classPower.html',1,'']]], 4 | ['print_5fstack',['print_stack',['../classAcyclicGraph.html#abea4470f8df7e67cca412973a2b7bb17',1,'AcyclicGraph']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /doc/html/search/all_10.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['utilized_5fcommands',['utilized_commands',['../classAcyclicGraph.html#a9be943e53aa4257ca1ba960868e2a3da',1,'AcyclicGraph']]], 4 | ['utils_2eh',['utils.h',['../utils_8h.html',1,'']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /doc/html/search/classes_5.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['implicitregression',['ImplicitRegression',['../structImplicitRegression.html',1,'']]], 4 | ['implicittrainingdata',['ImplicitTrainingData',['../structImplicitTrainingData.html',1,'']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /doc/html/search/variables_b.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['x',['x',['../structExplicitTrainingData.html#aff442821da57c0cf21ab4f2a7396c7e8',1,'ExplicitTrainingData::x()'],['../structImplicitTrainingData.html#a7d797c666ce6c25d2f816e01ed4f3aed',1,'ImplicitTrainingData::x()']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/variables_9.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['simple_5fstack',['simple_stack',['../classAcyclicGraph.html#acea3997a10f2fe2acc6226f629413feb',1,'AcyclicGraph']]], 4 | ['stack',['stack',['../classAcyclicGraph.html#a0289993135a2d37ae5eaf5701801500f',1,'AcyclicGraph']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /.astylerc: -------------------------------------------------------------------------------- 1 | --suffix=none 2 | --delete-empty-lines 3 | --style=google 4 | --indent=spaces=2 5 | --attach-namespaces 6 | --indent-switches 7 | --indent-classes 8 | --break-blocks=all 9 | --pad-oper 10 | --pad-header 11 | --add-braces 12 | --convert-tabs 13 | --max-code-length=80 14 | -------------------------------------------------------------------------------- /doc/html/search/functions_6.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['latexstring',['latexstring',['../classAcyclicGraph.html#a9534cfd26946835e4190bfa722856f56',1,'AcyclicGraph']]], 4 | ['load',['load',['../classAcyclicGraphManipulator.html#af84d3a060598f93d6b0752e99d7df019',1,'AcyclicGraphManipulator']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /doc/html/search/functions_9.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['operator_28_29',['operator()',['../structLMFunctor.html#ab9272cf916bc55507969dff595743dfe',1,'LMFunctor']]], 4 | ['optimize_5fconstants',['optimize_constants',['../structFitnessMetric.html#ae4e27aefef6b54dddd6052bd80d37665',1,'FitnessMetric']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /doc/html/search/classes_a.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['sin',['Sin',['../classSin.html',1,'']]], 4 | ['sqrt',['Sqrt',['../classSqrt.html',1,'']]], 5 | ['standardregression',['StandardRegression',['../structStandardRegression.html',1,'']]], 6 | ['subtraction',['Subtraction',['../classSubtraction.html',1,'']]] 7 | ]; 8 | -------------------------------------------------------------------------------- /doc/html/search/all_12.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['x',['x',['../structExplicitTrainingData.html#aff442821da57c0cf21ab4f2a7396c7e8',1,'ExplicitTrainingData::x()'],['../structImplicitTrainingData.html#a7d797c666ce6c25d2f816e01ed4f3aed',1,'ImplicitTrainingData::x()']]], 4 | ['x_5fload',['X_Load',['../classX__Load.html',1,'']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /doc/html/search/functions_7.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['mutate_5fterminal_5fparam',['mutate_terminal_param',['../classAcyclicGraphManipulator.html#a7be7015974574f92858d6d4dac3f1fee',1,'AcyclicGraphManipulator']]], 4 | ['mutation',['mutation',['../classAcyclicGraphManipulator.html#aea8fbfeb0fbd0c8044aaa5ea50363cad',1,'AcyclicGraphManipulator']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "external/googletest"] 2 | path = external/googletest 3 | url = https://github.com/google/googletest 4 | [submodule "external/pybind"] 5 | path = external/pybind 6 | url = https://github.com/pybind/pybind11.git 7 | [submodule "external/eigen"] 8 | path = external/eigen 9 | url = https://github.com/eigenteam/eigen-git-mirror.git 10 | -------------------------------------------------------------------------------- /doc/html/search/classes_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['absolute',['Absolute',['../classAbsolute.html',1,'']]], 4 | ['acyclicgraph',['AcyclicGraph',['../classAcyclicGraph.html',1,'']]], 5 | ['acyclicgraphmanipulator',['AcyclicGraphManipulator',['../classAcyclicGraphManipulator.html',1,'']]], 6 | ['addition',['Addition',['../classAddition.html',1,'']]] 7 | ]; 8 | -------------------------------------------------------------------------------- /doc/html/search/all_8.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['latexstring',['latexstring',['../classAcyclicGraph.html#a9534cfd26946835e4190bfa722856f56',1,'AcyclicGraph']]], 4 | ['lmfunctor',['LMFunctor',['../structLMFunctor.html',1,'']]], 5 | ['load',['load',['../classAcyclicGraphManipulator.html#af84d3a060598f93d6b0752e99d7df019',1,'AcyclicGraphManipulator']]], 6 | ['log',['Log',['../classLog.html',1,'']]] 7 | ]; 8 | -------------------------------------------------------------------------------- /doc/html/search/variables_a.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['term_5fvec',['term_vec',['../classAcyclicGraphManipulator.html#a4eae07e6d85c11dd5c24e74beecb2682',1,'AcyclicGraphManipulator']]], 4 | ['terminal_5fprob',['terminal_prob',['../classAcyclicGraphManipulator.html#a0b11805aca890b75517094e6afd98875',1,'AcyclicGraphManipulator']]], 5 | ['train',['train',['../structLMFunctor.html#a025c08d9282710fb0766dcee6dd8ff07',1,'LMFunctor']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /doc/html/search/variables_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['acceptable_5ffinite_5ffracion',['acceptable_finite_fracion',['../structImplicitRegression.html#ae74f24de0d7a6a9fb3cab6e6a8b9e560',1,'ImplicitRegression']]], 4 | ['ag_5fsize',['ag_size',['../classAcyclicGraphManipulator.html#a1b0e2746882dd6cffae75018c831d99d',1,'AcyclicGraphManipulator']]], 5 | ['agraphindv',['agraphIndv',['../structLMFunctor.html#aece2cab33ffd2f919fe9e6817e3a85ac',1,'LMFunctor']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /tests/test_main.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file test_main.cc 3 | * 4 | * \author Geoffrey F. Bomarito 5 | * \date 6 | * 7 | * This file contains the main function for driving unit tests. 8 | */ 9 | 10 | #include 11 | 12 | #include 13 | #include 14 | #include 15 | 16 | #include "gtest/gtest.h" 17 | 18 | int main(int argc, char **argv) { 19 | srand (time(NULL)); 20 | ::testing::InitGoogleTest(&argc, argv); 21 | return RUN_ALL_TESTS(); 22 | } 23 | 24 | 25 | -------------------------------------------------------------------------------- /doc/html/search/functions_5.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['implicittrainingdata',['ImplicitTrainingData',['../structImplicitTrainingData.html#a517aa36137750f3d4299491b030b7431',1,'ImplicitTrainingData::ImplicitTrainingData(Eigen::ArrayXXd vx)'],['../structImplicitTrainingData.html#a5bea19d7ebed073cab7dbad3a0aeaeb2',1,'ImplicitTrainingData::ImplicitTrainingData(Eigen::ArrayXXd vx, Eigen::ArrayXXd vdx_dt)']]], 4 | ['inputs',['inputs',['../structLMFunctor.html#af3216685479be9d9c3d7fc5066927d02',1,'LMFunctor']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /doc/html/search/variables_3.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['fit',['fit',['../structLMFunctor.html#a39d6ef99670d28134bd7a903993f5e23',1,'LMFunctor']]], 4 | ['fit_5fset',['fit_set',['../classAcyclicGraph.html#aa1003d4eb327ef21a1084efcdaeb953a',1,'AcyclicGraph']]], 5 | ['fitness',['fitness',['../classAcyclicGraph.html#a01d92c1b852c41e7a6fdf1085861b5bd',1,'AcyclicGraph']]], 6 | ['float_5flim',['float_lim',['../classAcyclicGraphManipulator.html#a6591f90b81ad497237fc80e923dae793',1,'AcyclicGraphManipulator']]] 7 | ]; 8 | -------------------------------------------------------------------------------- /doc/html/search/all_9.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['m',['m',['../structLMFunctor.html#a090d075bceebea8c93aa70a99e7620d5',1,'LMFunctor']]], 4 | ['multiplication',['Multiplication',['../classMultiplication.html',1,'']]], 5 | ['mutate_5fterminal_5fparam',['mutate_terminal_param',['../classAcyclicGraphManipulator.html#a7be7015974574f92858d6d4dac3f1fee',1,'AcyclicGraphManipulator']]], 6 | ['mutation',['mutation',['../classAcyclicGraphManipulator.html#aea8fbfeb0fbd0c8044aaa5ea50363cad',1,'AcyclicGraphManipulator']]] 7 | ]; 8 | -------------------------------------------------------------------------------- /doc/latex/dir_68267d1309a1af8e8297ef4c3efbcdba.tex: -------------------------------------------------------------------------------- 1 | \hypertarget{dir_68267d1309a1af8e8297ef4c3efbcdba}{}\section{/users0/gbomarit/\+Projects/\+Genetic\+\_\+\+Programming/bingo/bingocpp/src Directory Reference} 2 | \label{dir_68267d1309a1af8e8297ef4c3efbcdba}\index{/users0/gbomarit/\+Projects/\+Genetic\+\_\+\+Programming/bingo/bingocpp/src Directory Reference@{/users0/gbomarit/\+Projects/\+Genetic\+\_\+\+Programming/bingo/bingocpp/src Directory Reference}} 3 | \subsection*{Files} 4 | \begin{DoxyCompactItemize} 5 | \end{DoxyCompactItemize} 6 | -------------------------------------------------------------------------------- /doc/html/search/nomatches.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |
No Matches
10 |
11 | 12 | 13 | -------------------------------------------------------------------------------- /doc/html/search/variables_7.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['op_5fvec',['op_vec',['../classAcyclicGraphManipulator.html#a23c0c3e199c8d25e4ca4946410ceb96b',1,'AcyclicGraphManipulator']]], 4 | ['oper_5finterface',['oper_interface',['../classAcyclicGraph.html#a82c104a4c80268bd7705be59c99b73c7',1,'AcyclicGraph']]], 5 | ['opt_5frate',['opt_rate',['../classAcyclicGraph.html#a8d3ba0273e9b1084dc9b165e5f9231fb',1,'AcyclicGraph::opt_rate()'],['../classAcyclicGraphManipulator.html#ac6d1c55c9a9012663f66b3c027abef82',1,'AcyclicGraphManipulator::opt_rate()']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /doc/latex/dir_d44c64559bbebec7f509842c48db8b23.tex: -------------------------------------------------------------------------------- 1 | \hypertarget{dir_d44c64559bbebec7f509842c48db8b23}{}\section{/users0/gbomarit/\+Projects/\+Genetic\+\_\+\+Programming/bingo/bingocpp/include Directory Reference} 2 | \label{dir_d44c64559bbebec7f509842c48db8b23}\index{/users0/gbomarit/\+Projects/\+Genetic\+\_\+\+Programming/bingo/bingocpp/include Directory Reference@{/users0/gbomarit/\+Projects/\+Genetic\+\_\+\+Programming/bingo/bingocpp/include Directory Reference}} 3 | \subsection*{Directories} 4 | \begin{DoxyCompactItemize} 5 | \end{DoxyCompactItemize} 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Compiled Object files 5 | *.slo 6 | *.lo 7 | *.o 8 | *.obj 9 | 10 | # Precompiled Headers 11 | *.gch 12 | *.pch 13 | 14 | # Compiled Dynamic libraries 15 | *.so 16 | *.dylib 17 | *.dll 18 | 19 | # Fortran module files 20 | *.mod 21 | *.smod 22 | 23 | # Compiled Static libraries 24 | *.lai 25 | *.la 26 | *.a 27 | *.lib 28 | 29 | # Executables 30 | *.exe 31 | *.out 32 | *.app 33 | *.x 34 | 35 | # Build directory 36 | build/ 37 | Debug/ 38 | Release/ 39 | Build/ 40 | 41 | # Python Build 42 | __pycache__/ 43 | -------------------------------------------------------------------------------- /include/bingocpp/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file contains definitions made in CMakeLists.txt 3 | * that we want available in the source code. 4 | * In the source code, include "BingoCpp/version.h" (no .in suffix). 5 | * This header file will be generated, and filled with the 6 | * right definition values. Change the namings as you wish, 7 | * but make sure they match up with whats in CMakeLists.txt. 8 | */ 9 | #define PROJECT_VERSION_MAJOR 0 10 | #define PROJECT_VERSION_MINOR 4 11 | #define PROJECT_VERSION_PATCH 0 12 | #define PROJECT_VERSION_TWEAK 0 13 | -------------------------------------------------------------------------------- /doc/html/search/searchdata.js: -------------------------------------------------------------------------------- 1 | var indexSectionsWithContent = 2 | { 3 | 0: "abcdefgilmnoprstuvxy", 4 | 1: "acdefilmopstx", 5 | 2: "fgtu", 6 | 3: "acdegilmnoprsuv", 7 | 4: "acdfgmnorstxy", 8 | 5: "b" 9 | }; 10 | 11 | var indexSectionNames = 12 | { 13 | 0: "all", 14 | 1: "classes", 15 | 2: "files", 16 | 3: "functions", 17 | 4: "variables", 18 | 5: "pages" 19 | }; 20 | 21 | var indexSectionLabels = 22 | { 23 | 0: "All", 24 | 1: "Classes", 25 | 2: "Files", 26 | 3: "Functions", 27 | 4: "Variables", 28 | 5: "Pages" 29 | }; 30 | 31 | -------------------------------------------------------------------------------- /doc/html/search/all_f.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['term_5fvec',['term_vec',['../classAcyclicGraphManipulator.html#a4eae07e6d85c11dd5c24e74beecb2682',1,'AcyclicGraphManipulator']]], 4 | ['terminal_5fprob',['terminal_prob',['../classAcyclicGraphManipulator.html#a0b11805aca890b75517094e6afd98875',1,'AcyclicGraphManipulator']]], 5 | ['train',['train',['../structLMFunctor.html#a025c08d9282710fb0766dcee6dd8ff07',1,'LMFunctor']]], 6 | ['training_5fdata_2eh',['training_data.h',['../training__data_8h.html',1,'']]], 7 | ['trainingdata',['TrainingData',['../structTrainingData.html',1,'']]] 8 | ]; 9 | -------------------------------------------------------------------------------- /doc/latex/Makefile: -------------------------------------------------------------------------------- 1 | all: refman.pdf 2 | 3 | pdf: refman.pdf 4 | 5 | refman.pdf: clean refman.tex 6 | pdflatex refman 7 | makeindex refman.idx 8 | pdflatex refman 9 | latex_count=8 ; \ 10 | while egrep -s 'Rerun (LaTeX|to get cross-references right)' refman.log && [ $$latex_count -gt 0 ] ;\ 11 | do \ 12 | echo "Rerunning latex...." ;\ 13 | pdflatex refman ;\ 14 | latex_count=`expr $$latex_count - 1` ;\ 15 | done 16 | makeindex refman.idx 17 | pdflatex refman 18 | 19 | 20 | clean: 21 | rm -f *.ps *.dvi *.aux *.toc *.idx *.ind *.ilg *.log *.out *.brf *.blg *.bbl refman.pdf 22 | -------------------------------------------------------------------------------- /doc/html/search/functions_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['acyclicgraph',['AcyclicGraph',['../classAcyclicGraph.html#a939b4fffe09d7157d334509bdf8ce2be',1,'AcyclicGraph::AcyclicGraph()'],['../classAcyclicGraph.html#ab76060134cbc2754f3200f57da385ad2',1,'AcyclicGraph::AcyclicGraph(const AcyclicGraph &ag)']]], 4 | ['acyclicgraphmanipulator',['AcyclicGraphManipulator',['../classAcyclicGraphManipulator.html#ae822e96783de629b1278bdacc936e984',1,'AcyclicGraphManipulator']]], 5 | ['add_5fnode_5ftype',['add_node_type',['../classAcyclicGraphManipulator.html#aea284c38a894e8bd6a7d19f0c94ce6c1',1,'AcyclicGraphManipulator']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /include/bingocpp/version.h.in: -------------------------------------------------------------------------------- 1 | /* 2 | * This file contains definitions made in CMakeLists.txt 3 | * that we want available in the source code. 4 | * In the source code, include "BingoCpp/version.h" (no .in suffix). 5 | * This header file will be generated, and filled with the 6 | * right definition values. Change the namings as you wish, 7 | * but make sure they match up with whats in CMakeLists.txt. 8 | */ 9 | #define PROJECT_VERSION_MAJOR @PROJECT_VERSION_MAJOR@ 10 | #define PROJECT_VERSION_MINOR @PROJECT_VERSION_MINOR@ 11 | #define PROJECT_VERSION_PATCH @PROJECT_VERSION_PATCH@ 12 | #define PROJECT_VERSION_TWEAK @PROJECT_VERSION_TWEAK@ 13 | -------------------------------------------------------------------------------- /doc/html/search/functions_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['calculate_5fpartials',['calculate_partials',['../utils_8h.html#a5836ec6058e585f69258a177ae67a000',1,'utils.cpp']]], 4 | ['complexity',['complexity',['../classAcyclicGraph.html#a66f52b6e177fdef6f9578e400d8efe93',1,'AcyclicGraph']]], 5 | ['copy',['copy',['../classAcyclicGraph.html#a0e3956f4b7ea48b386e32032ac139e04',1,'AcyclicGraph']]], 6 | ['count_5fconstants',['count_constants',['../classAcyclicGraph.html#a0f430cfe917cb859478a595560acd590',1,'AcyclicGraph']]], 7 | ['crossover',['crossover',['../classAcyclicGraphManipulator.html#a48cbf21ddadc69fd9122ad923532b105',1,'AcyclicGraphManipulator']]] 8 | ]; 9 | -------------------------------------------------------------------------------- /include/benchmarking/benchmark_logging.h: -------------------------------------------------------------------------------- 1 | #ifndef APP_BENCMARK_UTILS_BENCHMARK_LOGGING_H_ 2 | #define APP_BENCMARK_UTILS_BENCHMARK_LOGGING_H_ 3 | 4 | #include 5 | 6 | #include 7 | 8 | void PrintHeader(std::string title="PERFORMANCE BENCHMARKS"); 9 | void PrintResults(const Eigen::ArrayXd &run_times, const std::string &name); 10 | std::string StringPrecision(double val, int precision); 11 | void OutputParams(const std::string &name, const std::string &mean, 12 | const std::string &std, const std::string &min, 13 | const std::string &max); 14 | 15 | #endif //APP_BENCHMARK_UTILS_BENCHMARK_LOGGING_H_ -------------------------------------------------------------------------------- /cmake/Colors.cmake: -------------------------------------------------------------------------------- 1 | IF(NOT WIN32) 2 | string(ASCII 27 Esc) 3 | set(ColorReset "${Esc}[m") 4 | set(ColorBold "${Esc}[1m") 5 | set(Red "${Esc}[31m") 6 | set(Green "${Esc}[32m") 7 | set(Yellow "${Esc}[33m") 8 | set(Blue "${Esc}[34m") 9 | set(Magenta "${Esc}[35m") 10 | set(Cyan "${Esc}[36m") 11 | set(White "${Esc}[37m") 12 | set(BoldRed "${Esc}[1;31m") 13 | set(BoldGreen "${Esc}[1;32m") 14 | set(BoldYellow "${Esc}[1;33m") 15 | set(BoldBlue "${Esc}[1;34m") 16 | set(BoldMagenta "${Esc}[1;35m") 17 | set(BoldCyan "${Esc}[1;36m") 18 | set(BoldWhite "${Esc}[1;37m") 19 | ENDIF() 20 | -------------------------------------------------------------------------------- /doc/html/search/all_7.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['implicitregression',['ImplicitRegression',['../structImplicitRegression.html',1,'']]], 4 | ['implicittrainingdata',['ImplicitTrainingData',['../structImplicitTrainingData.html',1,'ImplicitTrainingData'],['../structImplicitTrainingData.html#a517aa36137750f3d4299491b030b7431',1,'ImplicitTrainingData::ImplicitTrainingData(Eigen::ArrayXXd vx)'],['../structImplicitTrainingData.html#a5bea19d7ebed073cab7dbad3a0aeaeb2',1,'ImplicitTrainingData::ImplicitTrainingData(Eigen::ArrayXXd vx, Eigen::ArrayXXd vdx_dt)']]], 5 | ['inputs',['inputs',['../structLMFunctor.html#af3216685479be9d9c3d7fc5066927d02',1,'LMFunctor']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /doc/html/search/all_5.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['fit',['fit',['../structLMFunctor.html#a39d6ef99670d28134bd7a903993f5e23',1,'LMFunctor']]], 4 | ['fit_5fset',['fit_set',['../classAcyclicGraph.html#aa1003d4eb327ef21a1084efcdaeb953a',1,'AcyclicGraph']]], 5 | ['fitness',['fitness',['../classAcyclicGraph.html#a01d92c1b852c41e7a6fdf1085861b5bd',1,'AcyclicGraph']]], 6 | ['fitness_5fmetric_2eh',['fitness_metric.h',['../fitness__metric_8h.html',1,'']]], 7 | ['fitnessmetric',['FitnessMetric',['../structFitnessMetric.html',1,'']]], 8 | ['float_5flim',['float_lim',['../classAcyclicGraphManipulator.html#a6591f90b81ad497237fc80e923dae793',1,'AcyclicGraphManipulator']]] 9 | ]; 10 | -------------------------------------------------------------------------------- /__init__.py: -------------------------------------------------------------------------------- 1 | from .build.bingocpp import Equation, \ 2 | AGraph, \ 3 | ExplicitRegression, \ 4 | ExplicitTrainingData, \ 5 | ImplicitRegression, \ 6 | ImplicitTrainingData, \ 7 | evaluation_backend, \ 8 | simplification_backend, \ 9 | FitnessFunction, \ 10 | VectorBasedFunction, \ 11 | TrainingData, \ 12 | GradientMixin, \ 13 | VectorGradientMixin 14 | 15 | del build 16 | -------------------------------------------------------------------------------- /doc/html/search/functions_c.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['savitzky_5fgolay',['savitzky_golay',['../utils_8h.html#a477f6a4d628d505fd6b0551cf2832850',1,'utils.cpp']]], 4 | ['set_5fconstants',['set_constants',['../classAcyclicGraph.html#a11aacda6eb5659d132cf03ab05eef8bd',1,'AcyclicGraph']]], 5 | ['simplify_5fstack',['simplify_stack',['../classAcyclicGraphManipulator.html#af53180fce6c3aa0deeaa9db2d1877990',1,'AcyclicGraphManipulator']]], 6 | ['size',['size',['../structTrainingData.html#a9be21e878961cc347e6820eb34db0a1b',1,'TrainingData::size()'],['../structExplicitTrainingData.html#aa5a3da99babf2436bdb9b4652a217584',1,'ExplicitTrainingData::size()'],['../structImplicitTrainingData.html#aa3be8b04a160fb496668bba52507d3e4',1,'ImplicitTrainingData::size()']]] 7 | ]; 8 | -------------------------------------------------------------------------------- /doc/html/search/functions_b.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['rand_5foperator',['rand_operator',['../classAcyclicGraphManipulator.html#a7a2a7243ed3ee04a3ce424b1b9a9d594',1,'AcyclicGraphManipulator']]], 4 | ['rand_5foperator_5fparams',['rand_operator_params',['../classAcyclicGraphManipulator.html#affb7623093d462e3f03507c3b24f6fa4',1,'AcyclicGraphManipulator']]], 5 | ['rand_5foperator_5ftype',['rand_operator_type',['../classAcyclicGraphManipulator.html#a0989820d894340cd667e9b7a66203c7a',1,'AcyclicGraphManipulator']]], 6 | ['rand_5fterminal',['rand_terminal',['../classAcyclicGraphManipulator.html#adbf93d559581182e4d4b6335952f5357',1,'AcyclicGraphManipulator']]], 7 | ['rand_5fterminal_5fparam',['rand_terminal_param',['../classAcyclicGraphManipulator.html#ad664d50ba8dba3dce11d0d3136952806',1,'AcyclicGraphManipulator']]] 8 | ]; 9 | -------------------------------------------------------------------------------- /doc/latex/dir_dcbc573d067b13a200a39ad3adabc01a.tex: -------------------------------------------------------------------------------- 1 | \hypertarget{dir_dcbc573d067b13a200a39ad3adabc01a}{}\section{/users0/gbomarit/\+Projects/\+Genetic\+\_\+\+Programming/bingo/bingocpp/include/\+Bingo\+Cpp Directory Reference} 2 | \label{dir_dcbc573d067b13a200a39ad3adabc01a}\index{/users0/gbomarit/\+Projects/\+Genetic\+\_\+\+Programming/bingo/bingocpp/include/\+Bingo\+Cpp Directory Reference@{/users0/gbomarit/\+Projects/\+Genetic\+\_\+\+Programming/bingo/bingocpp/include/\+Bingo\+Cpp Directory Reference}} 3 | \subsection*{Files} 4 | \begin{DoxyCompactItemize} 5 | \item 6 | file \hyperlink{fitness__metric_8h}{fitness\+\_\+metric.\+h} 7 | \item 8 | file \hyperlink{graph__manip_8h}{graph\+\_\+manip.\+h} 9 | \item 10 | file \hyperlink{training__data_8h}{training\+\_\+data.\+h} 11 | \item 12 | file \hyperlink{utils_8h}{utils.\+h} 13 | \end{DoxyCompactItemize} 14 | -------------------------------------------------------------------------------- /doc/html/search/all_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['c_5fload',['C_Load',['../classC__Load.html',1,'']]], 4 | ['calculate_5fpartials',['calculate_partials',['../utils_8h.html#a5836ec6058e585f69258a177ae67a000',1,'utils.cpp']]], 5 | ['complexity',['complexity',['../classAcyclicGraph.html#a66f52b6e177fdef6f9578e400d8efe93',1,'AcyclicGraph']]], 6 | ['constants',['constants',['../classAcyclicGraph.html#a06e93c34292ca14a3e963b2c2cc4b57a',1,'AcyclicGraph']]], 7 | ['copy',['copy',['../classAcyclicGraph.html#a0e3956f4b7ea48b386e32032ac139e04',1,'AcyclicGraph']]], 8 | ['cos',['Cos',['../classCos.html',1,'']]], 9 | ['count_5fconstants',['count_constants',['../classAcyclicGraph.html#a0f430cfe917cb859478a595560acd590',1,'AcyclicGraph']]], 10 | ['crossover',['crossover',['../classAcyclicGraphManipulator.html#a48cbf21ddadc69fd9122ad923532b105',1,'AcyclicGraphManipulator']]] 11 | ]; 12 | -------------------------------------------------------------------------------- /include/benchmarking/benchmark_data.h: -------------------------------------------------------------------------------- 1 | #ifndef APP_BENCMARK_UTILS_BENCHMARK_DATA_H_ 2 | #define APP_BENCMARK_UTILS_BENCHMARK_DATA_H_ 3 | 4 | #include 5 | #include 6 | 7 | using namespace bingo; 8 | 9 | struct BenchmarkTestData { 10 | std::vector indv_list; 11 | Eigen::ArrayXXd x_vals; 12 | BenchmarkTestData() {} 13 | BenchmarkTestData(std::vector &il, Eigen::ArrayXXd &x): 14 | indv_list(il), x_vals(x) {} 15 | }; 16 | 17 | void LoadBenchmarkData(BenchmarkTestData &benchmark_test_data); 18 | void LoadAgraphIndvidualData(std::vector &indv_list); 19 | void SetIndvConstants(AGraph &indv, std::string &const_string); 20 | void SetIndvStack(AGraph &indv, std::string &stack_string); 21 | Eigen::ArrayXXd LoadAgraphXVals(); 22 | double StandardDeviation(const Eigen::ArrayXd &vec); 23 | 24 | #endif // APP_BENCMARK_UTILS_BENCHMARK_DATA_H_ 25 | -------------------------------------------------------------------------------- /doc/html/search/all_b.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['op_5fvec',['op_vec',['../classAcyclicGraphManipulator.html#a23c0c3e199c8d25e4ca4946410ceb96b',1,'AcyclicGraphManipulator']]], 4 | ['oper_5finterface',['oper_interface',['../classAcyclicGraph.html#a82c104a4c80268bd7705be59c99b73c7',1,'AcyclicGraph']]], 5 | ['operation',['Operation',['../classOperation.html',1,'']]], 6 | ['operator_28_29',['operator()',['../structLMFunctor.html#ab9272cf916bc55507969dff595743dfe',1,'LMFunctor']]], 7 | ['operatorinterface',['OperatorInterface',['../classOperatorInterface.html',1,'']]], 8 | ['opt_5frate',['opt_rate',['../classAcyclicGraph.html#a8d3ba0273e9b1084dc9b165e5f9231fb',1,'AcyclicGraph::opt_rate()'],['../classAcyclicGraphManipulator.html#ac6d1c55c9a9012663f66b3c027abef82',1,'AcyclicGraphManipulator::opt_rate()']]], 9 | ['optimize_5fconstants',['optimize_constants',['../structFitnessMetric.html#ae4e27aefef6b54dddd6052bd80d37665',1,'FitnessMetric']]] 10 | ]; 11 | -------------------------------------------------------------------------------- /doc/html/search/all_d.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['rand_5foperator',['rand_operator',['../classAcyclicGraphManipulator.html#a7a2a7243ed3ee04a3ce424b1b9a9d594',1,'AcyclicGraphManipulator']]], 4 | ['rand_5foperator_5fparams',['rand_operator_params',['../classAcyclicGraphManipulator.html#affb7623093d462e3f03507c3b24f6fa4',1,'AcyclicGraphManipulator']]], 5 | ['rand_5foperator_5ftype',['rand_operator_type',['../classAcyclicGraphManipulator.html#a0989820d894340cd667e9b7a66203c7a',1,'AcyclicGraphManipulator']]], 6 | ['rand_5fterminal',['rand_terminal',['../classAcyclicGraphManipulator.html#adbf93d559581182e4d4b6335952f5357',1,'AcyclicGraphManipulator']]], 7 | ['rand_5fterminal_5fparam',['rand_terminal_param',['../classAcyclicGraphManipulator.html#ad664d50ba8dba3dce11d0d3136952806',1,'AcyclicGraphManipulator']]], 8 | ['required_5fparams',['required_params',['../structImplicitRegression.html#a5f25461dae2b71ad79eaf7fb91c86696',1,'ImplicitRegression']]] 9 | ]; 10 | -------------------------------------------------------------------------------- /doc/html/search/variables_6.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['n',['n',['../structLMFunctor.html#a97d53b5fcdf96c8ffe5ea70b7adc0de4',1,'LMFunctor']]], 4 | ['needs_5fopt',['needs_opt',['../classAcyclicGraph.html#adad7dd87ced7e2cae5a1ec20a6936ef6',1,'AcyclicGraph']]], 5 | ['nloads',['nloads',['../classAcyclicGraphManipulator.html#abaabd6c4fb4cee6b7adfc3fc146fb395',1,'AcyclicGraphManipulator']]], 6 | ['node_5ftype_5fvec',['node_type_vec',['../classAcyclicGraphManipulator.html#aa0e85eda232a3dd36fe170b5b67e5e57',1,'AcyclicGraphManipulator']]], 7 | ['normalize_5fdot',['normalize_dot',['../structImplicitRegression.html#a8d31df5b4020c1d26dc130e694b69ee4',1,'ImplicitRegression']]], 8 | ['num_5fnode_5ftypes',['num_node_types',['../classAcyclicGraphManipulator.html#a69ebad78a28b2ce356e82db1f883c19d',1,'AcyclicGraphManipulator']]], 9 | ['nvars',['nvars',['../classAcyclicGraphManipulator.html#a1daae08faa803d96d51c71911a543bde',1,'AcyclicGraphManipulator']]] 10 | ]; 11 | -------------------------------------------------------------------------------- /cmake/ConfigSafeGuards.cmake: -------------------------------------------------------------------------------- 1 | # guard against in-source builds 2 | if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) 3 | message(FATAL_ERROR "In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there.") 4 | endif() 5 | 6 | # guard against bad build-type strings 7 | if (NOT CMAKE_BUILD_TYPE) 8 | message(STATUS "No build type selected, default to Debug") 9 | set(CMAKE_BUILD_TYPE "Debug") 10 | endif() 11 | 12 | string(TOLOWER "${CMAKE_BUILD_TYPE}" cmake_build_type_tolower) 13 | string(TOUPPER "${CMAKE_BUILD_TYPE}" cmake_build_type_toupper) 14 | if( NOT cmake_build_type_tolower STREQUAL "debug" 15 | AND NOT cmake_build_type_tolower STREQUAL "release" 16 | AND NOT cmake_build_type_tolower STREQUAL "profile" 17 | AND NOT cmake_build_type_tolower STREQUAL "relwithdebinfo" 18 | AND NOT cmake_build_type_tolower STREQUAL "coverage") 19 | message(FATAL_ERROR "Unknown build type \"${CMAKE_BUILD_TYPE}\". Allowed values are Debug, Coverage, Release, Profile, RelWithDebInfo (case-insensitive).") 20 | endif() 21 | -------------------------------------------------------------------------------- /doc/html/search/all_a.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['n',['n',['../structLMFunctor.html#a97d53b5fcdf96c8ffe5ea70b7adc0de4',1,'LMFunctor']]], 4 | ['needs_5fopt',['needs_opt',['../classAcyclicGraph.html#adad7dd87ced7e2cae5a1ec20a6936ef6',1,'AcyclicGraph']]], 5 | ['needs_5foptimization',['needs_optimization',['../classAcyclicGraph.html#a4ca2be7ca5d026f3535634c94535e342',1,'AcyclicGraph']]], 6 | ['nloads',['nloads',['../classAcyclicGraphManipulator.html#abaabd6c4fb4cee6b7adfc3fc146fb395',1,'AcyclicGraphManipulator']]], 7 | ['node_5ftype_5fvec',['node_type_vec',['../classAcyclicGraphManipulator.html#aa0e85eda232a3dd36fe170b5b67e5e57',1,'AcyclicGraphManipulator']]], 8 | ['normalize_5fdot',['normalize_dot',['../structImplicitRegression.html#a8d31df5b4020c1d26dc130e694b69ee4',1,'ImplicitRegression']]], 9 | ['num_5fnode_5ftypes',['num_node_types',['../classAcyclicGraphManipulator.html#a69ebad78a28b2ce356e82db1f883c19d',1,'AcyclicGraphManipulator']]], 10 | ['nvars',['nvars',['../classAcyclicGraphManipulator.html#a1daae08faa803d96d51c71911a543bde',1,'AcyclicGraphManipulator']]] 11 | ]; 12 | -------------------------------------------------------------------------------- /doc/html/search/all_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/all_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/all_10.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/all_11.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/all_12.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/all_13.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/all_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/all_3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/all_4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/all_5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/all_6.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/all_7.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/all_8.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/all_9.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/all_a.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/all_b.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/all_c.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/all_d.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/all_e.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/all_f.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/classes_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/classes_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/classes_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/classes_3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/classes_4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/classes_5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/classes_6.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/classes_7.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/classes_8.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/classes_9.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/classes_a.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/classes_b.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/classes_c.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/files_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/files_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/files_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/files_3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/pages_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/functions_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/functions_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/functions_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/functions_3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/functions_4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/functions_5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/functions_6.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/functions_7.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/functions_8.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/functions_9.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/functions_a.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/functions_b.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/functions_c.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/functions_d.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/functions_e.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/variables_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/variables_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/variables_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/variables_3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/variables_4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/variables_5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/variables_6.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/variables_7.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/variables_8.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/variables_9.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/variables_a.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/variables_b.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/html/search/variables_c.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /include/bingocpp/agraph/simplification_backend/template.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 United States Government as represented by the Administrator 3 | * of the National Aeronautics and Space Administration. No copyright is claimed 4 | * in the United States under Title 17, U.S. Code. All Other Rights Reserved. 5 | * 6 | * The Bingo Mini-app platform is licensed under the Apache License, Version 2.0 7 | * (the "License"); you may not use this file except in compliance with the 8 | * License. You may obtain a copy of the License at 9 | * http://www.apache.org/licenses/LICENSE-2.0. 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | * License for the specific language governing permissions and limitations under 15 | * the License. 16 | */ 17 | #ifndef INCLUDE_BINGOCPP_SIMPLIFICATION_BACKEND_EXPRESSION_H 18 | #define INCLUDE_BINGOCPP_SIMPLIFICATION_BACKEND_EXPRESSION_H 19 | namespace bingo { 20 | namespace simplification_backend { 21 | 22 | } // namespace simplification_backend 23 | } // namespace bingo 24 | #endif -------------------------------------------------------------------------------- /doc/html/search/all_e.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['savitzky_5fgolay',['savitzky_golay',['../utils_8h.html#a477f6a4d628d505fd6b0551cf2832850',1,'utils.cpp']]], 4 | ['set_5fconstants',['set_constants',['../classAcyclicGraph.html#a11aacda6eb5659d132cf03ab05eef8bd',1,'AcyclicGraph']]], 5 | ['simple_5fstack',['simple_stack',['../classAcyclicGraph.html#acea3997a10f2fe2acc6226f629413feb',1,'AcyclicGraph']]], 6 | ['simplify_5fstack',['simplify_stack',['../classAcyclicGraphManipulator.html#af53180fce6c3aa0deeaa9db2d1877990',1,'AcyclicGraphManipulator']]], 7 | ['sin',['Sin',['../classSin.html',1,'']]], 8 | ['size',['size',['../structTrainingData.html#a9be21e878961cc347e6820eb34db0a1b',1,'TrainingData::size()'],['../structExplicitTrainingData.html#aa5a3da99babf2436bdb9b4652a217584',1,'ExplicitTrainingData::size()'],['../structImplicitTrainingData.html#aa3be8b04a160fb496668bba52507d3e4',1,'ImplicitTrainingData::size()']]], 9 | ['sqrt',['Sqrt',['../classSqrt.html',1,'']]], 10 | ['stack',['stack',['../classAcyclicGraph.html#a0289993135a2d37ae5eaf5701801500f',1,'AcyclicGraph']]], 11 | ['standardregression',['StandardRegression',['../structStandardRegression.html',1,'']]], 12 | ['subtraction',['Subtraction',['../classSubtraction.html',1,'']]] 13 | ]; 14 | -------------------------------------------------------------------------------- /doc/html/search/all_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['absolute',['Absolute',['../classAbsolute.html',1,'']]], 4 | ['acceptable_5ffinite_5ffracion',['acceptable_finite_fracion',['../structImplicitRegression.html#ae74f24de0d7a6a9fb3cab6e6a8b9e560',1,'ImplicitRegression']]], 5 | ['acyclicgraph',['AcyclicGraph',['../classAcyclicGraph.html',1,'AcyclicGraph'],['../classAcyclicGraph.html#a939b4fffe09d7157d334509bdf8ce2be',1,'AcyclicGraph::AcyclicGraph()'],['../classAcyclicGraph.html#ab76060134cbc2754f3200f57da385ad2',1,'AcyclicGraph::AcyclicGraph(const AcyclicGraph &ag)']]], 6 | ['acyclicgraphmanipulator',['AcyclicGraphManipulator',['../classAcyclicGraphManipulator.html',1,'AcyclicGraphManipulator'],['../classAcyclicGraphManipulator.html#ae822e96783de629b1278bdacc936e984',1,'AcyclicGraphManipulator::AcyclicGraphManipulator()']]], 7 | ['add_5fnode_5ftype',['add_node_type',['../classAcyclicGraphManipulator.html#aea284c38a894e8bd6a7d19f0c94ce6c1',1,'AcyclicGraphManipulator']]], 8 | ['addition',['Addition',['../classAddition.html',1,'']]], 9 | ['ag_5fsize',['ag_size',['../classAcyclicGraphManipulator.html#a1b0e2746882dd6cffae75018c831d99d',1,'AcyclicGraphManipulator']]], 10 | ['agraphindv',['agraphIndv',['../structLMFunctor.html#aece2cab33ffd2f919fe9e6817e3a85ac',1,'LMFunctor']]] 11 | ]; 12 | -------------------------------------------------------------------------------- /include/bingocpp/agraph/constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 United States Government as represented by the Administrator 3 | * of the National Aeronautics and Space Administration. No copyright is claimed 4 | * in the United States under Title 17, U.S. Code. All Other Rights Reserved. 5 | * 6 | * The Bingo Mini-app platform is licensed under the Apache License, Version 2.0 7 | * (the "License"); you may not use this file except in compliance with the 8 | * License. You may obtain a copy of the License at 9 | * http://www.apache.org/licenses/LICENSE-2.0. 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | * License for the specific language governing permissions and limitations under 15 | * the License. 16 | */ 17 | #ifndef BINGOCPP_INCLUDE_BINGOCPP_CONSTANTS_H_ 18 | #define BINGOCPP_INCLUDE_BINGOCPP_CONSTANTS_H_ 19 | 20 | namespace bingo { 21 | 22 | const double kNaN = std::numeric_limits::quiet_NaN(); 23 | 24 | const unsigned int kOpIdx = 0; 25 | const unsigned int kParam1Idx = 1; 26 | const unsigned int kParam2Idx = 2; 27 | const unsigned int kArrayCols = 3; 28 | 29 | const int kOptimizeConstant = -1; 30 | 31 | } // namespace bingo 32 | #endif // BINGOCPP_INCLUDE_BINGOCPP_CONSTANTS_H_ 33 | -------------------------------------------------------------------------------- /doc/latex/training__data_8h.tex: -------------------------------------------------------------------------------- 1 | \hypertarget{training__data_8h}{}\section{/users0/gbomarit/\+Projects/\+Genetic\+\_\+\+Programming/bingo/bingocpp/include/\+Bingo\+Cpp/training\+\_\+data.h File Reference} 2 | \label{training__data_8h}\index{/users0/gbomarit/\+Projects/\+Genetic\+\_\+\+Programming/bingo/bingocpp/include/\+Bingo\+Cpp/training\+\_\+data.\+h@{/users0/gbomarit/\+Projects/\+Genetic\+\_\+\+Programming/bingo/bingocpp/include/\+Bingo\+Cpp/training\+\_\+data.\+h}} 3 | {\ttfamily \#include $<$Eigen/\+Dense$>$}\\* 4 | {\ttfamily \#include $<$Eigen/\+Core$>$}\\* 5 | {\ttfamily \#include $<$vector$>$}\\* 6 | {\ttfamily \#include $<$list$>$}\\* 7 | \subsection*{Classes} 8 | \begin{DoxyCompactItemize} 9 | \item 10 | struct \hyperlink{structTrainingData}{Training\+Data} 11 | \item 12 | struct \hyperlink{structExplicitTrainingData}{Explicit\+Training\+Data} 13 | \begin{DoxyCompactList}\small\item\em This struct holds data for Explicit regression. \end{DoxyCompactList}\item 14 | struct \hyperlink{structImplicitTrainingData}{Implicit\+Training\+Data} 15 | \begin{DoxyCompactList}\small\item\em This struct holds data for Implicit regression. \end{DoxyCompactList}\end{DoxyCompactItemize} 16 | 17 | 18 | \subsection{Detailed Description} 19 | \begin{DoxyAuthor}{Author} 20 | Ethan Adams 21 | \end{DoxyAuthor} 22 | \begin{DoxyDate}{Date} 23 | 24 | \end{DoxyDate} 25 | This file contains the cpp version of training\+\_\+data.\+py -------------------------------------------------------------------------------- /doc/html/tabs.css: -------------------------------------------------------------------------------- 1 | .tabs, .tabs2, .tabs3 { 2 | background-image: url('tab_b.png'); 3 | width: 100%; 4 | z-index: 101; 5 | font-size: 13px; 6 | font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; 7 | } 8 | 9 | .tabs2 { 10 | font-size: 10px; 11 | } 12 | .tabs3 { 13 | font-size: 9px; 14 | } 15 | 16 | .tablist { 17 | margin: 0; 18 | padding: 0; 19 | display: table; 20 | } 21 | 22 | .tablist li { 23 | float: left; 24 | display: table-cell; 25 | background-image: url('tab_b.png'); 26 | line-height: 36px; 27 | list-style: none; 28 | } 29 | 30 | .tablist a { 31 | display: block; 32 | padding: 0 20px; 33 | font-weight: bold; 34 | background-image:url('tab_s.png'); 35 | background-repeat:no-repeat; 36 | background-position:right; 37 | color: #283A5D; 38 | text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); 39 | text-decoration: none; 40 | outline: none; 41 | } 42 | 43 | .tabs3 .tablist a { 44 | padding: 0 10px; 45 | } 46 | 47 | .tablist a:hover { 48 | background-image: url('tab_h.png'); 49 | background-repeat:repeat-x; 50 | color: #fff; 51 | text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); 52 | text-decoration: none; 53 | } 54 | 55 | .tablist li.current a { 56 | background-image: url('tab_a.png'); 57 | background-repeat:repeat-x; 58 | color: #fff; 59 | text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); 60 | } 61 | -------------------------------------------------------------------------------- /doc/latex/graph__manip_8h.tex: -------------------------------------------------------------------------------- 1 | \hypertarget{graph__manip_8h}{}\section{/users0/gbomarit/\+Projects/\+Genetic\+\_\+\+Programming/bingo/bingocpp/include/\+Bingo\+Cpp/graph\+\_\+manip.h File Reference} 2 | \label{graph__manip_8h}\index{/users0/gbomarit/\+Projects/\+Genetic\+\_\+\+Programming/bingo/bingocpp/include/\+Bingo\+Cpp/graph\+\_\+manip.\+h@{/users0/gbomarit/\+Projects/\+Genetic\+\_\+\+Programming/bingo/bingocpp/include/\+Bingo\+Cpp/graph\+\_\+manip.\+h}} 3 | {\ttfamily \#include $<$Eigen/\+Dense$>$}\\* 4 | {\ttfamily \#include $<$Eigen/\+Core$>$}\\* 5 | {\ttfamily \#include $<$set$>$}\\* 6 | {\ttfamily \#include $<$map$>$}\\* 7 | {\ttfamily \#include $<$utility$>$}\\* 8 | {\ttfamily \#include $<$vector$>$}\\* 9 | {\ttfamily \#include $<$string$>$}\\* 10 | {\ttfamily \#include $<$sstream$>$}\\* 11 | {\ttfamily \#include $<$stdlib.\+h$>$}\\* 12 | {\ttfamily \#include $<$iomanip$>$}\\* 13 | {\ttfamily \#include $<$time.\+h$>$}\\* 14 | {\ttfamily \#include \char`\"{}Bingo\+Cpp/acyclic\+\_\+graph\+\_\+nodes.\+h\char`\"{}}\\* 15 | \subsection*{Classes} 16 | \begin{DoxyCompactItemize} 17 | \item 18 | class \hyperlink{classAcyclicGraph}{Acyclic\+Graph} 19 | \item 20 | class \hyperlink{classAcyclicGraphManipulator}{Acyclic\+Graph\+Manipulator} 21 | \end{DoxyCompactItemize} 22 | 23 | 24 | \subsection{Detailed Description} 25 | \begin{DoxyAuthor}{Author} 26 | Ethan Adams 27 | \end{DoxyAuthor} 28 | \begin{DoxyDate}{Date} 29 | 2/26/2018 30 | \end{DoxyDate} 31 | This file contains the cpp version of A\+Graph\+Cpp.\+py -------------------------------------------------------------------------------- /doc/latex/fitness__metric_8h.tex: -------------------------------------------------------------------------------- 1 | \hypertarget{fitness__metric_8h}{}\section{/users0/gbomarit/\+Projects/\+Genetic\+\_\+\+Programming/bingo/bingocpp/include/\+Bingo\+Cpp/fitness\+\_\+metric.h File Reference} 2 | \label{fitness__metric_8h}\index{/users0/gbomarit/\+Projects/\+Genetic\+\_\+\+Programming/bingo/bingocpp/include/\+Bingo\+Cpp/fitness\+\_\+metric.\+h@{/users0/gbomarit/\+Projects/\+Genetic\+\_\+\+Programming/bingo/bingocpp/include/\+Bingo\+Cpp/fitness\+\_\+metric.\+h}} 3 | {\ttfamily \#include \char`\"{}Bingo\+Cpp/graph\+\_\+manip.\+h\char`\"{}}\\* 4 | {\ttfamily \#include \char`\"{}Bingo\+Cpp/training\+\_\+data.\+h\char`\"{}}\\* 5 | {\ttfamily \#include $<$Eigen/\+Dense$>$}\\* 6 | {\ttfamily \#include $<$Eigen/\+Core$>$}\\* 7 | \subsection*{Classes} 8 | \begin{DoxyCompactItemize} 9 | \item 10 | struct \hyperlink{structLMFunctor}{L\+M\+Functor} 11 | \item 12 | struct \hyperlink{structFitnessMetric}{Fitness\+Metric} 13 | \item 14 | struct \hyperlink{structStandardRegression}{Standard\+Regression} 15 | \begin{DoxyCompactList}\small\item\em Traditional fitness evaluation. \end{DoxyCompactList}\item 16 | struct \hyperlink{structImplicitRegression}{Implicit\+Regression} 17 | \begin{DoxyCompactList}\small\item\em Implicit Regression. \end{DoxyCompactList}\end{DoxyCompactItemize} 18 | 19 | 20 | \subsection{Detailed Description} 21 | \begin{DoxyAuthor}{Author} 22 | Ethan Adams 23 | \end{DoxyAuthor} 24 | \begin{DoxyDate}{Date} 25 | 26 | \end{DoxyDate} 27 | This file contains the cpp version of Fitness\+Metric.\+py -------------------------------------------------------------------------------- /include/bingocpp/agraph/simplification_backend/constant_expressions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 United States Government as represented by the Administrator 3 | * of the National Aeronautics and Space Administration. No copyright is claimed 4 | * in the United States under Title 17, U.S. Code. All Other Rights Reserved. 5 | * 6 | * The Bingo Mini-app platform is licensed under the Apache License, Version 2.0 7 | * (the "License"); you may not use this file except in compliance with the 8 | * License. You may obtain a copy of the License at 9 | * http://www.apache.org/licenses/LICENSE-2.0. 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | * License for the specific language governing permissions and limitations under 15 | * the License. 16 | */ 17 | #ifndef INCLUDE_BINGOCPP_SIMPLIFICATION_BACKEND_CONST_EXPRESSION_H 18 | #define INCLUDE_BINGOCPP_SIMPLIFICATION_BACKEND_CONST_EXPRESSION_H 19 | 20 | #include 21 | 22 | #include 23 | #include 24 | 25 | namespace bingo { 26 | namespace simplification_backend { 27 | 28 | 29 | std::shared_ptr kOne = 30 | std::make_shared(kInteger, 1); 31 | 32 | 33 | 34 | } // namespace simplification_backend 35 | } // namespace bingo 36 | #endif -------------------------------------------------------------------------------- /doc/latex/files.tex: -------------------------------------------------------------------------------- 1 | \section{File List} 2 | Here is a list of all documented files with brief descriptions\+:\begin{DoxyCompactList} 3 | \item\contentsline{section}{/users0/gbomarit/\+Projects/\+Genetic\+\_\+\+Programming/bingo/bingocpp/include/\+Bingo\+Cpp/{\bfseries acyclic\+\_\+graph.\+h} }{\pageref{acyclic__graph_8h}}{} 4 | \item\contentsline{section}{/users0/gbomarit/\+Projects/\+Genetic\+\_\+\+Programming/bingo/bingocpp/include/\+Bingo\+Cpp/{\bfseries acyclic\+\_\+graph\+\_\+nodes.\+h} }{\pageref{acyclic__graph__nodes_8h}}{} 5 | \item\contentsline{section}{/users0/gbomarit/\+Projects/\+Genetic\+\_\+\+Programming/bingo/bingocpp/include/\+Bingo\+Cpp/\hyperlink{fitness__metric_8h}{fitness\+\_\+metric.\+h} }{\pageref{fitness__metric_8h}}{} 6 | \item\contentsline{section}{/users0/gbomarit/\+Projects/\+Genetic\+\_\+\+Programming/bingo/bingocpp/include/\+Bingo\+Cpp/\hyperlink{graph__manip_8h}{graph\+\_\+manip.\+h} }{\pageref{graph__manip_8h}}{} 7 | \item\contentsline{section}{/users0/gbomarit/\+Projects/\+Genetic\+\_\+\+Programming/bingo/bingocpp/include/\+Bingo\+Cpp/\hyperlink{training__data_8h}{training\+\_\+data.\+h} }{\pageref{training__data_8h}}{} 8 | \item\contentsline{section}{/users0/gbomarit/\+Projects/\+Genetic\+\_\+\+Programming/bingo/bingocpp/include/\+Bingo\+Cpp/\hyperlink{utils_8h}{utils.\+h} }{\pageref{utils_8h}}{} 9 | \item\contentsline{section}{/users0/gbomarit/\+Projects/\+Genetic\+\_\+\+Programming/bingo/bingocpp/include/\+Bingo\+Cpp/{\bfseries version.\+h} }{\pageref{version_8h}}{} 10 | \end{DoxyCompactList} 11 | -------------------------------------------------------------------------------- /src/gradient_mixin.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | 6 | namespace bingo { 7 | 8 | VectorGradientMixin::VectorGradientMixin(TrainingData *training_data, std::string metric) { 9 | if (metric_functions::metric_found(metric_functions::kMeanAbsoluteError, metric)) { 10 | metric_function_ = metric_functions::mean_absolute_error; 11 | metric_derivative_ = VectorGradientMixin::mean_absolute_error_derivative; 12 | } else if (metric_functions::metric_found(metric_functions::kMeanSquaredError, metric)) { 13 | metric_function_ = metric_functions::mean_squared_error; 14 | metric_derivative_ = VectorGradientMixin::mean_squared_error_derivative; 15 | } else if (metric_functions::metric_found(metric_functions::kRootMeanSquaredError, metric)) { 16 | metric_function_ = metric_functions::root_mean_squared_error; 17 | metric_derivative_ = VectorGradientMixin::root_mean_squared_error_derivative; 18 | } else { 19 | throw std::invalid_argument("Invalid metric for VectorGradientMixin"); 20 | } 21 | } 22 | 23 | FitnessAndGradient VectorGradientMixin::GetIndividualFitnessAndGradient(Equation &individual) const { 24 | Eigen::ArrayXd fitness_vector; 25 | Eigen::ArrayXXd jacobian; 26 | std::tie(fitness_vector, jacobian) = this->GetFitnessVectorAndJacobian(individual); 27 | double fitness = this->metric_function_(fitness_vector); 28 | return FitnessAndGradient{fitness, metric_derivative_(fitness_vector, jacobian.transpose())}; 29 | } 30 | 31 | } // namespace bingo 32 | -------------------------------------------------------------------------------- /include/python/py_equation.h: -------------------------------------------------------------------------------- 1 | #ifndef BINGOCPP_INCLUDE_BINGOCPP_PY_EQUATION_H_ 2 | #define BINGOCPP_INCLUDE_BINGOCPP_PY_EQUATION_H_ 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #include "bingocpp/equation.h" 11 | 12 | namespace bingo { 13 | 14 | class PyEquation : public Equation { 15 | public: 16 | Eigen::ArrayXXd 17 | EvaluateEquationAt(const Eigen::ArrayXXd &x) { 18 | PYBIND11_OVERLOAD_PURE_NAME( 19 | Eigen::ArrayXXd, 20 | Equation, 21 | "evaluate_equation_at", 22 | EvaluateEquationAt, 23 | x 24 | ); 25 | } 26 | 27 | EvalAndDerivative 28 | EvaluateEquationWithXGradientAt(const Eigen::ArrayXXd &x) { 29 | PYBIND11_OVERLOAD_PURE_NAME( 30 | EvalAndDerivative, 31 | Equation, 32 | "evaluate_equation_with_x_gradient_at", 33 | EvaluateEquationWithXGradientAt, 34 | x 35 | ); 36 | } 37 | 38 | EvalAndDerivative 39 | EvaluateEquationWithLocalOptGradientAt(const Eigen::ArrayXXd &x) { 40 | PYBIND11_OVERLOAD_PURE_NAME( 41 | EvalAndDerivative, 42 | Equation, 43 | "evaluate_equation_with_local_opt_gradient_at", 44 | EvaluateEquationWithLocalOptGradientAt, 45 | x 46 | ); 47 | } 48 | 49 | int GetComplexity() override { 50 | PYBIND11_OVERLOAD_PURE_NAME( 51 | int, 52 | Equation, 53 | "get_complexity", 54 | GetComplexity, 55 | ); 56 | } 57 | }; 58 | } // namespace bingo 59 | #endif // BINGOCPP_INCLUDE_BINGOCPP_PY_EQUATION_H_ -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: cpp 2 | compiler: gcc 3 | 4 | before_install: 5 | - which python 6 | - python --version 7 | # - pyenv install 3.6 8 | # - pyenv global 3.4.0 9 | # # C++17 10 | # - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test 11 | # - sudo apt-get update -qq 12 | 13 | install: 14 | # # C++17 15 | # - sudo apt-get install -qq g++-7 16 | # - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 90 17 | # - sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-7 90 18 | 19 | # install newer LCOV (apt version outdated and fails for new gcov). 20 | - wget http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.11.orig.tar.gz 21 | - tar xf lcov_1.11.orig.tar.gz 22 | - sudo make -C lcov-1.11/ install 23 | - which lcov 24 | 25 | # Install coverals gem for uploading coverage to coveralls. 26 | - gem install coveralls-lcov 27 | 28 | before_script: 29 | - lcov --version 30 | - gcov --version 31 | - g++ --version 32 | - PARENTDIR=$(pwd) 33 | - mkdir $PARENTDIR/build && cd $PARENTDIR/build 34 | 35 | script: 36 | - cd $PARENTDIR/build 37 | - PYEXECUTABLE=`which python` 38 | - cmake -DCMAKE_BUILD_TYPE=Coverage -DPYTHON_EXECUTABLE:FILEPATH=$PYEXECUTABLE $PARENTDIR 39 | - make 40 | - make gtest 41 | - make coverage 42 | - cd .. 43 | - ./build.sh 44 | - cd build/ 45 | - ./performanceBenchmark 46 | - ./fitnessBenchmark 47 | 48 | after_success: 49 | - cd $PARENTDIR/build 50 | - lcov --list coverage_out.info.cleaned # Show test report in travis log. 51 | - coveralls-lcov coverage_out.info.cleaned # uploads to coveralls 52 | -------------------------------------------------------------------------------- /include/python/py_gradient_mixin.h: -------------------------------------------------------------------------------- 1 | #ifndef BINGOCPP_INCLUDE_BINGOCPP_PY_GRADIENT_MIXIN_H 2 | #define BINGOCPP_INCLUDE_BINGOCPP_PY_GRADIENT_MIXIN_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | 11 | namespace py = pybind11; 12 | 13 | namespace bingo { 14 | 15 | class PyGradientMixin : public GradientMixin { 16 | public: 17 | FitnessAndGradient GetIndividualFitnessAndGradient(Equation &individual) { 18 | PYBIND11_OVERLOAD_PURE_NAME( 19 | FitnessAndGradient, 20 | GradientMixin, 21 | "get_fitness_and_gradient", 22 | GetIndividualFitnessAndGradient, 23 | individual 24 | ); 25 | } 26 | }; 27 | 28 | class PyVectorGradientMixin : public VectorGradientMixin { 29 | public: 30 | using VectorGradientMixin::VectorGradientMixin; 31 | 32 | FitnessAndGradient GetIndividualFitnessAndGradient(Equation &individual) const { 33 | PYBIND11_OVERLOAD_NAME( 34 | FitnessAndGradient, 35 | VectorGradientMixin, 36 | "get_fitness_and_gradient", 37 | GetIndividualFitnessAndGradient, 38 | individual 39 | ); 40 | } 41 | 42 | virtual FitnessVectorAndJacobian GetFitnessVectorAndJacobian(Equation &individual) const { 43 | PYBIND11_OVERLOAD_PURE_NAME( 44 | FitnessVectorAndJacobian, 45 | VectorGradientMixin, 46 | "get_fitness_vector_and_jacobian", 47 | GetFitnessVectorAndJacobian, 48 | individual 49 | ); 50 | } 51 | }; 52 | } // namespace bingo 53 | #endif //BINGOCPP_INCLUDE_BINGOCPP_PY_GRADIENT_MIXIN_H 54 | -------------------------------------------------------------------------------- /app/fitness_function_pymodule.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | namespace py = pybind11; 12 | using namespace bingo; 13 | 14 | void add_fitness_classes(py::module &parent) { 15 | py::class_(parent, "FitnessFunction") 16 | .def(py::init(), 17 | py::arg("training_data") = py::none()) 18 | .def("__call__", &FitnessFunction::EvaluateIndividualFitness) 19 | .def_property("eval_count", &FitnessFunction::GetEvalCount, &FitnessFunction::SetEvalCount) 20 | .def_property("training_data", &FitnessFunction::GetTrainingData, &FitnessFunction::SetTrainingData); 21 | 22 | py::class_(parent, "TrainingData") 23 | .def(py::init<>()) 24 | .def("__getitem__", 25 | static_cast &)>(&TrainingData::GetItem), 26 | py::arg("items")) 27 | .def("__len__", &TrainingData::Size); 28 | 29 | py::class_(parent, "VectorBasedFunction") 30 | .def(py::init(), 31 | py::arg("training_data") = py::none(), 32 | py::arg("metric") = "mae") 33 | .def("__call__", &VectorBasedFunction::EvaluateIndividualFitness) 34 | .def("evaluate_fitness_vector", &VectorBasedFunction::EvaluateFitnessVector); 35 | } -------------------------------------------------------------------------------- /doc/html/search/functions_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['deriv_5fevaluate',['deriv_evaluate',['../classOperation.html#a42b611d08c6b00568c5d1b08688ebcce',1,'Operation::deriv_evaluate()'],['../classX__Load.html#a5ee414b0a344871b8e52d5c9c6c2f51b',1,'X_Load::deriv_evaluate()'],['../classC__Load.html#abfe90cef11f940a216284970f6db7b0d',1,'C_Load::deriv_evaluate()'],['../classAddition.html#a30c3e7495cbe3bdc010f2d3f8570bcc8',1,'Addition::deriv_evaluate()'],['../classSubtraction.html#aabe4bc428dcc778adb63940a3e91327d',1,'Subtraction::deriv_evaluate()'],['../classMultiplication.html#add5b53fbcd0f2e16c3be398c53d0fbe6',1,'Multiplication::deriv_evaluate()'],['../classDivision.html#af0f88f306718e3a490315e4be78885f3',1,'Division::deriv_evaluate()'],['../classSin.html#a7ee9713a0e86b56b7cb4f23f81b1a502',1,'Sin::deriv_evaluate()'],['../classCos.html#a4ca2ae643db43a16772f9fdbb86c06a6',1,'Cos::deriv_evaluate()'],['../classExp.html#aaf9e4870dcd8eda83174f003d9bd4a8a',1,'Exp::deriv_evaluate()'],['../classLog.html#a6f52d16f62171275092117364faa9b04',1,'Log::deriv_evaluate()'],['../classPower.html#aacb7fa5a44485f39df757f5a8b134d28',1,'Power::deriv_evaluate()'],['../classAbsolute.html#a8c75e9e1efcfd1fc50ee2af13ed9d6d1',1,'Absolute::deriv_evaluate()'],['../classSqrt.html#aa85791e8fd1f7239b34aed9f21a9f3a6',1,'Sqrt::deriv_evaluate()']]], 4 | ['df',['df',['../structLMFunctor.html#a0f2edfe1662d360c601caec4332ab60a',1,'LMFunctor']]], 5 | ['distance',['distance',['../classAcyclicGraphManipulator.html#a4bee8f5802f96f250f71be70978aac92',1,'AcyclicGraphManipulator']]], 6 | ['dump',['dump',['../classAcyclicGraphManipulator.html#a25e1e62f422475fd78c2a9f9046190e2',1,'AcyclicGraphManipulator']]] 7 | ]; 8 | -------------------------------------------------------------------------------- /app/test-agraph-consts.csv: -------------------------------------------------------------------------------- 1 | 0.0 2 | 1.0,5.129124949847277 3 | 1.0,5.202147157569902 4 | 0.0 5 | 1.0,1.380993941980998 6 | 2.0,6.592270195209067,4.732943410951449 7 | 1.0,5.066632556308527 8 | 0.0 9 | 0.0 10 | 1.0,3.6502864254233502 11 | 0.0 12 | 1.0,5.507974503531338 13 | 0.0 14 | 0.0 15 | 0.0 16 | 0.0 17 | 1.0,9.400378637524563 18 | 0.0 19 | 0.0 20 | 2.0,3.69302267094743,3.740809055545485 21 | 0.0 22 | 0.0 23 | 1.0,2.154533971473378 24 | 1.0,6.98797671419368 25 | 0.0 26 | 1.0,3.4926017564995657 27 | 0.0 28 | 0.0 29 | 0.0 30 | 0.0 31 | 1.0,8.089675153872246 32 | 0.0 33 | 0.0 34 | 0.0 35 | 0.0 36 | 0.0 37 | 1.0,2.4421875439279206 38 | 0.0 39 | 0.0 40 | 0.0 41 | 0.0 42 | 1.0,5.68969224127514 43 | 0.0 44 | 0.0 45 | 1.0,7.490326751384808 46 | 0.0 47 | 1.0,4.3752505039243665 48 | 0.0 49 | 1.0,3.436806166544175 50 | 0.0 51 | 1.0,0.9227370964972814 52 | 0.0 53 | 0.0 54 | 0.0 55 | 1.0,4.413228561070257 56 | 0.0 57 | 0.0 58 | 0.0 59 | 0.0 60 | 0.0 61 | 0.0 62 | 0.0 63 | 0.0 64 | 1.0,6.943952729969112 65 | 1.0,6.523997663069922 66 | 0.0 67 | 0.0 68 | 0.0 69 | 0.0 70 | 0.0 71 | 1.0,4.672764679520634 72 | 0.0 73 | 1.0,4.8111177475634195 74 | 1.0,7.2345640010462695 75 | 0.0 76 | 1.0,4.946875305749439 77 | 0.0 78 | 0.0 79 | 0.0 80 | 0.0 81 | 1.0,8.92480545659817 82 | 1.0,5.8280836802385 83 | 0.0 84 | 0.0 85 | 0.0 86 | 0.0 87 | 0.0 88 | 1.0,9.718659755117464 89 | 0.0 90 | 0.0 91 | 0.0 92 | 1.0,8.8919942330997 93 | 1.0,0.8668408758993063 94 | 0.0 95 | 0.0 96 | 0.0 97 | 0.0 98 | 0.0 99 | 0.0 100 | 0.0 101 | -------------------------------------------------------------------------------- /doc/html/search/all_3.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['deriv_5fevaluate',['deriv_evaluate',['../classOperation.html#a42b611d08c6b00568c5d1b08688ebcce',1,'Operation::deriv_evaluate()'],['../classX__Load.html#a5ee414b0a344871b8e52d5c9c6c2f51b',1,'X_Load::deriv_evaluate()'],['../classC__Load.html#abfe90cef11f940a216284970f6db7b0d',1,'C_Load::deriv_evaluate()'],['../classAddition.html#a30c3e7495cbe3bdc010f2d3f8570bcc8',1,'Addition::deriv_evaluate()'],['../classSubtraction.html#aabe4bc428dcc778adb63940a3e91327d',1,'Subtraction::deriv_evaluate()'],['../classMultiplication.html#add5b53fbcd0f2e16c3be398c53d0fbe6',1,'Multiplication::deriv_evaluate()'],['../classDivision.html#af0f88f306718e3a490315e4be78885f3',1,'Division::deriv_evaluate()'],['../classSin.html#a7ee9713a0e86b56b7cb4f23f81b1a502',1,'Sin::deriv_evaluate()'],['../classCos.html#a4ca2ae643db43a16772f9fdbb86c06a6',1,'Cos::deriv_evaluate()'],['../classExp.html#aaf9e4870dcd8eda83174f003d9bd4a8a',1,'Exp::deriv_evaluate()'],['../classLog.html#a6f52d16f62171275092117364faa9b04',1,'Log::deriv_evaluate()'],['../classPower.html#aacb7fa5a44485f39df757f5a8b134d28',1,'Power::deriv_evaluate()'],['../classAbsolute.html#a8c75e9e1efcfd1fc50ee2af13ed9d6d1',1,'Absolute::deriv_evaluate()'],['../classSqrt.html#aa85791e8fd1f7239b34aed9f21a9f3a6',1,'Sqrt::deriv_evaluate()']]], 4 | ['df',['df',['../structLMFunctor.html#a0f2edfe1662d360c601caec4332ab60a',1,'LMFunctor']]], 5 | ['distance',['distance',['../classAcyclicGraphManipulator.html#a4bee8f5802f96f250f71be70978aac92',1,'AcyclicGraphManipulator']]], 6 | ['division',['Division',['../classDivision.html',1,'']]], 7 | ['dump',['dump',['../classAcyclicGraphManipulator.html#a25e1e62f422475fd78c2a9f9046190e2',1,'AcyclicGraphManipulator']]], 8 | ['dx_5fdt',['dx_dt',['../structImplicitTrainingData.html#a46e7205b1b43da1e0b6b582b3d127a2e',1,'ImplicitTrainingData']]] 9 | ]; 10 | -------------------------------------------------------------------------------- /app/simplification_backend_pymodule.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 United States Government as represented by the Administrator 3 | * of the National Aeronautics and Space Administration. No copyright is claimed 4 | * in the United States under Title 17, U.S. Code. All Other Rights Reserved. 5 | * 6 | * The Bingo Mini-app platform is licensed under the Apache License, Version 2.0 7 | * (the "License"); you may not use this file except in compliance with the 8 | * License. You may obtain a copy of the License at 9 | * http://www.apache.org/licenses/LICENSE-2.0. 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | * License for the specific language governing permissions and limitations under 15 | * the License. 16 | */ 17 | #include 18 | #include 19 | #include 20 | 21 | #include 22 | 23 | #include 24 | 25 | namespace py = pybind11; 26 | using namespace bingo; 27 | 28 | void add_simplification_backend_submodule(py::module &parent) { 29 | py::module m = parent.def_submodule("simplification_backend", 30 | "The simplification backend for Agraphs"); 31 | m.attr("ENGINE") = "c++"; 32 | m.def("get_utilized_commands", &simplification_backend::GetUtilizedCommands, 33 | "Find which commands are utilized", 34 | py::arg("stack")); 35 | m.def("simplify_stack", &simplification_backend::PythonSimplifyStack, 36 | "Simplifies a stack based on computational algebra", 37 | py::arg("stack")); 38 | m.def("reduce_stack", &simplification_backend::SimplifyStack, "Reduces a stack", 39 | py::arg("stack")); 40 | 41 | } -------------------------------------------------------------------------------- /app/evaluation_backend_pymodule.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 United States Government as represented by the Administrator 3 | * of the National Aeronautics and Space Administration. No copyright is claimed 4 | * in the United States under Title 17, U.S. Code. All Other Rights Reserved. 5 | * 6 | * The Bingo Mini-app platform is licensed under the Apache License, Version 2.0 7 | * (the "License"); you may not use this file except in compliance with the 8 | * License. You may obtain a copy of the License at 9 | * http://www.apache.org/licenses/LICENSE-2.0. 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | * License for the specific language governing permissions and limitations under 15 | * the License. 16 | */ 17 | #include 18 | #include 19 | #include 20 | 21 | #include 22 | 23 | #include "bingocpp/agraph/evaluation_backend/evaluation_backend.h" 24 | 25 | namespace py = pybind11; 26 | using namespace bingo; 27 | 28 | void add_evaluation_backend_submodule(py::module &parent) 29 | { 30 | py::module m = parent.def_submodule("evaluation_backend", 31 | "The evaluation backend for Agraphs"); 32 | m.attr("ENGINE") = "c++"; 33 | m.def("evaluate", &evaluation_backend::Evaluate, "Evaluate an equation", 34 | py::arg("stack"), 35 | py::arg("x"), 36 | py::arg("constants")); 37 | m.def("evaluate_with_derivative", 38 | &evaluation_backend::EvaluateWithDerivative, 39 | "Evaluate equation and take derivative", 40 | py::arg("stack"), 41 | py::arg("x"), 42 | py::arg("constants"), 43 | py::arg("wrt_param_x_or_c")); 44 | } -------------------------------------------------------------------------------- /tests/utility_function_tests.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file utility_function_tests.cpp 3 | * 4 | * \author Ethan Adams 5 | * \date 6 | * 7 | * This file contains the unit tests for the utility functions 8 | */ 9 | 10 | #include 11 | #include 12 | 13 | #include 14 | 15 | TEST(UtilsTest, SavitzkyGolay) { 16 | int window_size = 7; 17 | int order = 3; 18 | int derivative_order = 1; 19 | Eigen::ArrayXXd y(9, 2); 20 | y << 7, 4, 21 | 3, 11, 22 | 2, 13, 23 | 6, 15, 24 | 10, 22, 25 | 0, 14, 26 | 18, 19, 27 | 2, 15, 28 | 13, 8; 29 | 30 | Eigen::ArrayXXd expected_value(9, 1); 31 | expected_value << -.0595238, 32 | -1.0119, 33 | -.964286, 34 | .0833333, 35 | 2.96032, 36 | -.18254, 37 | .186508, 38 | 1.72222, 39 | 4.4246; 40 | 41 | Eigen::ArrayXXd computed_result = bingo::SavitzkyGolay( 42 | y, window_size, order, derivative_order); 43 | for (int i = 0; i < 9; ++i) { 44 | ASSERT_NEAR(computed_result(i), expected_value(i), .01); 45 | } 46 | } 47 | 48 | TEST(UtilsTest, CalculatePartials) { 49 | Eigen::ArrayXXd x(8, 3); 50 | x << 1., 4., 7., 51 | 2., 5., 8., 52 | 3., 6., 9., 53 | 5., 1., 4., 54 | 5., 6., 7., 55 | 8., 4., 5., 56 | 7., 3., 14., 57 | 5.64, 8.28, 11.42; 58 | Eigen::ArrayXXd expected_x(1, 3); 59 | Eigen::ArrayXXd expected_time_deriv(1, 3); 60 | expected_x << 5, 1, 4; 61 | expected_time_deriv << 1.53175, -.178571, -1.86905; 62 | auto partials = bingo::CalculatePartials(x); 63 | 64 | ASSERT_NEAR(partials.first(0, 0), expected_x(0, 0), .001); 65 | ASSERT_NEAR(partials.first(0, 1), expected_x(0, 1), .001); 66 | ASSERT_NEAR(partials.second(0, 0), expected_time_deriv(0, 0), .001); 67 | ASSERT_NEAR(partials.second(0, 1), expected_time_deriv(0, 1), .001); 68 | } -------------------------------------------------------------------------------- /include/bingocpp/gradient_mixin.h: -------------------------------------------------------------------------------- 1 | #ifndef BINGOCPP_INCLUDE_BINGOCPP_GRADIENT_MIXIN_H_ 2 | #define BINGOCPP_INCLUDE_BINGOCPP_GRADIENT_MIXIN_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | 11 | typedef std::tuple FitnessAndGradient; 12 | typedef std::tuple FitnessVectorAndJacobian; 13 | 14 | namespace bingo { 15 | 16 | class GradientMixin { 17 | public: 18 | virtual FitnessAndGradient GetIndividualFitnessAndGradient(Equation &individual) const = 0; 19 | }; 20 | 21 | class VectorGradientMixin : public GradientMixin { 22 | public: 23 | VectorGradientMixin(TrainingData *training_data = nullptr, std::string metric = "mae"); 24 | 25 | FitnessAndGradient GetIndividualFitnessAndGradient(Equation &individual) const; 26 | 27 | virtual FitnessVectorAndJacobian GetFitnessVectorAndJacobian(Equation &individual) const = 0; 28 | 29 | protected: 30 | static Eigen::ArrayXd mean_absolute_error_derivative( 31 | const Eigen::ArrayXd &fitness_vector, const Eigen::ArrayXXd &fitness_partials) { 32 | return (fitness_partials.rowwise() * fitness_vector.transpose().sign()).rowwise().mean(); 33 | } 34 | 35 | static Eigen::ArrayXd mean_squared_error_derivative( 36 | const Eigen::ArrayXd &fitness_vector, const Eigen::ArrayXXd &fitness_partials) { 37 | return 2.0 * (fitness_partials.rowwise() * fitness_vector.transpose()).rowwise().mean(); 38 | } 39 | 40 | static Eigen::ArrayXd root_mean_squared_error_derivative( 41 | const Eigen::ArrayXd &fitness_vector, const Eigen::ArrayXXd &fitness_partials) { 42 | return 1.0/sqrt(fitness_vector.square().mean()) * 43 | (fitness_partials.rowwise() * fitness_vector.transpose()).rowwise().mean(); 44 | } 45 | 46 | private: 47 | std::function metric_function_; 48 | std::function metric_derivative_; 49 | }; 50 | 51 | } // namespace bingo 52 | #endif // BINGOCPP_INCLUDE_BINGOCPP_GRADIENT_MIXIN_H_ 53 | -------------------------------------------------------------------------------- /src/explicit_regression.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "bingocpp/explicit_regression.h" 5 | 6 | namespace bingo { 7 | 8 | ExplicitTrainingData *ExplicitTrainingData::GetItem(int item) { 9 | return new ExplicitTrainingData(x.row(item), y.row(item)); 10 | } 11 | 12 | ExplicitTrainingData *ExplicitTrainingData::GetItem( 13 | const std::vector &items) { 14 | Eigen::ArrayXXd temp_in(items.size(), x.cols()); 15 | Eigen::ArrayXXd temp_out(items.size(), y.cols()); 16 | 17 | for (unsigned int row = 0; row < items.size(); row ++) { 18 | temp_in.row(row) = x.row(items[row]); 19 | temp_out.row(row) = y.row(items[row]); 20 | } 21 | 22 | return new ExplicitTrainingData(temp_in, temp_out); 23 | } 24 | 25 | Eigen::ArrayXd ExplicitRegression::EvaluateFitnessVector( 26 | Equation &individual) const { 27 | ++ eval_count_; 28 | const Eigen::ArrayXXd x = ((ExplicitTrainingData*)training_data_)->x; 29 | Eigen::ArrayXXd f_of_x = individual.EvaluateEquationAt(x); 30 | Eigen::ArrayXXd error = f_of_x - ((ExplicitTrainingData*)training_data_)->y; 31 | if (relative_) 32 | error /= ((ExplicitTrainingData*)training_data_)->y; 33 | return error; 34 | } 35 | 36 | FitnessVectorAndJacobian ExplicitRegression::GetFitnessVectorAndJacobian( 37 | Equation &individual) const { 38 | ++ eval_count_; 39 | Eigen::ArrayXXd f_of_x, df_dc; 40 | const Eigen::ArrayXXd x = ((ExplicitTrainingData*)training_data_)->x; 41 | std::tie(f_of_x, df_dc) = individual.EvaluateEquationWithLocalOptGradientAt(x); 42 | 43 | Eigen::ArrayXXd error = f_of_x - ((ExplicitTrainingData*)training_data_)->y; 44 | if (relative_) { 45 | error /= ((ExplicitTrainingData*)training_data_)->y; 46 | df_dc.colwise() /= ((ExplicitTrainingData*)training_data_)->y(Eigen::all, 0); 47 | } 48 | return FitnessVectorAndJacobian{error, df_dc}; 49 | } 50 | 51 | ExplicitRegressionState ExplicitRegression::DumpState() { 52 | return ExplicitRegressionState( 53 | ((ExplicitTrainingData*)training_data_)->DumpState(), 54 | metric_, eval_count_); 55 | } 56 | 57 | } // namespace bingo -------------------------------------------------------------------------------- /doc/html/search/functions_3.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['evaluate',['evaluate',['../classOperation.html#a89093eb53f975dd98b6a36d85fa17276',1,'Operation::evaluate()'],['../classX__Load.html#ab2725c1a3843f12e4f0730aefbcaedd9',1,'X_Load::evaluate()'],['../classC__Load.html#a82be394b7e177cc378def30ff9972941',1,'C_Load::evaluate()'],['../classAddition.html#a2fe0b74f5aaf992389f39db8e47c671f',1,'Addition::evaluate()'],['../classSubtraction.html#af0628604da8b47a69ab666a507b7b58d',1,'Subtraction::evaluate()'],['../classMultiplication.html#a19044777a8cc6ba3bc662d1fbadb7b28',1,'Multiplication::evaluate()'],['../classDivision.html#a09bcc06557768b3a3abc31667ab03103',1,'Division::evaluate()'],['../classSin.html#a1eee9fe523f2facfb47360eff481277b',1,'Sin::evaluate()'],['../classCos.html#a580742a5758d0e31ecfc98c9e49fa597',1,'Cos::evaluate()'],['../classExp.html#a12142e937f2fa11002ebe3d574626aa5',1,'Exp::evaluate()'],['../classLog.html#af5402c400512ee9dfe17698929683bbc',1,'Log::evaluate()'],['../classPower.html#a3e672a4654976e92496e05c5c1d78ccd',1,'Power::evaluate()'],['../classAbsolute.html#a841ddbf6d5c0e8ad3950208946f9ad75',1,'Absolute::evaluate()'],['../classSqrt.html#aa0f673292c8980fe03061c5f0f85339d',1,'Sqrt::evaluate()'],['../classAcyclicGraph.html#a03140f2d30f36a447bc920364bcaf902',1,'AcyclicGraph::evaluate()']]], 4 | ['evaluate_5ffitness',['evaluate_fitness',['../structFitnessMetric.html#a8af896d7e25e1bf34412ce92b4851958',1,'FitnessMetric']]], 5 | ['evaluate_5ffitness_5fvector',['evaluate_fitness_vector',['../structFitnessMetric.html#a17bf921d3200dc93493e2af5c38552ad',1,'FitnessMetric::evaluate_fitness_vector()'],['../structStandardRegression.html#a0c35e5b8ce369988c8e1d6c3249b9581',1,'StandardRegression::evaluate_fitness_vector()'],['../structImplicitRegression.html#a8737c12d204ab5035347259f47018e5a',1,'ImplicitRegression::evaluate_fitness_vector()']]], 6 | ['evaluate_5fwith_5fconst_5fderiv',['evaluate_with_const_deriv',['../classAcyclicGraph.html#ae0165998884415c340ef42f5519ee378',1,'AcyclicGraph']]], 7 | ['explicittrainingdata',['ExplicitTrainingData',['../structExplicitTrainingData.html#a96eb847c22542ecc3f60201d36935e39',1,'ExplicitTrainingData']]] 8 | ]; 9 | -------------------------------------------------------------------------------- /doc/latex/classOperatorInterface.tex: -------------------------------------------------------------------------------- 1 | \hypertarget{classOperatorInterface}{}\section{Operator\+Interface Class Reference} 2 | \label{classOperatorInterface}\index{Operator\+Interface@{Operator\+Interface}} 3 | 4 | 5 | Populate and hold the map of operations. 6 | 7 | 8 | 9 | 10 | {\ttfamily \#include $<$acyclic\+\_\+graph\+\_\+nodes.\+h$>$} 11 | 12 | \subsection*{Static Public Member Functions} 13 | \begin{DoxyCompactItemize} 14 | \item 15 | static std\+::map$<$ int, \hyperlink{classOperation}{Operation} $\ast$ $>$ {\bfseries create\+\_\+op\+\_\+map} ()\hypertarget{classOperatorInterface_ab9027be9ca1976893ed083b05c067d13}{}\label{classOperatorInterface_ab9027be9ca1976893ed083b05c067d13} 16 | 17 | \end{DoxyCompactItemize} 18 | \subsection*{Static Public Attributes} 19 | \begin{DoxyCompactItemize} 20 | \item 21 | static std\+::map$<$ int, \hyperlink{classOperation}{Operation} $\ast$ $>$ {\bfseries operator\+\_\+map} 22 | \end{DoxyCompactItemize} 23 | 24 | 25 | \subsection{Detailed Description} 26 | Populate and hold the map of operations. 27 | 28 | \subsection{Member Data Documentation} 29 | \index{Operator\+Interface@{Operator\+Interface}!operator\+\_\+map@{operator\+\_\+map}} 30 | \index{operator\+\_\+map@{operator\+\_\+map}!Operator\+Interface@{Operator\+Interface}} 31 | \subsubsection[{\texorpdfstring{operator\+\_\+map}{operator_map}}]{\setlength{\rightskip}{0pt plus 5cm}std\+::map$<$ int, {\bf Operation} $\ast$ $>$ Operator\+Interface\+::operator\+\_\+map\hspace{0.3cm}{\ttfamily [static]}}\hypertarget{classOperatorInterface_a90337c660b5c440182b4d7bcd2b49e61}{}\label{classOperatorInterface_a90337c660b5c440182b4d7bcd2b49e61} 32 | {\bfseries Initial value\+:} 33 | \begin{DoxyCode} 34 | = 35 | OperatorInterface::create\_op\_map() 36 | \end{DoxyCode} 37 | 38 | 39 | The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize} 40 | \item 41 | /users0/gbomarit/\+Projects/\+Genetic\+\_\+\+Programming/bingo/bingocpp/include/\+Bingo\+Cpp/acyclic\+\_\+graph\+\_\+nodes.\+h\item 42 | /users0/gbomarit/\+Projects/\+Genetic\+\_\+\+Programming/bingo/bingocpp/src/acyclic\+\_\+graph\+\_\+nodes.\+cpp\end{DoxyCompactItemize} 43 | -------------------------------------------------------------------------------- /doc/latex/hierarchy.tex: -------------------------------------------------------------------------------- 1 | \section{Class Hierarchy} 2 | This inheritance list is sorted roughly, but not completely, alphabetically\+:\begin{DoxyCompactList} 3 | \item \contentsline{section}{Acyclic\+Graph}{\pageref{classAcyclicGraph}}{} 4 | \item \contentsline{section}{Acyclic\+Graph\+Manipulator}{\pageref{classAcyclicGraphManipulator}}{} 5 | \item \contentsline{section}{Fitness\+Metric}{\pageref{structFitnessMetric}}{} 6 | \begin{DoxyCompactList} 7 | \item \contentsline{section}{Implicit\+Regression}{\pageref{structImplicitRegression}}{} 8 | \item \contentsline{section}{Standard\+Regression}{\pageref{structStandardRegression}}{} 9 | \end{DoxyCompactList} 10 | \item \contentsline{section}{L\+M\+Functor}{\pageref{structLMFunctor}}{} 11 | \item \contentsline{section}{Operation}{\pageref{classOperation}}{} 12 | \begin{DoxyCompactList} 13 | \item \contentsline{section}{Absolute}{\pageref{classAbsolute}}{} 14 | \item \contentsline{section}{Addition}{\pageref{classAddition}}{} 15 | \item \contentsline{section}{C\+\_\+\+Load}{\pageref{classC__Load}}{} 16 | \item \contentsline{section}{Cos}{\pageref{classCos}}{} 17 | \item \contentsline{section}{Division}{\pageref{classDivision}}{} 18 | \item \contentsline{section}{Exp}{\pageref{classExp}}{} 19 | \item \contentsline{section}{Log}{\pageref{classLog}}{} 20 | \item \contentsline{section}{Multiplication}{\pageref{classMultiplication}}{} 21 | \item \contentsline{section}{Power}{\pageref{classPower}}{} 22 | \item \contentsline{section}{Sin}{\pageref{classSin}}{} 23 | \item \contentsline{section}{Sqrt}{\pageref{classSqrt}}{} 24 | \item \contentsline{section}{Subtraction}{\pageref{classSubtraction}}{} 25 | \item \contentsline{section}{X\+\_\+\+Load}{\pageref{classX__Load}}{} 26 | \end{DoxyCompactList} 27 | \item \contentsline{section}{Operator\+Interface}{\pageref{classOperatorInterface}}{} 28 | \item \contentsline{section}{Training\+Data}{\pageref{structTrainingData}}{} 29 | \begin{DoxyCompactList} 30 | \item \contentsline{section}{Explicit\+Training\+Data}{\pageref{structExplicitTrainingData}}{} 31 | \item \contentsline{section}{Implicit\+Training\+Data}{\pageref{structImplicitTrainingData}}{} 32 | \end{DoxyCompactList} 33 | \end{DoxyCompactList} 34 | -------------------------------------------------------------------------------- /include/bingocpp/agraph/evaluation_backend/operator_eval.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 United States Government as represented by the Administrator 3 | * of the National Aeronautics and Space Administration. No copyright is claimed 4 | * in the United States under Title 17, U.S. Code. All Other Rights Reserved. 5 | * 6 | * The Bingo Mini-app platform is licensed under the Apache License, Version 2.0 7 | * (the "License"); you may not use this file except in compliance with the 8 | * License. You may obtain a copy of the License at 9 | * http://www.apache.org/licenses/LICENSE-2.0. 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | * License for the specific language governing permissions and limitations under 15 | * the License. 16 | */ 17 | #ifndef INCLUDE_BINGOCPP_BACKEND_OPERATOR_EVAL_H_ 18 | #define INCLUDE_BINGOCPP_BACKEND_OPERATOR_EVAL_H_ 19 | 20 | #include 21 | 22 | #include 23 | 24 | namespace bingo 25 | { 26 | namespace evaluation_backend 27 | { 28 | 29 | /* 30 | * Maps param1, param2, x, constants, and forward eval to the correct 31 | * forward eval function corresponding to the operation node. 32 | */ 33 | Eigen::ArrayXXd ForwardEvalFunction(int node, int param1, int param2, 34 | const Eigen::ArrayXXd &x, 35 | const Eigen::ArrayXXd &constants, 36 | std::vector &forward_eval); 37 | /* 38 | * Maps reverse_index, param1, param2, forward evaluation stack and 39 | * revese evaluation stack to the corresponding operation node. 40 | */ 41 | void ReverseEvalFunction(int node, int reverse_index, int param1, int param2, 42 | const std::vector &forward_eval, 43 | std::vector &reverse_eval); 44 | } 45 | } // namespace bingo 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /include/bingocpp/training_data.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file training_data.h 3 | * 4 | * \author Ethan Adams 5 | * \date 6 | * 7 | * This file contains the cpp version of training_data.py 8 | * 9 | * Copyright 2018 United States Government as represented by the Administrator 10 | * of the National Aeronautics and Space Administration. No copyright is claimed 11 | * in the United States under Title 17, U.S. Code. All Other Rights Reserved. 12 | * 13 | * The Bingo Mini-app platform is licensed under the Apache License, Version 2.0 14 | * (the "License"); you may not use this file except in compliance with the 15 | * License. You may obtain a copy of the License at 16 | * http://www.apache.org/licenses/LICENSE-2.0. 17 | * 18 | * Unless required by applicable law or agreed to in writing, software 19 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 20 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 21 | * License for the specific language governing permissions and limitations under 22 | * the License. 23 | */ 24 | 25 | #ifndef INCLUDE_BINGOCPP_TRAINING_DATA_H_ 26 | #define INCLUDE_BINGOCPP_TRAINING_DATA_H_ 27 | 28 | #include 29 | 30 | #include 31 | #include 32 | 33 | 34 | namespace bingo { 35 | 36 | /*! \struct TrainingData 37 | * 38 | * An abstract struct to hold the data for fitness calculations 39 | * 40 | * \note TrainingData includes : Implicit and Explicit data 41 | * 42 | * \fn TrainingData* get_item(std::list items) 43 | * \fn int size() 44 | */ 45 | struct TrainingData { 46 | public: 47 | TrainingData() { } 48 | 49 | virtual ~TrainingData() { } 50 | 51 | virtual TrainingData *GetItem(int item) = 0; 52 | /*! \brief gets a new training data with certain rows 53 | * 54 | * \param[in] items The rows to retrieve. std::list 55 | * \return TrainingData* with the selected data 56 | */ 57 | virtual TrainingData *GetItem(const std::vector &items) = 0; 58 | /*! \brief gets the size of x 59 | * 60 | * \return int the amount of rows in x 61 | */ 62 | virtual int Size() = 0; 63 | }; 64 | } // namespace bingo 65 | #endif 66 | -------------------------------------------------------------------------------- /doc/html/search/all_4.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['evaluate',['evaluate',['../classOperation.html#a89093eb53f975dd98b6a36d85fa17276',1,'Operation::evaluate()'],['../classX__Load.html#ab2725c1a3843f12e4f0730aefbcaedd9',1,'X_Load::evaluate()'],['../classC__Load.html#a82be394b7e177cc378def30ff9972941',1,'C_Load::evaluate()'],['../classAddition.html#a2fe0b74f5aaf992389f39db8e47c671f',1,'Addition::evaluate()'],['../classSubtraction.html#af0628604da8b47a69ab666a507b7b58d',1,'Subtraction::evaluate()'],['../classMultiplication.html#a19044777a8cc6ba3bc662d1fbadb7b28',1,'Multiplication::evaluate()'],['../classDivision.html#a09bcc06557768b3a3abc31667ab03103',1,'Division::evaluate()'],['../classSin.html#a1eee9fe523f2facfb47360eff481277b',1,'Sin::evaluate()'],['../classCos.html#a580742a5758d0e31ecfc98c9e49fa597',1,'Cos::evaluate()'],['../classExp.html#a12142e937f2fa11002ebe3d574626aa5',1,'Exp::evaluate()'],['../classLog.html#af5402c400512ee9dfe17698929683bbc',1,'Log::evaluate()'],['../classPower.html#a3e672a4654976e92496e05c5c1d78ccd',1,'Power::evaluate()'],['../classAbsolute.html#a841ddbf6d5c0e8ad3950208946f9ad75',1,'Absolute::evaluate()'],['../classSqrt.html#aa0f673292c8980fe03061c5f0f85339d',1,'Sqrt::evaluate()'],['../classAcyclicGraph.html#a03140f2d30f36a447bc920364bcaf902',1,'AcyclicGraph::evaluate()']]], 4 | ['evaluate_5ffitness',['evaluate_fitness',['../structFitnessMetric.html#a8af896d7e25e1bf34412ce92b4851958',1,'FitnessMetric']]], 5 | ['evaluate_5ffitness_5fvector',['evaluate_fitness_vector',['../structFitnessMetric.html#a17bf921d3200dc93493e2af5c38552ad',1,'FitnessMetric::evaluate_fitness_vector()'],['../structStandardRegression.html#a0c35e5b8ce369988c8e1d6c3249b9581',1,'StandardRegression::evaluate_fitness_vector()'],['../structImplicitRegression.html#a8737c12d204ab5035347259f47018e5a',1,'ImplicitRegression::evaluate_fitness_vector()']]], 6 | ['evaluate_5fwith_5fconst_5fderiv',['evaluate_with_const_deriv',['../classAcyclicGraph.html#ae0165998884415c340ef42f5519ee378',1,'AcyclicGraph']]], 7 | ['exp',['Exp',['../classExp.html',1,'']]], 8 | ['explicittrainingdata',['ExplicitTrainingData',['../structExplicitTrainingData.html',1,'ExplicitTrainingData'],['../structExplicitTrainingData.html#a96eb847c22542ecc3f60201d36935e39',1,'ExplicitTrainingData::ExplicitTrainingData()']]] 9 | ]; 10 | -------------------------------------------------------------------------------- /depricated/fitness_metric.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file fitness_metric.cc 3 | * 4 | * \author Ethan Adams 5 | * \date 6 | * 7 | * This file contains the cpp version of FitnessMetric.py 8 | */ 9 | 10 | #include 11 | 12 | #include 13 | #include 14 | 15 | #include 16 | 17 | #include "bingocpp/explicit_regression.h" 18 | #include "bingocpp/fitness_metric.h" 19 | 20 | namespace bingo { 21 | 22 | int LMFunctor::operator()(const Eigen::VectorXd &x, Eigen::VectorXd &fvec) { 23 | agraphIndv.set_constants(x); 24 | fvec = fit->evaluate_fitness_vector(agraphIndv, *train); 25 | return 0; 26 | } 27 | 28 | int LMFunctor::df(const Eigen::VectorXd &x, Eigen::MatrixXd &fjac) { 29 | double epsilon; 30 | epsilon = 1e-5f; 31 | 32 | for (int i = 0; i < x.size(); i++) { 33 | Eigen::VectorXd xPlus(x); 34 | xPlus(i) += epsilon; 35 | Eigen::VectorXd xMinus(x); 36 | xMinus(i) -= epsilon; 37 | Eigen::VectorXd fvecPlus(values()); 38 | operator()(xPlus, fvecPlus); 39 | Eigen::VectorXd fvecMinus(values()); 40 | operator()(xMinus, fvecMinus); 41 | Eigen::VectorXd fvecDiff(values()); 42 | fvecDiff = (fvecPlus - fvecMinus) / (2.0 * epsilon); 43 | fjac.block(0, i, values(), 1) = fvecDiff; 44 | } 45 | 46 | return 0; 47 | } 48 | 49 | double FitnessMetric::evaluate_fitness(AcyclicGraph &indv, 50 | TrainingData &train) { 51 | if (indv.needs_optimization()) { 52 | optimize_constants(indv, train); 53 | } 54 | 55 | return ((evaluate_fitness_vector(indv, train)).abs()).mean(); 56 | } 57 | 58 | void FitnessMetric::optimize_constants(AcyclicGraph &indv, 59 | TrainingData &train) { 60 | LMFunctor functor; 61 | functor.train = &train; 62 | functor.fit = this; 63 | functor.m = functor.train->Size(); 64 | // indv.input_constants(); 65 | functor.n = indv.count_constants(); 66 | functor.agraphIndv = indv; 67 | Eigen::VectorXd vec = Eigen::VectorXd::Random(functor.n); 68 | Eigen::LevenbergMarquardt lm(functor); 69 | lm.minimize(vec); 70 | indv.set_constants(vec); 71 | indv.needs_opt = false; 72 | } 73 | } // namespace bingo -------------------------------------------------------------------------------- /include/benchmarking/benchmark_logging.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "benchmark_logging.h" 6 | 7 | #define EVALUATE "pure c++: evaluate" 8 | #define X_DERIVATIVE "pure c++: x derivative" 9 | #define C_DERIVATIVE "pure c++: c derivative" 10 | 11 | const int kLogWidth = 78; 12 | 13 | double StandardDeviation(const Eigen::ArrayXd &vec) { 14 | return std::sqrt((vec - vec.mean()).square().sum()/(vec.size()-1)); 15 | } 16 | 17 | void PrintHeader(std::string title) { 18 | int diff = kLogWidth - title.size() - 10; 19 | const std::string left_tacks = std::string((diff/2), '-'); 20 | const std::string right_tacks = std::string((diff + 1)/2, '-'); 21 | const std::string middle = ":::: " + title + " ::::"; 22 | const std::string full_title = left_tacks + middle + right_tacks; 23 | const std::string bottom = std::string (78, '-'); 24 | std::cout << full_title << std::endl; 25 | OutputParams("NAME", "MEAN", "STD", " MIN", "MAX"); 26 | std::cout << bottom << std::endl; 27 | } 28 | 29 | void PrintResults(const Eigen::ArrayXd &run_times, const std::string &name) { 30 | double std_dev = StandardDeviation(run_times); 31 | double average = run_times.mean(); 32 | double max = run_times.maxCoeff(); 33 | double min = run_times.minCoeff(); 34 | std::string s_std_dev = StringPrecision(std_dev, 5); 35 | std::string s_average= StringPrecision(average, 5); 36 | std::string s_min= StringPrecision(min, 5); 37 | std::string s_max= StringPrecision(max, 5); 38 | OutputParams(name, s_average, s_std_dev, s_min, s_max); 39 | } 40 | 41 | std::string StringPrecision(double val, int precision) { 42 | std::stringstream stream; 43 | stream << std::fixed << std::setprecision(precision) << val; 44 | return stream.str(); 45 | } 46 | 47 | void OutputParams(const std::string &name, const std::string &mean, 48 | const std::string &std, const std::string &min, 49 | const std::string &max) { 50 | std::cout << std::setw(25) << std::left << name << " " 51 | << std::setw(10) << std::right << mean << " +- " 52 | << std::setw(10) << std::left << std << " " 53 | << std::setw(10) << std::left << min << " " 54 | << std::setw(10) << std::left << max 55 | << std::endl; 56 | } -------------------------------------------------------------------------------- /include/python/py_fitness_function.h: -------------------------------------------------------------------------------- 1 | #ifndef BINGOCPP_INCLUDE_BINGOCPP_PY_FITNESS_FUNCTION_H_ 2 | #define BINGOCPP_INCLUDE_BINGOCPP_PY_FITNESS_FUNCTION_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | #include 11 | #include 12 | 13 | namespace bingo { 14 | class PyTrainingData : public TrainingData { 15 | using TrainingData::TrainingData; 16 | TrainingData* GetItem(int item) { 17 | PYBIND11_OVERLOAD_PURE_NAME( 18 | TrainingData*, 19 | TrainingData, 20 | "__getitem__", 21 | GetItem, 22 | item 23 | ); 24 | } 25 | 26 | TrainingData* GetItem(const std::vector &items) { 27 | PYBIND11_OVERLOAD_PURE_NAME( 28 | TrainingData*, 29 | TrainingData, 30 | "__getitem__", 31 | GetItem, 32 | items 33 | ); 34 | } 35 | 36 | int Size() { 37 | PYBIND11_OVERLOAD_PURE_NAME( 38 | int, 39 | TrainingData, 40 | "__len__", 41 | Size, 42 | // no arguments 43 | ); 44 | } 45 | }; 46 | 47 | class PyFitnessFunction : public FitnessFunction { 48 | using FitnessFunction::FitnessFunction; 49 | double EvaluateIndividualFitness(Equation &individual) const { 50 | PYBIND11_OVERLOAD_PURE_NAME( 51 | double, 52 | FitnessFunction, 53 | "__call__", 54 | EvaluateIndividualFitness, 55 | individual 56 | ); 57 | } 58 | }; 59 | 60 | class PyVectorBasedFunction : public VectorBasedFunction { 61 | using VectorBasedFunction::VectorBasedFunction; 62 | double EvaluateIndividualFitness(Equation &individual) const { 63 | PYBIND11_OVERLOAD_NAME( 64 | double, 65 | VectorBasedFunction, 66 | "__call__", 67 | EvaluateIndividualFitness, 68 | individual 69 | ); 70 | } 71 | 72 | Eigen::ArrayXd EvaluateFitnessVector(Equation &individual) const { 73 | PYBIND11_OVERLOAD_PURE_NAME( 74 | Eigen::ArrayXd, 75 | VectorBasedFunction, 76 | "evaluate_fitness_vector", 77 | EvaluateFitnessVector, 78 | individual 79 | ); 80 | } 81 | }; 82 | 83 | } // namespace bingo 84 | 85 | #endif // BINGOCPP_INCLUDE_BINGOCPP_PY_FITNESS_FUNCTION_H_ 86 | -------------------------------------------------------------------------------- /tests/testing_utils.h: -------------------------------------------------------------------------------- 1 | #ifndef BINGO_TEST_TESTING_UTILS_H_ 2 | #define BINGO_TEST_TESTING_UTILS_H_ 3 | 4 | #include 5 | 6 | #include 7 | 8 | namespace testutils { 9 | namespace { 10 | 11 | const double TESTING_TOL = 1e-7; 12 | 13 | inline void print_difference(const Eigen::ArrayXXd &array1, 14 | const Eigen::ArrayXXd &array2) { 15 | std::cout << " Actual: \n" << array1 << "\n"; 16 | std::cout << "Expected: \n" << array2 << "\n"; 17 | } 18 | 19 | inline double difference(double val_1, double val_2) { 20 | if ((std::isnan(val_1) && std::isnan(val_2)) || 21 | (val_1 == INFINITY && val_2 == INFINITY) || 22 | (val_1 == -INFINITY && val_2 == -INFINITY)) { 23 | return 0; 24 | } else { 25 | return val_1 - val_2; 26 | } 27 | } 28 | 29 | inline bool non_comparable_matrices(const Eigen::ArrayXXd &array1, 30 | const Eigen::ArrayXXd &array2) { 31 | int rows_array1 = array1.rows(); 32 | int rows_array2 = array2.rows(); 33 | int cols_array1 = array1.cols(); 34 | int cols_array2 = array2.cols(); 35 | return (!(rows_array1 > 0) || 36 | !(rows_array2 > 0) || 37 | !(cols_array1 > 0) || 38 | !(cols_array2 > 0) || 39 | (rows_array1 != rows_array2) || 40 | (cols_array1 != cols_array2)); 41 | } 42 | } // namespace 43 | 44 | inline bool almost_equal(const Eigen::ArrayXXd &array1, 45 | const Eigen::ArrayXXd &array2, 46 | double tolerance = TESTING_TOL) { 47 | if (non_comparable_matrices(array1, array2)) { 48 | print_difference(array1, array2); 49 | return false; 50 | } 51 | 52 | int rows_array1 = array1.rows(); 53 | int cols_array1 = array1.cols(); 54 | Eigen::MatrixXd matrix_diff = Eigen::MatrixXd(rows_array1, cols_array1); 55 | for (int row = 0; row < rows_array1; row++) { 56 | for (int col = 0; col < cols_array1; col++) { 57 | matrix_diff(row, col) = difference(array1(row, col), array2(row, col)); 58 | } 59 | } 60 | 61 | double frobenius_norm = matrix_diff.norm(); 62 | bool equal = (frobenius_norm < tolerance ? true : false); 63 | if (!equal) { 64 | std::cout << "Frobenius Norm: " << frobenius_norm << std::endl; 65 | print_difference(array1, array2); 66 | } 67 | return equal; 68 | } 69 | } // namespace testutils 70 | #endif //BINGO_TEST_TESTING_UTILS_H_ 71 | -------------------------------------------------------------------------------- /include/bingocpp/agraph/simplification_backend/simplification_backend.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 United States Government as represented by the Administrator 3 | * of the National Aeronautics and Space Administration. No copyright is claimed 4 | * in the United States under Title 17, U.S. Code. All Other Rights Reserved. 5 | * 6 | * The Bingo Mini-app platform is licensed under the Apache License, Version 2.0 7 | * (the "License"); you may not use this file except in compliance with the 8 | * License. You may obtain a copy of the License at 9 | * http://www.apache.org/licenses/LICENSE-2.0. 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | * License for the specific language governing permissions and limitations under 15 | * the License. 16 | */ 17 | #ifndef INCLUDE_BINGOCPP_SIMPLIFICATION_BACKEND_H 18 | #define INCLUDE_BINGOCPP_SIMPLIFICATION_BACKEND_H 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | #include 25 | #include 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | #include 33 | 34 | namespace bingo { 35 | /** 36 | * @brief This file contains the simplification backend of the agraph class. 37 | * 38 | */ 39 | namespace simplification_backend { 40 | /** 41 | * @brief Simplifies a stack. 42 | * 43 | * An acyclic graph is given in stack form. The stack is first simplified to 44 | * consist only of the commands used by the last command. 45 | * 46 | * @param stack Description of an acyclic graph in stack format. 47 | * 48 | * @return Simplified stack. 49 | */ 50 | Eigen::ArrayX3i SimplifyStack(const Eigen::ArrayX3i &stack); 51 | 52 | // TODO documentation and change simplify_stack to reduce stack 53 | Eigen::ArrayX3i PythonSimplifyStack(const Eigen::ArrayX3i &stack); 54 | 55 | /** 56 | * @brief Finds which commands are utilized in a stack. 57 | * 58 | * An acyclic graph is given in stack form. The stack is processed in reverse 59 | * to find which commands the last command depends. 60 | * 61 | * @param stack Description of an acyclic graph in stack format. 62 | * 63 | * @return vector describing which commands in the stack are used. 64 | */ 65 | std::vector GetUtilizedCommands(const Eigen::ArrayX3i &stack); 66 | } // namespace simplification_backend 67 | } // namespace bingo 68 | #endif 69 | -------------------------------------------------------------------------------- /depricated/acyclic_graph_nodes.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file acyclic_graph_nodes.hh 3 | * 4 | * \author Ethan Adams 5 | * \date 2/9/2018 6 | * 7 | * This is the header file to hold the Operation abstract class 8 | * and all implementations of that class. Also holds the OperatorInterface 9 | * class, which includes a map to keep the Operations in 10 | * 11 | * Copyright 2018 United States Government as represented by the Administrator 12 | * of the National Aeronautics and Space Administration. No copyright is claimed 13 | * in the United States under Title 17, U.S. Code. All Other Rights Reserved. 14 | * 15 | * The Bingo Mini-app platform is licensed under the Apache License, Version 2.0 16 | * (the "License"); you may not use this file except in compliance with the 17 | * License. You may obtain a copy of the License at 18 | * http://www.apache.org/licenses/LICENSE-2.0. 19 | * 20 | * Unless required by applicable law or agreed to in writing, software 21 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 22 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 23 | * License for the specific language governing permissions and limitations under 24 | * the License. 25 | */ 26 | 27 | #ifndef INCLUDE_BINGOCPP_ACYCLIC_GRAPH_NODES_H_ 28 | #define INCLUDE_BINGOCPP_ACYCLIC_GRAPH_NODES_H_ 29 | 30 | #include 31 | 32 | #include 33 | 34 | namespace agraphnodes{ 35 | typedef void ( 36 | *forward_operator_function)( 37 | const Eigen::ArrayX3i&, const Eigen::ArrayXXd&, 38 | const Eigen::VectorXd&, std::vector&, std::size_t 39 | ); 40 | typedef void ( 41 | *derivative_operator_function)( 42 | const Eigen::ArrayX3i &, const int, 43 | const std::vector &, 44 | std::vector &, int 45 | ); 46 | 47 | void forward_eval_function(int node, const Eigen::ArrayX3i &stack, 48 | const Eigen::ArrayXXd &x, 49 | const Eigen::VectorXd &constants, 50 | std::vector &buffer, 51 | std::size_t result_location); 52 | 53 | void derivative_eval_function(int node, const Eigen::ArrayX3i &stack, 54 | const int command_index, 55 | const std::vector &forward_buffer, 56 | std::vector &reverse_buffer, 57 | int dependency); 58 | } //agraphnodes 59 | 60 | #endif // INCLUDE_BINGOCPP_ACYCLIC_GRAPH_NODES_H_ 61 | -------------------------------------------------------------------------------- /src/agraph/simplification_backend/simplification_backend.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | namespace py = pybind11; 16 | 17 | namespace bingo { 18 | namespace simplification_backend { 19 | 20 | std::vector GetUtilizedCommands(const Eigen::ArrayX3i &stack) { 21 | std::vector used_commands(stack.rows()); 22 | used_commands.back() = true; 23 | int stack_size = stack.rows(); 24 | for (int i = 1; i < stack_size; i++) { 25 | int row = stack_size - i; 26 | int node = stack(row, kOpIdx); 27 | int param1 = stack(row, kParam1Idx); 28 | int param2 = stack(row, kParam2Idx); 29 | if (used_commands[row] && node > Op::kConstant) { 30 | used_commands[param1] = true; 31 | if (kIsArity2Map.at(node)) { 32 | used_commands[param2] = true; 33 | } 34 | } 35 | } 36 | return used_commands; 37 | } 38 | 39 | Eigen::ArrayX3i SimplifyStack(const Eigen::ArrayX3i &stack) { 40 | std::vector used_command = GetUtilizedCommands(stack); 41 | std::map reduced_param_map; 42 | int num_commands = 0; 43 | num_commands = std::accumulate(used_command.begin(), used_command.end(), 0); 44 | Eigen::ArrayX3i new_stack(num_commands, 3); 45 | 46 | for (int i = 0, j = 0; i < stack.rows(); ++i) { 47 | if (used_command[i]) { 48 | new_stack(j, kOpIdx) = stack(i, kOpIdx); 49 | if (kIsTerminalMap.at(new_stack(j, kOpIdx))) { 50 | new_stack(j, kParam1Idx) = stack(i, kParam1Idx); 51 | new_stack(j, kParam2Idx) = stack(i, kParam2Idx); 52 | } else { 53 | new_stack(j, kParam1Idx) = reduced_param_map[stack(i, kParam1Idx)]; 54 | if (kIsArity2Map.at(new_stack(j, kOpIdx))) { 55 | new_stack(j, kParam2Idx) = reduced_param_map[stack(i, kParam2Idx)]; 56 | } else { 57 | new_stack(j, kParam2Idx) = new_stack(j, kParam1Idx); 58 | } 59 | } 60 | reduced_param_map[i] = j; 61 | ++j; 62 | } 63 | } 64 | return new_stack; 65 | } 66 | 67 | Eigen::ArrayX3i PythonSimplifyStack(const Eigen::ArrayX3i &stack) { 68 | py::object python_simp_module = py::module::import("bingo.symbolic_regression.agraph.simplification_backend.simplification_backend"); 69 | py::object python_simp = python_simp_module.attr("simplify_stack"); 70 | Eigen::ArrayX3i result = python_simp(stack).cast(); 71 | return result; 72 | } 73 | 74 | } // namespace simplification_backend 75 | } // namespace bingo 76 | -------------------------------------------------------------------------------- /include/benchmarking/benchmark_data.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "benchmark_data.h" 5 | 6 | #define STACK_FILE "test-agraph-stacks.csv" 7 | #define CONST_FILE "test-agraph-consts.csv" 8 | #define X_FILE "test-agraph-x-vals.csv" 9 | 10 | #define INPUT_DIM 4 11 | #define NUM_DATA_POINTS 128 12 | #define STACK_SIZE 128 13 | #define STACK_COLS 3 14 | 15 | void LoadBenchmarkData(BenchmarkTestData &benchmark_test_data) { 16 | std::vector indv_list; 17 | LoadAgraphIndvidualData(indv_list); 18 | Eigen::ArrayXXd x_vals = LoadAgraphXVals(); 19 | benchmark_test_data = BenchmarkTestData(indv_list, x_vals); 20 | } 21 | 22 | void LoadAgraphIndvidualData(std::vector &indv_list) { 23 | std::ifstream stack_filestream; 24 | std::ifstream const_filestream; 25 | stack_filestream.open(STACK_FILE); 26 | const_filestream.open(CONST_FILE); 27 | 28 | std::string stack_file_line; 29 | std::string const_file_line; 30 | while ((stack_filestream >> stack_file_line) && 31 | (const_filestream >> const_file_line)) { 32 | AGraph curr_indv = AGraph(false); 33 | SetIndvStack(curr_indv, stack_file_line); 34 | SetIndvConstants(curr_indv, const_file_line); 35 | indv_list.push_back(curr_indv); 36 | } 37 | stack_filestream.close(); 38 | const_filestream.close(); 39 | } 40 | 41 | void SetIndvConstants(AGraph &indv, std::string &const_string) { 42 | std::stringstream string_stream(const_string); 43 | std::string num_constants; 44 | std::getline(string_stream, num_constants, ','); 45 | Eigen::VectorXd curr_const(std::stoi(num_constants)); 46 | 47 | std::string curr_val; 48 | for (int i=0; std::getline(string_stream, curr_val, ','); i++) { 49 | curr_const(i) = std::stod(curr_val); 50 | } 51 | indv.SetLocalOptimizationParams(curr_const); 52 | } 53 | 54 | void SetIndvStack(AGraph &indv, std::string &stack_string) { 55 | std::stringstream string_stream(stack_string); 56 | Eigen::ArrayX3i curr_stack = Eigen::ArrayX3i(STACK_SIZE, STACK_COLS); 57 | 58 | std::string curr_op; 59 | for (int i=0; std::getline(string_stream, curr_op, ','); i++) { 60 | curr_stack(i/STACK_COLS, i%STACK_COLS) = std::stoi(curr_op); 61 | } 62 | indv.SetCommandArray(curr_stack); 63 | } 64 | 65 | Eigen::ArrayXXd LoadAgraphXVals() { 66 | std::ifstream filename; 67 | filename.open(X_FILE); 68 | 69 | Eigen::ArrayXXd x_vals = Eigen::ArrayXXd(NUM_DATA_POINTS, INPUT_DIM); 70 | std::string curr_x_row; 71 | for (int row = 0; filename >> curr_x_row; row++) { 72 | std::stringstream string_stream(curr_x_row); 73 | std::string curr_x; 74 | for (int col = 0; std::getline(string_stream, curr_x, ','); col++) { 75 | x_vals(row, col) = std::stod(curr_x); 76 | } 77 | } 78 | filename.close(); 79 | return x_vals; 80 | } -------------------------------------------------------------------------------- /src/implicit_regression.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "bingocpp/implicit_regression.h" 5 | 6 | namespace bingo { 7 | 8 | ImplicitTrainingData *ImplicitTrainingData::GetItem(int item) { 9 | return new ImplicitTrainingData(x.row(item), dx_dt.row(item)); 10 | } 11 | 12 | ImplicitTrainingData *ImplicitTrainingData::GetItem( 13 | const std::vector &items) { 14 | Eigen::ArrayXXd temp_in(items.size(), x.cols()); 15 | Eigen::ArrayXXd temp_out(items.size(), dx_dt.cols()); 16 | 17 | for (std::size_t row = 0; row < items.size(); row ++) { 18 | temp_in.row(row) = x.row(items[row]); 19 | temp_out.row(row) = dx_dt.row(items[row]); 20 | } 21 | return new ImplicitTrainingData(temp_in, temp_out); 22 | } 23 | 24 | ImplicitRegressionState ImplicitRegression::DumpState() { 25 | return ImplicitRegressionState( 26 | ((ImplicitTrainingData*)training_data_)->DumpState(), 27 | metric_, required_params_, eval_count_); 28 | } 29 | 30 | Eigen::ArrayXXd dfdx_dot_dfdt(const Eigen::ArrayXXd &dx_dt, 31 | const Eigen::ArrayXXd &grad); 32 | bool not_enough_parameters_used(int required_params, 33 | const Eigen::ArrayXXd &dot_product); 34 | 35 | Eigen::ArrayXd ImplicitRegression::EvaluateFitnessVector( 36 | Equation &individual) const { 37 | EvalAndDerivative eval_and_grad 38 | = individual.EvaluateEquationWithXGradientAt( 39 | ((ImplicitTrainingData*)training_data_)->x); 40 | Eigen::ArrayXXd dot_product = dfdx_dot_dfdt( 41 | ((ImplicitTrainingData*)training_data_)->dx_dt, 42 | eval_and_grad.second); 43 | 44 | if (required_params_ != kNoneRequired 45 | && not_enough_parameters_used(required_params_, dot_product)) { 46 | return Eigen::ArrayXd::Constant( 47 | ((ImplicitTrainingData*)training_data_)->x.rows(), 48 | std::numeric_limits::infinity()); 49 | } 50 | // NOTE tylertownsend: may need to verify eigen NaN conditions 51 | Eigen::ArrayXXd denominator = dot_product.abs().rowwise().sum(); 52 | Eigen::ArrayXXd normalized_fitness = 53 | dot_product.rowwise().sum() / denominator; 54 | return normalized_fitness.unaryExpr([](double v) { 55 | return std::isfinite(v) ? v : std::numeric_limits::infinity(); 56 | }); 57 | } 58 | 59 | Eigen::ArrayXXd dfdx_dot_dfdt(const Eigen::ArrayXXd &dx_dt, 60 | const Eigen::ArrayXXd &grad) { 61 | Eigen::ArrayXXd left_dot = grad; 62 | Eigen::ArrayXXd right_dot = dx_dt; 63 | return left_dot * right_dot; 64 | } 65 | 66 | bool not_enough_parameters_used(int required_params, 67 | const Eigen::ArrayXXd &dot_product) { 68 | auto num_params_used = (dot_product.abs() > 1e-16).rowwise().count(); 69 | return !(num_params_used >= required_params).any(); 70 | } 71 | } // namespace bingo -------------------------------------------------------------------------------- /app/bingocpp_pymodule.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file bingocpp_pymodule.cc 3 | * 4 | * \author Geoffrey F. Bomarito 5 | * \date 6 | * 7 | * This file contains the python bindings for the c++ bingo library. 8 | * 9 | * Notices 10 | * ------- 11 | * Copyright 2018 United States Government as represented by the Administrator of 12 | * the National Aeronautics and Space Administration. No copyright is claimed in 13 | * the United States under Title 17, U.S. Code. All Other Rights Reserved. 14 | * 15 | * 16 | * Disclaimers 17 | * ----------- 18 | * No Warranty: THE SUBJECT SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY OF 19 | * ANY KIND, EITHER EXPRESSED, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED 20 | * TO, ANY WARRANTY THAT THE SUBJECT SOFTWARE WILL CONFORM TO SPECIFICATIONS, ANY 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR 22 | * FREEDOM FROM INFRINGEMENT, ANY WARRANTY THAT THE SUBJECT SOFTWARE WILL BE ERROR 23 | * FREE, OR ANY WARRANTY THAT DOCUMENTATION, IF PROVIDED, WILL CONFORM TO THE 24 | * SUBJECT SOFTWARE. THIS AGREEMENT DOES NOT, IN ANY MANNER, CONSTITUTE AN 25 | * ENDORSEMENT BY GOVERNMENT AGENCY OR ANY PRIOR RECIPIENT OF ANY RESULTS, 26 | * RESULTING DESIGNS, HARDWARE, SOFTWARE PRODUCTS OR ANY OTHER APPLICATIONS 27 | * RESULTING FROM USE OF THE SUBJECT SOFTWARE. FURTHER, GOVERNMENT AGENCY 28 | * DISCLAIMS ALL WARRANTIES AND LIABILITIES REGARDING THIRD-PARTY SOFTWARE, IF 29 | * PRESENT IN THE ORIGINAL SOFTWARE, AND DISTRIBUTES IT "AS IS." 30 | * 31 | * Waiver and Indemnity: RECIPIENT AGREES TO WAIVE ANY AND ALL CLAIMS AGAINST THE 32 | * UNITED STATES GOVERNMENT, ITS CONTRACTORS AND SUBCONTRACTORS, AS WELL AS ANY 33 | * PRIOR RECIPIENT. IF RECIPIENT'S USE OF THE SUBJECT SOFTWARE RESULTS IN ANY 34 | * LIABILITIES, DEMANDS, DAMAGES, EXPENSES OR LOSSES ARISING FROM SUCH USE, 35 | * INCLUDING ANY DAMAGES FROM PRODUCTS BASED ON, OR RESULTING FROM, RECIPIENT'S USE 36 | * OF THE SUBJECT SOFTWARE, RECIPIENT SHALL INDEMNIFY AND HOLD HARMLESS THE UNITED 37 | * STATES GOVERNMENT, ITS CONTRACTORS AND SUBCONTRACTORS, AS WELL AS ANY PRIOR 38 | * RECIPIENT, TO THE EXTENT PERMITTED BY LAW. RECIPIENT'S SOLE REMEDY FOR ANY 39 | * SUCH MATTER SHALL BE THE IMMEDIATE, UNILATERAL TERMINATION OF THIS AGREEMENT. 40 | */ 41 | 42 | #include 43 | #include 44 | #include 45 | 46 | #include 47 | 48 | #include "evaluation_backend_pymodule.cpp" 49 | #include "simplification_backend_pymodule.cpp" 50 | #include "agraph_pymodule.cpp" 51 | #include "fitness_function_pymodule.cpp" 52 | #include "symbolic_regression_pymodule.cpp" 53 | 54 | namespace py = pybind11; 55 | using namespace bingo; 56 | 57 | PYBIND11_MODULE(bingocpp, m) { 58 | m.doc() = "The c++ extension to bingo"; 59 | add_agraph_class(m); 60 | add_evaluation_backend_submodule(m); 61 | add_simplification_backend_submodule(m); 62 | add_fitness_classes(m); 63 | add_regressor_classes(m); 64 | } -------------------------------------------------------------------------------- /app/utils_pymodule.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file util_pymodule.cc 3 | * 4 | * \author Geoffrey F. Bomarito 5 | * \date 6 | * 7 | * This file contains the python bindings of the utility module in bingo. 8 | * 9 | * Notices 10 | * ------- 11 | * Copyright 2018 United States Government as represented by the Administrator of 12 | * the National Aeronautics and Space Administration. No copyright is claimed in 13 | * the United States under Title 17, U.S. Code. All Other Rights Reserved. 14 | * 15 | * 16 | * Disclaimers 17 | * ----------- 18 | * No Warranty: THE SUBJECT SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY OF 19 | * ANY KIND, EITHER EXPRESSED, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED 20 | * TO, ANY WARRANTY THAT THE SUBJECT SOFTWARE WILL CONFORM TO SPECIFICATIONS, ANY 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR 22 | * FREEDOM FROM INFRINGEMENT, ANY WARRANTY THAT THE SUBJECT SOFTWARE WILL BE ERROR 23 | * FREE, OR ANY WARRANTY THAT DOCUMENTATION, IF PROVIDED, WILL CONFORM TO THE 24 | * SUBJECT SOFTWARE. THIS AGREEMENT DOES NOT, IN ANY MANNER, CONSTITUTE AN 25 | * ENDORSEMENT BY GOVERNMENT AGENCY OR ANY PRIOR RECIPIENT OF ANY RESULTS, 26 | * RESULTING DESIGNS, HARDWARE, SOFTWARE PRODUCTS OR ANY OTHER APPLICATIONS 27 | * RESULTING FROM USE OF THE SUBJECT SOFTWARE. FURTHER, GOVERNMENT AGENCY 28 | * DISCLAIMS ALL WARRANTIES AND LIABILITIES REGARDING THIRD-PARTY SOFTWARE, IF 29 | * PRESENT IN THE ORIGINAL SOFTWARE, AND DISTRIBUTES IT "AS IS."
 30 | * 31 | * Waiver and Indemnity: RECIPIENT AGREES TO WAIVE ANY AND ALL CLAIMS AGAINST THE 32 | * UNITED STATES GOVERNMENT, ITS CONTRACTORS AND SUBCONTRACTORS, AS WELL AS ANY 33 | * PRIOR RECIPIENT. IF RECIPIENT'S USE OF THE SUBJECT SOFTWARE RESULTS IN ANY 34 | * LIABILITIES, DEMANDS, DAMAGES, EXPENSES OR LOSSES ARISING FROM SUCH USE, 35 | * INCLUDING ANY DAMAGES FROM PRODUCTS BASED ON, OR RESULTING FROM, RECIPIENT'S USE 36 | * OF THE SUBJECT SOFTWARE, RECIPIENT SHALL INDEMNIFY AND HOLD HARMLESS THE UNITED 37 | * STATES GOVERNMENT, ITS CONTRACTORS AND SUBCONTRACTORS, AS WELL AS ANY PRIOR 38 | * RECIPIENT, TO THE EXTENT PERMITTED BY LAW. RECIPIENT'S SOLE REMEDY FOR ANY 39 | * SUCH MATTER SHALL BE THE IMMEDIATE, UNILATERAL TERMINATION OF THIS AGREEMENT. 40 | */ 41 | 42 | #include 43 | 44 | #include "bingocpp/utils.h" 45 | 46 | namespace py = pybind11; 47 | using namespace bingo; 48 | 49 | PYBIND11_MODULE(utils, m) { 50 | m.def("_calculate_partials", &CalculatePartials,py::arg("X")); 51 | m.def("_savitzky_golay_gram", &SavitzkyGolay, 52 | py::arg("y"), 53 | py::arg("window_size"), 54 | py::arg("order"), 55 | py::arg("deriv") = 0); 56 | m.def("generalized_factorial", &GenFact, 57 | py::arg("a"), 58 | py::arg("b")); 59 | m.def("gram_polynomial", &GramPoly, 60 | py::arg("gp_i"), 61 | py::arg("gp_m"), 62 | py::arg("gp_k"), 63 | py::arg("gp_s")); 64 | m.def("gram_weight", &GramWeight, 65 | py::arg("gw_i"), 66 | py::arg("gw_t"), 67 | py::arg("gw_m"), 68 | py::arg("gw_n"), 69 | py::arg("gw_s")); 70 | } -------------------------------------------------------------------------------- /doc/html/search/functions_4.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['generate',['generate',['../classAcyclicGraphManipulator.html#ade84b4ad6030e5b78026d252af9b38fa',1,'AcyclicGraphManipulator']]], 4 | ['genfact',['GenFact',['../utils_8h.html#a8883803c41dd3a1f8d4ff8d654d92979',1,'utils.cpp']]], 5 | ['get_5farity',['get_arity',['../classOperation.html#ae6af21e893ca28e13471e2f7879afd3e',1,'Operation::get_arity()'],['../classX__Load.html#a04ac1ceb5aba1a29dcc77234136de802',1,'X_Load::get_arity()'],['../classC__Load.html#ae655fdc171a24965bb5cbb1e2fda9293',1,'C_Load::get_arity()'],['../classAddition.html#a691bb6b9a2d71d9074254d90389a2713',1,'Addition::get_arity()'],['../classSubtraction.html#a0ecd0c6d95631fea8c73d166a30831e8',1,'Subtraction::get_arity()'],['../classMultiplication.html#a696c850947f8fb31ad471dde80e8d2d2',1,'Multiplication::get_arity()'],['../classDivision.html#a269601e11e98c4fc5f885363b9c8a2c5',1,'Division::get_arity()'],['../classSin.html#af9defcb92f8a2ddd5785b631f3b7296d',1,'Sin::get_arity()'],['../classCos.html#ac2beebc68e2983e2f6f27728c04d32b8',1,'Cos::get_arity()'],['../classExp.html#a4174a935068765b990ab706e7ec1bbbe',1,'Exp::get_arity()'],['../classLog.html#a42d5513e8506369af7372aaba01c58b3',1,'Log::get_arity()'],['../classPower.html#a07b02c15e12345a186bc2f5904df87d7',1,'Power::get_arity()'],['../classAbsolute.html#afb371f8c2c449e1d3b6d7f7a87621873',1,'Absolute::get_arity()'],['../classSqrt.html#af9e7bd53427b5d56bf70a9958c793964',1,'Sqrt::get_arity()']]], 6 | ['get_5fitem',['get_item',['../structTrainingData.html#a96ef790e9e78909f84ce83692c7faced',1,'TrainingData::get_item()'],['../structExplicitTrainingData.html#a7c60c1b5ea185580a5842c5cca18c7d0',1,'ExplicitTrainingData::get_item()'],['../structImplicitTrainingData.html#a91e92604cc19a693ac89eb7dbd9fab80',1,'ImplicitTrainingData::get_item()']]], 7 | ['get_5fprint',['get_print',['../classOperation.html#aa905714b34d5cc518fa9b248682f4ee7',1,'Operation::get_print()'],['../classX__Load.html#af38090c6c8ebcde7f221f6dd15f80bdb',1,'X_Load::get_print()'],['../classC__Load.html#a58d4503b40ec02c4da5d5daa1bb51967',1,'C_Load::get_print()'],['../classAddition.html#aad65a3e629f302a3fe15327e5259be2f',1,'Addition::get_print()'],['../classSubtraction.html#a9de7e0f8e324423dcfb7691d41545e21',1,'Subtraction::get_print()'],['../classMultiplication.html#aaa0b55c91c439c1d471fa5357b6b83a8',1,'Multiplication::get_print()'],['../classDivision.html#a05bf2f19700b47d772be822f85aeb884',1,'Division::get_print()'],['../classSin.html#a126a29e052db561151e42cf9d778bd8b',1,'Sin::get_print()'],['../classCos.html#a4db275037edc252704370b203dcc2efb',1,'Cos::get_print()'],['../classExp.html#a591369485b6ce08f11132ca81225d0d4',1,'Exp::get_print()'],['../classLog.html#a218147ad7dbad6c9385810b5c79453b9',1,'Log::get_print()'],['../classPower.html#a89b7b5eb5f1073ac4a20ee9eff9ea232',1,'Power::get_print()'],['../classAbsolute.html#a18f5a749b8691c91d30c274603b3917e',1,'Absolute::get_print()'],['../classSqrt.html#ad219db03b8559e643e48c859e741ab1a',1,'Sqrt::get_print()']]], 8 | ['grampoly',['GramPoly',['../utils_8h.html#ac78013378e297fd448de0283399913c5',1,'utils.cpp']]], 9 | ['gramweight',['GramWeight',['../utils_8h.html#ad6be665a715d2863859c7571484e7cbd',1,'utils.cpp']]] 10 | ]; 11 | -------------------------------------------------------------------------------- /app/fitness_benchmarks.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | 11 | #define EXPLICIT "explicit regression" 12 | #define IMPLICIT "implicit regression" 13 | 14 | using namespace bingo; 15 | 16 | void BenchmarkRegression(std::vector &agraph_list, 17 | const VectorBasedFunction &fitness_function); 18 | Eigen::ArrayXd TimeBenchmark( 19 | void (*benchmark)(std::vector&, const VectorBasedFunction &), 20 | BenchmarkTestData &test_data, 21 | const VectorBasedFunction &fitness_function, int number=100, int repeat=10); 22 | void DoRegressionBenchmarking(); 23 | void RunRegressionBenchmarks(BenchmarkTestData &benchmark_test_data); 24 | 25 | int main() { 26 | DoRegressionBenchmarking(); 27 | return 0; 28 | } 29 | 30 | void DoRegressionBenchmarking() { 31 | BenchmarkTestData benchmark_test_data; 32 | LoadBenchmarkData(benchmark_test_data); 33 | RunRegressionBenchmarks(benchmark_test_data); 34 | } 35 | 36 | void RunRegressionBenchmarks(BenchmarkTestData &benchmark_test_data) { 37 | auto input_and_derivative = CalculatePartials(benchmark_test_data.x_vals); 38 | auto x_vals = input_and_derivative.first; 39 | auto derivative = input_and_derivative.second; 40 | auto y = Eigen::ArrayXXd::Zero(x_vals.rows(), x_vals.cols()); 41 | 42 | auto e_training_data = new ExplicitTrainingData(x_vals, y); 43 | ExplicitRegression e_regression(e_training_data); 44 | Eigen::ArrayXd explicit_times = TimeBenchmark( 45 | BenchmarkRegression, benchmark_test_data, e_regression); 46 | 47 | auto i_training_data = new ImplicitTrainingData(x_vals, derivative); 48 | ImplicitRegression i_regression(i_training_data); 49 | Eigen::ArrayXd implicit_times = TimeBenchmark( 50 | BenchmarkRegression, benchmark_test_data, i_regression); 51 | 52 | PrintHeader("REGRESSION BENCHMARKS"); 53 | PrintResults(explicit_times, EXPLICIT); 54 | PrintResults(implicit_times, IMPLICIT); 55 | delete i_training_data; 56 | delete e_training_data; 57 | } 58 | 59 | Eigen::ArrayXd TimeBenchmark( 60 | void (*benchmark)(std::vector&, const VectorBasedFunction &), 61 | BenchmarkTestData &test_data, 62 | const VectorBasedFunction &fitness_function, int number, int repeat) { 63 | Eigen::ArrayXd times = Eigen::ArrayXd(repeat); 64 | for (int run=0; run> time_span = (stop - start); 71 | times(run) = time_span.count(); 72 | } 73 | return times; 74 | } 75 | 76 | void BenchmarkRegression(std::vector &agraph_list, 77 | const VectorBasedFunction &fitness_function) { 78 | std::vector::iterator indv; 79 | for(indv = agraph_list.begin(); indv != agraph_list.end(); indv ++) { 80 | fitness_function.EvaluateIndividualFitness(*indv); 81 | } 82 | } --------------------------------------------------------------------------------