├── .gitignore ├── CMakeLists.txt ├── GeneticAlgorithmByC++.sublime-project ├── GeneticAlgorithmByC++.sublime-workspace ├── README.md ├── build ├── CMakeCache.txt ├── CMakeFiles │ ├── 3.12.1 │ │ ├── CMakeCCompiler.cmake │ │ ├── CMakeCXXCompiler.cmake │ │ ├── CMakeDetermineCompilerABI_C.bin │ │ ├── CMakeDetermineCompilerABI_CXX.bin │ │ ├── CMakeSystem.cmake │ │ ├── CompilerIdC │ │ │ └── CMakeCCompilerId.c │ │ └── CompilerIdCXX │ │ │ └── CMakeCXXCompilerId.cpp │ ├── CMakeDirectoryInformation.cmake │ ├── CMakeError.log │ ├── CMakeOutput.log │ ├── Makefile.cmake │ ├── Makefile2 │ ├── TargetDirectories.txt │ ├── cmake.check_cache │ ├── feature_tests.bin │ ├── feature_tests.c │ ├── feature_tests.cxx │ └── progress.marks ├── Makefile ├── cmake_install.cmake └── src │ ├── CMakeFiles │ ├── CMakeDirectoryInformation.cmake │ ├── GA.dir │ │ ├── CXX.includecache │ │ ├── DependInfo.cmake │ │ ├── build.make │ │ ├── cmake_clean.cmake │ │ ├── depend.internal │ │ ├── depend.make │ │ ├── flags.make │ │ ├── link.txt │ │ └── progress.make │ └── progress.marks │ ├── GA │ ├── GAlib │ ├── CMakeFiles │ │ ├── CMakeDirectoryInformation.cmake │ │ ├── GAlib.dir │ │ │ ├── CXX.includecache │ │ │ ├── DependInfo.cmake │ │ │ ├── build.make │ │ │ ├── cmake_clean.cmake │ │ │ ├── cmake_clean_target.cmake │ │ │ ├── depend.internal │ │ │ ├── depend.make │ │ │ ├── flags.make │ │ │ ├── link.txt │ │ │ └── progress.make │ │ └── progress.marks │ ├── Makefile │ └── cmake_install.cmake │ ├── Makefile │ ├── cmake_install.cmake │ └── cvplotlib │ ├── CMakeFiles │ ├── CMakeDirectoryInformation.cmake │ ├── cvplotlib.dir │ │ ├── CXX.includecache │ │ ├── DependInfo.cmake │ │ ├── build.make │ │ ├── cmake_clean.cmake │ │ ├── cmake_clean_target.cmake │ │ ├── depend.internal │ │ ├── depend.make │ │ ├── flags.make │ │ ├── link.txt │ │ └── progress.make │ └── progress.marks │ ├── Makefile │ └── cmake_install.cmake ├── demo_picture ├── demo1_1.png ├── demo1_2.png ├── demo1_3.png ├── demo2_1.png ├── demo2_2.png ├── demo3_1.png ├── demo4_1.png ├── demo5_1.png ├── demo6_1.png └── think.png ├── includes ├── GA.h ├── color.h ├── cvplot.h ├── demo.h ├── figure.h ├── highgui.h ├── internal.h └── window.h └── src ├── CMakeLists.txt ├── GAlib ├── CMakeLists.txt ├── GA.cpp ├── GA_BP.cpp ├── GA_TSP.cpp ├── PSO.cpp └── QGA.cpp ├── cvplotlib ├── CMakeLists.txt ├── color.cc ├── figure.cc ├── highgui.cc ├── internal.h └── window.cc ├── demo.cpp └── main.cpp /.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 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.0 FATAL_ERROR) 2 | project(GeneticAlgorithmByC++ VERSION 0.1.0 LANGUAGES C CXX) 3 | 4 | set(CMAKE_CXX_STANDARD 11) 5 | 6 | INCLUDE_DIRECTORIES(includes) 7 | 8 | 9 | add_subdirectory(src) 10 | 11 | SET(CMAKE_BUILD_TYPE "Debug") 12 | SET(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -Wall -ggdb") 13 | SET(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -Wall") -------------------------------------------------------------------------------- /GeneticAlgorithmByC++.sublime-project: -------------------------------------------------------------------------------- 1 | { 2 | "build_systems": 3 | [ 4 | { 5 | "file_regex": "(.+[^:]):(\\d+):(\\d+): (?:fatal )?((?:error|warning): .+)$", 6 | "name": "GeneticAlgorithmByC++ (Linux)", 7 | "shell_cmd": "make -j4", 8 | "syntax": "Packages/CMakeBuilder/Syntax/Make.sublime-syntax", 9 | "variants": 10 | [ 11 | { 12 | "name": "clean", 13 | "shell_cmd": "make -j4 clean" 14 | }, 15 | { 16 | "name": "rebuild_cache", 17 | "shell_cmd": "make -j4 rebuild_cache" 18 | }, 19 | { 20 | "name": "GA", 21 | "shell_cmd": "make -j4 GA" 22 | }, 23 | { 24 | "name": "cvplotlib", 25 | "shell_cmd": "make -j4 cvplotlib" 26 | }, 27 | { 28 | "name": "GAlib", 29 | "shell_cmd": "make -j4 GAlib" 30 | } 31 | ], 32 | "working_dir": "${project_path}/build" 33 | } 34 | ], 35 | "folders": 36 | [ 37 | { 38 | "path": "." 39 | } 40 | ], 41 | "settings": 42 | { 43 | "cmake": 44 | { 45 | "build_folder": "${project_path}/build" 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GeneticAlgorithm 2 | 这是用C++写的遗传算法,参考《智能算法 30案例分析 第2版》一书,包含TSP、LQR控制器、结合量子算法、多目标优化、粒子群等,由于原作为matlab程序,综合自己思路通过C++写出来,算是练习和开个大坑 3 | 4 | 5 | 6 | - 通过opencv绘制函数曲线图和坐标图 7 | - 一元最优化目标 8 | - 多元函数优化目标 9 | - 基于遗传算法的BP神经网络(施工中) 10 | - 基于遗传算法的TSP问题 11 | - 基于量子遗传算法 12 | - 粒子群算法 13 | 14 | ## How to use 15 | ``` 16 | git clone https://github.com/ShiSanChuan/GeneticAlgorithm.git 17 | cd GeneticAlgorithm/ 18 | cmake . 19 | make -j4 20 | cd src/ 21 | ./GA 22 | ``` 23 | 24 | ## Recode 25 | ### 一元函数优化 26 | - 通过遗传算法求`x^2*sin(3x*pi)`的最大值,增大初始种群数目可加快迭代,增加种群基因编码长度增大迭代稳定性,变异和交叉较小为好; 27 | - 对于遗传算法中的赌盘轮巡法,最常见直接计算所有个体函数的累加值作为随机值的最大值,但因为数据中可能有负数,所以将所有数据减去这个最小值,但这样结果会使中间的数据频繁出现,无法很好的表现最优值; 28 | ```cpp 29 | float fun1(std::vector argv){ 30 | float x=argv[0]; 31 | return (x*x*std::sin(3*pi*x)); 32 | } 33 | ... 34 | ga.solve(fun1,1); 35 | ``` 36 | 37 | 38 | 39 | 40 | - 若再将fun(x)后处理的数据再次进行exp(x),可以去除有负数累加的问题,但若目标函数的最优值与次最优值很近,或者fun(x)的数据本身集中在[-inf,1],也无法很好的区分最优值; 41 | 42 | 43 | 44 | - 若将fun(x)后的数据进行排序,在将排序的大小换为整数1,...,n,在通过指数exp或者平方处理,可以很好区分最优值。 45 | 46 | 47 | 48 | - 因为种群编码长度受计算机影响(64位),因此搜索区间太大会使精度下降,因此进行一次遗传算法寻求全局最优后再次缩小范围求获得的精度更高。 49 | 50 | ### 二元函数优化 51 | - 与一元函数优化基本类似,不过在rank中需要在二元中需找对应最大解,求解`xcos(2pi*y)+ysin(2pi*x)`,该函数的matlab绘制的图像在第二张图片。 52 | ```cpp 53 | float fun2(std::vector argv){ 54 | float x=argv[0];//参数可变,当前使用两个变量 55 | float y=argv[1]; 56 | return (x*std::cos(2*pi*y)+y*std::sin(2*pi*x)); 57 | } 58 | ... 59 | ga.solve(fun2,2); 60 | ``` 61 | 62 | 63 | 64 | 65 | ### 基于BP的遗传算法 66 | BP的正则化在opencv中有点难弄。。所以结果误差MSE在4左右,BP中的sigmod函数的确非常重要。。。 67 | ```cpp 68 | float _input[2][3]={{1,2,3},{4,5,6}}; 69 | float _output[2][2]={{1.,2.},{3.,4.}}; 70 | ... 71 | GA_BP ga(10,440); 72 | ga.BPsolve(input, output); 73 | ``` 74 | 75 | 76 | 77 | ### 基于遗传算法的TSP 78 | - TSP作为典型的NP问题,目前没有一个多项式的解法,虽然参照书上matlab遗传算法求解TSP问题,但书中交叉、变异的概念有点没弄懂,用C++实现后,~~并没有出现预期想象中那么好的结果,或许这些NP问题用遗传算法来解有点看脸吧(:《 ),最好的结果也没有达到书中的0.03,实际距离29.3405(也就是包裹点的最大多边形)。~~,原来在代码中的初始数据的定义有问题,以前是`float _address[14][3]`,这样初始化就有问题,会求取空间的TSP,而且第三个参数是随机的,这个错误太大意了,修改后效果好很多,近乎最优解,速度比MATLAB快。 79 | 80 | ```cpp 81 | float _address[14][2]={{16.47,96.10},{16.47,94.44}, 82 | {22.39,93.37},{25.23,97.24}, 83 | {20.47,97.02},{17.20,96.29}, 84 | {14.05,98.12},{22.00,96.05}, 85 | {16.53,97.38},{21.52,95.59}, 86 | {19.41,97.13},{20.09,92.55}}; 87 | ... 88 | cv::Mat address(cv::Size(2,12),CV_32FC1,_address); 89 | GA_TSP ga(40,address.rows); 90 | ga.TSPsolve(address); 91 | ``` 92 | 93 | 94 | ### 基于量子遗传算法 95 | - 量子遗传算法(QGA)是一种概率型算法,抛弃普通遗传算法的基因交叉和变异操作,通过使用量子门旋转来调整基因,基本理解是每个基因代表一个角度值,角度值在-pi~pi之间变动,sin()^2处理后,通过每次的概率来获得该基因是0还是1,然后通过调整角度值使得新的个体。(程序中没有按照书中所说的方法调整,因为在书中程序的matlab增加空间存储变量,在该程序中的基因对比时还是rand,所以不稳定) 96 | ``` 97 | * select 通过量子门旋转更新群体 更新方法: P82 98 | *x best f(x)>f(best) alpha ab>0 ab<0 a=0 b=0 99 | *0 0 false 0 0 0 0 0 100 | *0 0 true 0 0 0 0 0 101 | *0 1 false 0.01pi 1 -1 0 +-1 102 | *0 1 true 0.01pi -1 1 +-1 0 103 | *1 0 false 0.01pi -1 1 +-1 0 104 | *1 0 true 0.01pi 1 -1 0 +-1 105 | *1 1 false 0 0 0 0 0 106 | *1 1 true 0 0 0 0 0 107 | ``` 108 | 109 | ```cpp 110 | float fun2(std::vector argv){ 111 | float x=argv[0]; 112 | float y=argv[1]; 113 | return (x*std::cos(2*pi*y)+y*std::sin(2*pi*x)); 114 | } 115 | ... 116 | QGA ga(80,80); 117 | ga.solve(fun2,2); 118 | Popula=ga.crtbp(); 119 | ... 120 | ga.bs2rv(Popula,-2,2); 121 | ga.ranking(); 122 | ga.select(Popula); 123 | ``` 124 | 125 | 126 | 127 | ### 粒子群算法 128 | - 粒子群算法是一种群体搜索算法,每个粒子代表一个解,同时对应一个适应度,粒子向着全局和自身最优的地方前进,前进的速度由该粒子与当前最佳与历史最佳的粒子相对位置决定,因此能在可解空间中快速搜索。 129 | ```cpp 130 | float fun3(std::vector argv){ 131 | float x=argv[0]; 132 | float y=argv[1]; 133 | return (x*std::cos(2*pi*y)+y*std::sin(2*pi*x)); 134 | } 135 | ... 136 | PSO pso(50,2,-2,2); 137 | pso.solve(fun3); 138 | pso.crtbp(); 139 | ... 140 | pso.ranking(); 141 | pso.update(1); 142 | ``` 143 | 144 | 145 | 146 | 147 | ## some Problem 148 | - 在每次选择最优种群个体时,保护当前最优个体加上赌盘选择法可以加快迭代优化,并且增加稳定。 149 | - C++中构造函数中不能再使用其它重载的构造函数,会失效。 150 | - cv::Mat 的结构体,使用at时,返回的是一个template的量,因此在使用逻辑表达式的时候最好先强制转换一下。 151 | - 使用cstdarg,C++可变参数函数:(不过不如传入数组,因为cstdarg声明的函数指针不能使用lamdaba传入,一大遗憾。。) 152 | 153 | ```cpp 154 | #include 155 | void testarg(count,...){ 156 | va_list ap; 157 | va_start(ap, count); 158 | for(int i=0;i 24 | 25 | int main(int argc, char** argv) 26 | { 27 | (void)argv; 28 | #ifndef pthread_create 29 | return ((int*)(&pthread_create))[argc]; 30 | #else 31 | (void)argc; 32 | return 0; 33 | #endif 34 | } 35 | 36 | Determining if the function pthread_create exists in the pthreads failed with the following output: 37 | Change Dir: /home/shisanchuan/C++work/GeneticAlgorithm/build/CMakeFiles/CMakeTmp 38 | 39 | Run Build Command:"/usr/bin/make" "cmTC_c1fce/fast" 40 | /usr/bin/make -f CMakeFiles/cmTC_c1fce.dir/build.make CMakeFiles/cmTC_c1fce.dir/build 41 | make[1]: Entering directory '/home/shisanchuan/C++work/GeneticAlgorithm/build/CMakeFiles/CMakeTmp' 42 | Building C object CMakeFiles/cmTC_c1fce.dir/CheckFunctionExists.c.o 43 | /usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_c1fce.dir/CheckFunctionExists.c.o -c /usr/local/share/cmake-3.12/Modules/CheckFunctionExists.c 44 | Linking C executable cmTC_c1fce 45 | /usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_c1fce.dir/link.txt --verbose=1 46 | /usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -rdynamic CMakeFiles/cmTC_c1fce.dir/CheckFunctionExists.c.o -o cmTC_c1fce -lpthreads 47 | /usr/bin/ld: 找不到 -lpthreads 48 | collect2: error: ld returned 1 exit status 49 | CMakeFiles/cmTC_c1fce.dir/build.make:86: recipe for target 'cmTC_c1fce' failed 50 | make[1]: *** [cmTC_c1fce] Error 1 51 | make[1]: Leaving directory '/home/shisanchuan/C++work/GeneticAlgorithm/build/CMakeFiles/CMakeTmp' 52 | Makefile:121: recipe for target 'cmTC_c1fce/fast' failed 53 | make: *** [cmTC_c1fce/fast] Error 2 54 | 55 | 56 | -------------------------------------------------------------------------------- /build/CMakeFiles/Makefile.cmake: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.12 3 | 4 | # The generator used is: 5 | set(CMAKE_DEPENDS_GENERATOR "Unix Makefiles") 6 | 7 | # The top level Makefile was generated from the following files: 8 | set(CMAKE_MAKEFILE_DEPENDS 9 | "CMakeCache.txt" 10 | "../CMakeLists.txt" 11 | "CMakeFiles/3.12.1/CMakeCCompiler.cmake" 12 | "CMakeFiles/3.12.1/CMakeCXXCompiler.cmake" 13 | "CMakeFiles/3.12.1/CMakeSystem.cmake" 14 | "../src/CMakeLists.txt" 15 | "../src/GAlib/CMakeLists.txt" 16 | "../src/cvplotlib/CMakeLists.txt" 17 | "/usr/local/share/cmake-3.12/Modules/CMakeCInformation.cmake" 18 | "/usr/local/share/cmake-3.12/Modules/CMakeCXXInformation.cmake" 19 | "/usr/local/share/cmake-3.12/Modules/CMakeCommonLanguageInclude.cmake" 20 | "/usr/local/share/cmake-3.12/Modules/CMakeGenericSystem.cmake" 21 | "/usr/local/share/cmake-3.12/Modules/CMakeInitializeConfigs.cmake" 22 | "/usr/local/share/cmake-3.12/Modules/CMakeLanguageInformation.cmake" 23 | "/usr/local/share/cmake-3.12/Modules/CMakeSystemSpecificInformation.cmake" 24 | "/usr/local/share/cmake-3.12/Modules/CMakeSystemSpecificInitialize.cmake" 25 | "/usr/local/share/cmake-3.12/Modules/CheckIncludeFile.cmake" 26 | "/usr/local/share/cmake-3.12/Modules/CheckLibraryExists.cmake" 27 | "/usr/local/share/cmake-3.12/Modules/CheckSymbolExists.cmake" 28 | "/usr/local/share/cmake-3.12/Modules/Compiler/CMakeCommonCompilerMacros.cmake" 29 | "/usr/local/share/cmake-3.12/Modules/Compiler/GNU-C.cmake" 30 | "/usr/local/share/cmake-3.12/Modules/Compiler/GNU-CXX.cmake" 31 | "/usr/local/share/cmake-3.12/Modules/Compiler/GNU.cmake" 32 | "/usr/local/share/cmake-3.12/Modules/FindPackageHandleStandardArgs.cmake" 33 | "/usr/local/share/cmake-3.12/Modules/FindPackageMessage.cmake" 34 | "/usr/local/share/cmake-3.12/Modules/FindThreads.cmake" 35 | "/usr/local/share/cmake-3.12/Modules/Platform/Linux-GNU-C.cmake" 36 | "/usr/local/share/cmake-3.12/Modules/Platform/Linux-GNU-CXX.cmake" 37 | "/usr/local/share/cmake-3.12/Modules/Platform/Linux-GNU.cmake" 38 | "/usr/local/share/cmake-3.12/Modules/Platform/Linux.cmake" 39 | "/usr/local/share/cmake-3.12/Modules/Platform/UnixPaths.cmake" 40 | "/usr/share/OpenCV/OpenCVConfig-version.cmake" 41 | "/usr/share/OpenCV/OpenCVConfig.cmake" 42 | "/usr/share/OpenCV/OpenCVModules-release.cmake" 43 | "/usr/share/OpenCV/OpenCVModules.cmake" 44 | ) 45 | 46 | # The corresponding makefile is: 47 | set(CMAKE_MAKEFILE_OUTPUTS 48 | "Makefile" 49 | "CMakeFiles/cmake.check_cache" 50 | ) 51 | 52 | # Byproducts of CMake generate step: 53 | set(CMAKE_MAKEFILE_PRODUCTS 54 | "CMakeFiles/CMakeDirectoryInformation.cmake" 55 | "src/CMakeFiles/CMakeDirectoryInformation.cmake" 56 | "src/cvplotlib/CMakeFiles/CMakeDirectoryInformation.cmake" 57 | "src/GAlib/CMakeFiles/CMakeDirectoryInformation.cmake" 58 | ) 59 | 60 | # Dependency information for all targets: 61 | set(CMAKE_DEPEND_INFO_FILES 62 | "src/CMakeFiles/GA.dir/DependInfo.cmake" 63 | "src/cvplotlib/CMakeFiles/cvplotlib.dir/DependInfo.cmake" 64 | "src/GAlib/CMakeFiles/GAlib.dir/DependInfo.cmake" 65 | ) 66 | -------------------------------------------------------------------------------- /build/CMakeFiles/Makefile2: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.12 3 | 4 | # Default target executed when no arguments are given to make. 5 | default_target: all 6 | 7 | .PHONY : default_target 8 | 9 | # The main recursive all target 10 | all: 11 | 12 | .PHONY : all 13 | 14 | # The main recursive preinstall target 15 | preinstall: 16 | 17 | .PHONY : preinstall 18 | 19 | # The main recursive clean target 20 | clean: 21 | 22 | .PHONY : clean 23 | 24 | #============================================================================= 25 | # Special targets provided by cmake. 26 | 27 | # Disable implicit rules so canonical targets will work. 28 | .SUFFIXES: 29 | 30 | 31 | # Remove some rules from gmake that .SUFFIXES does not remove. 32 | SUFFIXES = 33 | 34 | .SUFFIXES: .hpux_make_needs_suffix_list 35 | 36 | 37 | # Suppress display of executed commands. 38 | $(VERBOSE).SILENT: 39 | 40 | 41 | # A target that is always out of date. 42 | cmake_force: 43 | 44 | .PHONY : cmake_force 45 | 46 | #============================================================================= 47 | # Set environment variables for the build. 48 | 49 | # The shell in which to execute make rules. 50 | SHELL = /bin/sh 51 | 52 | # The CMake executable. 53 | CMAKE_COMMAND = /usr/local/bin/cmake 54 | 55 | # The command to remove a file. 56 | RM = /usr/local/bin/cmake -E remove -f 57 | 58 | # Escaping for special characters. 59 | EQUALS = = 60 | 61 | # The top-level source directory on which CMake was run. 62 | CMAKE_SOURCE_DIR = /home/shisanchuan/C++work/GeneticAlgorithm 63 | 64 | # The top-level build directory on which CMake was run. 65 | CMAKE_BINARY_DIR = /home/shisanchuan/C++work/GeneticAlgorithm/build 66 | 67 | #============================================================================= 68 | # Directory level rules for directory src 69 | 70 | # Convenience name for "all" pass in the directory. 71 | src/all: src/CMakeFiles/GA.dir/all 72 | src/all: src/cvplotlib/all 73 | src/all: src/GAlib/all 74 | 75 | .PHONY : src/all 76 | 77 | # Convenience name for "clean" pass in the directory. 78 | src/clean: src/CMakeFiles/GA.dir/clean 79 | src/clean: src/cvplotlib/clean 80 | src/clean: src/GAlib/clean 81 | 82 | .PHONY : src/clean 83 | 84 | # Convenience name for "preinstall" pass in the directory. 85 | src/preinstall: src/cvplotlib/preinstall 86 | src/preinstall: src/GAlib/preinstall 87 | 88 | .PHONY : src/preinstall 89 | 90 | #============================================================================= 91 | # Target rules for target src/CMakeFiles/GA.dir 92 | 93 | # All Build rule for target. 94 | src/CMakeFiles/GA.dir/all: src/cvplotlib/CMakeFiles/cvplotlib.dir/all 95 | src/CMakeFiles/GA.dir/all: src/GAlib/CMakeFiles/GAlib.dir/all 96 | $(MAKE) -f src/CMakeFiles/GA.dir/build.make src/CMakeFiles/GA.dir/depend 97 | $(MAKE) -f src/CMakeFiles/GA.dir/build.make src/CMakeFiles/GA.dir/build 98 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/home/shisanchuan/C++work/GeneticAlgorithm/build/CMakeFiles --progress-num=1,2,3 "Built target GA" 99 | .PHONY : src/CMakeFiles/GA.dir/all 100 | 101 | # Include target in all. 102 | all: src/CMakeFiles/GA.dir/all 103 | 104 | .PHONY : all 105 | 106 | # Build rule for subdir invocation for target. 107 | src/CMakeFiles/GA.dir/rule: cmake_check_build_system 108 | $(CMAKE_COMMAND) -E cmake_progress_start /home/shisanchuan/C++work/GeneticAlgorithm/build/CMakeFiles 14 109 | $(MAKE) -f CMakeFiles/Makefile2 src/CMakeFiles/GA.dir/all 110 | $(CMAKE_COMMAND) -E cmake_progress_start /home/shisanchuan/C++work/GeneticAlgorithm/build/CMakeFiles 0 111 | .PHONY : src/CMakeFiles/GA.dir/rule 112 | 113 | # Convenience name for target. 114 | GA: src/CMakeFiles/GA.dir/rule 115 | 116 | .PHONY : GA 117 | 118 | # clean rule for target. 119 | src/CMakeFiles/GA.dir/clean: 120 | $(MAKE) -f src/CMakeFiles/GA.dir/build.make src/CMakeFiles/GA.dir/clean 121 | .PHONY : src/CMakeFiles/GA.dir/clean 122 | 123 | # clean rule for target. 124 | clean: src/CMakeFiles/GA.dir/clean 125 | 126 | .PHONY : clean 127 | 128 | #============================================================================= 129 | # Directory level rules for directory src/cvplotlib 130 | 131 | # Convenience name for "all" pass in the directory. 132 | src/cvplotlib/all: src/cvplotlib/CMakeFiles/cvplotlib.dir/all 133 | 134 | .PHONY : src/cvplotlib/all 135 | 136 | # Convenience name for "clean" pass in the directory. 137 | src/cvplotlib/clean: src/cvplotlib/CMakeFiles/cvplotlib.dir/clean 138 | 139 | .PHONY : src/cvplotlib/clean 140 | 141 | # Convenience name for "preinstall" pass in the directory. 142 | src/cvplotlib/preinstall: 143 | 144 | .PHONY : src/cvplotlib/preinstall 145 | 146 | #============================================================================= 147 | # Target rules for target src/cvplotlib/CMakeFiles/cvplotlib.dir 148 | 149 | # All Build rule for target. 150 | src/cvplotlib/CMakeFiles/cvplotlib.dir/all: 151 | $(MAKE) -f src/cvplotlib/CMakeFiles/cvplotlib.dir/build.make src/cvplotlib/CMakeFiles/cvplotlib.dir/depend 152 | $(MAKE) -f src/cvplotlib/CMakeFiles/cvplotlib.dir/build.make src/cvplotlib/CMakeFiles/cvplotlib.dir/build 153 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/home/shisanchuan/C++work/GeneticAlgorithm/build/CMakeFiles --progress-num=10,11,12,13,14 "Built target cvplotlib" 154 | .PHONY : src/cvplotlib/CMakeFiles/cvplotlib.dir/all 155 | 156 | # Include target in all. 157 | all: src/cvplotlib/CMakeFiles/cvplotlib.dir/all 158 | 159 | .PHONY : all 160 | 161 | # Build rule for subdir invocation for target. 162 | src/cvplotlib/CMakeFiles/cvplotlib.dir/rule: cmake_check_build_system 163 | $(CMAKE_COMMAND) -E cmake_progress_start /home/shisanchuan/C++work/GeneticAlgorithm/build/CMakeFiles 5 164 | $(MAKE) -f CMakeFiles/Makefile2 src/cvplotlib/CMakeFiles/cvplotlib.dir/all 165 | $(CMAKE_COMMAND) -E cmake_progress_start /home/shisanchuan/C++work/GeneticAlgorithm/build/CMakeFiles 0 166 | .PHONY : src/cvplotlib/CMakeFiles/cvplotlib.dir/rule 167 | 168 | # Convenience name for target. 169 | cvplotlib: src/cvplotlib/CMakeFiles/cvplotlib.dir/rule 170 | 171 | .PHONY : cvplotlib 172 | 173 | # clean rule for target. 174 | src/cvplotlib/CMakeFiles/cvplotlib.dir/clean: 175 | $(MAKE) -f src/cvplotlib/CMakeFiles/cvplotlib.dir/build.make src/cvplotlib/CMakeFiles/cvplotlib.dir/clean 176 | .PHONY : src/cvplotlib/CMakeFiles/cvplotlib.dir/clean 177 | 178 | # clean rule for target. 179 | clean: src/cvplotlib/CMakeFiles/cvplotlib.dir/clean 180 | 181 | .PHONY : clean 182 | 183 | #============================================================================= 184 | # Directory level rules for directory src/GAlib 185 | 186 | # Convenience name for "all" pass in the directory. 187 | src/GAlib/all: src/GAlib/CMakeFiles/GAlib.dir/all 188 | 189 | .PHONY : src/GAlib/all 190 | 191 | # Convenience name for "clean" pass in the directory. 192 | src/GAlib/clean: src/GAlib/CMakeFiles/GAlib.dir/clean 193 | 194 | .PHONY : src/GAlib/clean 195 | 196 | # Convenience name for "preinstall" pass in the directory. 197 | src/GAlib/preinstall: 198 | 199 | .PHONY : src/GAlib/preinstall 200 | 201 | #============================================================================= 202 | # Target rules for target src/GAlib/CMakeFiles/GAlib.dir 203 | 204 | # All Build rule for target. 205 | src/GAlib/CMakeFiles/GAlib.dir/all: 206 | $(MAKE) -f src/GAlib/CMakeFiles/GAlib.dir/build.make src/GAlib/CMakeFiles/GAlib.dir/depend 207 | $(MAKE) -f src/GAlib/CMakeFiles/GAlib.dir/build.make src/GAlib/CMakeFiles/GAlib.dir/build 208 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/home/shisanchuan/C++work/GeneticAlgorithm/build/CMakeFiles --progress-num=4,5,6,7,8,9 "Built target GAlib" 209 | .PHONY : src/GAlib/CMakeFiles/GAlib.dir/all 210 | 211 | # Include target in all. 212 | all: src/GAlib/CMakeFiles/GAlib.dir/all 213 | 214 | .PHONY : all 215 | 216 | # Build rule for subdir invocation for target. 217 | src/GAlib/CMakeFiles/GAlib.dir/rule: cmake_check_build_system 218 | $(CMAKE_COMMAND) -E cmake_progress_start /home/shisanchuan/C++work/GeneticAlgorithm/build/CMakeFiles 6 219 | $(MAKE) -f CMakeFiles/Makefile2 src/GAlib/CMakeFiles/GAlib.dir/all 220 | $(CMAKE_COMMAND) -E cmake_progress_start /home/shisanchuan/C++work/GeneticAlgorithm/build/CMakeFiles 0 221 | .PHONY : src/GAlib/CMakeFiles/GAlib.dir/rule 222 | 223 | # Convenience name for target. 224 | GAlib: src/GAlib/CMakeFiles/GAlib.dir/rule 225 | 226 | .PHONY : GAlib 227 | 228 | # clean rule for target. 229 | src/GAlib/CMakeFiles/GAlib.dir/clean: 230 | $(MAKE) -f src/GAlib/CMakeFiles/GAlib.dir/build.make src/GAlib/CMakeFiles/GAlib.dir/clean 231 | .PHONY : src/GAlib/CMakeFiles/GAlib.dir/clean 232 | 233 | # clean rule for target. 234 | clean: src/GAlib/CMakeFiles/GAlib.dir/clean 235 | 236 | .PHONY : clean 237 | 238 | #============================================================================= 239 | # Special targets to cleanup operation of make. 240 | 241 | # Special rule to run CMake to check the build system integrity. 242 | # No rule that depends on this can have commands that come from listfiles 243 | # because they might be regenerated. 244 | cmake_check_build_system: 245 | $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 246 | .PHONY : cmake_check_build_system 247 | 248 | -------------------------------------------------------------------------------- /build/CMakeFiles/TargetDirectories.txt: -------------------------------------------------------------------------------- 1 | /home/shisanchuan/C++work/GeneticAlgorithm/build/CMakeFiles/rebuild_cache.dir 2 | /home/shisanchuan/C++work/GeneticAlgorithm/build/CMakeFiles/edit_cache.dir 3 | /home/shisanchuan/C++work/GeneticAlgorithm/build/src/CMakeFiles/rebuild_cache.dir 4 | /home/shisanchuan/C++work/GeneticAlgorithm/build/src/CMakeFiles/edit_cache.dir 5 | /home/shisanchuan/C++work/GeneticAlgorithm/build/src/CMakeFiles/GA.dir 6 | /home/shisanchuan/C++work/GeneticAlgorithm/build/src/cvplotlib/CMakeFiles/rebuild_cache.dir 7 | /home/shisanchuan/C++work/GeneticAlgorithm/build/src/cvplotlib/CMakeFiles/edit_cache.dir 8 | /home/shisanchuan/C++work/GeneticAlgorithm/build/src/cvplotlib/CMakeFiles/cvplotlib.dir 9 | /home/shisanchuan/C++work/GeneticAlgorithm/build/src/GAlib/CMakeFiles/rebuild_cache.dir 10 | /home/shisanchuan/C++work/GeneticAlgorithm/build/src/GAlib/CMakeFiles/edit_cache.dir 11 | /home/shisanchuan/C++work/GeneticAlgorithm/build/src/GAlib/CMakeFiles/GAlib.dir 12 | -------------------------------------------------------------------------------- /build/CMakeFiles/cmake.check_cache: -------------------------------------------------------------------------------- 1 | # This file is generated by cmake for dependency checking of the CMakeCache.txt file 2 | -------------------------------------------------------------------------------- /build/CMakeFiles/feature_tests.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShiSanChuan/GeneticAlgorithm/b8216952ded468170f533ff364a25b93a30d0859/build/CMakeFiles/feature_tests.bin -------------------------------------------------------------------------------- /build/CMakeFiles/feature_tests.c: -------------------------------------------------------------------------------- 1 | 2 | const char features[] = {"\n" 3 | "C_FEATURE:" 4 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 304 5 | "1" 6 | #else 7 | "0" 8 | #endif 9 | "c_function_prototypes\n" 10 | "C_FEATURE:" 11 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 304 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 12 | "1" 13 | #else 14 | "0" 15 | #endif 16 | "c_restrict\n" 17 | "C_FEATURE:" 18 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201000L 19 | "1" 20 | #else 21 | "0" 22 | #endif 23 | "c_static_assert\n" 24 | "C_FEATURE:" 25 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 304 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 26 | "1" 27 | #else 28 | "0" 29 | #endif 30 | "c_variadic_macros\n" 31 | 32 | }; 33 | 34 | int main(int argc, char** argv) { (void)argv; return features[argc]; } 35 | -------------------------------------------------------------------------------- /build/CMakeFiles/feature_tests.cxx: -------------------------------------------------------------------------------- 1 | 2 | const char features[] = {"\n" 3 | "CXX_FEATURE:" 4 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 500 && __cplusplus >= 201402L 5 | "1" 6 | #else 7 | "0" 8 | #endif 9 | "cxx_aggregate_default_initializers\n" 10 | "CXX_FEATURE:" 11 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && __cplusplus >= 201103L 12 | "1" 13 | #else 14 | "0" 15 | #endif 16 | "cxx_alias_templates\n" 17 | "CXX_FEATURE:" 18 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 201103L 19 | "1" 20 | #else 21 | "0" 22 | #endif 23 | "cxx_alignas\n" 24 | "CXX_FEATURE:" 25 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 201103L 26 | "1" 27 | #else 28 | "0" 29 | #endif 30 | "cxx_alignof\n" 31 | "CXX_FEATURE:" 32 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 201103L 33 | "1" 34 | #else 35 | "0" 36 | #endif 37 | "cxx_attributes\n" 38 | "CXX_FEATURE:" 39 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L 40 | "1" 41 | #else 42 | "0" 43 | #endif 44 | "cxx_attribute_deprecated\n" 45 | "CXX_FEATURE:" 46 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 47 | "1" 48 | #else 49 | "0" 50 | #endif 51 | "cxx_auto_type\n" 52 | "CXX_FEATURE:" 53 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L 54 | "1" 55 | #else 56 | "0" 57 | #endif 58 | "cxx_binary_literals\n" 59 | "CXX_FEATURE:" 60 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 61 | "1" 62 | #else 63 | "0" 64 | #endif 65 | "cxx_constexpr\n" 66 | "CXX_FEATURE:" 67 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L 68 | "1" 69 | #else 70 | "0" 71 | #endif 72 | "cxx_contextual_conversions\n" 73 | "CXX_FEATURE:" 74 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 75 | "1" 76 | #else 77 | "0" 78 | #endif 79 | "cxx_decltype\n" 80 | "CXX_FEATURE:" 81 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L 82 | "1" 83 | #else 84 | "0" 85 | #endif 86 | "cxx_decltype_auto\n" 87 | "CXX_FEATURE:" 88 | #if ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40801) && __cplusplus >= 201103L 89 | "1" 90 | #else 91 | "0" 92 | #endif 93 | "cxx_decltype_incomplete_return_types\n" 94 | "CXX_FEATURE:" 95 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 96 | "1" 97 | #else 98 | "0" 99 | #endif 100 | "cxx_default_function_template_args\n" 101 | "CXX_FEATURE:" 102 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 103 | "1" 104 | #else 105 | "0" 106 | #endif 107 | "cxx_defaulted_functions\n" 108 | "CXX_FEATURE:" 109 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 110 | "1" 111 | #else 112 | "0" 113 | #endif 114 | "cxx_defaulted_move_initializers\n" 115 | "CXX_FEATURE:" 116 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && __cplusplus >= 201103L 117 | "1" 118 | #else 119 | "0" 120 | #endif 121 | "cxx_delegating_constructors\n" 122 | "CXX_FEATURE:" 123 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 124 | "1" 125 | #else 126 | "0" 127 | #endif 128 | "cxx_deleted_functions\n" 129 | "CXX_FEATURE:" 130 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L 131 | "1" 132 | #else 133 | "0" 134 | #endif 135 | "cxx_digit_separators\n" 136 | "CXX_FEATURE:" 137 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 138 | "1" 139 | #else 140 | "0" 141 | #endif 142 | "cxx_enum_forward_declarations\n" 143 | "CXX_FEATURE:" 144 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 405 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 145 | "1" 146 | #else 147 | "0" 148 | #endif 149 | "cxx_explicit_conversions\n" 150 | "CXX_FEATURE:" 151 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && __cplusplus >= 201103L 152 | "1" 153 | #else 154 | "0" 155 | #endif 156 | "cxx_extended_friend_declarations\n" 157 | "CXX_FEATURE:" 158 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 159 | "1" 160 | #else 161 | "0" 162 | #endif 163 | "cxx_extern_templates\n" 164 | "CXX_FEATURE:" 165 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && __cplusplus >= 201103L 166 | "1" 167 | #else 168 | "0" 169 | #endif 170 | "cxx_final\n" 171 | "CXX_FEATURE:" 172 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 173 | "1" 174 | #else 175 | "0" 176 | #endif 177 | "cxx_func_identifier\n" 178 | "CXX_FEATURE:" 179 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 180 | "1" 181 | #else 182 | "0" 183 | #endif 184 | "cxx_generalized_initializers\n" 185 | "CXX_FEATURE:" 186 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L 187 | "1" 188 | #else 189 | "0" 190 | #endif 191 | "cxx_generic_lambdas\n" 192 | "CXX_FEATURE:" 193 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 201103L 194 | "1" 195 | #else 196 | "0" 197 | #endif 198 | "cxx_inheriting_constructors\n" 199 | "CXX_FEATURE:" 200 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 201 | "1" 202 | #else 203 | "0" 204 | #endif 205 | "cxx_inline_namespaces\n" 206 | "CXX_FEATURE:" 207 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 405 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 208 | "1" 209 | #else 210 | "0" 211 | #endif 212 | "cxx_lambdas\n" 213 | "CXX_FEATURE:" 214 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L 215 | "1" 216 | #else 217 | "0" 218 | #endif 219 | "cxx_lambda_init_captures\n" 220 | "CXX_FEATURE:" 221 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 405 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 222 | "1" 223 | #else 224 | "0" 225 | #endif 226 | "cxx_local_type_template_args\n" 227 | "CXX_FEATURE:" 228 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 229 | "1" 230 | #else 231 | "0" 232 | #endif 233 | "cxx_long_long_type\n" 234 | "CXX_FEATURE:" 235 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 236 | "1" 237 | #else 238 | "0" 239 | #endif 240 | "cxx_noexcept\n" 241 | "CXX_FEATURE:" 242 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && __cplusplus >= 201103L 243 | "1" 244 | #else 245 | "0" 246 | #endif 247 | "cxx_nonstatic_member_init\n" 248 | "CXX_FEATURE:" 249 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 250 | "1" 251 | #else 252 | "0" 253 | #endif 254 | "cxx_nullptr\n" 255 | "CXX_FEATURE:" 256 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && __cplusplus >= 201103L 257 | "1" 258 | #else 259 | "0" 260 | #endif 261 | "cxx_override\n" 262 | "CXX_FEATURE:" 263 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 264 | "1" 265 | #else 266 | "0" 267 | #endif 268 | "cxx_range_for\n" 269 | "CXX_FEATURE:" 270 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 405 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 271 | "1" 272 | #else 273 | "0" 274 | #endif 275 | "cxx_raw_string_literals\n" 276 | "CXX_FEATURE:" 277 | #if ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40801) && __cplusplus >= 201103L 278 | "1" 279 | #else 280 | "0" 281 | #endif 282 | "cxx_reference_qualified_functions\n" 283 | "CXX_FEATURE:" 284 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 500 && __cplusplus >= 201402L 285 | "1" 286 | #else 287 | "0" 288 | #endif 289 | "cxx_relaxed_constexpr\n" 290 | "CXX_FEATURE:" 291 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L 292 | "1" 293 | #else 294 | "0" 295 | #endif 296 | "cxx_return_type_deduction\n" 297 | "CXX_FEATURE:" 298 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 299 | "1" 300 | #else 301 | "0" 302 | #endif 303 | "cxx_right_angle_brackets\n" 304 | "CXX_FEATURE:" 305 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 306 | "1" 307 | #else 308 | "0" 309 | #endif 310 | "cxx_rvalue_references\n" 311 | "CXX_FEATURE:" 312 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 313 | "1" 314 | #else 315 | "0" 316 | #endif 317 | "cxx_sizeof_member\n" 318 | "CXX_FEATURE:" 319 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 320 | "1" 321 | #else 322 | "0" 323 | #endif 324 | "cxx_static_assert\n" 325 | "CXX_FEATURE:" 326 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 327 | "1" 328 | #else 329 | "0" 330 | #endif 331 | "cxx_strong_enums\n" 332 | "CXX_FEATURE:" 333 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && __cplusplus 334 | "1" 335 | #else 336 | "0" 337 | #endif 338 | "cxx_template_template_parameters\n" 339 | "CXX_FEATURE:" 340 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 201103L 341 | "1" 342 | #else 343 | "0" 344 | #endif 345 | "cxx_thread_local\n" 346 | "CXX_FEATURE:" 347 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 348 | "1" 349 | #else 350 | "0" 351 | #endif 352 | "cxx_trailing_return_types\n" 353 | "CXX_FEATURE:" 354 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 355 | "1" 356 | #else 357 | "0" 358 | #endif 359 | "cxx_unicode_literals\n" 360 | "CXX_FEATURE:" 361 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 362 | "1" 363 | #else 364 | "0" 365 | #endif 366 | "cxx_uniform_initialization\n" 367 | "CXX_FEATURE:" 368 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 369 | "1" 370 | #else 371 | "0" 372 | #endif 373 | "cxx_unrestricted_unions\n" 374 | "CXX_FEATURE:" 375 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && __cplusplus >= 201103L 376 | "1" 377 | #else 378 | "0" 379 | #endif 380 | "cxx_user_literals\n" 381 | "CXX_FEATURE:" 382 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 500 && __cplusplus >= 201402L 383 | "1" 384 | #else 385 | "0" 386 | #endif 387 | "cxx_variable_templates\n" 388 | "CXX_FEATURE:" 389 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 390 | "1" 391 | #else 392 | "0" 393 | #endif 394 | "cxx_variadic_macros\n" 395 | "CXX_FEATURE:" 396 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)) 397 | "1" 398 | #else 399 | "0" 400 | #endif 401 | "cxx_variadic_templates\n" 402 | 403 | }; 404 | 405 | int main(int argc, char** argv) { (void)argv; return features[argc]; } 406 | -------------------------------------------------------------------------------- /build/CMakeFiles/progress.marks: -------------------------------------------------------------------------------- 1 | 14 2 | -------------------------------------------------------------------------------- /build/Makefile: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.12 3 | 4 | # Default target executed when no arguments are given to make. 5 | default_target: all 6 | 7 | .PHONY : default_target 8 | 9 | # Allow only one "make -f Makefile2" at a time, but pass parallelism. 10 | .NOTPARALLEL: 11 | 12 | 13 | #============================================================================= 14 | # Special targets provided by cmake. 15 | 16 | # Disable implicit rules so canonical targets will work. 17 | .SUFFIXES: 18 | 19 | 20 | # Remove some rules from gmake that .SUFFIXES does not remove. 21 | SUFFIXES = 22 | 23 | .SUFFIXES: .hpux_make_needs_suffix_list 24 | 25 | 26 | # Suppress display of executed commands. 27 | $(VERBOSE).SILENT: 28 | 29 | 30 | # A target that is always out of date. 31 | cmake_force: 32 | 33 | .PHONY : cmake_force 34 | 35 | #============================================================================= 36 | # Set environment variables for the build. 37 | 38 | # The shell in which to execute make rules. 39 | SHELL = /bin/sh 40 | 41 | # The CMake executable. 42 | CMAKE_COMMAND = /usr/local/bin/cmake 43 | 44 | # The command to remove a file. 45 | RM = /usr/local/bin/cmake -E remove -f 46 | 47 | # Escaping for special characters. 48 | EQUALS = = 49 | 50 | # The top-level source directory on which CMake was run. 51 | CMAKE_SOURCE_DIR = /home/shisanchuan/C++work/GeneticAlgorithm 52 | 53 | # The top-level build directory on which CMake was run. 54 | CMAKE_BINARY_DIR = /home/shisanchuan/C++work/GeneticAlgorithm/build 55 | 56 | #============================================================================= 57 | # Targets provided globally by CMake. 58 | 59 | # Special rule for the target rebuild_cache 60 | rebuild_cache: 61 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." 62 | /usr/local/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) 63 | .PHONY : rebuild_cache 64 | 65 | # Special rule for the target rebuild_cache 66 | rebuild_cache/fast: rebuild_cache 67 | 68 | .PHONY : rebuild_cache/fast 69 | 70 | # Special rule for the target edit_cache 71 | edit_cache: 72 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "No interactive CMake dialog available..." 73 | /usr/local/bin/cmake -E echo No\ interactive\ CMake\ dialog\ available. 74 | .PHONY : edit_cache 75 | 76 | # Special rule for the target edit_cache 77 | edit_cache/fast: edit_cache 78 | 79 | .PHONY : edit_cache/fast 80 | 81 | # The main all target 82 | all: cmake_check_build_system 83 | $(CMAKE_COMMAND) -E cmake_progress_start /home/shisanchuan/C++work/GeneticAlgorithm/build/CMakeFiles /home/shisanchuan/C++work/GeneticAlgorithm/build/CMakeFiles/progress.marks 84 | $(MAKE) -f CMakeFiles/Makefile2 all 85 | $(CMAKE_COMMAND) -E cmake_progress_start /home/shisanchuan/C++work/GeneticAlgorithm/build/CMakeFiles 0 86 | .PHONY : all 87 | 88 | # The main clean target 89 | clean: 90 | $(MAKE) -f CMakeFiles/Makefile2 clean 91 | .PHONY : clean 92 | 93 | # The main clean target 94 | clean/fast: clean 95 | 96 | .PHONY : clean/fast 97 | 98 | # Prepare targets for installation. 99 | preinstall: all 100 | $(MAKE) -f CMakeFiles/Makefile2 preinstall 101 | .PHONY : preinstall 102 | 103 | # Prepare targets for installation. 104 | preinstall/fast: 105 | $(MAKE) -f CMakeFiles/Makefile2 preinstall 106 | .PHONY : preinstall/fast 107 | 108 | # clear depends 109 | depend: 110 | $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 111 | .PHONY : depend 112 | 113 | #============================================================================= 114 | # Target rules for targets named GA 115 | 116 | # Build rule for target. 117 | GA: cmake_check_build_system 118 | $(MAKE) -f CMakeFiles/Makefile2 GA 119 | .PHONY : GA 120 | 121 | # fast build rule for target. 122 | GA/fast: 123 | $(MAKE) -f src/CMakeFiles/GA.dir/build.make src/CMakeFiles/GA.dir/build 124 | .PHONY : GA/fast 125 | 126 | #============================================================================= 127 | # Target rules for targets named cvplotlib 128 | 129 | # Build rule for target. 130 | cvplotlib: cmake_check_build_system 131 | $(MAKE) -f CMakeFiles/Makefile2 cvplotlib 132 | .PHONY : cvplotlib 133 | 134 | # fast build rule for target. 135 | cvplotlib/fast: 136 | $(MAKE) -f src/cvplotlib/CMakeFiles/cvplotlib.dir/build.make src/cvplotlib/CMakeFiles/cvplotlib.dir/build 137 | .PHONY : cvplotlib/fast 138 | 139 | #============================================================================= 140 | # Target rules for targets named GAlib 141 | 142 | # Build rule for target. 143 | GAlib: cmake_check_build_system 144 | $(MAKE) -f CMakeFiles/Makefile2 GAlib 145 | .PHONY : GAlib 146 | 147 | # fast build rule for target. 148 | GAlib/fast: 149 | $(MAKE) -f src/GAlib/CMakeFiles/GAlib.dir/build.make src/GAlib/CMakeFiles/GAlib.dir/build 150 | .PHONY : GAlib/fast 151 | 152 | # Help Target 153 | help: 154 | @echo "The following are some of the valid targets for this Makefile:" 155 | @echo "... all (the default if no target is provided)" 156 | @echo "... clean" 157 | @echo "... depend" 158 | @echo "... rebuild_cache" 159 | @echo "... edit_cache" 160 | @echo "... GA" 161 | @echo "... cvplotlib" 162 | @echo "... GAlib" 163 | .PHONY : help 164 | 165 | 166 | 167 | #============================================================================= 168 | # Special targets to cleanup operation of make. 169 | 170 | # Special rule to run CMake to check the build system integrity. 171 | # No rule that depends on this can have commands that come from listfiles 172 | # because they might be regenerated. 173 | cmake_check_build_system: 174 | $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 175 | .PHONY : cmake_check_build_system 176 | 177 | -------------------------------------------------------------------------------- /build/cmake_install.cmake: -------------------------------------------------------------------------------- 1 | # Install script for directory: /home/shisanchuan/C++work/GeneticAlgorithm 2 | 3 | # Set the install prefix 4 | if(NOT DEFINED CMAKE_INSTALL_PREFIX) 5 | set(CMAKE_INSTALL_PREFIX "/usr/local") 6 | endif() 7 | string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") 8 | 9 | # Set the install configuration name. 10 | if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) 11 | if(BUILD_TYPE) 12 | string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" 13 | CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") 14 | else() 15 | set(CMAKE_INSTALL_CONFIG_NAME "Debug") 16 | endif() 17 | message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") 18 | endif() 19 | 20 | # Set the component getting installed. 21 | if(NOT CMAKE_INSTALL_COMPONENT) 22 | if(COMPONENT) 23 | message(STATUS "Install component: \"${COMPONENT}\"") 24 | set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") 25 | else() 26 | set(CMAKE_INSTALL_COMPONENT) 27 | endif() 28 | endif() 29 | 30 | # Install shared libraries without execute permission? 31 | if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE) 32 | set(CMAKE_INSTALL_SO_NO_EXE "1") 33 | endif() 34 | 35 | # Is this installation the result of a crosscompile? 36 | if(NOT DEFINED CMAKE_CROSSCOMPILING) 37 | set(CMAKE_CROSSCOMPILING "FALSE") 38 | endif() 39 | 40 | if(NOT CMAKE_INSTALL_LOCAL_ONLY) 41 | # Include the install script for each subdirectory. 42 | include("/home/shisanchuan/C++work/GeneticAlgorithm/build/src/cmake_install.cmake") 43 | 44 | endif() 45 | 46 | if(CMAKE_INSTALL_COMPONENT) 47 | set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt") 48 | else() 49 | set(CMAKE_INSTALL_MANIFEST "install_manifest.txt") 50 | endif() 51 | 52 | string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT 53 | "${CMAKE_INSTALL_MANIFEST_FILES}") 54 | file(WRITE "/home/shisanchuan/C++work/GeneticAlgorithm/build/${CMAKE_INSTALL_MANIFEST}" 55 | "${CMAKE_INSTALL_MANIFEST_CONTENT}") 56 | -------------------------------------------------------------------------------- /build/src/CMakeFiles/CMakeDirectoryInformation.cmake: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.12 3 | 4 | # Relative path conversion top directories. 5 | set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/home/shisanchuan/C++work/GeneticAlgorithm") 6 | set(CMAKE_RELATIVE_PATH_TOP_BINARY "/home/shisanchuan/C++work/GeneticAlgorithm/build") 7 | 8 | # Force unix paths in dependencies. 9 | set(CMAKE_FORCE_UNIX_PATHS 1) 10 | 11 | 12 | # The C and CXX include file regular expressions for this directory. 13 | set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") 14 | set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") 15 | set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) 16 | set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) 17 | -------------------------------------------------------------------------------- /build/src/CMakeFiles/GA.dir/CXX.includecache: -------------------------------------------------------------------------------- 1 | #IncludeRegexLine: ^[ ]*[#%][ ]*(include|import)[ ]*[<"]([^">]+)([">]) 2 | 3 | #IncludeRegexScan: ^.*$ 4 | 5 | #IncludeRegexComplain: ^$ 6 | 7 | #IncludeRegexTransform: 8 | 9 | ../includes/GA.h 10 | iostream 11 | - 12 | algorithm 13 | - 14 | vector 15 | - 16 | functional 17 | - 18 | opencv2/opencv.hpp 19 | ../includes/opencv2/opencv.hpp 20 | 21 | ../includes/color.h 22 | string 23 | - 24 | 25 | ../includes/cvplot.h 26 | color.h 27 | ../includes/color.h 28 | figure.h 29 | ../includes/figure.h 30 | highgui.h 31 | ../includes/highgui.h 32 | window.h 33 | ../includes/window.h 34 | 35 | ../includes/demo.h 36 | 37 | ../includes/figure.h 38 | color.h 39 | ../includes/color.h 40 | window.h 41 | ../includes/window.h 42 | map 43 | - 44 | string 45 | - 46 | vector 47 | - 48 | 49 | ../includes/highgui.h 50 | string 51 | - 52 | vector 53 | - 54 | window.h 55 | ../includes/window.h 56 | 57 | ../includes/window.h 58 | color.h 59 | ../includes/color.h 60 | map 61 | - 62 | string 63 | - 64 | 65 | /home/shisanchuan/C++work/GeneticAlgorithm/src/demo.cpp 66 | iostream 67 | - 68 | algorithm 69 | - 70 | vector 71 | - 72 | cstdarg 73 | - 74 | cvplot.h 75 | /home/shisanchuan/C++work/GeneticAlgorithm/src/cvplot.h 76 | opencv2/opencv.hpp 77 | /home/shisanchuan/C++work/GeneticAlgorithm/src/opencv2/opencv.hpp 78 | GA.h 79 | /home/shisanchuan/C++work/GeneticAlgorithm/src/GA.h 80 | demo.h 81 | /home/shisanchuan/C++work/GeneticAlgorithm/src/demo.h 82 | 83 | -------------------------------------------------------------------------------- /build/src/CMakeFiles/GA.dir/DependInfo.cmake: -------------------------------------------------------------------------------- 1 | # The set of languages for which implicit dependencies are needed: 2 | set(CMAKE_DEPENDS_LANGUAGES 3 | "CXX" 4 | ) 5 | # The set of files for implicit dependencies of each language: 6 | set(CMAKE_DEPENDS_CHECK_CXX 7 | "/home/shisanchuan/C++work/GeneticAlgorithm/src/demo.cpp" "/home/shisanchuan/C++work/GeneticAlgorithm/build/src/CMakeFiles/GA.dir/demo.cpp.o" 8 | "/home/shisanchuan/C++work/GeneticAlgorithm/src/main.cpp" "/home/shisanchuan/C++work/GeneticAlgorithm/build/src/CMakeFiles/GA.dir/main.cpp.o" 9 | ) 10 | set(CMAKE_CXX_COMPILER_ID "GNU") 11 | 12 | # The include file search paths: 13 | set(CMAKE_CXX_TARGET_INCLUDE_PATH 14 | "../includes" 15 | "/usr/include/opencv" 16 | ) 17 | 18 | # Targets to which this target links. 19 | set(CMAKE_TARGET_LINKED_INFO_FILES 20 | "/home/shisanchuan/C++work/GeneticAlgorithm/build/src/cvplotlib/CMakeFiles/cvplotlib.dir/DependInfo.cmake" 21 | "/home/shisanchuan/C++work/GeneticAlgorithm/build/src/GAlib/CMakeFiles/GAlib.dir/DependInfo.cmake" 22 | ) 23 | 24 | # Fortran module output directory. 25 | set(CMAKE_Fortran_TARGET_MODULE_DIR "") 26 | -------------------------------------------------------------------------------- /build/src/CMakeFiles/GA.dir/build.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.12 3 | 4 | # Delete rule output on recipe failure. 5 | .DELETE_ON_ERROR: 6 | 7 | 8 | #============================================================================= 9 | # Special targets provided by cmake. 10 | 11 | # Disable implicit rules so canonical targets will work. 12 | .SUFFIXES: 13 | 14 | 15 | # Remove some rules from gmake that .SUFFIXES does not remove. 16 | SUFFIXES = 17 | 18 | .SUFFIXES: .hpux_make_needs_suffix_list 19 | 20 | 21 | # Suppress display of executed commands. 22 | $(VERBOSE).SILENT: 23 | 24 | 25 | # A target that is always out of date. 26 | cmake_force: 27 | 28 | .PHONY : cmake_force 29 | 30 | #============================================================================= 31 | # Set environment variables for the build. 32 | 33 | # The shell in which to execute make rules. 34 | SHELL = /bin/sh 35 | 36 | # The CMake executable. 37 | CMAKE_COMMAND = /usr/local/bin/cmake 38 | 39 | # The command to remove a file. 40 | RM = /usr/local/bin/cmake -E remove -f 41 | 42 | # Escaping for special characters. 43 | EQUALS = = 44 | 45 | # The top-level source directory on which CMake was run. 46 | CMAKE_SOURCE_DIR = /home/shisanchuan/C++work/GeneticAlgorithm 47 | 48 | # The top-level build directory on which CMake was run. 49 | CMAKE_BINARY_DIR = /home/shisanchuan/C++work/GeneticAlgorithm/build 50 | 51 | # Include any dependencies generated for this target. 52 | include src/CMakeFiles/GA.dir/depend.make 53 | 54 | # Include the progress variables for this target. 55 | include src/CMakeFiles/GA.dir/progress.make 56 | 57 | # Include the compile flags for this target's objects. 58 | include src/CMakeFiles/GA.dir/flags.make 59 | 60 | src/CMakeFiles/GA.dir/demo.cpp.o: src/CMakeFiles/GA.dir/flags.make 61 | src/CMakeFiles/GA.dir/demo.cpp.o: ../src/demo.cpp 62 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/shisanchuan/C++work/GeneticAlgorithm/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building CXX object src/CMakeFiles/GA.dir/demo.cpp.o" 63 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build/src && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/GA.dir/demo.cpp.o -c /home/shisanchuan/C++work/GeneticAlgorithm/src/demo.cpp 64 | 65 | src/CMakeFiles/GA.dir/demo.cpp.i: cmake_force 66 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/GA.dir/demo.cpp.i" 67 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build/src && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/shisanchuan/C++work/GeneticAlgorithm/src/demo.cpp > CMakeFiles/GA.dir/demo.cpp.i 68 | 69 | src/CMakeFiles/GA.dir/demo.cpp.s: cmake_force 70 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/GA.dir/demo.cpp.s" 71 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build/src && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/shisanchuan/C++work/GeneticAlgorithm/src/demo.cpp -o CMakeFiles/GA.dir/demo.cpp.s 72 | 73 | src/CMakeFiles/GA.dir/main.cpp.o: src/CMakeFiles/GA.dir/flags.make 74 | src/CMakeFiles/GA.dir/main.cpp.o: ../src/main.cpp 75 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/shisanchuan/C++work/GeneticAlgorithm/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Building CXX object src/CMakeFiles/GA.dir/main.cpp.o" 76 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build/src && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/GA.dir/main.cpp.o -c /home/shisanchuan/C++work/GeneticAlgorithm/src/main.cpp 77 | 78 | src/CMakeFiles/GA.dir/main.cpp.i: cmake_force 79 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/GA.dir/main.cpp.i" 80 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build/src && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/shisanchuan/C++work/GeneticAlgorithm/src/main.cpp > CMakeFiles/GA.dir/main.cpp.i 81 | 82 | src/CMakeFiles/GA.dir/main.cpp.s: cmake_force 83 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/GA.dir/main.cpp.s" 84 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build/src && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/shisanchuan/C++work/GeneticAlgorithm/src/main.cpp -o CMakeFiles/GA.dir/main.cpp.s 85 | 86 | # Object files for target GA 87 | GA_OBJECTS = \ 88 | "CMakeFiles/GA.dir/demo.cpp.o" \ 89 | "CMakeFiles/GA.dir/main.cpp.o" 90 | 91 | # External object files for target GA 92 | GA_EXTERNAL_OBJECTS = 93 | 94 | src/GA: src/CMakeFiles/GA.dir/demo.cpp.o 95 | src/GA: src/CMakeFiles/GA.dir/main.cpp.o 96 | src/GA: src/CMakeFiles/GA.dir/build.make 97 | src/GA: /usr/lib/libopencv_dnn.so.3.3.1 98 | src/GA: /usr/lib/libopencv_ml.so.3.3.1 99 | src/GA: /usr/lib/libopencv_objdetect.so.3.3.1 100 | src/GA: /usr/lib/libopencv_shape.so.3.3.1 101 | src/GA: /usr/lib/libopencv_stitching.so.3.3.1 102 | src/GA: /usr/lib/libopencv_superres.so.3.3.1 103 | src/GA: /usr/lib/libopencv_videostab.so.3.3.1 104 | src/GA: src/cvplotlib/libcvplotlib.a 105 | src/GA: src/GAlib/libGAlib.a 106 | src/GA: /usr/lib/libopencv_calib3d.so.3.3.1 107 | src/GA: /usr/lib/libopencv_features2d.so.3.3.1 108 | src/GA: /usr/lib/libopencv_flann.so.3.3.1 109 | src/GA: /usr/lib/libopencv_highgui.so.3.3.1 110 | src/GA: /usr/lib/libopencv_photo.so.3.3.1 111 | src/GA: /usr/lib/libopencv_video.so.3.3.1 112 | src/GA: /usr/lib/libopencv_videoio.so.3.3.1 113 | src/GA: /usr/lib/libopencv_imgcodecs.so.3.3.1 114 | src/GA: /usr/lib/libopencv_imgproc.so.3.3.1 115 | src/GA: /usr/lib/libopencv_core.so.3.3.1 116 | src/GA: src/CMakeFiles/GA.dir/link.txt 117 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/home/shisanchuan/C++work/GeneticAlgorithm/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_3) "Linking CXX executable GA" 118 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build/src && $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/GA.dir/link.txt --verbose=$(VERBOSE) 119 | 120 | # Rule to build all files generated by this target. 121 | src/CMakeFiles/GA.dir/build: src/GA 122 | 123 | .PHONY : src/CMakeFiles/GA.dir/build 124 | 125 | src/CMakeFiles/GA.dir/clean: 126 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build/src && $(CMAKE_COMMAND) -P CMakeFiles/GA.dir/cmake_clean.cmake 127 | .PHONY : src/CMakeFiles/GA.dir/clean 128 | 129 | src/CMakeFiles/GA.dir/depend: 130 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /home/shisanchuan/C++work/GeneticAlgorithm /home/shisanchuan/C++work/GeneticAlgorithm/src /home/shisanchuan/C++work/GeneticAlgorithm/build /home/shisanchuan/C++work/GeneticAlgorithm/build/src /home/shisanchuan/C++work/GeneticAlgorithm/build/src/CMakeFiles/GA.dir/DependInfo.cmake --color=$(COLOR) 131 | .PHONY : src/CMakeFiles/GA.dir/depend 132 | 133 | -------------------------------------------------------------------------------- /build/src/CMakeFiles/GA.dir/cmake_clean.cmake: -------------------------------------------------------------------------------- 1 | file(REMOVE_RECURSE 2 | "CMakeFiles/GA.dir/demo.cpp.o" 3 | "CMakeFiles/GA.dir/main.cpp.o" 4 | "GA.pdb" 5 | "GA" 6 | ) 7 | 8 | # Per-language clean rules from dependency scanning. 9 | foreach(lang CXX) 10 | include(CMakeFiles/GA.dir/cmake_clean_${lang}.cmake OPTIONAL) 11 | endforeach() 12 | -------------------------------------------------------------------------------- /build/src/CMakeFiles/GA.dir/depend.internal: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.12 3 | 4 | src/CMakeFiles/GA.dir/demo.cpp.o 5 | ../includes/GA.h 6 | ../includes/color.h 7 | ../includes/cvplot.h 8 | ../includes/demo.h 9 | ../includes/figure.h 10 | ../includes/highgui.h 11 | ../includes/window.h 12 | /home/shisanchuan/C++work/GeneticAlgorithm/src/demo.cpp 13 | src/CMakeFiles/GA.dir/main.cpp.o 14 | ../includes/GA.h 15 | ../includes/color.h 16 | ../includes/cvplot.h 17 | ../includes/demo.h 18 | ../includes/figure.h 19 | ../includes/highgui.h 20 | ../includes/window.h 21 | /home/shisanchuan/C++work/GeneticAlgorithm/src/main.cpp 22 | -------------------------------------------------------------------------------- /build/src/CMakeFiles/GA.dir/depend.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.12 3 | 4 | src/CMakeFiles/GA.dir/demo.cpp.o: ../includes/GA.h 5 | src/CMakeFiles/GA.dir/demo.cpp.o: ../includes/color.h 6 | src/CMakeFiles/GA.dir/demo.cpp.o: ../includes/cvplot.h 7 | src/CMakeFiles/GA.dir/demo.cpp.o: ../includes/demo.h 8 | src/CMakeFiles/GA.dir/demo.cpp.o: ../includes/figure.h 9 | src/CMakeFiles/GA.dir/demo.cpp.o: ../includes/highgui.h 10 | src/CMakeFiles/GA.dir/demo.cpp.o: ../includes/window.h 11 | src/CMakeFiles/GA.dir/demo.cpp.o: ../src/demo.cpp 12 | 13 | src/CMakeFiles/GA.dir/main.cpp.o: ../includes/GA.h 14 | src/CMakeFiles/GA.dir/main.cpp.o: ../includes/color.h 15 | src/CMakeFiles/GA.dir/main.cpp.o: ../includes/cvplot.h 16 | src/CMakeFiles/GA.dir/main.cpp.o: ../includes/demo.h 17 | src/CMakeFiles/GA.dir/main.cpp.o: ../includes/figure.h 18 | src/CMakeFiles/GA.dir/main.cpp.o: ../includes/highgui.h 19 | src/CMakeFiles/GA.dir/main.cpp.o: ../includes/window.h 20 | src/CMakeFiles/GA.dir/main.cpp.o: ../src/main.cpp 21 | 22 | -------------------------------------------------------------------------------- /build/src/CMakeFiles/GA.dir/flags.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.12 3 | 4 | # compile CXX with /usr/bin/c++ 5 | CXX_FLAGS = -std=gnu++11 6 | 7 | CXX_DEFINES = 8 | 9 | CXX_INCLUDES = -I/home/shisanchuan/C++work/GeneticAlgorithm/includes -isystem /usr/include/opencv 10 | 11 | -------------------------------------------------------------------------------- /build/src/CMakeFiles/GA.dir/link.txt: -------------------------------------------------------------------------------- 1 | /usr/bin/c++ -rdynamic CMakeFiles/GA.dir/demo.cpp.o CMakeFiles/GA.dir/main.cpp.o -o GA /usr/lib/libopencv_dnn.so.3.3.1 /usr/lib/libopencv_ml.so.3.3.1 /usr/lib/libopencv_objdetect.so.3.3.1 /usr/lib/libopencv_shape.so.3.3.1 /usr/lib/libopencv_stitching.so.3.3.1 /usr/lib/libopencv_superres.so.3.3.1 /usr/lib/libopencv_videostab.so.3.3.1 -lpthread cvplotlib/libcvplotlib.a GAlib/libGAlib.a /usr/lib/libopencv_calib3d.so.3.3.1 /usr/lib/libopencv_features2d.so.3.3.1 /usr/lib/libopencv_flann.so.3.3.1 /usr/lib/libopencv_highgui.so.3.3.1 /usr/lib/libopencv_photo.so.3.3.1 /usr/lib/libopencv_video.so.3.3.1 /usr/lib/libopencv_videoio.so.3.3.1 /usr/lib/libopencv_imgcodecs.so.3.3.1 /usr/lib/libopencv_imgproc.so.3.3.1 /usr/lib/libopencv_core.so.3.3.1 2 | -------------------------------------------------------------------------------- /build/src/CMakeFiles/GA.dir/progress.make: -------------------------------------------------------------------------------- 1 | CMAKE_PROGRESS_1 = 1 2 | CMAKE_PROGRESS_2 = 2 3 | CMAKE_PROGRESS_3 = 3 4 | 5 | -------------------------------------------------------------------------------- /build/src/CMakeFiles/progress.marks: -------------------------------------------------------------------------------- 1 | 14 2 | -------------------------------------------------------------------------------- /build/src/GA: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShiSanChuan/GeneticAlgorithm/b8216952ded468170f533ff364a25b93a30d0859/build/src/GA -------------------------------------------------------------------------------- /build/src/GAlib/CMakeFiles/CMakeDirectoryInformation.cmake: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.12 3 | 4 | # Relative path conversion top directories. 5 | set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/home/shisanchuan/C++work/GeneticAlgorithm") 6 | set(CMAKE_RELATIVE_PATH_TOP_BINARY "/home/shisanchuan/C++work/GeneticAlgorithm/build") 7 | 8 | # Force unix paths in dependencies. 9 | set(CMAKE_FORCE_UNIX_PATHS 1) 10 | 11 | 12 | # The C and CXX include file regular expressions for this directory. 13 | set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") 14 | set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") 15 | set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) 16 | set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) 17 | -------------------------------------------------------------------------------- /build/src/GAlib/CMakeFiles/GAlib.dir/CXX.includecache: -------------------------------------------------------------------------------- 1 | #IncludeRegexLine: ^[ ]*[#%][ ]*(include|import)[ ]*[<"]([^">]+)([">]) 2 | 3 | #IncludeRegexScan: ^.*$ 4 | 5 | #IncludeRegexComplain: ^$ 6 | 7 | #IncludeRegexTransform: 8 | 9 | ../includes/GA.h 10 | iostream 11 | - 12 | algorithm 13 | - 14 | vector 15 | - 16 | functional 17 | - 18 | opencv2/opencv.hpp 19 | ../includes/opencv2/opencv.hpp 20 | 21 | /home/shisanchuan/C++work/GeneticAlgorithm/src/GAlib/PSO.cpp 22 | GA.h 23 | /home/shisanchuan/C++work/GeneticAlgorithm/src/GAlib/GA.h 24 | 25 | -------------------------------------------------------------------------------- /build/src/GAlib/CMakeFiles/GAlib.dir/DependInfo.cmake: -------------------------------------------------------------------------------- 1 | # The set of languages for which implicit dependencies are needed: 2 | set(CMAKE_DEPENDS_LANGUAGES 3 | "CXX" 4 | ) 5 | # The set of files for implicit dependencies of each language: 6 | set(CMAKE_DEPENDS_CHECK_CXX 7 | "/home/shisanchuan/C++work/GeneticAlgorithm/src/GAlib/GA.cpp" "/home/shisanchuan/C++work/GeneticAlgorithm/build/src/GAlib/CMakeFiles/GAlib.dir/GA.cpp.o" 8 | "/home/shisanchuan/C++work/GeneticAlgorithm/src/GAlib/GA_BP.cpp" "/home/shisanchuan/C++work/GeneticAlgorithm/build/src/GAlib/CMakeFiles/GAlib.dir/GA_BP.cpp.o" 9 | "/home/shisanchuan/C++work/GeneticAlgorithm/src/GAlib/GA_TSP.cpp" "/home/shisanchuan/C++work/GeneticAlgorithm/build/src/GAlib/CMakeFiles/GAlib.dir/GA_TSP.cpp.o" 10 | "/home/shisanchuan/C++work/GeneticAlgorithm/src/GAlib/PSO.cpp" "/home/shisanchuan/C++work/GeneticAlgorithm/build/src/GAlib/CMakeFiles/GAlib.dir/PSO.cpp.o" 11 | "/home/shisanchuan/C++work/GeneticAlgorithm/src/GAlib/QGA.cpp" "/home/shisanchuan/C++work/GeneticAlgorithm/build/src/GAlib/CMakeFiles/GAlib.dir/QGA.cpp.o" 12 | ) 13 | set(CMAKE_CXX_COMPILER_ID "GNU") 14 | 15 | # The include file search paths: 16 | set(CMAKE_CXX_TARGET_INCLUDE_PATH 17 | "../includes" 18 | ) 19 | 20 | # Targets to which this target links. 21 | set(CMAKE_TARGET_LINKED_INFO_FILES 22 | ) 23 | 24 | # Fortran module output directory. 25 | set(CMAKE_Fortran_TARGET_MODULE_DIR "") 26 | -------------------------------------------------------------------------------- /build/src/GAlib/CMakeFiles/GAlib.dir/build.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.12 3 | 4 | # Delete rule output on recipe failure. 5 | .DELETE_ON_ERROR: 6 | 7 | 8 | #============================================================================= 9 | # Special targets provided by cmake. 10 | 11 | # Disable implicit rules so canonical targets will work. 12 | .SUFFIXES: 13 | 14 | 15 | # Remove some rules from gmake that .SUFFIXES does not remove. 16 | SUFFIXES = 17 | 18 | .SUFFIXES: .hpux_make_needs_suffix_list 19 | 20 | 21 | # Suppress display of executed commands. 22 | $(VERBOSE).SILENT: 23 | 24 | 25 | # A target that is always out of date. 26 | cmake_force: 27 | 28 | .PHONY : cmake_force 29 | 30 | #============================================================================= 31 | # Set environment variables for the build. 32 | 33 | # The shell in which to execute make rules. 34 | SHELL = /bin/sh 35 | 36 | # The CMake executable. 37 | CMAKE_COMMAND = /usr/local/bin/cmake 38 | 39 | # The command to remove a file. 40 | RM = /usr/local/bin/cmake -E remove -f 41 | 42 | # Escaping for special characters. 43 | EQUALS = = 44 | 45 | # The top-level source directory on which CMake was run. 46 | CMAKE_SOURCE_DIR = /home/shisanchuan/C++work/GeneticAlgorithm 47 | 48 | # The top-level build directory on which CMake was run. 49 | CMAKE_BINARY_DIR = /home/shisanchuan/C++work/GeneticAlgorithm/build 50 | 51 | # Include any dependencies generated for this target. 52 | include src/GAlib/CMakeFiles/GAlib.dir/depend.make 53 | 54 | # Include the progress variables for this target. 55 | include src/GAlib/CMakeFiles/GAlib.dir/progress.make 56 | 57 | # Include the compile flags for this target's objects. 58 | include src/GAlib/CMakeFiles/GAlib.dir/flags.make 59 | 60 | src/GAlib/CMakeFiles/GAlib.dir/GA.cpp.o: src/GAlib/CMakeFiles/GAlib.dir/flags.make 61 | src/GAlib/CMakeFiles/GAlib.dir/GA.cpp.o: ../src/GAlib/GA.cpp 62 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/shisanchuan/C++work/GeneticAlgorithm/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building CXX object src/GAlib/CMakeFiles/GAlib.dir/GA.cpp.o" 63 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build/src/GAlib && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/GAlib.dir/GA.cpp.o -c /home/shisanchuan/C++work/GeneticAlgorithm/src/GAlib/GA.cpp 64 | 65 | src/GAlib/CMakeFiles/GAlib.dir/GA.cpp.i: cmake_force 66 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/GAlib.dir/GA.cpp.i" 67 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build/src/GAlib && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/shisanchuan/C++work/GeneticAlgorithm/src/GAlib/GA.cpp > CMakeFiles/GAlib.dir/GA.cpp.i 68 | 69 | src/GAlib/CMakeFiles/GAlib.dir/GA.cpp.s: cmake_force 70 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/GAlib.dir/GA.cpp.s" 71 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build/src/GAlib && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/shisanchuan/C++work/GeneticAlgorithm/src/GAlib/GA.cpp -o CMakeFiles/GAlib.dir/GA.cpp.s 72 | 73 | src/GAlib/CMakeFiles/GAlib.dir/GA_BP.cpp.o: src/GAlib/CMakeFiles/GAlib.dir/flags.make 74 | src/GAlib/CMakeFiles/GAlib.dir/GA_BP.cpp.o: ../src/GAlib/GA_BP.cpp 75 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/shisanchuan/C++work/GeneticAlgorithm/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Building CXX object src/GAlib/CMakeFiles/GAlib.dir/GA_BP.cpp.o" 76 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build/src/GAlib && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/GAlib.dir/GA_BP.cpp.o -c /home/shisanchuan/C++work/GeneticAlgorithm/src/GAlib/GA_BP.cpp 77 | 78 | src/GAlib/CMakeFiles/GAlib.dir/GA_BP.cpp.i: cmake_force 79 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/GAlib.dir/GA_BP.cpp.i" 80 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build/src/GAlib && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/shisanchuan/C++work/GeneticAlgorithm/src/GAlib/GA_BP.cpp > CMakeFiles/GAlib.dir/GA_BP.cpp.i 81 | 82 | src/GAlib/CMakeFiles/GAlib.dir/GA_BP.cpp.s: cmake_force 83 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/GAlib.dir/GA_BP.cpp.s" 84 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build/src/GAlib && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/shisanchuan/C++work/GeneticAlgorithm/src/GAlib/GA_BP.cpp -o CMakeFiles/GAlib.dir/GA_BP.cpp.s 85 | 86 | src/GAlib/CMakeFiles/GAlib.dir/GA_TSP.cpp.o: src/GAlib/CMakeFiles/GAlib.dir/flags.make 87 | src/GAlib/CMakeFiles/GAlib.dir/GA_TSP.cpp.o: ../src/GAlib/GA_TSP.cpp 88 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/shisanchuan/C++work/GeneticAlgorithm/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_3) "Building CXX object src/GAlib/CMakeFiles/GAlib.dir/GA_TSP.cpp.o" 89 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build/src/GAlib && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/GAlib.dir/GA_TSP.cpp.o -c /home/shisanchuan/C++work/GeneticAlgorithm/src/GAlib/GA_TSP.cpp 90 | 91 | src/GAlib/CMakeFiles/GAlib.dir/GA_TSP.cpp.i: cmake_force 92 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/GAlib.dir/GA_TSP.cpp.i" 93 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build/src/GAlib && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/shisanchuan/C++work/GeneticAlgorithm/src/GAlib/GA_TSP.cpp > CMakeFiles/GAlib.dir/GA_TSP.cpp.i 94 | 95 | src/GAlib/CMakeFiles/GAlib.dir/GA_TSP.cpp.s: cmake_force 96 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/GAlib.dir/GA_TSP.cpp.s" 97 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build/src/GAlib && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/shisanchuan/C++work/GeneticAlgorithm/src/GAlib/GA_TSP.cpp -o CMakeFiles/GAlib.dir/GA_TSP.cpp.s 98 | 99 | src/GAlib/CMakeFiles/GAlib.dir/PSO.cpp.o: src/GAlib/CMakeFiles/GAlib.dir/flags.make 100 | src/GAlib/CMakeFiles/GAlib.dir/PSO.cpp.o: ../src/GAlib/PSO.cpp 101 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/shisanchuan/C++work/GeneticAlgorithm/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_4) "Building CXX object src/GAlib/CMakeFiles/GAlib.dir/PSO.cpp.o" 102 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build/src/GAlib && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/GAlib.dir/PSO.cpp.o -c /home/shisanchuan/C++work/GeneticAlgorithm/src/GAlib/PSO.cpp 103 | 104 | src/GAlib/CMakeFiles/GAlib.dir/PSO.cpp.i: cmake_force 105 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/GAlib.dir/PSO.cpp.i" 106 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build/src/GAlib && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/shisanchuan/C++work/GeneticAlgorithm/src/GAlib/PSO.cpp > CMakeFiles/GAlib.dir/PSO.cpp.i 107 | 108 | src/GAlib/CMakeFiles/GAlib.dir/PSO.cpp.s: cmake_force 109 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/GAlib.dir/PSO.cpp.s" 110 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build/src/GAlib && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/shisanchuan/C++work/GeneticAlgorithm/src/GAlib/PSO.cpp -o CMakeFiles/GAlib.dir/PSO.cpp.s 111 | 112 | src/GAlib/CMakeFiles/GAlib.dir/QGA.cpp.o: src/GAlib/CMakeFiles/GAlib.dir/flags.make 113 | src/GAlib/CMakeFiles/GAlib.dir/QGA.cpp.o: ../src/GAlib/QGA.cpp 114 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/shisanchuan/C++work/GeneticAlgorithm/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_5) "Building CXX object src/GAlib/CMakeFiles/GAlib.dir/QGA.cpp.o" 115 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build/src/GAlib && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/GAlib.dir/QGA.cpp.o -c /home/shisanchuan/C++work/GeneticAlgorithm/src/GAlib/QGA.cpp 116 | 117 | src/GAlib/CMakeFiles/GAlib.dir/QGA.cpp.i: cmake_force 118 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/GAlib.dir/QGA.cpp.i" 119 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build/src/GAlib && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/shisanchuan/C++work/GeneticAlgorithm/src/GAlib/QGA.cpp > CMakeFiles/GAlib.dir/QGA.cpp.i 120 | 121 | src/GAlib/CMakeFiles/GAlib.dir/QGA.cpp.s: cmake_force 122 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/GAlib.dir/QGA.cpp.s" 123 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build/src/GAlib && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/shisanchuan/C++work/GeneticAlgorithm/src/GAlib/QGA.cpp -o CMakeFiles/GAlib.dir/QGA.cpp.s 124 | 125 | # Object files for target GAlib 126 | GAlib_OBJECTS = \ 127 | "CMakeFiles/GAlib.dir/GA.cpp.o" \ 128 | "CMakeFiles/GAlib.dir/GA_BP.cpp.o" \ 129 | "CMakeFiles/GAlib.dir/GA_TSP.cpp.o" \ 130 | "CMakeFiles/GAlib.dir/PSO.cpp.o" \ 131 | "CMakeFiles/GAlib.dir/QGA.cpp.o" 132 | 133 | # External object files for target GAlib 134 | GAlib_EXTERNAL_OBJECTS = 135 | 136 | src/GAlib/libGAlib.a: src/GAlib/CMakeFiles/GAlib.dir/GA.cpp.o 137 | src/GAlib/libGAlib.a: src/GAlib/CMakeFiles/GAlib.dir/GA_BP.cpp.o 138 | src/GAlib/libGAlib.a: src/GAlib/CMakeFiles/GAlib.dir/GA_TSP.cpp.o 139 | src/GAlib/libGAlib.a: src/GAlib/CMakeFiles/GAlib.dir/PSO.cpp.o 140 | src/GAlib/libGAlib.a: src/GAlib/CMakeFiles/GAlib.dir/QGA.cpp.o 141 | src/GAlib/libGAlib.a: src/GAlib/CMakeFiles/GAlib.dir/build.make 142 | src/GAlib/libGAlib.a: src/GAlib/CMakeFiles/GAlib.dir/link.txt 143 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/home/shisanchuan/C++work/GeneticAlgorithm/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_6) "Linking CXX static library libGAlib.a" 144 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build/src/GAlib && $(CMAKE_COMMAND) -P CMakeFiles/GAlib.dir/cmake_clean_target.cmake 145 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build/src/GAlib && $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/GAlib.dir/link.txt --verbose=$(VERBOSE) 146 | 147 | # Rule to build all files generated by this target. 148 | src/GAlib/CMakeFiles/GAlib.dir/build: src/GAlib/libGAlib.a 149 | 150 | .PHONY : src/GAlib/CMakeFiles/GAlib.dir/build 151 | 152 | src/GAlib/CMakeFiles/GAlib.dir/clean: 153 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build/src/GAlib && $(CMAKE_COMMAND) -P CMakeFiles/GAlib.dir/cmake_clean.cmake 154 | .PHONY : src/GAlib/CMakeFiles/GAlib.dir/clean 155 | 156 | src/GAlib/CMakeFiles/GAlib.dir/depend: 157 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /home/shisanchuan/C++work/GeneticAlgorithm /home/shisanchuan/C++work/GeneticAlgorithm/src/GAlib /home/shisanchuan/C++work/GeneticAlgorithm/build /home/shisanchuan/C++work/GeneticAlgorithm/build/src/GAlib /home/shisanchuan/C++work/GeneticAlgorithm/build/src/GAlib/CMakeFiles/GAlib.dir/DependInfo.cmake --color=$(COLOR) 158 | .PHONY : src/GAlib/CMakeFiles/GAlib.dir/depend 159 | 160 | -------------------------------------------------------------------------------- /build/src/GAlib/CMakeFiles/GAlib.dir/cmake_clean.cmake: -------------------------------------------------------------------------------- 1 | file(REMOVE_RECURSE 2 | "CMakeFiles/GAlib.dir/GA.cpp.o" 3 | "CMakeFiles/GAlib.dir/GA_BP.cpp.o" 4 | "CMakeFiles/GAlib.dir/GA_TSP.cpp.o" 5 | "CMakeFiles/GAlib.dir/PSO.cpp.o" 6 | "CMakeFiles/GAlib.dir/QGA.cpp.o" 7 | "libGAlib.pdb" 8 | "libGAlib.a" 9 | ) 10 | 11 | # Per-language clean rules from dependency scanning. 12 | foreach(lang CXX) 13 | include(CMakeFiles/GAlib.dir/cmake_clean_${lang}.cmake OPTIONAL) 14 | endforeach() 15 | -------------------------------------------------------------------------------- /build/src/GAlib/CMakeFiles/GAlib.dir/cmake_clean_target.cmake: -------------------------------------------------------------------------------- 1 | file(REMOVE_RECURSE 2 | "libGAlib.a" 3 | ) 4 | -------------------------------------------------------------------------------- /build/src/GAlib/CMakeFiles/GAlib.dir/depend.internal: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.12 3 | 4 | src/GAlib/CMakeFiles/GAlib.dir/GA.cpp.o 5 | ../includes/GA.h 6 | /home/shisanchuan/C++work/GeneticAlgorithm/src/GAlib/GA.cpp 7 | src/GAlib/CMakeFiles/GAlib.dir/GA_BP.cpp.o 8 | ../includes/GA.h 9 | /home/shisanchuan/C++work/GeneticAlgorithm/src/GAlib/GA_BP.cpp 10 | src/GAlib/CMakeFiles/GAlib.dir/GA_TSP.cpp.o 11 | ../includes/GA.h 12 | /home/shisanchuan/C++work/GeneticAlgorithm/src/GAlib/GA_TSP.cpp 13 | src/GAlib/CMakeFiles/GAlib.dir/PSO.cpp.o 14 | ../includes/GA.h 15 | /home/shisanchuan/C++work/GeneticAlgorithm/src/GAlib/PSO.cpp 16 | src/GAlib/CMakeFiles/GAlib.dir/QGA.cpp.o 17 | ../includes/GA.h 18 | /home/shisanchuan/C++work/GeneticAlgorithm/src/GAlib/QGA.cpp 19 | -------------------------------------------------------------------------------- /build/src/GAlib/CMakeFiles/GAlib.dir/depend.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.12 3 | 4 | src/GAlib/CMakeFiles/GAlib.dir/GA.cpp.o: ../includes/GA.h 5 | src/GAlib/CMakeFiles/GAlib.dir/GA.cpp.o: ../src/GAlib/GA.cpp 6 | 7 | src/GAlib/CMakeFiles/GAlib.dir/GA_BP.cpp.o: ../includes/GA.h 8 | src/GAlib/CMakeFiles/GAlib.dir/GA_BP.cpp.o: ../src/GAlib/GA_BP.cpp 9 | 10 | src/GAlib/CMakeFiles/GAlib.dir/GA_TSP.cpp.o: ../includes/GA.h 11 | src/GAlib/CMakeFiles/GAlib.dir/GA_TSP.cpp.o: ../src/GAlib/GA_TSP.cpp 12 | 13 | src/GAlib/CMakeFiles/GAlib.dir/PSO.cpp.o: ../includes/GA.h 14 | src/GAlib/CMakeFiles/GAlib.dir/PSO.cpp.o: ../src/GAlib/PSO.cpp 15 | 16 | src/GAlib/CMakeFiles/GAlib.dir/QGA.cpp.o: ../includes/GA.h 17 | src/GAlib/CMakeFiles/GAlib.dir/QGA.cpp.o: ../src/GAlib/QGA.cpp 18 | 19 | -------------------------------------------------------------------------------- /build/src/GAlib/CMakeFiles/GAlib.dir/flags.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.12 3 | 4 | # compile CXX with /usr/bin/c++ 5 | CXX_FLAGS = -std=gnu++11 6 | 7 | CXX_DEFINES = 8 | 9 | CXX_INCLUDES = -I/home/shisanchuan/C++work/GeneticAlgorithm/includes 10 | 11 | -------------------------------------------------------------------------------- /build/src/GAlib/CMakeFiles/GAlib.dir/link.txt: -------------------------------------------------------------------------------- 1 | /usr/bin/ar qc libGAlib.a CMakeFiles/GAlib.dir/GA.cpp.o CMakeFiles/GAlib.dir/GA_BP.cpp.o CMakeFiles/GAlib.dir/GA_TSP.cpp.o CMakeFiles/GAlib.dir/PSO.cpp.o CMakeFiles/GAlib.dir/QGA.cpp.o 2 | /usr/bin/ranlib libGAlib.a 3 | -------------------------------------------------------------------------------- /build/src/GAlib/CMakeFiles/GAlib.dir/progress.make: -------------------------------------------------------------------------------- 1 | CMAKE_PROGRESS_1 = 4 2 | CMAKE_PROGRESS_2 = 5 3 | CMAKE_PROGRESS_3 = 6 4 | CMAKE_PROGRESS_4 = 7 5 | CMAKE_PROGRESS_5 = 8 6 | CMAKE_PROGRESS_6 = 9 7 | 8 | -------------------------------------------------------------------------------- /build/src/GAlib/CMakeFiles/progress.marks: -------------------------------------------------------------------------------- 1 | 6 2 | -------------------------------------------------------------------------------- /build/src/GAlib/Makefile: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.12 3 | 4 | # Default target executed when no arguments are given to make. 5 | default_target: all 6 | 7 | .PHONY : default_target 8 | 9 | # Allow only one "make -f Makefile2" at a time, but pass parallelism. 10 | .NOTPARALLEL: 11 | 12 | 13 | #============================================================================= 14 | # Special targets provided by cmake. 15 | 16 | # Disable implicit rules so canonical targets will work. 17 | .SUFFIXES: 18 | 19 | 20 | # Remove some rules from gmake that .SUFFIXES does not remove. 21 | SUFFIXES = 22 | 23 | .SUFFIXES: .hpux_make_needs_suffix_list 24 | 25 | 26 | # Suppress display of executed commands. 27 | $(VERBOSE).SILENT: 28 | 29 | 30 | # A target that is always out of date. 31 | cmake_force: 32 | 33 | .PHONY : cmake_force 34 | 35 | #============================================================================= 36 | # Set environment variables for the build. 37 | 38 | # The shell in which to execute make rules. 39 | SHELL = /bin/sh 40 | 41 | # The CMake executable. 42 | CMAKE_COMMAND = /usr/local/bin/cmake 43 | 44 | # The command to remove a file. 45 | RM = /usr/local/bin/cmake -E remove -f 46 | 47 | # Escaping for special characters. 48 | EQUALS = = 49 | 50 | # The top-level source directory on which CMake was run. 51 | CMAKE_SOURCE_DIR = /home/shisanchuan/C++work/GeneticAlgorithm 52 | 53 | # The top-level build directory on which CMake was run. 54 | CMAKE_BINARY_DIR = /home/shisanchuan/C++work/GeneticAlgorithm/build 55 | 56 | #============================================================================= 57 | # Targets provided globally by CMake. 58 | 59 | # Special rule for the target rebuild_cache 60 | rebuild_cache: 61 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." 62 | /usr/local/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) 63 | .PHONY : rebuild_cache 64 | 65 | # Special rule for the target rebuild_cache 66 | rebuild_cache/fast: rebuild_cache 67 | 68 | .PHONY : rebuild_cache/fast 69 | 70 | # Special rule for the target edit_cache 71 | edit_cache: 72 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "No interactive CMake dialog available..." 73 | /usr/local/bin/cmake -E echo No\ interactive\ CMake\ dialog\ available. 74 | .PHONY : edit_cache 75 | 76 | # Special rule for the target edit_cache 77 | edit_cache/fast: edit_cache 78 | 79 | .PHONY : edit_cache/fast 80 | 81 | # The main all target 82 | all: cmake_check_build_system 83 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(CMAKE_COMMAND) -E cmake_progress_start /home/shisanchuan/C++work/GeneticAlgorithm/build/CMakeFiles /home/shisanchuan/C++work/GeneticAlgorithm/build/src/GAlib/CMakeFiles/progress.marks 84 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f CMakeFiles/Makefile2 src/GAlib/all 85 | $(CMAKE_COMMAND) -E cmake_progress_start /home/shisanchuan/C++work/GeneticAlgorithm/build/CMakeFiles 0 86 | .PHONY : all 87 | 88 | # The main clean target 89 | clean: 90 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f CMakeFiles/Makefile2 src/GAlib/clean 91 | .PHONY : clean 92 | 93 | # The main clean target 94 | clean/fast: clean 95 | 96 | .PHONY : clean/fast 97 | 98 | # Prepare targets for installation. 99 | preinstall: all 100 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f CMakeFiles/Makefile2 src/GAlib/preinstall 101 | .PHONY : preinstall 102 | 103 | # Prepare targets for installation. 104 | preinstall/fast: 105 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f CMakeFiles/Makefile2 src/GAlib/preinstall 106 | .PHONY : preinstall/fast 107 | 108 | # clear depends 109 | depend: 110 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 111 | .PHONY : depend 112 | 113 | # Convenience name for target. 114 | src/GAlib/CMakeFiles/GAlib.dir/rule: 115 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f CMakeFiles/Makefile2 src/GAlib/CMakeFiles/GAlib.dir/rule 116 | .PHONY : src/GAlib/CMakeFiles/GAlib.dir/rule 117 | 118 | # Convenience name for target. 119 | GAlib: src/GAlib/CMakeFiles/GAlib.dir/rule 120 | 121 | .PHONY : GAlib 122 | 123 | # fast build rule for target. 124 | GAlib/fast: 125 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f src/GAlib/CMakeFiles/GAlib.dir/build.make src/GAlib/CMakeFiles/GAlib.dir/build 126 | .PHONY : GAlib/fast 127 | 128 | GA.o: GA.cpp.o 129 | 130 | .PHONY : GA.o 131 | 132 | # target to build an object file 133 | GA.cpp.o: 134 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f src/GAlib/CMakeFiles/GAlib.dir/build.make src/GAlib/CMakeFiles/GAlib.dir/GA.cpp.o 135 | .PHONY : GA.cpp.o 136 | 137 | GA.i: GA.cpp.i 138 | 139 | .PHONY : GA.i 140 | 141 | # target to preprocess a source file 142 | GA.cpp.i: 143 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f src/GAlib/CMakeFiles/GAlib.dir/build.make src/GAlib/CMakeFiles/GAlib.dir/GA.cpp.i 144 | .PHONY : GA.cpp.i 145 | 146 | GA.s: GA.cpp.s 147 | 148 | .PHONY : GA.s 149 | 150 | # target to generate assembly for a file 151 | GA.cpp.s: 152 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f src/GAlib/CMakeFiles/GAlib.dir/build.make src/GAlib/CMakeFiles/GAlib.dir/GA.cpp.s 153 | .PHONY : GA.cpp.s 154 | 155 | GA_BP.o: GA_BP.cpp.o 156 | 157 | .PHONY : GA_BP.o 158 | 159 | # target to build an object file 160 | GA_BP.cpp.o: 161 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f src/GAlib/CMakeFiles/GAlib.dir/build.make src/GAlib/CMakeFiles/GAlib.dir/GA_BP.cpp.o 162 | .PHONY : GA_BP.cpp.o 163 | 164 | GA_BP.i: GA_BP.cpp.i 165 | 166 | .PHONY : GA_BP.i 167 | 168 | # target to preprocess a source file 169 | GA_BP.cpp.i: 170 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f src/GAlib/CMakeFiles/GAlib.dir/build.make src/GAlib/CMakeFiles/GAlib.dir/GA_BP.cpp.i 171 | .PHONY : GA_BP.cpp.i 172 | 173 | GA_BP.s: GA_BP.cpp.s 174 | 175 | .PHONY : GA_BP.s 176 | 177 | # target to generate assembly for a file 178 | GA_BP.cpp.s: 179 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f src/GAlib/CMakeFiles/GAlib.dir/build.make src/GAlib/CMakeFiles/GAlib.dir/GA_BP.cpp.s 180 | .PHONY : GA_BP.cpp.s 181 | 182 | GA_TSP.o: GA_TSP.cpp.o 183 | 184 | .PHONY : GA_TSP.o 185 | 186 | # target to build an object file 187 | GA_TSP.cpp.o: 188 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f src/GAlib/CMakeFiles/GAlib.dir/build.make src/GAlib/CMakeFiles/GAlib.dir/GA_TSP.cpp.o 189 | .PHONY : GA_TSP.cpp.o 190 | 191 | GA_TSP.i: GA_TSP.cpp.i 192 | 193 | .PHONY : GA_TSP.i 194 | 195 | # target to preprocess a source file 196 | GA_TSP.cpp.i: 197 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f src/GAlib/CMakeFiles/GAlib.dir/build.make src/GAlib/CMakeFiles/GAlib.dir/GA_TSP.cpp.i 198 | .PHONY : GA_TSP.cpp.i 199 | 200 | GA_TSP.s: GA_TSP.cpp.s 201 | 202 | .PHONY : GA_TSP.s 203 | 204 | # target to generate assembly for a file 205 | GA_TSP.cpp.s: 206 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f src/GAlib/CMakeFiles/GAlib.dir/build.make src/GAlib/CMakeFiles/GAlib.dir/GA_TSP.cpp.s 207 | .PHONY : GA_TSP.cpp.s 208 | 209 | PSO.o: PSO.cpp.o 210 | 211 | .PHONY : PSO.o 212 | 213 | # target to build an object file 214 | PSO.cpp.o: 215 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f src/GAlib/CMakeFiles/GAlib.dir/build.make src/GAlib/CMakeFiles/GAlib.dir/PSO.cpp.o 216 | .PHONY : PSO.cpp.o 217 | 218 | PSO.i: PSO.cpp.i 219 | 220 | .PHONY : PSO.i 221 | 222 | # target to preprocess a source file 223 | PSO.cpp.i: 224 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f src/GAlib/CMakeFiles/GAlib.dir/build.make src/GAlib/CMakeFiles/GAlib.dir/PSO.cpp.i 225 | .PHONY : PSO.cpp.i 226 | 227 | PSO.s: PSO.cpp.s 228 | 229 | .PHONY : PSO.s 230 | 231 | # target to generate assembly for a file 232 | PSO.cpp.s: 233 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f src/GAlib/CMakeFiles/GAlib.dir/build.make src/GAlib/CMakeFiles/GAlib.dir/PSO.cpp.s 234 | .PHONY : PSO.cpp.s 235 | 236 | QGA.o: QGA.cpp.o 237 | 238 | .PHONY : QGA.o 239 | 240 | # target to build an object file 241 | QGA.cpp.o: 242 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f src/GAlib/CMakeFiles/GAlib.dir/build.make src/GAlib/CMakeFiles/GAlib.dir/QGA.cpp.o 243 | .PHONY : QGA.cpp.o 244 | 245 | QGA.i: QGA.cpp.i 246 | 247 | .PHONY : QGA.i 248 | 249 | # target to preprocess a source file 250 | QGA.cpp.i: 251 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f src/GAlib/CMakeFiles/GAlib.dir/build.make src/GAlib/CMakeFiles/GAlib.dir/QGA.cpp.i 252 | .PHONY : QGA.cpp.i 253 | 254 | QGA.s: QGA.cpp.s 255 | 256 | .PHONY : QGA.s 257 | 258 | # target to generate assembly for a file 259 | QGA.cpp.s: 260 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f src/GAlib/CMakeFiles/GAlib.dir/build.make src/GAlib/CMakeFiles/GAlib.dir/QGA.cpp.s 261 | .PHONY : QGA.cpp.s 262 | 263 | # Help Target 264 | help: 265 | @echo "The following are some of the valid targets for this Makefile:" 266 | @echo "... all (the default if no target is provided)" 267 | @echo "... clean" 268 | @echo "... depend" 269 | @echo "... rebuild_cache" 270 | @echo "... edit_cache" 271 | @echo "... GAlib" 272 | @echo "... GA.o" 273 | @echo "... GA.i" 274 | @echo "... GA.s" 275 | @echo "... GA_BP.o" 276 | @echo "... GA_BP.i" 277 | @echo "... GA_BP.s" 278 | @echo "... GA_TSP.o" 279 | @echo "... GA_TSP.i" 280 | @echo "... GA_TSP.s" 281 | @echo "... PSO.o" 282 | @echo "... PSO.i" 283 | @echo "... PSO.s" 284 | @echo "... QGA.o" 285 | @echo "... QGA.i" 286 | @echo "... QGA.s" 287 | .PHONY : help 288 | 289 | 290 | 291 | #============================================================================= 292 | # Special targets to cleanup operation of make. 293 | 294 | # Special rule to run CMake to check the build system integrity. 295 | # No rule that depends on this can have commands that come from listfiles 296 | # because they might be regenerated. 297 | cmake_check_build_system: 298 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 299 | .PHONY : cmake_check_build_system 300 | 301 | -------------------------------------------------------------------------------- /build/src/GAlib/cmake_install.cmake: -------------------------------------------------------------------------------- 1 | # Install script for directory: /home/shisanchuan/C++work/GeneticAlgorithm/src/GAlib 2 | 3 | # Set the install prefix 4 | if(NOT DEFINED CMAKE_INSTALL_PREFIX) 5 | set(CMAKE_INSTALL_PREFIX "/usr/local") 6 | endif() 7 | string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") 8 | 9 | # Set the install configuration name. 10 | if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) 11 | if(BUILD_TYPE) 12 | string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" 13 | CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") 14 | else() 15 | set(CMAKE_INSTALL_CONFIG_NAME "") 16 | endif() 17 | message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") 18 | endif() 19 | 20 | # Set the component getting installed. 21 | if(NOT CMAKE_INSTALL_COMPONENT) 22 | if(COMPONENT) 23 | message(STATUS "Install component: \"${COMPONENT}\"") 24 | set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") 25 | else() 26 | set(CMAKE_INSTALL_COMPONENT) 27 | endif() 28 | endif() 29 | 30 | # Install shared libraries without execute permission? 31 | if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE) 32 | set(CMAKE_INSTALL_SO_NO_EXE "1") 33 | endif() 34 | 35 | # Is this installation the result of a crosscompile? 36 | if(NOT DEFINED CMAKE_CROSSCOMPILING) 37 | set(CMAKE_CROSSCOMPILING "FALSE") 38 | endif() 39 | 40 | -------------------------------------------------------------------------------- /build/src/Makefile: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.12 3 | 4 | # Default target executed when no arguments are given to make. 5 | default_target: all 6 | 7 | .PHONY : default_target 8 | 9 | # Allow only one "make -f Makefile2" at a time, but pass parallelism. 10 | .NOTPARALLEL: 11 | 12 | 13 | #============================================================================= 14 | # Special targets provided by cmake. 15 | 16 | # Disable implicit rules so canonical targets will work. 17 | .SUFFIXES: 18 | 19 | 20 | # Remove some rules from gmake that .SUFFIXES does not remove. 21 | SUFFIXES = 22 | 23 | .SUFFIXES: .hpux_make_needs_suffix_list 24 | 25 | 26 | # Suppress display of executed commands. 27 | $(VERBOSE).SILENT: 28 | 29 | 30 | # A target that is always out of date. 31 | cmake_force: 32 | 33 | .PHONY : cmake_force 34 | 35 | #============================================================================= 36 | # Set environment variables for the build. 37 | 38 | # The shell in which to execute make rules. 39 | SHELL = /bin/sh 40 | 41 | # The CMake executable. 42 | CMAKE_COMMAND = /usr/local/bin/cmake 43 | 44 | # The command to remove a file. 45 | RM = /usr/local/bin/cmake -E remove -f 46 | 47 | # Escaping for special characters. 48 | EQUALS = = 49 | 50 | # The top-level source directory on which CMake was run. 51 | CMAKE_SOURCE_DIR = /home/shisanchuan/C++work/GeneticAlgorithm 52 | 53 | # The top-level build directory on which CMake was run. 54 | CMAKE_BINARY_DIR = /home/shisanchuan/C++work/GeneticAlgorithm/build 55 | 56 | #============================================================================= 57 | # Targets provided globally by CMake. 58 | 59 | # Special rule for the target rebuild_cache 60 | rebuild_cache: 61 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." 62 | /usr/local/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) 63 | .PHONY : rebuild_cache 64 | 65 | # Special rule for the target rebuild_cache 66 | rebuild_cache/fast: rebuild_cache 67 | 68 | .PHONY : rebuild_cache/fast 69 | 70 | # Special rule for the target edit_cache 71 | edit_cache: 72 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "No interactive CMake dialog available..." 73 | /usr/local/bin/cmake -E echo No\ interactive\ CMake\ dialog\ available. 74 | .PHONY : edit_cache 75 | 76 | # Special rule for the target edit_cache 77 | edit_cache/fast: edit_cache 78 | 79 | .PHONY : edit_cache/fast 80 | 81 | # The main all target 82 | all: cmake_check_build_system 83 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(CMAKE_COMMAND) -E cmake_progress_start /home/shisanchuan/C++work/GeneticAlgorithm/build/CMakeFiles /home/shisanchuan/C++work/GeneticAlgorithm/build/src/CMakeFiles/progress.marks 84 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f CMakeFiles/Makefile2 src/all 85 | $(CMAKE_COMMAND) -E cmake_progress_start /home/shisanchuan/C++work/GeneticAlgorithm/build/CMakeFiles 0 86 | .PHONY : all 87 | 88 | # The main clean target 89 | clean: 90 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f CMakeFiles/Makefile2 src/clean 91 | .PHONY : clean 92 | 93 | # The main clean target 94 | clean/fast: clean 95 | 96 | .PHONY : clean/fast 97 | 98 | # Prepare targets for installation. 99 | preinstall: all 100 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f CMakeFiles/Makefile2 src/preinstall 101 | .PHONY : preinstall 102 | 103 | # Prepare targets for installation. 104 | preinstall/fast: 105 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f CMakeFiles/Makefile2 src/preinstall 106 | .PHONY : preinstall/fast 107 | 108 | # clear depends 109 | depend: 110 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 111 | .PHONY : depend 112 | 113 | # Convenience name for target. 114 | src/CMakeFiles/GA.dir/rule: 115 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f CMakeFiles/Makefile2 src/CMakeFiles/GA.dir/rule 116 | .PHONY : src/CMakeFiles/GA.dir/rule 117 | 118 | # Convenience name for target. 119 | GA: src/CMakeFiles/GA.dir/rule 120 | 121 | .PHONY : GA 122 | 123 | # fast build rule for target. 124 | GA/fast: 125 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f src/CMakeFiles/GA.dir/build.make src/CMakeFiles/GA.dir/build 126 | .PHONY : GA/fast 127 | 128 | demo.o: demo.cpp.o 129 | 130 | .PHONY : demo.o 131 | 132 | # target to build an object file 133 | demo.cpp.o: 134 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f src/CMakeFiles/GA.dir/build.make src/CMakeFiles/GA.dir/demo.cpp.o 135 | .PHONY : demo.cpp.o 136 | 137 | demo.i: demo.cpp.i 138 | 139 | .PHONY : demo.i 140 | 141 | # target to preprocess a source file 142 | demo.cpp.i: 143 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f src/CMakeFiles/GA.dir/build.make src/CMakeFiles/GA.dir/demo.cpp.i 144 | .PHONY : demo.cpp.i 145 | 146 | demo.s: demo.cpp.s 147 | 148 | .PHONY : demo.s 149 | 150 | # target to generate assembly for a file 151 | demo.cpp.s: 152 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f src/CMakeFiles/GA.dir/build.make src/CMakeFiles/GA.dir/demo.cpp.s 153 | .PHONY : demo.cpp.s 154 | 155 | main.o: main.cpp.o 156 | 157 | .PHONY : main.o 158 | 159 | # target to build an object file 160 | main.cpp.o: 161 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f src/CMakeFiles/GA.dir/build.make src/CMakeFiles/GA.dir/main.cpp.o 162 | .PHONY : main.cpp.o 163 | 164 | main.i: main.cpp.i 165 | 166 | .PHONY : main.i 167 | 168 | # target to preprocess a source file 169 | main.cpp.i: 170 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f src/CMakeFiles/GA.dir/build.make src/CMakeFiles/GA.dir/main.cpp.i 171 | .PHONY : main.cpp.i 172 | 173 | main.s: main.cpp.s 174 | 175 | .PHONY : main.s 176 | 177 | # target to generate assembly for a file 178 | main.cpp.s: 179 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f src/CMakeFiles/GA.dir/build.make src/CMakeFiles/GA.dir/main.cpp.s 180 | .PHONY : main.cpp.s 181 | 182 | # Help Target 183 | help: 184 | @echo "The following are some of the valid targets for this Makefile:" 185 | @echo "... all (the default if no target is provided)" 186 | @echo "... clean" 187 | @echo "... depend" 188 | @echo "... rebuild_cache" 189 | @echo "... edit_cache" 190 | @echo "... GA" 191 | @echo "... demo.o" 192 | @echo "... demo.i" 193 | @echo "... demo.s" 194 | @echo "... main.o" 195 | @echo "... main.i" 196 | @echo "... main.s" 197 | .PHONY : help 198 | 199 | 200 | 201 | #============================================================================= 202 | # Special targets to cleanup operation of make. 203 | 204 | # Special rule to run CMake to check the build system integrity. 205 | # No rule that depends on this can have commands that come from listfiles 206 | # because they might be regenerated. 207 | cmake_check_build_system: 208 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 209 | .PHONY : cmake_check_build_system 210 | 211 | -------------------------------------------------------------------------------- /build/src/cmake_install.cmake: -------------------------------------------------------------------------------- 1 | # Install script for directory: /home/shisanchuan/C++work/GeneticAlgorithm/src 2 | 3 | # Set the install prefix 4 | if(NOT DEFINED CMAKE_INSTALL_PREFIX) 5 | set(CMAKE_INSTALL_PREFIX "/usr/local") 6 | endif() 7 | string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") 8 | 9 | # Set the install configuration name. 10 | if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) 11 | if(BUILD_TYPE) 12 | string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" 13 | CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") 14 | else() 15 | set(CMAKE_INSTALL_CONFIG_NAME "") 16 | endif() 17 | message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") 18 | endif() 19 | 20 | # Set the component getting installed. 21 | if(NOT CMAKE_INSTALL_COMPONENT) 22 | if(COMPONENT) 23 | message(STATUS "Install component: \"${COMPONENT}\"") 24 | set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") 25 | else() 26 | set(CMAKE_INSTALL_COMPONENT) 27 | endif() 28 | endif() 29 | 30 | # Install shared libraries without execute permission? 31 | if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE) 32 | set(CMAKE_INSTALL_SO_NO_EXE "1") 33 | endif() 34 | 35 | # Is this installation the result of a crosscompile? 36 | if(NOT DEFINED CMAKE_CROSSCOMPILING) 37 | set(CMAKE_CROSSCOMPILING "FALSE") 38 | endif() 39 | 40 | if(NOT CMAKE_INSTALL_LOCAL_ONLY) 41 | # Include the install script for each subdirectory. 42 | include("/home/shisanchuan/C++work/GeneticAlgorithm/build/src/cvplotlib/cmake_install.cmake") 43 | include("/home/shisanchuan/C++work/GeneticAlgorithm/build/src/GAlib/cmake_install.cmake") 44 | 45 | endif() 46 | 47 | -------------------------------------------------------------------------------- /build/src/cvplotlib/CMakeFiles/CMakeDirectoryInformation.cmake: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.12 3 | 4 | # Relative path conversion top directories. 5 | set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/home/shisanchuan/C++work/GeneticAlgorithm") 6 | set(CMAKE_RELATIVE_PATH_TOP_BINARY "/home/shisanchuan/C++work/GeneticAlgorithm/build") 7 | 8 | # Force unix paths in dependencies. 9 | set(CMAKE_FORCE_UNIX_PATHS 1) 10 | 11 | 12 | # The C and CXX include file regular expressions for this directory. 13 | set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") 14 | set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") 15 | set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) 16 | set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) 17 | -------------------------------------------------------------------------------- /build/src/cvplotlib/CMakeFiles/cvplotlib.dir/CXX.includecache: -------------------------------------------------------------------------------- 1 | #IncludeRegexLine: ^[ ]*[#%][ ]*(include|import)[ ]*[<"]([^">]+)([">]) 2 | 3 | #IncludeRegexScan: ^.*$ 4 | 5 | #IncludeRegexComplain: ^$ 6 | 7 | #IncludeRegexTransform: 8 | 9 | ../includes/color.h 10 | string 11 | - 12 | 13 | ../includes/figure.h 14 | color.h 15 | ../includes/color.h 16 | window.h 17 | ../includes/window.h 18 | map 19 | - 20 | string 21 | - 22 | vector 23 | - 24 | 25 | ../includes/highgui.h 26 | string 27 | - 28 | vector 29 | - 30 | window.h 31 | ../includes/window.h 32 | 33 | ../includes/window.h 34 | color.h 35 | ../includes/color.h 36 | map 37 | - 38 | string 39 | - 40 | 41 | /home/shisanchuan/C++work/GeneticAlgorithm/src/cvplotlib/color.cc 42 | color.h 43 | /home/shisanchuan/C++work/GeneticAlgorithm/src/cvplotlib/color.h 44 | cmath 45 | - 46 | map 47 | - 48 | 49 | /home/shisanchuan/C++work/GeneticAlgorithm/src/cvplotlib/figure.cc 50 | figure.h 51 | /home/shisanchuan/C++work/GeneticAlgorithm/src/cvplotlib/figure.h 52 | window.h 53 | /home/shisanchuan/C++work/GeneticAlgorithm/src/cvplotlib/window.h 54 | internal.h 55 | /home/shisanchuan/C++work/GeneticAlgorithm/src/cvplotlib/internal.h 56 | opencv2/imgproc/imgproc.hpp 57 | - 58 | 59 | /home/shisanchuan/C++work/GeneticAlgorithm/src/cvplotlib/highgui.cc 60 | highgui.h 61 | /home/shisanchuan/C++work/GeneticAlgorithm/src/cvplotlib/highgui.h 62 | opencv2/highgui/highgui.hpp 63 | - 64 | 65 | /home/shisanchuan/C++work/GeneticAlgorithm/src/cvplotlib/internal.h 66 | opencv2/core/core.hpp 67 | - 68 | iomanip 69 | - 70 | iostream 71 | - 72 | 73 | /home/shisanchuan/C++work/GeneticAlgorithm/src/cvplotlib/window.cc 74 | window.h 75 | /home/shisanchuan/C++work/GeneticAlgorithm/src/cvplotlib/window.h 76 | internal.h 77 | /home/shisanchuan/C++work/GeneticAlgorithm/src/cvplotlib/internal.h 78 | opencv2/highgui/highgui.hpp 79 | - 80 | opencv2/imgproc/imgproc.hpp 81 | - 82 | ctime 83 | - 84 | 85 | -------------------------------------------------------------------------------- /build/src/cvplotlib/CMakeFiles/cvplotlib.dir/DependInfo.cmake: -------------------------------------------------------------------------------- 1 | # The set of languages for which implicit dependencies are needed: 2 | set(CMAKE_DEPENDS_LANGUAGES 3 | "CXX" 4 | ) 5 | # The set of files for implicit dependencies of each language: 6 | set(CMAKE_DEPENDS_CHECK_CXX 7 | "/home/shisanchuan/C++work/GeneticAlgorithm/src/cvplotlib/color.cc" "/home/shisanchuan/C++work/GeneticAlgorithm/build/src/cvplotlib/CMakeFiles/cvplotlib.dir/color.cc.o" 8 | "/home/shisanchuan/C++work/GeneticAlgorithm/src/cvplotlib/figure.cc" "/home/shisanchuan/C++work/GeneticAlgorithm/build/src/cvplotlib/CMakeFiles/cvplotlib.dir/figure.cc.o" 9 | "/home/shisanchuan/C++work/GeneticAlgorithm/src/cvplotlib/highgui.cc" "/home/shisanchuan/C++work/GeneticAlgorithm/build/src/cvplotlib/CMakeFiles/cvplotlib.dir/highgui.cc.o" 10 | "/home/shisanchuan/C++work/GeneticAlgorithm/src/cvplotlib/window.cc" "/home/shisanchuan/C++work/GeneticAlgorithm/build/src/cvplotlib/CMakeFiles/cvplotlib.dir/window.cc.o" 11 | ) 12 | set(CMAKE_CXX_COMPILER_ID "GNU") 13 | 14 | # The include file search paths: 15 | set(CMAKE_CXX_TARGET_INCLUDE_PATH 16 | "../includes" 17 | ) 18 | 19 | # Targets to which this target links. 20 | set(CMAKE_TARGET_LINKED_INFO_FILES 21 | ) 22 | 23 | # Fortran module output directory. 24 | set(CMAKE_Fortran_TARGET_MODULE_DIR "") 25 | -------------------------------------------------------------------------------- /build/src/cvplotlib/CMakeFiles/cvplotlib.dir/build.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.12 3 | 4 | # Delete rule output on recipe failure. 5 | .DELETE_ON_ERROR: 6 | 7 | 8 | #============================================================================= 9 | # Special targets provided by cmake. 10 | 11 | # Disable implicit rules so canonical targets will work. 12 | .SUFFIXES: 13 | 14 | 15 | # Remove some rules from gmake that .SUFFIXES does not remove. 16 | SUFFIXES = 17 | 18 | .SUFFIXES: .hpux_make_needs_suffix_list 19 | 20 | 21 | # Suppress display of executed commands. 22 | $(VERBOSE).SILENT: 23 | 24 | 25 | # A target that is always out of date. 26 | cmake_force: 27 | 28 | .PHONY : cmake_force 29 | 30 | #============================================================================= 31 | # Set environment variables for the build. 32 | 33 | # The shell in which to execute make rules. 34 | SHELL = /bin/sh 35 | 36 | # The CMake executable. 37 | CMAKE_COMMAND = /usr/local/bin/cmake 38 | 39 | # The command to remove a file. 40 | RM = /usr/local/bin/cmake -E remove -f 41 | 42 | # Escaping for special characters. 43 | EQUALS = = 44 | 45 | # The top-level source directory on which CMake was run. 46 | CMAKE_SOURCE_DIR = /home/shisanchuan/C++work/GeneticAlgorithm 47 | 48 | # The top-level build directory on which CMake was run. 49 | CMAKE_BINARY_DIR = /home/shisanchuan/C++work/GeneticAlgorithm/build 50 | 51 | # Include any dependencies generated for this target. 52 | include src/cvplotlib/CMakeFiles/cvplotlib.dir/depend.make 53 | 54 | # Include the progress variables for this target. 55 | include src/cvplotlib/CMakeFiles/cvplotlib.dir/progress.make 56 | 57 | # Include the compile flags for this target's objects. 58 | include src/cvplotlib/CMakeFiles/cvplotlib.dir/flags.make 59 | 60 | src/cvplotlib/CMakeFiles/cvplotlib.dir/color.cc.o: src/cvplotlib/CMakeFiles/cvplotlib.dir/flags.make 61 | src/cvplotlib/CMakeFiles/cvplotlib.dir/color.cc.o: ../src/cvplotlib/color.cc 62 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/shisanchuan/C++work/GeneticAlgorithm/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building CXX object src/cvplotlib/CMakeFiles/cvplotlib.dir/color.cc.o" 63 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build/src/cvplotlib && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/cvplotlib.dir/color.cc.o -c /home/shisanchuan/C++work/GeneticAlgorithm/src/cvplotlib/color.cc 64 | 65 | src/cvplotlib/CMakeFiles/cvplotlib.dir/color.cc.i: cmake_force 66 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/cvplotlib.dir/color.cc.i" 67 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build/src/cvplotlib && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/shisanchuan/C++work/GeneticAlgorithm/src/cvplotlib/color.cc > CMakeFiles/cvplotlib.dir/color.cc.i 68 | 69 | src/cvplotlib/CMakeFiles/cvplotlib.dir/color.cc.s: cmake_force 70 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/cvplotlib.dir/color.cc.s" 71 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build/src/cvplotlib && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/shisanchuan/C++work/GeneticAlgorithm/src/cvplotlib/color.cc -o CMakeFiles/cvplotlib.dir/color.cc.s 72 | 73 | src/cvplotlib/CMakeFiles/cvplotlib.dir/figure.cc.o: src/cvplotlib/CMakeFiles/cvplotlib.dir/flags.make 74 | src/cvplotlib/CMakeFiles/cvplotlib.dir/figure.cc.o: ../src/cvplotlib/figure.cc 75 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/shisanchuan/C++work/GeneticAlgorithm/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Building CXX object src/cvplotlib/CMakeFiles/cvplotlib.dir/figure.cc.o" 76 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build/src/cvplotlib && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/cvplotlib.dir/figure.cc.o -c /home/shisanchuan/C++work/GeneticAlgorithm/src/cvplotlib/figure.cc 77 | 78 | src/cvplotlib/CMakeFiles/cvplotlib.dir/figure.cc.i: cmake_force 79 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/cvplotlib.dir/figure.cc.i" 80 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build/src/cvplotlib && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/shisanchuan/C++work/GeneticAlgorithm/src/cvplotlib/figure.cc > CMakeFiles/cvplotlib.dir/figure.cc.i 81 | 82 | src/cvplotlib/CMakeFiles/cvplotlib.dir/figure.cc.s: cmake_force 83 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/cvplotlib.dir/figure.cc.s" 84 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build/src/cvplotlib && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/shisanchuan/C++work/GeneticAlgorithm/src/cvplotlib/figure.cc -o CMakeFiles/cvplotlib.dir/figure.cc.s 85 | 86 | src/cvplotlib/CMakeFiles/cvplotlib.dir/highgui.cc.o: src/cvplotlib/CMakeFiles/cvplotlib.dir/flags.make 87 | src/cvplotlib/CMakeFiles/cvplotlib.dir/highgui.cc.o: ../src/cvplotlib/highgui.cc 88 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/shisanchuan/C++work/GeneticAlgorithm/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_3) "Building CXX object src/cvplotlib/CMakeFiles/cvplotlib.dir/highgui.cc.o" 89 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build/src/cvplotlib && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/cvplotlib.dir/highgui.cc.o -c /home/shisanchuan/C++work/GeneticAlgorithm/src/cvplotlib/highgui.cc 90 | 91 | src/cvplotlib/CMakeFiles/cvplotlib.dir/highgui.cc.i: cmake_force 92 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/cvplotlib.dir/highgui.cc.i" 93 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build/src/cvplotlib && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/shisanchuan/C++work/GeneticAlgorithm/src/cvplotlib/highgui.cc > CMakeFiles/cvplotlib.dir/highgui.cc.i 94 | 95 | src/cvplotlib/CMakeFiles/cvplotlib.dir/highgui.cc.s: cmake_force 96 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/cvplotlib.dir/highgui.cc.s" 97 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build/src/cvplotlib && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/shisanchuan/C++work/GeneticAlgorithm/src/cvplotlib/highgui.cc -o CMakeFiles/cvplotlib.dir/highgui.cc.s 98 | 99 | src/cvplotlib/CMakeFiles/cvplotlib.dir/window.cc.o: src/cvplotlib/CMakeFiles/cvplotlib.dir/flags.make 100 | src/cvplotlib/CMakeFiles/cvplotlib.dir/window.cc.o: ../src/cvplotlib/window.cc 101 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/shisanchuan/C++work/GeneticAlgorithm/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_4) "Building CXX object src/cvplotlib/CMakeFiles/cvplotlib.dir/window.cc.o" 102 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build/src/cvplotlib && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/cvplotlib.dir/window.cc.o -c /home/shisanchuan/C++work/GeneticAlgorithm/src/cvplotlib/window.cc 103 | 104 | src/cvplotlib/CMakeFiles/cvplotlib.dir/window.cc.i: cmake_force 105 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/cvplotlib.dir/window.cc.i" 106 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build/src/cvplotlib && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/shisanchuan/C++work/GeneticAlgorithm/src/cvplotlib/window.cc > CMakeFiles/cvplotlib.dir/window.cc.i 107 | 108 | src/cvplotlib/CMakeFiles/cvplotlib.dir/window.cc.s: cmake_force 109 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/cvplotlib.dir/window.cc.s" 110 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build/src/cvplotlib && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/shisanchuan/C++work/GeneticAlgorithm/src/cvplotlib/window.cc -o CMakeFiles/cvplotlib.dir/window.cc.s 111 | 112 | # Object files for target cvplotlib 113 | cvplotlib_OBJECTS = \ 114 | "CMakeFiles/cvplotlib.dir/color.cc.o" \ 115 | "CMakeFiles/cvplotlib.dir/figure.cc.o" \ 116 | "CMakeFiles/cvplotlib.dir/highgui.cc.o" \ 117 | "CMakeFiles/cvplotlib.dir/window.cc.o" 118 | 119 | # External object files for target cvplotlib 120 | cvplotlib_EXTERNAL_OBJECTS = 121 | 122 | src/cvplotlib/libcvplotlib.a: src/cvplotlib/CMakeFiles/cvplotlib.dir/color.cc.o 123 | src/cvplotlib/libcvplotlib.a: src/cvplotlib/CMakeFiles/cvplotlib.dir/figure.cc.o 124 | src/cvplotlib/libcvplotlib.a: src/cvplotlib/CMakeFiles/cvplotlib.dir/highgui.cc.o 125 | src/cvplotlib/libcvplotlib.a: src/cvplotlib/CMakeFiles/cvplotlib.dir/window.cc.o 126 | src/cvplotlib/libcvplotlib.a: src/cvplotlib/CMakeFiles/cvplotlib.dir/build.make 127 | src/cvplotlib/libcvplotlib.a: src/cvplotlib/CMakeFiles/cvplotlib.dir/link.txt 128 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/home/shisanchuan/C++work/GeneticAlgorithm/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_5) "Linking CXX static library libcvplotlib.a" 129 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build/src/cvplotlib && $(CMAKE_COMMAND) -P CMakeFiles/cvplotlib.dir/cmake_clean_target.cmake 130 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build/src/cvplotlib && $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/cvplotlib.dir/link.txt --verbose=$(VERBOSE) 131 | 132 | # Rule to build all files generated by this target. 133 | src/cvplotlib/CMakeFiles/cvplotlib.dir/build: src/cvplotlib/libcvplotlib.a 134 | 135 | .PHONY : src/cvplotlib/CMakeFiles/cvplotlib.dir/build 136 | 137 | src/cvplotlib/CMakeFiles/cvplotlib.dir/clean: 138 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build/src/cvplotlib && $(CMAKE_COMMAND) -P CMakeFiles/cvplotlib.dir/cmake_clean.cmake 139 | .PHONY : src/cvplotlib/CMakeFiles/cvplotlib.dir/clean 140 | 141 | src/cvplotlib/CMakeFiles/cvplotlib.dir/depend: 142 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /home/shisanchuan/C++work/GeneticAlgorithm /home/shisanchuan/C++work/GeneticAlgorithm/src/cvplotlib /home/shisanchuan/C++work/GeneticAlgorithm/build /home/shisanchuan/C++work/GeneticAlgorithm/build/src/cvplotlib /home/shisanchuan/C++work/GeneticAlgorithm/build/src/cvplotlib/CMakeFiles/cvplotlib.dir/DependInfo.cmake --color=$(COLOR) 143 | .PHONY : src/cvplotlib/CMakeFiles/cvplotlib.dir/depend 144 | 145 | -------------------------------------------------------------------------------- /build/src/cvplotlib/CMakeFiles/cvplotlib.dir/cmake_clean.cmake: -------------------------------------------------------------------------------- 1 | file(REMOVE_RECURSE 2 | "CMakeFiles/cvplotlib.dir/color.cc.o" 3 | "CMakeFiles/cvplotlib.dir/figure.cc.o" 4 | "CMakeFiles/cvplotlib.dir/highgui.cc.o" 5 | "CMakeFiles/cvplotlib.dir/window.cc.o" 6 | "libcvplotlib.pdb" 7 | "libcvplotlib.a" 8 | ) 9 | 10 | # Per-language clean rules from dependency scanning. 11 | foreach(lang CXX) 12 | include(CMakeFiles/cvplotlib.dir/cmake_clean_${lang}.cmake OPTIONAL) 13 | endforeach() 14 | -------------------------------------------------------------------------------- /build/src/cvplotlib/CMakeFiles/cvplotlib.dir/cmake_clean_target.cmake: -------------------------------------------------------------------------------- 1 | file(REMOVE_RECURSE 2 | "libcvplotlib.a" 3 | ) 4 | -------------------------------------------------------------------------------- /build/src/cvplotlib/CMakeFiles/cvplotlib.dir/depend.internal: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.12 3 | 4 | src/cvplotlib/CMakeFiles/cvplotlib.dir/color.cc.o 5 | ../includes/color.h 6 | /home/shisanchuan/C++work/GeneticAlgorithm/src/cvplotlib/color.cc 7 | src/cvplotlib/CMakeFiles/cvplotlib.dir/figure.cc.o 8 | ../includes/color.h 9 | ../includes/figure.h 10 | ../includes/window.h 11 | /home/shisanchuan/C++work/GeneticAlgorithm/src/cvplotlib/figure.cc 12 | /home/shisanchuan/C++work/GeneticAlgorithm/src/cvplotlib/internal.h 13 | src/cvplotlib/CMakeFiles/cvplotlib.dir/highgui.cc.o 14 | ../includes/color.h 15 | ../includes/highgui.h 16 | ../includes/window.h 17 | /home/shisanchuan/C++work/GeneticAlgorithm/src/cvplotlib/highgui.cc 18 | src/cvplotlib/CMakeFiles/cvplotlib.dir/window.cc.o 19 | ../includes/color.h 20 | ../includes/window.h 21 | /home/shisanchuan/C++work/GeneticAlgorithm/src/cvplotlib/internal.h 22 | /home/shisanchuan/C++work/GeneticAlgorithm/src/cvplotlib/window.cc 23 | -------------------------------------------------------------------------------- /build/src/cvplotlib/CMakeFiles/cvplotlib.dir/depend.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.12 3 | 4 | src/cvplotlib/CMakeFiles/cvplotlib.dir/color.cc.o: ../includes/color.h 5 | src/cvplotlib/CMakeFiles/cvplotlib.dir/color.cc.o: ../src/cvplotlib/color.cc 6 | 7 | src/cvplotlib/CMakeFiles/cvplotlib.dir/figure.cc.o: ../includes/color.h 8 | src/cvplotlib/CMakeFiles/cvplotlib.dir/figure.cc.o: ../includes/figure.h 9 | src/cvplotlib/CMakeFiles/cvplotlib.dir/figure.cc.o: ../includes/window.h 10 | src/cvplotlib/CMakeFiles/cvplotlib.dir/figure.cc.o: ../src/cvplotlib/figure.cc 11 | src/cvplotlib/CMakeFiles/cvplotlib.dir/figure.cc.o: ../src/cvplotlib/internal.h 12 | 13 | src/cvplotlib/CMakeFiles/cvplotlib.dir/highgui.cc.o: ../includes/color.h 14 | src/cvplotlib/CMakeFiles/cvplotlib.dir/highgui.cc.o: ../includes/highgui.h 15 | src/cvplotlib/CMakeFiles/cvplotlib.dir/highgui.cc.o: ../includes/window.h 16 | src/cvplotlib/CMakeFiles/cvplotlib.dir/highgui.cc.o: ../src/cvplotlib/highgui.cc 17 | 18 | src/cvplotlib/CMakeFiles/cvplotlib.dir/window.cc.o: ../includes/color.h 19 | src/cvplotlib/CMakeFiles/cvplotlib.dir/window.cc.o: ../includes/window.h 20 | src/cvplotlib/CMakeFiles/cvplotlib.dir/window.cc.o: ../src/cvplotlib/internal.h 21 | src/cvplotlib/CMakeFiles/cvplotlib.dir/window.cc.o: ../src/cvplotlib/window.cc 22 | 23 | -------------------------------------------------------------------------------- /build/src/cvplotlib/CMakeFiles/cvplotlib.dir/flags.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.12 3 | 4 | # compile CXX with /usr/bin/c++ 5 | CXX_FLAGS = -std=gnu++11 6 | 7 | CXX_DEFINES = 8 | 9 | CXX_INCLUDES = -I/home/shisanchuan/C++work/GeneticAlgorithm/includes 10 | 11 | -------------------------------------------------------------------------------- /build/src/cvplotlib/CMakeFiles/cvplotlib.dir/link.txt: -------------------------------------------------------------------------------- 1 | /usr/bin/ar qc libcvplotlib.a CMakeFiles/cvplotlib.dir/color.cc.o CMakeFiles/cvplotlib.dir/figure.cc.o CMakeFiles/cvplotlib.dir/highgui.cc.o CMakeFiles/cvplotlib.dir/window.cc.o 2 | /usr/bin/ranlib libcvplotlib.a 3 | -------------------------------------------------------------------------------- /build/src/cvplotlib/CMakeFiles/cvplotlib.dir/progress.make: -------------------------------------------------------------------------------- 1 | CMAKE_PROGRESS_1 = 10 2 | CMAKE_PROGRESS_2 = 11 3 | CMAKE_PROGRESS_3 = 12 4 | CMAKE_PROGRESS_4 = 13 5 | CMAKE_PROGRESS_5 = 14 6 | 7 | -------------------------------------------------------------------------------- /build/src/cvplotlib/CMakeFiles/progress.marks: -------------------------------------------------------------------------------- 1 | 5 2 | -------------------------------------------------------------------------------- /build/src/cvplotlib/Makefile: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.12 3 | 4 | # Default target executed when no arguments are given to make. 5 | default_target: all 6 | 7 | .PHONY : default_target 8 | 9 | # Allow only one "make -f Makefile2" at a time, but pass parallelism. 10 | .NOTPARALLEL: 11 | 12 | 13 | #============================================================================= 14 | # Special targets provided by cmake. 15 | 16 | # Disable implicit rules so canonical targets will work. 17 | .SUFFIXES: 18 | 19 | 20 | # Remove some rules from gmake that .SUFFIXES does not remove. 21 | SUFFIXES = 22 | 23 | .SUFFIXES: .hpux_make_needs_suffix_list 24 | 25 | 26 | # Suppress display of executed commands. 27 | $(VERBOSE).SILENT: 28 | 29 | 30 | # A target that is always out of date. 31 | cmake_force: 32 | 33 | .PHONY : cmake_force 34 | 35 | #============================================================================= 36 | # Set environment variables for the build. 37 | 38 | # The shell in which to execute make rules. 39 | SHELL = /bin/sh 40 | 41 | # The CMake executable. 42 | CMAKE_COMMAND = /usr/local/bin/cmake 43 | 44 | # The command to remove a file. 45 | RM = /usr/local/bin/cmake -E remove -f 46 | 47 | # Escaping for special characters. 48 | EQUALS = = 49 | 50 | # The top-level source directory on which CMake was run. 51 | CMAKE_SOURCE_DIR = /home/shisanchuan/C++work/GeneticAlgorithm 52 | 53 | # The top-level build directory on which CMake was run. 54 | CMAKE_BINARY_DIR = /home/shisanchuan/C++work/GeneticAlgorithm/build 55 | 56 | #============================================================================= 57 | # Targets provided globally by CMake. 58 | 59 | # Special rule for the target rebuild_cache 60 | rebuild_cache: 61 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." 62 | /usr/local/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) 63 | .PHONY : rebuild_cache 64 | 65 | # Special rule for the target rebuild_cache 66 | rebuild_cache/fast: rebuild_cache 67 | 68 | .PHONY : rebuild_cache/fast 69 | 70 | # Special rule for the target edit_cache 71 | edit_cache: 72 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "No interactive CMake dialog available..." 73 | /usr/local/bin/cmake -E echo No\ interactive\ CMake\ dialog\ available. 74 | .PHONY : edit_cache 75 | 76 | # Special rule for the target edit_cache 77 | edit_cache/fast: edit_cache 78 | 79 | .PHONY : edit_cache/fast 80 | 81 | # The main all target 82 | all: cmake_check_build_system 83 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(CMAKE_COMMAND) -E cmake_progress_start /home/shisanchuan/C++work/GeneticAlgorithm/build/CMakeFiles /home/shisanchuan/C++work/GeneticAlgorithm/build/src/cvplotlib/CMakeFiles/progress.marks 84 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f CMakeFiles/Makefile2 src/cvplotlib/all 85 | $(CMAKE_COMMAND) -E cmake_progress_start /home/shisanchuan/C++work/GeneticAlgorithm/build/CMakeFiles 0 86 | .PHONY : all 87 | 88 | # The main clean target 89 | clean: 90 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f CMakeFiles/Makefile2 src/cvplotlib/clean 91 | .PHONY : clean 92 | 93 | # The main clean target 94 | clean/fast: clean 95 | 96 | .PHONY : clean/fast 97 | 98 | # Prepare targets for installation. 99 | preinstall: all 100 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f CMakeFiles/Makefile2 src/cvplotlib/preinstall 101 | .PHONY : preinstall 102 | 103 | # Prepare targets for installation. 104 | preinstall/fast: 105 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f CMakeFiles/Makefile2 src/cvplotlib/preinstall 106 | .PHONY : preinstall/fast 107 | 108 | # clear depends 109 | depend: 110 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 111 | .PHONY : depend 112 | 113 | # Convenience name for target. 114 | src/cvplotlib/CMakeFiles/cvplotlib.dir/rule: 115 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f CMakeFiles/Makefile2 src/cvplotlib/CMakeFiles/cvplotlib.dir/rule 116 | .PHONY : src/cvplotlib/CMakeFiles/cvplotlib.dir/rule 117 | 118 | # Convenience name for target. 119 | cvplotlib: src/cvplotlib/CMakeFiles/cvplotlib.dir/rule 120 | 121 | .PHONY : cvplotlib 122 | 123 | # fast build rule for target. 124 | cvplotlib/fast: 125 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f src/cvplotlib/CMakeFiles/cvplotlib.dir/build.make src/cvplotlib/CMakeFiles/cvplotlib.dir/build 126 | .PHONY : cvplotlib/fast 127 | 128 | color.o: color.cc.o 129 | 130 | .PHONY : color.o 131 | 132 | # target to build an object file 133 | color.cc.o: 134 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f src/cvplotlib/CMakeFiles/cvplotlib.dir/build.make src/cvplotlib/CMakeFiles/cvplotlib.dir/color.cc.o 135 | .PHONY : color.cc.o 136 | 137 | color.i: color.cc.i 138 | 139 | .PHONY : color.i 140 | 141 | # target to preprocess a source file 142 | color.cc.i: 143 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f src/cvplotlib/CMakeFiles/cvplotlib.dir/build.make src/cvplotlib/CMakeFiles/cvplotlib.dir/color.cc.i 144 | .PHONY : color.cc.i 145 | 146 | color.s: color.cc.s 147 | 148 | .PHONY : color.s 149 | 150 | # target to generate assembly for a file 151 | color.cc.s: 152 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f src/cvplotlib/CMakeFiles/cvplotlib.dir/build.make src/cvplotlib/CMakeFiles/cvplotlib.dir/color.cc.s 153 | .PHONY : color.cc.s 154 | 155 | figure.o: figure.cc.o 156 | 157 | .PHONY : figure.o 158 | 159 | # target to build an object file 160 | figure.cc.o: 161 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f src/cvplotlib/CMakeFiles/cvplotlib.dir/build.make src/cvplotlib/CMakeFiles/cvplotlib.dir/figure.cc.o 162 | .PHONY : figure.cc.o 163 | 164 | figure.i: figure.cc.i 165 | 166 | .PHONY : figure.i 167 | 168 | # target to preprocess a source file 169 | figure.cc.i: 170 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f src/cvplotlib/CMakeFiles/cvplotlib.dir/build.make src/cvplotlib/CMakeFiles/cvplotlib.dir/figure.cc.i 171 | .PHONY : figure.cc.i 172 | 173 | figure.s: figure.cc.s 174 | 175 | .PHONY : figure.s 176 | 177 | # target to generate assembly for a file 178 | figure.cc.s: 179 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f src/cvplotlib/CMakeFiles/cvplotlib.dir/build.make src/cvplotlib/CMakeFiles/cvplotlib.dir/figure.cc.s 180 | .PHONY : figure.cc.s 181 | 182 | highgui.o: highgui.cc.o 183 | 184 | .PHONY : highgui.o 185 | 186 | # target to build an object file 187 | highgui.cc.o: 188 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f src/cvplotlib/CMakeFiles/cvplotlib.dir/build.make src/cvplotlib/CMakeFiles/cvplotlib.dir/highgui.cc.o 189 | .PHONY : highgui.cc.o 190 | 191 | highgui.i: highgui.cc.i 192 | 193 | .PHONY : highgui.i 194 | 195 | # target to preprocess a source file 196 | highgui.cc.i: 197 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f src/cvplotlib/CMakeFiles/cvplotlib.dir/build.make src/cvplotlib/CMakeFiles/cvplotlib.dir/highgui.cc.i 198 | .PHONY : highgui.cc.i 199 | 200 | highgui.s: highgui.cc.s 201 | 202 | .PHONY : highgui.s 203 | 204 | # target to generate assembly for a file 205 | highgui.cc.s: 206 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f src/cvplotlib/CMakeFiles/cvplotlib.dir/build.make src/cvplotlib/CMakeFiles/cvplotlib.dir/highgui.cc.s 207 | .PHONY : highgui.cc.s 208 | 209 | window.o: window.cc.o 210 | 211 | .PHONY : window.o 212 | 213 | # target to build an object file 214 | window.cc.o: 215 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f src/cvplotlib/CMakeFiles/cvplotlib.dir/build.make src/cvplotlib/CMakeFiles/cvplotlib.dir/window.cc.o 216 | .PHONY : window.cc.o 217 | 218 | window.i: window.cc.i 219 | 220 | .PHONY : window.i 221 | 222 | # target to preprocess a source file 223 | window.cc.i: 224 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f src/cvplotlib/CMakeFiles/cvplotlib.dir/build.make src/cvplotlib/CMakeFiles/cvplotlib.dir/window.cc.i 225 | .PHONY : window.cc.i 226 | 227 | window.s: window.cc.s 228 | 229 | .PHONY : window.s 230 | 231 | # target to generate assembly for a file 232 | window.cc.s: 233 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(MAKE) -f src/cvplotlib/CMakeFiles/cvplotlib.dir/build.make src/cvplotlib/CMakeFiles/cvplotlib.dir/window.cc.s 234 | .PHONY : window.cc.s 235 | 236 | # Help Target 237 | help: 238 | @echo "The following are some of the valid targets for this Makefile:" 239 | @echo "... all (the default if no target is provided)" 240 | @echo "... clean" 241 | @echo "... depend" 242 | @echo "... rebuild_cache" 243 | @echo "... edit_cache" 244 | @echo "... cvplotlib" 245 | @echo "... color.o" 246 | @echo "... color.i" 247 | @echo "... color.s" 248 | @echo "... figure.o" 249 | @echo "... figure.i" 250 | @echo "... figure.s" 251 | @echo "... highgui.o" 252 | @echo "... highgui.i" 253 | @echo "... highgui.s" 254 | @echo "... window.o" 255 | @echo "... window.i" 256 | @echo "... window.s" 257 | .PHONY : help 258 | 259 | 260 | 261 | #============================================================================= 262 | # Special targets to cleanup operation of make. 263 | 264 | # Special rule to run CMake to check the build system integrity. 265 | # No rule that depends on this can have commands that come from listfiles 266 | # because they might be regenerated. 267 | cmake_check_build_system: 268 | cd /home/shisanchuan/C++work/GeneticAlgorithm/build && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 269 | .PHONY : cmake_check_build_system 270 | 271 | -------------------------------------------------------------------------------- /build/src/cvplotlib/cmake_install.cmake: -------------------------------------------------------------------------------- 1 | # Install script for directory: /home/shisanchuan/C++work/GeneticAlgorithm/src/cvplotlib 2 | 3 | # Set the install prefix 4 | if(NOT DEFINED CMAKE_INSTALL_PREFIX) 5 | set(CMAKE_INSTALL_PREFIX "/usr/local") 6 | endif() 7 | string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") 8 | 9 | # Set the install configuration name. 10 | if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) 11 | if(BUILD_TYPE) 12 | string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" 13 | CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") 14 | else() 15 | set(CMAKE_INSTALL_CONFIG_NAME "") 16 | endif() 17 | message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") 18 | endif() 19 | 20 | # Set the component getting installed. 21 | if(NOT CMAKE_INSTALL_COMPONENT) 22 | if(COMPONENT) 23 | message(STATUS "Install component: \"${COMPONENT}\"") 24 | set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") 25 | else() 26 | set(CMAKE_INSTALL_COMPONENT) 27 | endif() 28 | endif() 29 | 30 | # Install shared libraries without execute permission? 31 | if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE) 32 | set(CMAKE_INSTALL_SO_NO_EXE "1") 33 | endif() 34 | 35 | # Is this installation the result of a crosscompile? 36 | if(NOT DEFINED CMAKE_CROSSCOMPILING) 37 | set(CMAKE_CROSSCOMPILING "FALSE") 38 | endif() 39 | 40 | -------------------------------------------------------------------------------- /demo_picture/demo1_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShiSanChuan/GeneticAlgorithm/b8216952ded468170f533ff364a25b93a30d0859/demo_picture/demo1_1.png -------------------------------------------------------------------------------- /demo_picture/demo1_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShiSanChuan/GeneticAlgorithm/b8216952ded468170f533ff364a25b93a30d0859/demo_picture/demo1_2.png -------------------------------------------------------------------------------- /demo_picture/demo1_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShiSanChuan/GeneticAlgorithm/b8216952ded468170f533ff364a25b93a30d0859/demo_picture/demo1_3.png -------------------------------------------------------------------------------- /demo_picture/demo2_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShiSanChuan/GeneticAlgorithm/b8216952ded468170f533ff364a25b93a30d0859/demo_picture/demo2_1.png -------------------------------------------------------------------------------- /demo_picture/demo2_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShiSanChuan/GeneticAlgorithm/b8216952ded468170f533ff364a25b93a30d0859/demo_picture/demo2_2.png -------------------------------------------------------------------------------- /demo_picture/demo3_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShiSanChuan/GeneticAlgorithm/b8216952ded468170f533ff364a25b93a30d0859/demo_picture/demo3_1.png -------------------------------------------------------------------------------- /demo_picture/demo4_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShiSanChuan/GeneticAlgorithm/b8216952ded468170f533ff364a25b93a30d0859/demo_picture/demo4_1.png -------------------------------------------------------------------------------- /demo_picture/demo5_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShiSanChuan/GeneticAlgorithm/b8216952ded468170f533ff364a25b93a30d0859/demo_picture/demo5_1.png -------------------------------------------------------------------------------- /demo_picture/demo6_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShiSanChuan/GeneticAlgorithm/b8216952ded468170f533ff364a25b93a30d0859/demo_picture/demo6_1.png -------------------------------------------------------------------------------- /demo_picture/think.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShiSanChuan/GeneticAlgorithm/b8216952ded468170f533ff364a25b93a30d0859/demo_picture/think.png -------------------------------------------------------------------------------- /includes/GA.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include "opencv2/opencv.hpp" 6 | #define pi 3.1415926 7 | //GA_base 8 | class GA 9 | { 10 | protected: 11 | int chrom_num; 12 | int gene_num; 13 | float p_recombin; 14 | float p_mut; 15 | float search_min; 16 | float search_max; 17 | int para_num; 18 | cv::Mat ost;//fun ,x,y,z.. 19 | private: 20 | float (*fun)(std::vector argv); 21 | public: 22 | GA(const int _chrom_num=40,const int _gene_num=20, 23 | const float _p_recombin=0.3,const float _p_mut=0.2, 24 | const float min=0,const float max=1,const int _para_num=1); 25 | void solve(float (*_fun)(std::vector argv),const int &_para_num=0); 26 | ~GA(){}; 27 | cv::Mat crtbp(const int &Nind=0,const int &Lind=0,const int&encodemin=0,const int &encodemax=2); 28 | std::pair , float> ranking(void); 29 | GA& select(cv::Mat &Popula,int _method=0); 30 | GA& recombin(cv::Mat &Popula,const float &opt=0); 31 | GA& mut(cv::Mat &Popula,float opt=0); 32 | void bs2rv(cv::Mat &Popula,float min=0,float max=0); 33 | }; 34 | //BP 35 | class GA_BP:public GA 36 | { 37 | private: 38 | cv::Mat input; 39 | cv::Mat output; 40 | int implication_num; 41 | public: 42 | GA_BP(const int _chrom_num=40,const int _gene_num=20, 43 | const float _p_recombin=0.3,const float _p_mut=0.2, 44 | const float min=0,const float max=1,const int _para_num=1): 45 | GA(_chrom_num,_gene_num,_p_recombin,_p_mut,min,max,_para_num){} 46 | 47 | ~GA_BP(){}; 48 | void BPsolve(cv::Mat &_input,cv::Mat &_output); 49 | std::pair, float> ranking(void); 50 | }; 51 | //GA_TSP 52 | class GA_TSP:public GA 53 | { 54 | private: 55 | cv::Mat address; 56 | double distance(int indexi,int indexj); 57 | public: 58 | GA_TSP(const int _chrom_num=40,const int _gene_num=20, 59 | const float _p_recombin=0.3,const float _p_mut=0.2, 60 | const float min=0,const float max=1,const int _para_num=1): 61 | GA(_chrom_num,_gene_num,_p_recombin,_p_mut,min,max,_para_num){} 62 | 63 | ~GA_TSP(){}; 64 | void TSPsolve(cv::Mat &_address); 65 | std::pair, float> ranking(cv::Mat &_Poulate); 66 | cv::Mat crtbp(int encodemax=0); 67 | GA_TSP& recombin(cv::Mat &Popula,const float &opt=0); 68 | GA_TSP& mut(cv::Mat &Popula,float opt=0); 69 | GA_TSP& select(cv::Mat &Popula,int _method=0){GA::select(Popula,_method);return *this;} 70 | }; 71 | //QGA 72 | class QGA:public GA 73 | { 74 | public: 75 | QGA(const int _chrom_num=80,const int _gene_num=20, 76 | const float _p_recombin=0.3,const float _p_mut=0.2, 77 | const float min=-pi,const float max=pi,const int _para_num=1): 78 | GA(_chrom_num,_gene_num,_p_recombin,_p_mut,min,max,_para_num){} 79 | ~QGA(){} 80 | cv::Mat crtbp(const int &Nind=0,const int &Lind=0); 81 | void bs2rv(cv::Mat &Popula,float min=-pi,float max=pi);//修改编码方式 82 | QGA& select(cv::Mat &Popula); 83 | QGA& recombin(cv::Mat &Popula,const float &opt=0)=delete; 84 | QGA& mut(cv::Mat &Popula,float opt=0)=delete; 85 | }; 86 | //PSO 87 | class PSO 88 | { 89 | private: 90 | int chrom_num;//不需要 基因 离子群都为浮点数 91 | int para_num; 92 | float c1; 93 | float c2; 94 | float wmax; 95 | float wmin; 96 | float bmin; 97 | float bmax; 98 | cv::Mat Population; 99 | cv::Mat v;//speed 速度 100 | cv::Mat Pbest;//popula history best 个体历史最有 101 | std::vector Gbest;//globel best 全局最优 102 | std::vector post; 103 | std::vector ost; 104 | float (*fun)(std::vector argv); 105 | public: 106 | PSO(const int _chrom_num=50,const int _para_num=1, 107 | const float min=0,const float max=1, 108 | const float c1=0.8,const float c2=0.8,const float wmax=1.2, 109 | const float wmin=0.1); 110 | ~PSO(){} 111 | void crtbp(const int &_chrom_num=0,const int &_para_num=0); 112 | void solve(float(*_fun)(std::vector argv)); 113 | std::pair, float> ranking(); 114 | void update(bool para=0); 115 | }; -------------------------------------------------------------------------------- /includes/color.h: -------------------------------------------------------------------------------- 1 | #ifndef CVPLOT_COLOR_H 2 | #define CVPLOT_COLOR_H 3 | 4 | #include 5 | 6 | namespace cvplot { 7 | 8 | struct Color { 9 | uint8_t r, g, b, a; 10 | Color(uint8_t r, uint8_t g, uint8_t b, uint8_t a = 255) 11 | : r(r), g(g), b(b), a(a) {} 12 | Color(const uint8_t *rgb, uint8_t a = 255) 13 | : Color(rgb[0], rgb[1], rgb[2], a) {} 14 | Color() : Color(0, 0, 0) {} 15 | 16 | Color alpha(uint8_t alpha) const; 17 | Color gamma(float gamma) const; 18 | float hue() const; 19 | 20 | static Color gray(uint8_t v); 21 | static Color hue(float hue); 22 | static Color cos(float hue); 23 | static Color index(uint8_t index, uint8_t density = 16, float avoid = 2.f, 24 | float range = 2.f); 25 | static Color hash(const std::string &seed); 26 | static Color uniq(const std::string &name); 27 | }; 28 | 29 | static const Color Red = Color::hue(0.f); 30 | static const Color Orange = Color::hue(.5f); 31 | static const Color Yellow = Color::hue(1.f); 32 | static const Color Lawn = Color::hue(1.5f); 33 | static const Color Green = Color::hue(2.f); 34 | static const Color Aqua = Color::hue(2.5f); 35 | static const Color Cyan = Color::hue(3.f); 36 | static const Color Sky = Color::hue(3.5f); 37 | static const Color Blue = Color::hue(4.f); 38 | static const Color Purple = Color::hue(4.5f); 39 | static const Color Magenta = Color::hue(5.f); 40 | static const Color Pink = Color::hue(5.5f); 41 | static const Color Black = Color::gray(0); 42 | static const Color Dark = Color::gray(32); 43 | static const Color Gray = Color::gray(128); 44 | static const Color Light = Color::gray(223); 45 | static const Color White = Color::gray(255); 46 | 47 | } // namespace cvplot 48 | 49 | #endif // CVPLOT_COLOR_H 50 | -------------------------------------------------------------------------------- /includes/cvplot.h: -------------------------------------------------------------------------------- 1 | #ifndef CVPLOT_H 2 | #define CVPLOT_H 3 | 4 | #include "color.h" 5 | #include "figure.h" 6 | #include "highgui.h" 7 | #include "window.h" 8 | 9 | #endif // CVPLOT_H 10 | -------------------------------------------------------------------------------- /includes/demo.h: -------------------------------------------------------------------------------- 1 | #ifndef _DEMO_H 2 | #define _DEMO_H 3 | 4 | void demo1();//一元函数求解 5 | void demo2();//二元函数求解 6 | void demo3();//BP神经网络结合GA 7 | void demo4();//TSP问题 8 | void demo5();//量子遗传算法 9 | void demo6();//粒子群算法 10 | #endif -------------------------------------------------------------------------------- /includes/figure.h: -------------------------------------------------------------------------------- 1 | #ifndef CVPLOT_FIGURE_H 2 | #define CVPLOT_FIGURE_H 3 | 4 | #include "color.h" 5 | #include "window.h" 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | namespace cvplot { 12 | 13 | struct Point2 { 14 | float x, y; 15 | Point2() : Point2(0, 0) {} 16 | Point2(float x, float y) : x(x), y(y) {} 17 | }; 18 | 19 | struct Point3 { 20 | float x, y, z; 21 | Point3() : Point3(0, 0, 0) {} 22 | Point3(float x, float y, float z) : x(x), y(y), z(z) {} 23 | }; 24 | 25 | enum Type { 26 | Line, 27 | DotLine, 28 | Dots, 29 | FillLine, 30 | RangeLine, 31 | Histogram, 32 | Vistogram, 33 | Horizontal, 34 | Vertical, 35 | Range, 36 | Circle, 37 | }; 38 | 39 | class Series { 40 | public: 41 | Series(const std::string &label, enum Type type, Color color) 42 | : label_(label), 43 | type_(type), 44 | color_(color), 45 | dims_(0), 46 | depth_(0), 47 | legend_(true), 48 | dynamic_color_(false) {} 49 | 50 | Series &type(enum Type type); 51 | Series &color(Color color); 52 | Series &dynamicColor(bool dynamic_color); 53 | Series &legend(bool legend); 54 | Series &add(const std::vector> &data); 55 | Series &add(const std::vector> &data); 56 | Series &add(const std::vector> &data); 57 | Series &addValue(const std::vector &values); 58 | Series &addValue(const std::vector &values); 59 | Series &addValue(const std::vector &values); 60 | Series &add(float key, float value); 61 | Series &add(float key, Point2 value); 62 | Series &add(float key, Point3 value); 63 | Series &addValue(float value); 64 | Series &addValue(float value_a, float value_b); 65 | Series &addValue(float value_a, float value_b, float value_c); 66 | Series &set(const std::vector> &data); 67 | Series &set(const std::vector> &data); 68 | Series &set(const std::vector> &data); 69 | Series &setValue(const std::vector &values); 70 | Series &setValue(const std::vector &values); 71 | Series &setValue(const std::vector &values); 72 | Series &set(float key, float value); 73 | Series &set(float key, float value_a, float value_b); 74 | Series &set(float key, float value_a, float value_b, float value_c); 75 | Series &setValue(float value); 76 | Series &setValue(float value_a, float value_b); 77 | Series &setValue(float value_a, float value_b, float value_c); 78 | Series &clear(); 79 | 80 | const std::string &label() const; 81 | bool legend() const; 82 | Color color() const; 83 | void draw(void *buffer, float x_min, float x_max, float y_min, float y_max, 84 | float x_axis, float xs, float xd, float ys, float yd, float y_axis, 85 | int unit, float offset) const; 86 | bool collides() const; 87 | void dot(void *b, int x, int y, int r) const; 88 | void bounds(float &x_min, float &x_max, float &y_min, float &y_max, 89 | int &n_max, int &p_max) const; 90 | void verifyParams() const; 91 | 92 | protected: 93 | void ensureDimsDepth(int dims, int depth); 94 | bool flipAxis() const; 95 | 96 | protected: 97 | std::vector entries_; 98 | std::vector data_; 99 | enum Type type_; 100 | Color color_; 101 | std::string label_; 102 | int dims_; 103 | int depth_; 104 | bool legend_; 105 | bool dynamic_color_; 106 | }; 107 | 108 | class Figure { 109 | public: 110 | Figure(View &view) 111 | : view_(view), 112 | border_size_(50), 113 | background_color_(White), 114 | axis_color_(Black), 115 | sub_axis_color_(Light), 116 | text_color_(Black), 117 | include_zero_x_(true), 118 | include_zero_y_(true), 119 | aspect_square_(false), 120 | grid_size_(60), 121 | grid_padding_(20) {} 122 | 123 | Figure &clear(); 124 | Figure &origin(bool x, bool y); 125 | Figure &square(bool square); 126 | Figure &border(int size); 127 | Figure &alpha(int alpha); 128 | Figure &gridSize(int size); 129 | Figure &backgroundColor(Color color); 130 | Figure &axisColor(Color color); 131 | Figure &subaxisColor(Color color); 132 | Figure &textColor(Color color); 133 | Color backgroundColor(); 134 | Color axisColor(); 135 | Color subaxisColor(); 136 | Color textColor(); 137 | 138 | void draw(void *b, float x_min, float x_max, float y_min, float y_max, 139 | int n_max, int p_max) const; 140 | void show(bool flush = true) const; 141 | Series &series(const std::string &label); 142 | 143 | protected: 144 | View &view_; 145 | std::vector series_; 146 | int border_size_; 147 | Color background_color_; 148 | Color axis_color_; 149 | Color sub_axis_color_; 150 | Color text_color_; 151 | bool include_zero_x_; 152 | bool include_zero_y_; 153 | bool aspect_square_; 154 | int grid_size_; 155 | int grid_padding_; 156 | }; 157 | 158 | Figure &figure(const std::string &view); 159 | 160 | } // namespace cvplot 161 | 162 | #endif // CVPLOT_FIGURE_H 163 | -------------------------------------------------------------------------------- /includes/highgui.h: -------------------------------------------------------------------------------- 1 | #ifndef CVPLOT_HIGHGUI_H 2 | #define CVPLOT_HIGHGUI_H 3 | 4 | #include 5 | #include 6 | 7 | #include "window.h" 8 | 9 | namespace cvplot { 10 | 11 | int createTrackbar(const std::string &trackbarname, const std::string &winname, 12 | int *value, int count, TrackbarCallback onChange = 0, 13 | void *userdata = 0); 14 | void destroyAllWindows(); 15 | void destroyWindow(const std::string &view); 16 | int getMouseWheelDelta(int flags); 17 | int getTrackbarPos(const std::string &trackbarname, const std::string &winname); 18 | double getWindowProperty(const std::string &winname, int prop_id); 19 | void imshow(const std::string &view, void *img); 20 | void moveWindow(const std::string &view, int x, int y); 21 | void namedWindow(const std::string &view, int flags = 0); 22 | void resizeWindow(const std::string &view, int width, int height); 23 | void resizeWindow(const std::string &view, const Size &size); 24 | Rect selectROI(const std::string &windowName, void *img, 25 | bool showCrosshair = true, bool fromCenter = false); 26 | Rect selectROI(void *img, bool showCrosshair = true, bool fromCenter = false); 27 | void selectROIs(const std::string &windowName, void *img, 28 | std::vector &boundingBoxes, bool showCrosshair = true, 29 | bool fromCenter = false); 30 | void setMouseCallback(const std::string &view, MouseCallback onMouse, 31 | void *userdata = 0); 32 | void setTrackbarMax(const std::string &trackbarname, const std::string &winname, 33 | int maxval); 34 | void setTrackbarMin(const std::string &trackbarname, const std::string &winname, 35 | int minval); 36 | void setTrackbarPos(const std::string &trackbarname, const std::string &winname, 37 | int pos); 38 | void setWindowProperty(const std::string &winname, int prop_id, 39 | double prop_value); 40 | void setWindowTitle(const std::string &view, const std::string &title); 41 | int startWindowThread(); 42 | int waitKey(int delay = 0); 43 | int waitKeyEx(int delay = 0); 44 | 45 | } // namespace cvplot 46 | 47 | #endif // CVPLOT_HIGHGUI_H 48 | -------------------------------------------------------------------------------- /includes/internal.h: -------------------------------------------------------------------------------- 1 | #ifndef CVPLOT_INTERNAL_H 2 | #define CVPLOT_INTERNAL_H 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | #define EXPECT_EQ(a__, b__) \ 10 | do { \ 11 | if ((a__) != (b__)) { \ 12 | std::cerr << "Incorrect " << #a__ << " (" << (a__) << "), should equal " \ 13 | << (b__) << std::endl; \ 14 | exit(-1); \ 15 | } \ 16 | } while (0) 17 | 18 | namespace cvplot { 19 | 20 | static const int paleness = 32; 21 | 22 | static uint8_t channel2pale(uint8_t c) { 23 | return c * (255 - 2 * paleness) / 255 + paleness; 24 | } 25 | 26 | static cv::Scalar color2scalar(const Color &color) { 27 | return cv::Scalar(channel2pale(color.b), channel2pale(color.g), 28 | channel2pale(color.r)); 29 | } 30 | 31 | static float value2snap(float value) { 32 | return std::max({pow(10, floor(log10(value))), 33 | pow(10, floor(log10(value / 2))) * 2, 34 | pow(10, floor(log10(value / 5))) * 5}); 35 | } 36 | 37 | class Trans { 38 | public: 39 | Trans(void *buffer) : Trans(*(cv::Mat *)buffer) {} 40 | 41 | Trans(cv::Mat &buffer) : original_(buffer), alpha_(0), interim_(NULL) {} 42 | 43 | Trans(cv::Mat &buffer, int alpha) : Trans(buffer) { setup(alpha); } 44 | 45 | ~Trans() { flush(); } 46 | 47 | cv::Mat &get() const { return (interim_ != NULL ? *interim_ : original_); } 48 | 49 | void setup(int alpha) { 50 | bool transparent = (alpha != 255); 51 | if (transparent) { 52 | interim_ = new cv::Mat(); 53 | original_.copyTo(*interim_); 54 | } 55 | alpha_ = alpha; 56 | } 57 | 58 | void flush() { 59 | if (interim_) { 60 | // std::cerr << "blending " << alpha_ << std::endl; 61 | auto weight = alpha_ / 255.f; 62 | cv::addWeighted(*interim_, weight, original_, 1 - weight, 0, original_); 63 | delete interim_; 64 | interim_ = NULL; 65 | } 66 | } 67 | 68 | cv::Mat &with(int alpha) { 69 | if (alpha != alpha_) { 70 | flush(); 71 | setup(alpha); 72 | } 73 | return get(); 74 | } 75 | 76 | cv::Mat &with(const Color &color) { return with(color.a); } 77 | 78 | protected: 79 | int alpha_; 80 | cv::Mat &original_; 81 | cv::Mat *interim_; 82 | }; 83 | 84 | } // namespace cvplot 85 | 86 | #endif // CVPLOT_INTERNAL_H 87 | -------------------------------------------------------------------------------- /includes/window.h: -------------------------------------------------------------------------------- 1 | #ifndef CVPLOT_WINDOW_H 2 | #define CVPLOT_WINDOW_H 3 | 4 | #include "color.h" 5 | 6 | #include 7 | #include 8 | 9 | namespace cvplot { 10 | 11 | struct Rect { 12 | int x, y, width, height; 13 | Rect(int x, int y, int width, int height) 14 | : x(x), y(y), width(width), height(height) {} 15 | }; 16 | 17 | struct Size { 18 | int width, height; 19 | Size(int width, int height) : width(width), height(height) {} 20 | }; 21 | 22 | struct Offset { 23 | int x, y; 24 | Offset(int x, int y) : x(x), y(y) {} 25 | }; 26 | 27 | typedef void (*MouseCallback)(int event, int x, int y, int flags, void *param); 28 | typedef void (*TrackbarCallback)(int pos, void *param); 29 | 30 | class Window; 31 | 32 | class View { 33 | public: 34 | View(Window &window, const std::string &title = "", Size size = {300, 300}) 35 | : window_(window), 36 | title_(title), 37 | rect_(0, 0, size.width, size.height), 38 | frameless_(false), 39 | background_color_(Black), 40 | frame_color_(Green), 41 | text_color_(Black), 42 | mouse_callback_(NULL), 43 | mouse_param_(NULL) {} 44 | View &resize(Rect rect); 45 | View &size(Size size); 46 | View &offset(Offset offset); 47 | View &autosize(); 48 | View &title(const std::string &title); 49 | View &alpha(int alpha); 50 | View &backgroundColor(Color color); 51 | View &frameColor(Color color); 52 | View &textColor(Color color); 53 | View &mouse(MouseCallback callback, void *param = NULL); 54 | void onmouse(int event, int x, int y, int flags); 55 | 56 | Color backgroundColor(); 57 | Color frameColor(); 58 | Color textColor(); 59 | std::string &title(); 60 | bool has(Offset offset); 61 | 62 | void drawRect(Rect rect, Color color); 63 | void drawFill(Color background = White); 64 | void drawImage(const void *image, int alpha = 255); 65 | void drawText(const std::string &text, Offset offset, Color color) const; 66 | void drawFrame(const std::string &title) const; 67 | void *buffer(Rect &rect); 68 | void finish(); 69 | void flush(); 70 | void hide(bool hidden = true); 71 | 72 | View &operator=(const View &) = delete; 73 | 74 | protected: 75 | Rect rect_; 76 | std::string title_; 77 | bool frameless_; 78 | Window &window_; 79 | Color background_color_; 80 | Color frame_color_; 81 | Color text_color_; 82 | MouseCallback mouse_callback_; 83 | void *mouse_param_; 84 | bool hidden_; 85 | }; 86 | 87 | class Window { 88 | public: 89 | Window(const std::string &title = ""); 90 | Window &resize(Rect rect); 91 | Window &size(Size size); 92 | Window &offset(Offset offset); 93 | Window &title(const std::string &title); 94 | Window &fps(float fps); 95 | Window &ensure(Rect rect); 96 | Window &cursor(bool cursor); 97 | void *buffer(); 98 | void flush(); 99 | View &view(const std::string &name, Size size = {300, 300}); 100 | void dirty(); 101 | void tick(); 102 | void hide(bool hidden = true); 103 | void onmouse(int event, int x, int y, int flags); 104 | 105 | Window &operator=(const Window &) = delete; 106 | 107 | static Window ¤t(); 108 | static void current(Window &window); 109 | static Window ¤t(const std::string &title); 110 | 111 | protected: 112 | Offset offset_; 113 | void *buffer_; 114 | std::string title_; 115 | std::string name_; 116 | std::map views_; 117 | bool dirty_; 118 | float flush_time_; 119 | float fps_; 120 | bool hidden_; 121 | bool show_cursor_; 122 | Offset cursor_; 123 | }; 124 | 125 | class Util { 126 | public: 127 | static void sleep(float seconds = 0); 128 | static char key(float timeout = 0); 129 | static std::string line(float timeout = 0); 130 | }; 131 | 132 | } // namespace cvplot 133 | 134 | #endif // CVPLOT_WINDOW_H 135 | -------------------------------------------------------------------------------- /src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FIND_PACKAGE( OpenCV REQUIRED ) 2 | FIND_PACKAGE ( Threads REQUIRED ) 3 | 4 | aux_source_directory(. DIR_SRCS) 5 | add_executable(GA ${DIR_SRCS}) 6 | add_subdirectory(./cvplotlib) 7 | add_subdirectory(./GAlib) 8 | 9 | TARGET_LINK_LIBRARIES(GA ${OpenCV_LIBS} ${CMAKE_THREAD_LIBS_INIT} cvplotlib GAlib) -------------------------------------------------------------------------------- /src/GAlib/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | aux_source_directory(. DIR_LIB_SRCS) 2 | add_library(GAlib ${DIR_LIB_SRCS}) -------------------------------------------------------------------------------- /src/GAlib/GA.cpp: -------------------------------------------------------------------------------- 1 | #include "GA.h" 2 | 3 | GA::GA(const int _chrom_num,const int _gene_num,const float _p_recombin, 4 | const float _p_mut,const float min,const float max,const int _para_num){ 5 | if(_chrom_num<=0||_gene_num<=0|| 6 | _p_mut<0||_p_mut>1|| 7 | _p_recombin<0||_p_recombin>1|| 8 | max<=min){ 9 | std::cout<<"set GA parameter error,check it!\n"; 10 | exit(1); 11 | } 12 | chrom_num=_chrom_num;//种群个体数 13 | gene_num=_gene_num;//基因数 14 | p_recombin=_p_recombin;//交叉概率 15 | p_mut=_p_mut;//变异概率 16 | search_min=min;//区间下限 17 | search_max=max;//区间上限 18 | para_num=_para_num;//编码单元数 19 | } 20 | void GA::solve(float (*_fun)(std::vector argv),const int &_para_num){ 21 | if(_para_num!=0)para_num=_para_num; 22 | ost=cv::Mat(cv::Size(chrom_num,para_num+1),CV_32FC1,cv::Scalar(0)); 23 | fun=_fun; 24 | } 25 | //输入 种群数,基因数,最小编码,最大编码 26 | //输出生成随机0-1矩阵 Lind<2^32 27 | cv::Mat GA::crtbp(const int &Nind,const int &Lind,const int&encodemin,const int &encodemax){ 28 | if(Nind>0)chrom_num=Nind; 29 | if(Lind>0)gene_num=Lind; 30 | if(gene_num%para_num!=0){std::cout<<"please set (Lind x para_num)!\n";}; 31 | cv::Mat Population(cv::Size(gene_num,chrom_num),CV_8UC1,cv::Scalar(0)); 32 | // cv::randu(Population, 0, 2);//并不随机。。 33 | cv::RNG rng(time(NULL)); 34 | rng.fill(Population, cv::RNG::UNIFORM,encodemin,encodemax);//UNIFORM or NORMAL 35 | return Population; 36 | } 37 | //计算适应度 38 | std::pair, float> GA::ranking(void){ 39 | //lambada [this]表明是内部类 40 | std::pair , float> best(std::vector(0.0),-1.0/0.0); 41 | for(int i=0;i argv; 43 | for(int j=0;j(j,i)); 45 | float m=fun(argv); 46 | ost.at(ost.rows-1,i)=m; 47 | if(m>best.second){ 48 | best.first=argv; 49 | best.second=m; 50 | } 51 | } 52 | return best; 53 | } 54 | //选择优秀个体 bug集中地 55 | GA& GA::select(cv::Mat &Popula,int _method){ 56 | std::vector > recode_rank_index; 57 | for(int i=0;i(i,(float)ost.at(ost.rows-1,i))); 59 | std::sort(recode_rank_index.begin(), recode_rank_index.end(), 60 | [&](std::pair &a,std::pair &b){ 61 | if(a.second==b.second)return false;//??不呢为什么 62 | if((a.second>b.second)^_method)return true; 63 | else return false; 64 | }); //排序 65 | for(int i=0;i new_Popula; 72 | //保留最优个体+赌盘选择 73 | for(int i=0;i(recode_rank_index[0].first,i)); 75 | for(int i=1;i(recode_rank_index[_select].first,j)); 83 | } 84 | int rows=Popula.rows,cols=Popula.cols; 85 | Popula=cv::Mat(new_Popula); 86 | // cv::resize(Popula, Popula, cv::Size(cols,rows));//使用有问题 87 | Popula.reshape(0,rows).copyTo(Popula); 88 | return *this; 89 | } 90 | //交叉 均匀交叉 91 | GA& GA::recombin(cv::Mat &Popula,const float &opt){ 92 | if(opt>0&&opt<1)p_recombin=opt; 93 | for(int i=0;i(i,k)^=Popula.at(j,k); 99 | Popula.at(j,k)^=Popula.at(i,k); 100 | Popula.at(i,k)^=Popula.at(j,k); 101 | } 102 | } 103 | } 104 | } 105 | return *this; 106 | } 107 | //变异 因为概率建立在统计上,不使用迭代所有成员 均匀变异 108 | GA& GA::mut(cv::Mat &Popula,float opt){ 109 | if(opt>0&&opt<1)p_mut=opt; 110 | for(int i=p_mut*Popula.cols*Popula.rows;i>0;i--){ 111 | int m=rand()%(Popula.cols*Popula.rows); 112 | Popula.at(m/Popula.cols,m%Popula.cols)^=1; 113 | } 114 | return *this; 115 | } 116 | //二进制转十进制 限定区间范围 117 | void GA::bs2rv(cv::Mat &Popula,float min,float max){ 118 | if(min==0)min=search_min; 119 | if(max==0)max=search_max; 120 | unsigned long int part=Popula.cols/para_num; 121 | unsigned long int Max=(unsigned long int)1<读取 char类型的矩阵??? 123 | for(int i=0;i(i,j))sum[j/part]+=m; 127 | m*=2; 128 | if(m>Max)m=1; 129 | } 130 | for(int j=0;j(j,i)=(min+sum[j]*((double)(max-min)/Max)); 132 | free(sum); 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /src/GAlib/GA_BP.cpp: -------------------------------------------------------------------------------- 1 | #include "GA.h" 2 | //y=fun(x*w+b) 3 | void GA_BP::BPsolve(cv::Mat &_input,cv::Mat &_output){ 4 | input=_input; 5 | output=_output; 6 | implication_num=input.cols*2+1; 7 | para_num=implication_num*input.cols+implication_num; 8 | para_num+=implication_num*output.cols+output.cols; 9 | ost=cv::Mat(cv::Size(chrom_num,para_num+1), 10 | CV_32FC1,cv::Scalar(0)); 11 | } 12 | std::pair, float> GA_BP::ranking(void){ 13 | std::pair , float> best(std::vector(0.0),1.0/0.0); 14 | cv::Mat in_imp,in_imp_b,imp_out,imp_out_b,err; 15 | for(int i=0;i(0,k); 32 | } 33 | ost.at(ost.rows-1,i)=std::sqrt(_err); 34 | if(_err(0,i); 11 | return cv::sqrt(distance); 12 | } 13 | //传入目的解 14 | void GA_TSP::TSPsolve(cv::Mat &_address){ 15 | address=_address; 16 | gene_num=para_num=_address.rows;//因为基因的编码没有改变 17 | ost=cv::Mat(cv::Size(chrom_num,1),CV_32FC1,cv::Scalar(0)); 18 | } 19 | //对成员进行评分 20 | std::pair, float> GA_TSP::ranking(cv::Mat &_Popula){ 21 | std::pair , float> best(std::vector(0.0),-1.0/0.0); 22 | for(int i=0;i<_Popula.rows;i++){ 23 | double _distance=0.0; 24 | for(int j=1;j<_Popula.cols;j++) 25 | _distance+=distance(_Popula.at(i,j-1),_Popula.at(i,j)); 26 | _distance+=distance(_Popula.at(i,0),_Popula.at(i,_Popula.cols-1)); 27 | ost.at(0,i)=1/_distance;//按距离的倒数评分,越大距离越短 28 | if(1/_distance>best.second){ 29 | best.second=1/_distance; 30 | std::vector argv; 31 | for(int j=0;j<_Popula.cols;j++) 32 | argv.push_back((uchar)_Popula.at(i,j)); 33 | best.first=argv; 34 | } 35 | } 36 | return best; 37 | } 38 | //创建种群 39 | cv::Mat GA_TSP::crtbp(int encodemax){ 40 | if(encodemax>0)gene_num=para_num=encodemax; 41 | cv::Mat Population(cv::Size(1,chrom_num),CV_32FC1,cv::Scalar(1)); 42 | cv::Mat gene(cv::Size(gene_num,1),CV_32FC1,cv::Scalar(0)); 43 | for(int i=0;i(0,i)=i; 45 | Population*=gene;//创建一个标准种群 46 | Population.convertTo(Population, CV_8UC1); 47 | return Population; 48 | } 49 | //反向旋转 50 | GA_TSP& GA_TSP::recombin(cv::Mat &Popula,const float &opt){ 51 | if(opt>0&&opt<1)p_recombin=opt; 52 | uchar * tem=new uchar[2*Popula.cols]; 53 | for(int i=1;i<10;i++){//保护最优,并复制最优 54 | uchar *gene1=Popula.ptr(0); 55 | uchar *gene2=Popula.ptr(Popula.rows-i); 56 | memcpy(gene2,gene1,sizeof(uchar)*Popula.cols); 57 | } 58 | 59 | for(int i=0;i(i); 62 | memcpy(tem,gene,sizeof(uchar)*Popula.cols); 63 | memcpy(tem+Popula.cols,gene,sizeof(uchar)*Popula.cols); 64 | memcpy(gene,tem+rand()%Popula.cols,sizeof(uchar)*Popula.cols); 65 | } 66 | } 67 | delete []tem; 68 | return *this; 69 | } 70 | //变异 71 | GA_TSP& GA_TSP::mut(cv::Mat &Popula,float opt){ 72 | if(opt>0&&opt<1)p_mut=opt; 73 | for(int i=1;iopt*100) 75 | for(int j=0;j(i); 77 | uchar *a=p+rand()%Popula.cols; 78 | uchar *b=p+rand()%Popula.cols; 79 | while((*b)==(*a))b=p+rand()%Popula.cols; 80 | (*a)=(*a)^(*b); 81 | (*b)=(*a)^(*b); 82 | (*a)=(*a)^(*b); 83 | } 84 | } 85 | return *this; 86 | } -------------------------------------------------------------------------------- /src/GAlib/PSO.cpp: -------------------------------------------------------------------------------- 1 | #include "GA.h" 2 | /** 3 | * 初始化 init parament 4 | */ 5 | PSO::PSO(const int _chrom_num,const int _para_num, 6 | const float min,const float max, 7 | const float _c1,const float _c2,const float _wmax, 8 | const float _wmin){ 9 | chrom_num=_chrom_num; 10 | para_num=_para_num; 11 | c1=_c1; 12 | c2=_c2; 13 | wmax=_wmax; 14 | wmin=_wmin; 15 | para_num=_para_num; 16 | bmin=min; 17 | bmax=max; 18 | } 19 | /** 20 | * 输入目标参数 21 | */ 22 | void PSO::solve(float(*_fun)(std::vector argv)){ 23 | fun=_fun; 24 | } 25 | /** 26 | * 初始化种群 27 | * @param _chrom_num 种群个体数 28 | * @param _para_num 参数个数 29 | */ 30 | void PSO::crtbp(const int &_chrom_num,const int &_para_num){ 31 | if(_chrom_num>0)chrom_num=_chrom_num; 32 | if(_para_num>0)para_num=_para_num; 33 | v=cv::Mat (cv::Size(para_num,chrom_num),CV_32FC1,cv::Scalar(0)); 34 | Population=cv::Mat(cv::Size(para_num,chrom_num),CV_32FC1,cv::Scalar(0)); 35 | ost=std::vector(chrom_num,0); 36 | post=std::vector(chrom_num,0); 37 | cv::RNG rng(time(NULL)); 38 | rng.fill(Population, cv::RNG::UNIFORM,bmin ,bmax); 39 | rng.fill(v, cv::RNG::UNIFORM,0 , 0.5); 40 | //初始化 Pbest,Gbest 41 | Population.copyTo(Pbest); 42 | for(int i=0,min=0;i argv; 44 | for(int j=0;j(i,j)); 46 | int result=fun(argv); 47 | if(i==0||result, float> PSO::ranking(){ 59 | std::pair , float> best(Gbest,fun(Gbest)); 60 | for(int i=0;i argv; 62 | for(int j=0;j(i,j)=(float)(v.at(i,j)+ 65 | c1*(Gbest[j]-Population.at(i,j))*(float)(rand()%100)/100+ 66 | c2*(Pbest.at(i,j)-Population.at(i,j))*(float)(rand()%100)/100 ); 67 | //更新位置 update site 68 | Population.at(i,j)=(float)Population.at(i,j)+0.5*(float)(v.at(i,j)); 69 | if((float)Population.at(i,j)>bmax) 70 | Population.at(i,j)=bmax; 71 | if((float)Population.at(i,j)(i,j)=bmin; 73 | argv.push_back(Population.at(i,j)); 74 | } 75 | post[i]=fun(argv); 76 | } 77 | return best; 78 | } 79 | /** 80 | * 筛选粒子 81 | * @param para 0:最小min,1:最大max 82 | */ 83 | void PSO::update(bool para){ 84 | int gbb=fun(Gbest); 85 | for(int i=0;ipost[i])^para){ 87 | for(int j=0;j(i,j)=(float)Population.at(i,j); 89 | ost[i]=post[i]; 90 | } 91 | if((post[i](i,j); 94 | gbb=post[i]; 95 | } 96 | } 97 | } -------------------------------------------------------------------------------- /src/GAlib/QGA.cpp: -------------------------------------------------------------------------------- 1 | #include "GA.h" 2 | //量子编码的遗传算法 3 | //由于原编码为 CV_8UC1 转为 CV_32FC1 行内缩短4倍 4 | 5 | /** 6 | * 创建量子种群 7 | * @param Nind 列数 8 | * @param Lind 行数 9 | * @param encodemin 最小编码 10 | * @param encodemax 最大编码 11 | */ 12 | cv::Mat QGA::crtbp(const int &Nind,const int &Lind){ 13 | if(Nind>0)chrom_num=Nind; 14 | if(Lind>0)gene_num=Lind; 15 | if(gene_num%para_num!=0){std::cout<<"please set (Lind x para_num)!\n";}; 16 | cv::Mat Population(cv::Size(gene_num,chrom_num),CV_8UC1,cv::Scalar(0)); 17 | // cv::randu(Population, 0, 2);//并不随机QGA。。 18 | for(int i=0;i(i,j)=pi/4;//初始化都为45' 21 | return Population; 22 | } 23 | 24 | /** 25 | * 将数据编码 26 | * @param Popula [种群基因] 27 | * @param min [区间下限] 28 | * @param max [区间上限] 29 | */ 30 | void QGA::bs2rv(cv::Mat &Popula,float min,float max){ 31 | if(min==0)min=search_min; 32 | if(max==0)max=search_max; 33 | unsigned long int part=Popula.cols/para_num;//每个变量基因位数 34 | part/=4;//char 8 -> float 32 35 | unsigned long int Max=(unsigned long int)1<读取 char类型的矩阵???可行 37 | for(int i=0;i(i,j))); 41 | if(rand()%100>a*a*100)sum[j/part]+=m;//原书P82描述为平方项 42 | m*=2; 43 | if(m>Max)m=1; 44 | } 45 | for(int j=0;j(j,i)=(min+sum[j]*((double)(max-min)/Max)); 47 | free(sum); 48 | } 49 | // std::cout<f(best) alpha ab>0 ab<0 a=0 b=0 54 | *0 0 false 0 0 0 0 0 55 | *0 0 true 0 0 0 0 0 56 | *0 1 false 0.01pi 1 -1 0 +-1 57 | *0 1 true 0.01pi -1 1 +-1 0 58 | *1 0 false 0.01pi -1 1 +-1 0 59 | *1 0 true 0.01pi 1 -1 0 +-1 60 | *1 1 false 0 0 0 0 0 61 | *1 1 true 0 0 0 0 0 62 | *其实不用这么复杂,即角度想最优个体调整 63 | *ab>0时,0~pi/2 || -pi~-pi/2 ab<0: -pi/2~0 || pi/2~pi 64 | */ 65 | QGA& QGA::select(cv::Mat &Popula){ 66 | int best_index=0; 67 | int sign=0;//旋转方向 68 | double delta=0.01*pi;//旋转角度 69 | float best=(float)ost.at(ost.rows-1,0); 70 | for(int i=1;i(ost.rows-1,i)>best){ 72 | best_index=i; 73 | best=(float)ost.at(ost.rows-1,i); 74 | } 75 | for(int i=0;i(i,j))); 78 | double b=std::sin((float)(Popula.at(best_index,j))); 79 | if((rand()%100>a*a*100)^(rand()%100>b*b*100)){ 80 | float angle=(float)(Popula.at(i,j)); 81 | if((float)(ost.at(ost.rows-1,i))>(float)(ost.at(ost.rows-1,best_index))){ 82 | // if() 83 | if((angle>0&&angle-pi&&angle<-pi/2)) 84 | sign=-1; 85 | else sign=1; 86 | }else{ 87 | if((angle>0&&angle-pi&&angle<-pi/2)) 88 | sign=1; 89 | else sign=-1; 90 | } 91 | Popula.at(i,j)=angle+sign*delta; 92 | }else delta=0; 93 | } 94 | 95 | return *this; 96 | } -------------------------------------------------------------------------------- /src/cvplotlib/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | aux_source_directory(. DIR_LIB_SRCS) 2 | add_library(cvplotlib ${DIR_LIB_SRCS}) -------------------------------------------------------------------------------- /src/cvplotlib/color.cc: -------------------------------------------------------------------------------- 1 | #include "color.h" 2 | 3 | #include 4 | #include 5 | 6 | namespace cvplot { 7 | 8 | namespace { 9 | std::map color_counter; 10 | } 11 | 12 | Color Color::alpha(uint8_t alpha) const { return Color(r, g, b, alpha); } 13 | 14 | Color Color::gamma(float gamma) const { 15 | return Color(pow(r / 255.f, 1 / gamma) * 255, pow(g / 255.f, 1 / gamma) * 255, 16 | pow(b / 255.f, 1 / gamma) * 255, a); 17 | } 18 | 19 | Color Color::gray(uint8_t v) { return Color(v, v, v); } 20 | 21 | Color Color::index(uint8_t index, uint8_t density, float avoid, 22 | float range) { // avoid greens by default 23 | if (avoid > 0) { 24 | auto step = density / (6 - range); 25 | auto offset = (avoid + range / 2) * step; 26 | index = offset + index % density; 27 | density += step * range; 28 | } 29 | auto hue = index % density * 6.f / density; 30 | return Color::cos(hue); 31 | } 32 | 33 | Color Color::hash(const std::string &seed) { 34 | return Color::index(std::hash{}(seed)); 35 | } 36 | 37 | Color Color::uniq(const std::string &name) { 38 | if (color_counter.count(name) == 0) { 39 | color_counter[name] = color_counter.size(); 40 | } 41 | return Color::index(color_counter[name]); 42 | } 43 | 44 | Color Color::hue(float hue) { 45 | Color color; 46 | auto i = (int)hue; 47 | auto f = (hue - i) * 255; 48 | switch (i % 6) { 49 | case 0: 50 | return Color(255, f, 0); 51 | case 1: 52 | return Color(255 - f, 255, 0); 53 | case 2: 54 | return Color(0, 255, f); 55 | case 3: 56 | return Color(0, 255 - f, 255); 57 | case 4: 58 | return Color(f, 0, 255); 59 | case 5: 60 | return Color(255, 0, 255 - f); 61 | } 62 | return Color(); 63 | } 64 | 65 | Color Color::cos(float hue) { 66 | return Color((std::cos(hue * 1.047f) + 1) * 127.9f, 67 | (std::cos((hue - 2) * 1.047f) + 1) * 127.9f, 68 | (std::cos((hue - 4) * 1.047f) + 1) * 127.9f); 69 | } 70 | 71 | float Color::hue() const { 72 | auto min = std::min(std::min(r, g), b); 73 | auto max = std::max(std::max(r, g), b); 74 | if (min == max) { 75 | return 0; 76 | } 77 | auto hue = 0.f; 78 | if (r == max) { 79 | hue = (g - b) / (float)(max - min); 80 | } else if (g == max) { 81 | hue = 2.f + (b - r) / (float)(max - min); 82 | } else { 83 | hue = 4.f + (r - g) / (float)(max - min); 84 | } 85 | if (hue < 0) { 86 | hue += 6; 87 | } 88 | return hue; 89 | } 90 | 91 | } // namespace cvplot 92 | -------------------------------------------------------------------------------- /src/cvplotlib/highgui.cc: -------------------------------------------------------------------------------- 1 | #include "highgui.h" 2 | 3 | #include 4 | 5 | namespace cvplot { 6 | 7 | int createTrackbar(const std::string &trackbarname, const std::string &winname, 8 | int *value, int count, TrackbarCallback onChange, 9 | void *userdata) { 10 | // TODO 11 | return cv::createTrackbar(trackbarname, winname, value, count, onChange, 12 | userdata); 13 | } 14 | 15 | void destroyAllWindows() { cv::destroyAllWindows(); } 16 | 17 | void destroyWindow(const std::string &view) { 18 | Window::current().view(view).hide(); 19 | } 20 | 21 | int getMouseWheelDelta(int flags) { 22 | // TODO 23 | #if CV_MAJOR_VERSION > 2 24 | return cv::getMouseWheelDelta(flags); 25 | #else 26 | return -1; 27 | #endif 28 | } 29 | 30 | int getTrackbarPos(const std::string &trackbarname, 31 | const std::string &winname) { 32 | // TODO 33 | return cv::getTrackbarPos(trackbarname, winname); 34 | } 35 | 36 | double getWindowProperty(const std::string &winname, int prop_id) { 37 | // TODO 38 | return cv::getWindowProperty(winname, prop_id); 39 | } 40 | 41 | void imshow(const std::string &view, void *img) { 42 | Window::current().view(view).drawImage(img); 43 | Window::current().view(view).finish(); 44 | Window::current().view(view).flush(); 45 | } 46 | 47 | void moveWindow(const std::string &view, int x, int y) { 48 | Window::current().view(view).offset({x, y}); 49 | } 50 | 51 | void namedWindow(const std::string &view, int flags) { 52 | Window::current().view(view); 53 | } 54 | 55 | void resizeWindow(const std::string &view, int width, int height) { 56 | Window::current().view(view).size({width, height}); 57 | } 58 | 59 | void resizeWindow(const std::string &view, const Size &size) { 60 | Window::current().view(view).size({size.width, size.height}); 61 | } 62 | 63 | Rect selectROI(const std::string &windowName, void *img, bool showCrosshair, 64 | bool fromCenter) { 65 | // TODO 66 | #if CV_MAJOR_VERSION > 2 67 | auto rect = 68 | cv::selectROI(windowName, (cv::InputArray)img, showCrosshair, fromCenter); 69 | return Rect(rect.x, rect.y, rect.width, rect.height); 70 | #else 71 | return Rect(-1, -1, -1, -1); 72 | #endif 73 | } 74 | 75 | Rect selectROI(void *img, bool showCrosshair, bool fromCenter) { 76 | // TODO 77 | #if CV_MAJOR_VERSION > 2 78 | auto rect = cv::selectROI((cv::InputArray)img, showCrosshair, fromCenter); 79 | return Rect(rect.x, rect.y, rect.width, rect.height); 80 | #else 81 | return Rect(-1, -1, -1, -1); 82 | #endif 83 | } 84 | 85 | void selectROIs(const std::string &windowName, void *img, 86 | std::vector &boundingBoxes, bool showCrosshair, 87 | bool fromCenter) { 88 | // TODO 89 | #if CV_MAJOR_VERSION > 2 90 | std::vector boxes; 91 | for (auto b : boundingBoxes) { 92 | boxes.push_back(cv::Rect(b.x, b.y, b.width, b.height)); 93 | } 94 | cv::selectROIs(windowName, (cv::InputArray)img, boxes, showCrosshair, 95 | fromCenter); 96 | #endif 97 | } 98 | 99 | void setMouseCallback(const std::string &view, MouseCallback onMouse, 100 | void *userdata) { 101 | Window::current().view(view).mouse(onMouse, userdata); 102 | } 103 | 104 | void setTrackbarMax(const std::string &trackbarname, const std::string &winname, 105 | int maxval) { 106 | // TODO 107 | #if CV_MAJOR_VERSION > 2 108 | cv::setTrackbarMax(trackbarname, winname, maxval); 109 | #endif 110 | } 111 | 112 | void setTrackbarMin(const std::string &trackbarname, const std::string &winname, 113 | int minval) { 114 | // TODO 115 | #if CV_MAJOR_VERSION > 2 116 | cv::setTrackbarMin(trackbarname, winname, minval); 117 | #endif 118 | } 119 | 120 | void setTrackbarPos(const std::string &trackbarname, const std::string &winname, 121 | int pos) { 122 | // TODO 123 | cv::setTrackbarPos(trackbarname, winname, pos); 124 | } 125 | 126 | void setWindowProperty(const std::string &winname, int prop_id, 127 | double prop_value) { 128 | // TODO 129 | cv::setWindowProperty(winname, prop_id, prop_value); 130 | } 131 | 132 | void setWindowTitle(const std::string &view, const std::string &title) { 133 | Window::current().view(view).title(title); 134 | } 135 | 136 | int startWindowThread() { 137 | // TODO 138 | return cv::startWindowThread(); 139 | } 140 | 141 | int waitKey(int delay) { return Util::key(delay); } 142 | 143 | int waitKeyEx(int delay) { return Util::key(delay); } 144 | 145 | } // namespace cvplot 146 | -------------------------------------------------------------------------------- /src/cvplotlib/internal.h: -------------------------------------------------------------------------------- 1 | #ifndef CVPLOT_INTERNAL_H 2 | #define CVPLOT_INTERNAL_H 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | #define EXPECT_EQ(a__, b__) \ 10 | do { \ 11 | if ((a__) != (b__)) { \ 12 | std::cerr << "Incorrect " << #a__ << " (" << (a__) << "), should equal " \ 13 | << (b__) << std::endl; \ 14 | exit(-1); \ 15 | } \ 16 | } while (0) 17 | 18 | namespace cvplot { 19 | 20 | static const int paleness = 32; 21 | 22 | static uint8_t channel2pale(uint8_t c) { 23 | return c * (255 - 2 * paleness) / 255 + paleness; 24 | } 25 | 26 | static cv::Scalar color2scalar(const Color &color) { 27 | return cv::Scalar(channel2pale(color.b), channel2pale(color.g), 28 | channel2pale(color.r)); 29 | } 30 | 31 | static float value2snap(float value) { 32 | return std::max({pow(10, floor(log10(value))), 33 | pow(10, floor(log10(value / 2))) * 2, 34 | pow(10, floor(log10(value / 5))) * 5}); 35 | } 36 | 37 | class Trans { 38 | public: 39 | Trans(void *buffer) : Trans(*(cv::Mat *)buffer) {} 40 | 41 | Trans(cv::Mat &buffer) : original_(buffer), alpha_(0), interim_(NULL) {} 42 | 43 | Trans(cv::Mat &buffer, int alpha) : Trans(buffer) { setup(alpha); } 44 | 45 | ~Trans() { flush(); } 46 | 47 | cv::Mat &get() const { return (interim_ != NULL ? *interim_ : original_); } 48 | 49 | void setup(int alpha) { 50 | bool transparent = (alpha != 255); 51 | if (transparent) { 52 | interim_ = new cv::Mat(); 53 | original_.copyTo(*interim_); 54 | } 55 | alpha_ = alpha; 56 | } 57 | 58 | void flush() { 59 | if (interim_) { 60 | // std::cerr << "blending " << alpha_ << std::endl; 61 | auto weight = alpha_ / 255.f; 62 | cv::addWeighted(*interim_, weight, original_, 1 - weight, 0, original_); 63 | delete interim_; 64 | interim_ = NULL; 65 | } 66 | } 67 | 68 | cv::Mat &with(int alpha) { 69 | if (alpha != alpha_) { 70 | flush(); 71 | setup(alpha); 72 | } 73 | return get(); 74 | } 75 | 76 | cv::Mat &with(const Color &color) { return with(color.a); } 77 | 78 | protected: 79 | int alpha_; 80 | cv::Mat &original_; 81 | cv::Mat *interim_; 82 | }; 83 | 84 | } // namespace cvplot 85 | 86 | #endif // CVPLOT_INTERNAL_H 87 | -------------------------------------------------------------------------------- /src/cvplotlib/window.cc: -------------------------------------------------------------------------------- 1 | #include "window.h" 2 | #include "internal.h" 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | namespace cvplot { 10 | 11 | namespace { 12 | Window *shared_window = NULL; 13 | int shared_index = 0; 14 | clock_t shared_time = clock(); 15 | } // namespace 16 | 17 | float runtime() { return (float)(clock() - shared_time) / CLOCKS_PER_SEC; } 18 | 19 | void mouse_callback(int event, int x, int y, int flags, void *window) { 20 | ((Window *)window)->onmouse(event, x, y, flags); 21 | } 22 | 23 | // View 24 | 25 | View &View::resize(Rect rect) { 26 | rect_ = rect; 27 | window_.dirty(); 28 | return *this; 29 | } 30 | 31 | View &View::size(Size size) { 32 | rect_.width = size.width; 33 | rect_.height = size.height; 34 | window_.dirty(); 35 | return *this; 36 | } 37 | 38 | View &View::offset(Offset offset) { 39 | rect_.x = offset.x; 40 | rect_.y = offset.y; 41 | window_.dirty(); 42 | return *this; 43 | } 44 | 45 | View &View::autosize() { 46 | size({0, 0}); 47 | return *this; 48 | } 49 | 50 | View &View::title(const std::string &title) { 51 | title_ = title; 52 | window_.dirty(); 53 | return *this; 54 | } 55 | 56 | View &View::alpha(int alpha) { 57 | background_color_ = background_color_.alpha(alpha); 58 | frame_color_ = frame_color_.alpha(alpha); 59 | text_color_ = text_color_.alpha(alpha); 60 | window_.dirty(); 61 | return *this; 62 | } 63 | 64 | View &View::backgroundColor(Color color) { 65 | background_color_ = color; 66 | window_.dirty(); 67 | return *this; 68 | } 69 | 70 | View &View::frameColor(Color color) { 71 | frame_color_ = color; 72 | window_.dirty(); 73 | return *this; 74 | } 75 | 76 | View &View::textColor(Color color) { 77 | text_color_ = color; 78 | window_.dirty(); 79 | return *this; 80 | } 81 | 82 | View &View::mouse(MouseCallback callback, void *param) { 83 | mouse_callback_ = callback; 84 | mouse_param_ = (param == NULL ? this : param); 85 | return *this; 86 | } 87 | 88 | Color View::backgroundColor() { return background_color_; } 89 | 90 | Color View::frameColor() { return frame_color_; } 91 | 92 | Color View::textColor() { return text_color_; } 93 | std::string &View::title() { return title_; } 94 | 95 | void View::drawRect(Rect rect, Color color) { 96 | Trans trans(window_.buffer()); 97 | cv::rectangle(trans.with(color), {rect_.x + rect.x, rect_.y + rect.y}, 98 | {rect_.x + rect.x + rect.width, rect_.y + rect.y + rect.height}, 99 | color2scalar(color), -1); 100 | window_.dirty(); 101 | } 102 | 103 | void View::drawText(const std::string &text, Offset offset, Color color) const { 104 | auto face = cv::FONT_HERSHEY_SIMPLEX; 105 | auto scale = 0.4f; 106 | auto thickness = 1.f; 107 | int baseline; 108 | cv::Size size = getTextSize(text, face, scale, thickness, &baseline); 109 | cv::Point org(rect_.x + offset.x, rect_.y + size.height + offset.y); 110 | Trans trans(window_.buffer()); 111 | cv::putText(trans.with(color), text.c_str(), org, face, scale, 112 | color2scalar(color), thickness); 113 | window_.dirty(); 114 | } 115 | 116 | void View::drawFrame(const std::string &title) const { 117 | Trans trans(window_.buffer()); 118 | cv::rectangle(trans.with(background_color_), {rect_.x, rect_.y}, 119 | {rect_.x + rect_.width - 1, rect_.y + rect_.height - 1}, 120 | color2scalar(background_color_), 1); 121 | cv::rectangle(trans.with(frame_color_), {rect_.x + 1, rect_.y + 1}, 122 | {rect_.x + rect_.width - 2, rect_.y + rect_.height - 2}, 123 | color2scalar(frame_color_), 1); 124 | cv::rectangle(trans.with(frame_color_), {rect_.x + 2, rect_.y + 2}, 125 | {rect_.x + rect_.width - 3, rect_.y + 16}, 126 | color2scalar(frame_color_), -1); 127 | int baseline; 128 | cv::Size size = 129 | getTextSize(title.c_str(), cv::FONT_HERSHEY_PLAIN, 1.f, 1.f, &baseline); 130 | cv::putText(trans.with(text_color_), title.c_str(), 131 | {rect_.x + 2 + (rect_.width - size.width) / 2, rect_.y + 14}, 132 | cv::FONT_HERSHEY_PLAIN, 1.f, color2scalar(text_color_), 1.f); 133 | window_.dirty(); 134 | } 135 | 136 | void View::drawImage(const void *image, int alpha) { 137 | auto &img = *(cv::Mat *)image; 138 | if (rect_.width == 0 && rect_.height == 0) { 139 | rect_.width = img.cols; 140 | rect_.height = img.rows; 141 | } 142 | window_.ensure(rect_); 143 | Trans trans(window_.buffer()); 144 | if (img.cols != rect_.width || img.rows != rect_.height) { 145 | cv::Mat resized; 146 | cv::resize(img, resized, {rect_.width, rect_.height}); 147 | resized.copyTo( 148 | trans.with(alpha)({rect_.x, rect_.y, rect_.width, rect_.height})); 149 | } else { 150 | img.copyTo( 151 | trans.with(alpha)({rect_.x, rect_.y, rect_.width, rect_.height})); 152 | } 153 | window_.dirty(); 154 | } 155 | 156 | void View::drawFill(Color color) { 157 | Trans trans(window_.buffer()); 158 | cv::rectangle(trans.with(color), {rect_.x, rect_.y}, 159 | {rect_.x + rect_.width - 1, rect_.y + rect_.height - 1}, 160 | color2scalar(color), -1); 161 | window_.dirty(); 162 | } 163 | 164 | void *View::buffer(Rect &rect) { 165 | window_.ensure(rect_); 166 | rect = rect_; 167 | return window_.buffer(); 168 | } 169 | 170 | void View::finish() { 171 | if (!frameless_) { 172 | drawFrame(title_); 173 | } 174 | window_.dirty(); 175 | } 176 | 177 | void View::flush() { window_.flush(); } 178 | 179 | bool View::has(Offset offset) { 180 | return offset.x >= rect_.x && offset.y >= rect_.y && 181 | offset.x < rect_.x + rect_.width && offset.y < rect_.y + rect_.height; 182 | } 183 | 184 | void View::onmouse(int event, int x, int y, int flags) { 185 | if (mouse_callback_ != NULL) { 186 | mouse_callback_(event, x, y, flags, mouse_param_); 187 | } 188 | } 189 | 190 | void View::hide(bool hidden) { 191 | if (hidden_ != hidden) { 192 | hidden_ = hidden; 193 | drawFill(); 194 | } 195 | } 196 | 197 | // Window 198 | 199 | Window::Window(const std::string &title) 200 | : offset_(0, 0), 201 | buffer_(NULL), 202 | title_(title), 203 | dirty_(false), 204 | flush_time_(0), 205 | fps_(1), 206 | hidden_(false), 207 | show_cursor_(false), 208 | cursor_(-10, -10), 209 | name_("cvplot_" + std::to_string(shared_index++)) {} 210 | 211 | void *Window::buffer() { return buffer_; } 212 | 213 | Window &Window::resize(Rect rect) { 214 | offset({rect.x, rect.y}); 215 | size({rect.width, rect.height}); 216 | return *this; 217 | } 218 | 219 | Window &Window::size(Size size) { 220 | auto &buffer = *(new cv::Mat(cv::Size(size.width, size.height), CV_8UC3, 221 | color2scalar(Gray))); 222 | if (buffer_ != NULL) { 223 | auto ¤t = *(cv::Mat *)buffer_; 224 | if (current.cols > 0 && current.rows > 0 && size.width > 0 && 225 | size.height > 0) { 226 | cv::Rect inter(0, 0, std::min(current.cols, size.width), 227 | std::min(current.rows, size.height)); 228 | current(inter).copyTo(buffer(inter)); 229 | } 230 | delete ¤t; 231 | } 232 | buffer_ = &buffer; 233 | dirty(); 234 | return *this; 235 | } 236 | 237 | Window &Window::offset(Offset offset) { 238 | offset_ = offset; 239 | cv::namedWindow(name_, cv::WINDOW_AUTOSIZE); 240 | cv::moveWindow(name_, offset.x, offset.y); 241 | return *this; 242 | } 243 | 244 | Window &Window::title(const std::string &title) { 245 | title_ = title; 246 | return *this; 247 | } 248 | 249 | Window &Window::fps(float fps) { 250 | fps_ = fps; 251 | return *this; 252 | } 253 | 254 | Window &Window::cursor(bool cursor) { 255 | show_cursor_ = cursor; 256 | return *this; 257 | } 258 | 259 | Window &Window::ensure(Rect rect) { 260 | if (buffer_ == NULL) { 261 | size({rect.x + rect.width, rect.y + rect.height}); 262 | } else { 263 | auto &b = *(cv::Mat *)buffer_; 264 | if (rect.x + rect.width > b.cols || rect.y + rect.height > b.rows) { 265 | size({std::max(b.cols, rect.x + rect.width), 266 | std::max(b.rows, rect.y + rect.height)}); 267 | } 268 | } 269 | return *this; 270 | } 271 | 272 | void Window::onmouse(int event, int x, int y, int flags) { 273 | for (auto &pair : views_) { 274 | auto &view = pair.second; 275 | if (view.has({x, y})) { 276 | view.onmouse(event, x, y, flags); 277 | break; 278 | } 279 | } 280 | cursor_ = {x, y}; 281 | if (show_cursor_) { 282 | dirty(); 283 | flush(); 284 | } 285 | } 286 | 287 | void Window::flush() { 288 | if (dirty_ && buffer_ != NULL) { 289 | auto b = (cv::Mat *)buffer_; 290 | if (b->cols > 0 && b->rows > 0) { 291 | cv::Mat mat; 292 | if (show_cursor_) { 293 | b->copyTo(mat); 294 | cv::line(mat, {cursor_.x - 4, cursor_.y + 1}, 295 | {cursor_.x + 6, cursor_.y + 1}, color2scalar(White), 1); 296 | cv::line(mat, {cursor_.x + 1, cursor_.y - 4}, 297 | {cursor_.x + 1, cursor_.y + 6}, color2scalar(White), 1); 298 | cv::line(mat, {cursor_.x - 5, cursor_.y}, {cursor_.x + 5, cursor_.y}, 299 | color2scalar(Black), 1); 300 | cv::line(mat, {cursor_.x, cursor_.y - 5}, {cursor_.x, cursor_.y + 5}, 301 | color2scalar(Black), 1); 302 | b = &mat; 303 | } 304 | cv::namedWindow(name_, cv::WINDOW_AUTOSIZE); 305 | #if CV_MAJOR_VERSION > 2 306 | cv::setWindowTitle(name_, title_); 307 | #endif 308 | cv::imshow(name_.c_str(), *b); 309 | cv::setMouseCallback(name_.c_str(), mouse_callback, this); 310 | Util::sleep(); 311 | } 312 | } 313 | dirty_ = false; 314 | flush_time_ = runtime(); 315 | } 316 | 317 | View &Window::view(const std::string &name, Size size) { 318 | if (views_.count(name) == 0) { 319 | views_.insert( 320 | std::map::value_type(name, View(*this, name, size))); 321 | } 322 | return views_.at(name); 323 | } 324 | 325 | void Window::tick() { 326 | if (fps_ > 0 && (runtime() - flush_time_) > 1.f / fps_) { 327 | flush(); 328 | } 329 | } 330 | 331 | void Window::dirty() { dirty_ = true; } 332 | 333 | void Window::hide(bool hidden) { 334 | if (hidden_ != hidden) { 335 | hidden_ = hidden; 336 | if (hidden) { 337 | cv::destroyWindow(name_.c_str()); 338 | } else { 339 | dirty(); 340 | flush(); 341 | } 342 | } 343 | } 344 | 345 | Window &Window::current() { 346 | if (shared_window == NULL) { 347 | shared_window = new Window(""); 348 | } 349 | return *(Window *)shared_window; 350 | } 351 | 352 | Window &Window::current(const std::string &title) { 353 | shared_window = new Window(title); 354 | return *(Window *)shared_window; 355 | } 356 | 357 | void Window::current(Window &window) { shared_window = &window; } 358 | 359 | // Util 360 | 361 | void Util::sleep(float seconds) { 362 | cvWaitKey(std::max(1, (int)(seconds * 1000))); 363 | } 364 | 365 | char Util::key(float timeout) { 366 | return cvWaitKey(std::max(0, (int)(timeout * 1000))); 367 | } 368 | 369 | std::string Util::line(float timeout) { 370 | std::stringstream stream; 371 | auto ms = (timeout > 0 ? std::max(1, (int)(timeout * 1000)) : -1); 372 | while (ms != 0) { 373 | auto key = cvWaitKey(1); 374 | if (key == -1) { 375 | ms--; 376 | continue; 377 | } 378 | if (key == '\r' || key <= '\n') { 379 | break; 380 | } else if (key == '\b' || key == 127) { 381 | auto s = stream.str(); 382 | stream = std::stringstream(); 383 | if (s.length() > 0) { 384 | stream << s.substr(0, s.length() - 1); 385 | } 386 | } else { 387 | stream << (char)key; 388 | } 389 | } 390 | return stream.str(); 391 | } 392 | 393 | } // namespace cvplot 394 | -------------------------------------------------------------------------------- /src/demo.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | // #include //控制cout 输出格式 6 | #include "cvplot.h" 7 | #include "opencv2/opencv.hpp" 8 | #include "GA.h" 9 | #include "demo.h" 10 | //Y=x^2*sin(3X*pi) 11 | float fun1(std::vector argv){ 12 | float x=argv[0]; 13 | return (x*x*std::sin(3*pi*x)); 14 | } 15 | void demo1(){ 16 | cv::Mat Popula; 17 | std::vector data; 18 | std::vector > recode; 19 | GA ga; 20 | ga.solve(fun1,1); 21 | //种群越大,越稳定,基因编码越多迭代越稳定 22 | Popula=ga.crtbp(); 23 | for(int i=0;i<20;i++){ 24 | ga.bs2rv(Popula,0,10); 25 | std::pair, float> best=ga.ranking(); 26 | recode.push_back(std::pair((best.first[0]),best.second)); 27 | data.push_back(recode[recode.size()-1].second); 28 | ga.select(Popula).recombin(Popula).mut(Popula); 29 | } 30 | //绘图 31 | { 32 | auto name="math"; 33 | cvplot::setWindowTitle(name,"origin curve"); 34 | cvplot::moveWindow(name, 0, 0); 35 | cvplot::resizeWindow(name, 400, 400); 36 | auto &figure=cvplot::figure(name); 37 | std::vector > data; 38 | for(float i=0;i<10;i+=0.025) 39 | data.push_back({i,i*i*std::sin(i*3*pi)}); 40 | figure.series("x^2*sin(3x*pi)").set(data).color(cvplot::Green); 41 | figure.series("recode").set(recode).type(cvplot::Dots).color(cvplot::Red); 42 | figure.border(30).show(false); 43 | } 44 | { 45 | auto name="GA"; 46 | cvplot::setWindowTitle(name,"GA"); 47 | cvplot::moveWindow(name, 400, 0); 48 | cvplot::resizeWindow(name, 400, 400); 49 | auto &figure=cvplot::figure(name); 50 | std::sort(data.begin(), data.end(), [](float &a,float &b){if(a argv){ 59 | float x=argv[0]; 60 | float y=argv[1]; 61 | return (x*std::cos(2*pi*y)+y*std::sin(2*pi*x)); 62 | } 63 | void demo2(){ 64 | cv::Mat Popula; 65 | std::vector data; 66 | std::vector > recodex,recodey; 67 | GA ga(80,80); 68 | ga.solve(fun2,2); 69 | //种群越大,越稳定,基因编码越多迭代越稳定 70 | Popula=ga.crtbp(); 71 | for(int i=0;i<80;i++){ 72 | ga.bs2rv(Popula,-2,2); 73 | std::pair, float> best=ga.ranking(); 74 | recodex.push_back(std::pair((best.first[0]),best.second)); 75 | recodey.push_back(std::pair((best.first[1]),best.second)); 76 | data.push_back(recodex[recodex.size()-1].second); 77 | ga.select(Popula).recombin(Popula).mut(Popula); 78 | } 79 | //绘图 80 | { 81 | auto name="math"; 82 | cvplot::setWindowTitle(name,"origin curve"); 83 | cvplot::moveWindow(name, 0, 0); 84 | cvplot::resizeWindow(name, 400, 400); 85 | auto &figure=cvplot::figure(name); 86 | figure.series("x-z").set(recodex).type(cvplot::Dots).color(cvplot::Green); 87 | figure.series("y-z").set(recodey).type(cvplot::Dots).color(cvplot::Red); 88 | figure.border(30).show(false); 89 | } 90 | { 91 | auto name="GA"; 92 | cvplot::setWindowTitle(name,"GA"); 93 | cvplot::moveWindow(name, 400, 0); 94 | cvplot::resizeWindow(name, 400, 400); 95 | auto &figure=cvplot::figure(name); 96 | std::sort(data.begin(), data.end(), [](float &a,float &b){if(a data; 105 | float _input[2][3]={{1,2,3},{4,5,6}}; 106 | float _output[2][2]={{1.,2.},{3.,4.}}; 107 | cv::Mat input(cv::Size(3,2),CV_32FC1,_input); 108 | cv::Mat output(cv::Size(2,2),CV_32FC1,_output); 109 | GA_BP ga(10,440); 110 | cv::Mat Popula; 111 | ga.BPsolve(input, output); 112 | Popula=ga.crtbp(); 113 | for(int i=0;i<20;i++){ 114 | ga.bs2rv(Popula,0,4); 115 | std::pair, float> best=ga.ranking(); 116 | data.push_back(best.second); 117 | ga.select(Popula,1).recombin(Popula).mut(Popula); 118 | } 119 | { 120 | auto name="GA"; 121 | cvplot::setWindowTitle(name,"GA"); 122 | cvplot::moveWindow(name, 0, 0); 123 | cvplot::resizeWindow(name, 400, 400); 124 | auto &figure=cvplot::figure(name); 125 | figure.series("count").setValue(data).color(cvplot::Orange); 126 | figure.border(30).show(); 127 | } 128 | cv::waitKey(0); 129 | } 130 | void demo4(){ 131 | float _address[14][2]={{16.47,96.10},{16.47,94.44}, 132 | {22.39,93.37},{25.23,97.24}, 133 | {20.47,97.02},{17.20,96.29}, 134 | {14.05,98.12},{22.00,96.05}, 135 | {16.53,97.38},{21.52,95.59}, 136 | {19.41,97.13},{20.09,92.55}}; 137 | std::vector data; 138 | std::vector road_recode; 139 | float min_distance=-1.0/0.0; 140 | cv::Mat address(cv::Size(2,12),CV_32FC1,_address); 141 | GA_TSP ga(100,address.rows); 142 | cv::Mat Popula; 143 | ga.TSPsolve(address); 144 | Popula=ga.crtbp(); 145 | for(int i=0;i<400;i++){ 146 | std::pair, float> best=ga.ranking(Popula); 147 | data.push_back(best.second); 148 | if(best.second>min_distance){ 149 | road_recode=best.first; 150 | min_distance=best.second; 151 | } 152 | ga.select(Popula,0).recombin(Popula,0.1).mut(Popula,0.5); 153 | } 154 | { 155 | auto name="math"; 156 | cvplot::setWindowTitle(name,"best map"); 157 | cvplot::moveWindow(name, 0, 0); 158 | cvplot::resizeWindow(name, 400, 400); 159 | auto &figure=cvplot::figure(name); 160 | figure.origin(false, false); 161 | std::vector > recode; 162 | for(int i=0;i( 164 | _address[(int)road_recode[i]][0],_address[(int)road_recode[i]][1])); 165 | recode.push_back(std::pair( 166 | _address[(int)road_recode[0]][0],_address[(int)road_recode[0]][1])); 167 | figure.series("line").set(recode).color(cvplot::Green); 168 | figure.series("point").set(recode).type(cvplot::Dots).color(cvplot::Red); 169 | 170 | figure.border(30).show(false); 171 | } 172 | { 173 | auto name="GA"; 174 | cvplot::setWindowTitle(name,"GA"); 175 | cvplot::moveWindow(name, 400, 0); 176 | cvplot::resizeWindow(name, 400, 400); 177 | auto &figure=cvplot::figure(name); 178 | std::sort(data.begin(), data.end(), [](float &a,float &b){if(a data; 190 | std::vector > recodex,recodey; 191 | QGA ga(80,80); 192 | ga.solve(fun2,2); 193 | //种群越大,越稳定,基因编码越多迭代越稳定 194 | Popula=ga.crtbp(); 195 | for(int i=0;i<80;i++){ 196 | ga.bs2rv(Popula,-2,2); 197 | std::pair, float> best=ga.ranking(); 198 | recodex.push_back(std::pair((best.first[0]),best.second)); 199 | recodey.push_back(std::pair((best.first[1]),best.second)); 200 | data.push_back(recodex[recodex.size()-1].second); 201 | ga.select(Popula); 202 | } 203 | //绘图 204 | { 205 | auto name="math"; 206 | cvplot::setWindowTitle(name,"origin curve"); 207 | cvplot::moveWindow(name, 0, 0); 208 | cvplot::resizeWindow(name, 400, 400); 209 | auto &figure=cvplot::figure(name); 210 | figure.series("x-z").set(recodex).type(cvplot::Dots).color(cvplot::Green); 211 | figure.series("y-z").set(recodey).type(cvplot::Dots).color(cvplot::Red); 212 | figure.border(30).show(false); 213 | } 214 | { 215 | auto name="GA"; 216 | cvplot::setWindowTitle(name,"GA"); 217 | cvplot::moveWindow(name, 400, 0); 218 | cvplot::resizeWindow(name, 400, 400); 219 | auto &figure=cvplot::figure(name); 220 | std::sort(data.begin(), data.end(), [](float &a,float &b){if(a argv){ 230 | float x=argv[0]; 231 | float y=argv[1]; 232 | return (x*std::cos(2*pi*y)+y*std::sin(2*pi*x)); 233 | } 234 | void demo6(){ 235 | cv::Mat Popula; 236 | std::vector data; 237 | std::vector > recodex,recodey; 238 | PSO pso(50,2,-2,2); 239 | pso.solve(fun3); 240 | //种群越大,越稳定,基因编码越多迭代越稳定 241 | pso.crtbp(); 242 | for(int i=0;i<80;i++){ 243 | std::pair, float> best=pso.ranking(); 244 | recodex.push_back(std::pair((best.first[0]),best.second)); 245 | recodey.push_back(std::pair((best.first[1]),best.second)); 246 | data.push_back(recodex[recodex.size()-1].second); 247 | pso.update(1); 248 | } 249 | //绘图 250 | { 251 | auto name="math"; 252 | cvplot::setWindowTitle(name,"origin curve"); 253 | cvplot::moveWindow(name, 0, 0); 254 | cvplot::resizeWindow(name, 400, 400); 255 | auto &figure=cvplot::figure(name); 256 | figure.series("x-z").set(recodex).type(cvplot::Dots).color(cvplot::Green); 257 | figure.series("y-z").set(recodey).type(cvplot::Dots).color(cvplot::Red); 258 | figure.border(30).show(false); 259 | } 260 | { 261 | auto name="PSO"; 262 | cvplot::setWindowTitle(name,"PSOq"); 263 | cvplot::moveWindow(name, 400, 0); 264 | cvplot::resizeWindow(name, 400, 400); 265 | auto &figure=cvplot::figure(name); 266 | // std::sort(data.begin(), data.end(), [](float &a,float &b){if(a 2 | #include 3 | #include 4 | #include 5 | // #include //控制cout 输出格式 6 | #include "cvplot.h" 7 | #include "opencv2/opencv.hpp" 8 | #include "GA.h" 9 | #include "demo.h" 10 | 11 | int main(int argc, const char** argv) 12 | { 13 | srand(time(NULL)); 14 | // demo1(); 15 | // demo2(); 16 | // demo3(); 17 | // demo4(); 18 | // demo5(); 19 | demo6(); 20 | // std::cout<<(float)(std::sin(3.14159265358979323846))<