├── .codedocs
├── .github
└── workflows
│ ├── build-pyclustering.yml
│ ├── test-pypi-installer.yml
│ └── test-testpypi-installer.yml
├── .gitignore
├── .travis.yml
├── CHANGES
├── LICENSE
├── MANIFEST.in
├── PKG-INFO.rst
├── README.rst
├── appveyor.yml
├── ccore
├── .cproject
├── .project
├── CMakeLists.txt
├── bvt
│ ├── CMakeLists.txt
│ ├── bvt-shared.vcxproj
│ ├── bvt-static.vcxproj
│ ├── shared-test.cpp
│ └── static-test.cpp
├── ccore.mk
├── ccore.sln
├── external
│ ├── CMakeLists.txt
│ ├── include
│ │ └── gtest
│ │ │ └── gtest.h
│ ├── libs
│ │ ├── linux
│ │ │ ├── x64
│ │ │ │ └── .linux.x64.libs
│ │ │ └── x86
│ │ │ │ └── .linux.x86.libs
│ │ └── windows
│ │ │ ├── x64
│ │ │ └── .win.x64.libs
│ │ │ └── x86
│ │ │ └── .win.x86.libs
│ └── src
│ │ └── gtest
│ │ └── gtest-all.cpp
├── include
│ └── pyclustering
│ │ ├── cluster
│ │ ├── agglomerative.hpp
│ │ ├── bsas.hpp
│ │ ├── bsas_data.hpp
│ │ ├── center_initializer.hpp
│ │ ├── clique.hpp
│ │ ├── clique_block.hpp
│ │ ├── clique_data.hpp
│ │ ├── cluster_data.hpp
│ │ ├── cure.hpp
│ │ ├── cure_data.hpp
│ │ ├── data_type.hpp
│ │ ├── dbscan.hpp
│ │ ├── dbscan_data.hpp
│ │ ├── elbow.hpp
│ │ ├── elbow_data.hpp
│ │ ├── fcm.hpp
│ │ ├── fcm_data.hpp
│ │ ├── gmeans.hpp
│ │ ├── gmeans_data.hpp
│ │ ├── hsyncnet.hpp
│ │ ├── kmeans.hpp
│ │ ├── kmeans_data.hpp
│ │ ├── kmeans_plus_plus.hpp
│ │ ├── kmedians.hpp
│ │ ├── kmedians_data.hpp
│ │ ├── kmedoids.hpp
│ │ ├── kmedoids_data.hpp
│ │ ├── mbsas.hpp
│ │ ├── mbsas_data.hpp
│ │ ├── optics.hpp
│ │ ├── optics_data.hpp
│ │ ├── optics_descriptor.hpp
│ │ ├── ordering_analyser.hpp
│ │ ├── pam_build.hpp
│ │ ├── random_center_initializer.hpp
│ │ ├── rock.hpp
│ │ ├── silhouette.hpp
│ │ ├── silhouette_data.hpp
│ │ ├── silhouette_ksearch.hpp
│ │ ├── silhouette_ksearch_data.hpp
│ │ ├── somsc.hpp
│ │ ├── somsc_data.hpp
│ │ ├── syncnet.hpp
│ │ ├── ttsas.hpp
│ │ ├── ttsas_data.hpp
│ │ ├── xmeans.hpp
│ │ └── xmeans_data.hpp
│ │ ├── container
│ │ ├── adjacency.hpp
│ │ ├── adjacency_bit_matrix.hpp
│ │ ├── adjacency_connector.hpp
│ │ ├── adjacency_factory.hpp
│ │ ├── adjacency_list.hpp
│ │ ├── adjacency_matrix.hpp
│ │ ├── adjacency_weight_list.hpp
│ │ ├── dynamic_data.hpp
│ │ ├── ensemble_data.hpp
│ │ ├── kdnode.hpp
│ │ ├── kdtree.hpp
│ │ ├── kdtree_balanced.hpp
│ │ └── kdtree_searcher.hpp
│ │ ├── definitions.hpp
│ │ ├── differential
│ │ ├── differ_factor.hpp
│ │ ├── differ_state.hpp
│ │ ├── equation.hpp
│ │ ├── runge_kutta_4.hpp
│ │ ├── runge_kutta_fehlberg_45.hpp
│ │ └── solve_type.hpp
│ │ ├── interface
│ │ ├── agglomerative_interface.h
│ │ ├── bsas_interface.h
│ │ ├── clique_interface.h
│ │ ├── cure_interface.h
│ │ ├── dbscan_interface.h
│ │ ├── elbow_interface.h
│ │ ├── fcm_interface.h
│ │ ├── gmeans_interface.h
│ │ ├── hhn_interface.h
│ │ ├── hsyncnet_interface.h
│ │ ├── interface_property.h
│ │ ├── kmeans_interface.h
│ │ ├── kmedians_interface.h
│ │ ├── kmedoids_interface.h
│ │ ├── legion_interface.h
│ │ ├── mbsas_interface.h
│ │ ├── metric_interface.h
│ │ ├── optics_interface.h
│ │ ├── pam_build_interface.h
│ │ ├── pcnn_interface.h
│ │ ├── pyclustering_interface.h
│ │ ├── pyclustering_package.hpp
│ │ ├── rock_interface.h
│ │ ├── silhouette_interface.h
│ │ ├── som_interface.h
│ │ ├── sync_interface.h
│ │ ├── syncnet_interface.h
│ │ ├── syncpr_interface.h
│ │ ├── ttsas_interface.h
│ │ └── xmeans_interface.h
│ │ ├── nnet
│ │ ├── dynamic_analyser.hpp
│ │ ├── hhn.hpp
│ │ ├── legion.hpp
│ │ ├── network.hpp
│ │ ├── pcnn.hpp
│ │ ├── som.hpp
│ │ ├── sync.hpp
│ │ └── syncpr.hpp
│ │ ├── parallel
│ │ ├── parallel.hpp
│ │ ├── spinlock.hpp
│ │ ├── task.hpp
│ │ ├── thread_executor.hpp
│ │ └── thread_pool.hpp
│ │ └── utils
│ │ ├── algorithm.hpp
│ │ ├── linalg.hpp
│ │ ├── math.hpp
│ │ ├── metric.hpp
│ │ ├── random.hpp
│ │ ├── stats.hpp
│ │ └── traits.hpp
├── makefile
├── src
│ ├── CMakeLists.txt
│ ├── cluster
│ │ ├── agglomerative.cpp
│ │ ├── bsas.cpp
│ │ ├── clique.cpp
│ │ ├── clique_block.cpp
│ │ ├── cluster_data.cpp
│ │ ├── cure.cpp
│ │ ├── dbscan.cpp
│ │ ├── fcm.cpp
│ │ ├── gmeans.cpp
│ │ ├── hsyncnet.cpp
│ │ ├── kmeans.cpp
│ │ ├── kmeans_data.cpp
│ │ ├── kmeans_plus_plus.cpp
│ │ ├── kmedians.cpp
│ │ ├── kmedoids.cpp
│ │ ├── mbsas.cpp
│ │ ├── optics.cpp
│ │ ├── optics_descriptor.cpp
│ │ ├── ordering_analyser.cpp
│ │ ├── pam_build.cpp
│ │ ├── random_center_initializer.cpp
│ │ ├── rock.cpp
│ │ ├── silhouette.cpp
│ │ ├── silhouette_ksearch.cpp
│ │ ├── silhouette_ksearch_data.cpp
│ │ ├── somsc.cpp
│ │ ├── syncnet.cpp
│ │ ├── ttsas.cpp
│ │ └── xmeans.cpp
│ ├── container
│ │ ├── adjacency_bit_matrix.cpp
│ │ ├── adjacency_connector.cpp
│ │ ├── adjacency_factory.cpp
│ │ ├── adjacency_list.cpp
│ │ ├── adjacency_matrix.cpp
│ │ ├── adjacency_weight_list.cpp
│ │ ├── kdnode.cpp
│ │ ├── kdtree.cpp
│ │ ├── kdtree_balanced.cpp
│ │ └── kdtree_searcher.cpp
│ ├── differential
│ │ └── differ_factor.cpp
│ ├── interface
│ │ ├── agglomerative_interface.cpp
│ │ ├── bsas_interface.cpp
│ │ ├── clique_interface.cpp
│ │ ├── cure_interface.cpp
│ │ ├── dbscan_interface.cpp
│ │ ├── elbow_interface.cpp
│ │ ├── fcm_interface.cpp
│ │ ├── gmeans_interface.cpp
│ │ ├── hhn_interface.cpp
│ │ ├── hsyncnet_interface.cpp
│ │ ├── interface_property.cpp
│ │ ├── kmeans_interface.cpp
│ │ ├── kmedians_interface.cpp
│ │ ├── kmedoids_interface.cpp
│ │ ├── legion_interface.cpp
│ │ ├── mbsas_interface.cpp
│ │ ├── metric_interface.cpp
│ │ ├── optics_interface.cpp
│ │ ├── pam_build_interface.cpp
│ │ ├── pcnn_interface.cpp
│ │ ├── pyclustering_interface.cpp
│ │ ├── pyclustering_package.cpp
│ │ ├── rock_interface.cpp
│ │ ├── silhouette_interface.cpp
│ │ ├── som_interface.cpp
│ │ ├── sync_interface.cpp
│ │ ├── syncnet_interface.cpp
│ │ ├── syncpr_interface.cpp
│ │ ├── ttsas_interface.cpp
│ │ └── xmeans_interface.cpp
│ ├── nnet
│ │ ├── dynamic_analyser.cpp
│ │ ├── hhn.cpp
│ │ ├── legion.cpp
│ │ ├── pcnn.cpp
│ │ ├── som.cpp
│ │ ├── sync.cpp
│ │ └── syncpr.cpp
│ ├── parallel
│ │ ├── spinlock.cpp
│ │ ├── task.cpp
│ │ ├── thread_executor.cpp
│ │ └── thread_pool.cpp
│ ├── pyclustering-shared.vcxproj
│ ├── pyclustering-shared.vcxproj.filters
│ ├── pyclustering-static.vcxproj
│ ├── pyclustering-static.vcxproj.filters
│ └── utils
│ │ ├── linalg.cpp
│ │ ├── math.cpp
│ │ ├── metric.cpp
│ │ ├── random.cpp
│ │ └── stats.cpp
├── tst
│ ├── CMakeLists.txt
│ ├── answer.hpp
│ ├── answer_reader.cpp
│ ├── answer_reader.hpp
│ ├── gtest.vcxproj
│ ├── gtest.vcxproj.filters
│ ├── main.cpp
│ ├── samples.cpp
│ ├── samples.hpp
│ ├── ut-runner.py
│ ├── ut-shared.vcxproj
│ ├── ut-shared.vcxproj.filters
│ ├── ut-static.vcxproj
│ ├── ut-static.vcxproj.filters
│ ├── utenv_check.cpp
│ ├── utenv_check.hpp
│ ├── utenv_utils.cpp
│ ├── utenv_utils.hpp
│ ├── utest-adjacency.cpp
│ ├── utest-adjacency.hpp
│ ├── utest-adjacency_bit_matrix.cpp
│ ├── utest-adjacency_connector.cpp
│ ├── utest-adjacency_list.cpp
│ ├── utest-adjacency_matrix.cpp
│ ├── utest-adjacency_weight_list.cpp
│ ├── utest-agglomerative.cpp
│ ├── utest-bsas.cpp
│ ├── utest-clique.cpp
│ ├── utest-cure.cpp
│ ├── utest-dbscan.cpp
│ ├── utest-differential.cpp
│ ├── utest-dynamic_analyser.cpp
│ ├── utest-elbow.cpp
│ ├── utest-elbow.hpp
│ ├── utest-fcm.cpp
│ ├── utest-gmeans.cpp
│ ├── utest-hhn.cpp
│ ├── utest-hsyncnet.cpp
│ ├── utest-interface-agglomerative.cpp
│ ├── utest-interface-bsas.cpp
│ ├── utest-interface-clique.cpp
│ ├── utest-interface-cure.cpp
│ ├── utest-interface-dbscan.cpp
│ ├── utest-interface-elbow.cpp
│ ├── utest-interface-fcm.cpp
│ ├── utest-interface-gmeans.cpp
│ ├── utest-interface-hhn.cpp
│ ├── utest-interface-hsyncnet.cpp
│ ├── utest-interface-kmeans.cpp
│ ├── utest-interface-kmedians.cpp
│ ├── utest-interface-kmedoids.cpp
│ ├── utest-interface-legion.cpp
│ ├── utest-interface-mbsas.cpp
│ ├── utest-interface-metric.cpp
│ ├── utest-interface-optics.cpp
│ ├── utest-interface-pam_build.cpp
│ ├── utest-interface-pcnn.cpp
│ ├── utest-interface-pyclustering.cpp
│ ├── utest-interface-silhouette.cpp
│ ├── utest-interface-som.cpp
│ ├── utest-interface-sync.cpp
│ ├── utest-interface-syncnet.cpp
│ ├── utest-interface-syncpr.cpp
│ ├── utest-interface-ttsas.cpp
│ ├── utest-interface-xmeans.cpp
│ ├── utest-kdtree.cpp
│ ├── utest-kmeans.cpp
│ ├── utest-kmeans_plus_plus.cpp
│ ├── utest-kmedians.cpp
│ ├── utest-kmedoids.cpp
│ ├── utest-legion.cpp
│ ├── utest-linalg.cpp
│ ├── utest-mbsas.cpp
│ ├── utest-optics.cpp
│ ├── utest-ordering_analyser.cpp
│ ├── utest-pam_build.cpp
│ ├── utest-parallel_for.cpp
│ ├── utest-pcnn.cpp
│ ├── utest-random_center_initializer.cpp
│ ├── utest-rock.cpp
│ ├── utest-silhouette.cpp
│ ├── utest-silhouette_ksearch.cpp
│ ├── utest-som.cpp
│ ├── utest-somsc.cpp
│ ├── utest-spinlock.cpp
│ ├── utest-stats.cpp
│ ├── utest-sync.cpp
│ ├── utest-syncnet.cpp
│ ├── utest-syncpr.cpp
│ ├── utest-thread_pool.cpp
│ ├── utest-ttsas.cpp
│ ├── utest-utils-algorithm.cpp
│ ├── utest-utils-metric.cpp
│ └── utest-xmeans.cpp
└── utcore.mk
├── ci
├── appveyor-ci.ps1
├── cloud
│ ├── __init__.py
│ ├── __main__.py
│ ├── cloud
│ │ ├── __init__.py
│ │ ├── task.py
│ │ ├── task_handler.py
│ │ └── yandex_disk.py
│ └── tests
│ │ ├── __init__.py
│ │ └── test_cloud.py
├── github-ci.sh
└── travis-ci.sh
├── docs
├── citation.bib
├── doxygen_conf_ccore
├── doxygen_conf_pyclustering
├── img
│ ├── agglomerative_lsun_clustering_single_link.png
│ ├── bang_blocks_chainlink.png
│ ├── bang_clustering_chainlink.png
│ ├── bang_dendrogram_chainlink.png
│ ├── birch_cf_encoding_lsun.png
│ ├── birch_clustering_old_faithful.png
│ ├── clique_clustering_target.png
│ ├── clique_clustering_with_noise.png
│ ├── dbscan_atom_visualizer.png
│ ├── elbow_example_simple_03.png
│ ├── ema_old_faithful_clustering.png
│ ├── example_cluster_place.png
│ ├── fcm_segmentation_stpetersburg.png
│ ├── fcps_cluster_analysis.png
│ ├── fsync_sync_examples.png
│ ├── ga_clustering_sample_simple_04.png
│ ├── gmeans_example_clustering.png
│ ├── gmeans_hepta_multidim_visualizer.png
│ ├── gmeans_lsun_multidim_visualizer.png
│ ├── hhn_architecture.drawio
│ ├── hhn_architecture.png
│ ├── hhn_three_ensembles.png
│ ├── kd_tree_balanced_lsun.png
│ ├── kd_tree_balanced_two_diamonds.png
│ ├── kd_tree_unbalanced_two_diamonds.png
│ ├── kmeans_example_clustering.png
│ ├── kmeans_plusplus_initializer_results.png
│ ├── optics_example_clustering.png
│ ├── optics_noise_tetra.png
│ ├── pam_build_initial_medoids.png
│ ├── pam_clustering_tetra.png
│ ├── pam_clustering_two_diamonds.png
│ ├── pyclustering_build_msvc.png
│ ├── silhouette_ksearch_hepta.png
│ ├── silhouette_score_for_various_K.png
│ ├── sync_partial_synchronization.png
│ ├── sync_som_image_segmentation.png
│ ├── target_som_processing.png
│ ├── xmeans_clustering_famous_iris.png
│ ├── xmeans_clustering_famous_iris_filtered.png
│ ├── xmeans_clustering_mndl_target.png
│ └── xmeans_clustering_simple3.png
├── logo
│ ├── pyclustering_logo_01.png
│ ├── pyclustering_logo_01.xcf
│ ├── pyclustering_logo_01_small.png
│ ├── pyclustering_logo_02.png
│ └── pyclustering_logo_02.xcf
└── page
│ └── cpp_pyclustering_intro.md
├── paper
├── paper.bib
└── paper.md
├── pyclustering
├── __init__.py
├── cluster
│ ├── __init__.py
│ ├── agglomerative.py
│ ├── bang.py
│ ├── birch.py
│ ├── bsas.py
│ ├── center_initializer.py
│ ├── clarans.py
│ ├── clique.py
│ ├── cure.py
│ ├── dbscan.py
│ ├── elbow.py
│ ├── ema.py
│ ├── encoder.py
│ ├── examples
│ │ ├── __init__.py
│ │ ├── agglomerative_examples.py
│ │ ├── bang_example.py
│ │ ├── birch_examples.py
│ │ ├── bsas_examples.py
│ │ ├── center_initializer_examples.py
│ │ ├── clarans_examples.py
│ │ ├── clique_example.py
│ │ ├── cure_examples.py
│ │ ├── dbscan_examples.py
│ │ ├── dbscan_segmentation.py
│ │ ├── elbow_examples.py
│ │ ├── ema_examples.py
│ │ ├── fcm_examples.py
│ │ ├── ga_examples.py
│ │ ├── general_examples.py
│ │ ├── gmeans_examples.py
│ │ ├── hsyncnet_examples.py
│ │ ├── kmeans_examples.py
│ │ ├── kmeans_segmentation.py
│ │ ├── kmedians_examples.py
│ │ ├── kmedoids_examples.py
│ │ ├── mbsas_examples.py
│ │ ├── optics_examples.py
│ │ ├── rock_examples.py
│ │ ├── silhouette_examples.py
│ │ ├── somsc_examples.py
│ │ ├── syncnet_examples.py
│ │ ├── syncsom_examples.py
│ │ ├── syncsom_segmentation.py
│ │ ├── ttsas_examples.py
│ │ └── xmeans_examples.py
│ ├── fcm.py
│ ├── ga.py
│ ├── ga_maths.py
│ ├── generator.py
│ ├── gmeans.py
│ ├── hsyncnet.py
│ ├── kmeans.py
│ ├── kmedians.py
│ ├── kmedoids.py
│ ├── mbsas.py
│ ├── optics.py
│ ├── rock.py
│ ├── silhouette.py
│ ├── somsc.py
│ ├── syncnet.py
│ ├── syncsom.py
│ ├── tests
│ │ ├── __init__.py
│ │ ├── agglomerative_templates.py
│ │ ├── bang_templates.py
│ │ ├── bsas_templates.py
│ │ ├── clique_templates.py
│ │ ├── cure_templates.py
│ │ ├── dbscan_templates.py
│ │ ├── elbow_template.py
│ │ ├── fcm_templates.py
│ │ ├── gmeans_templates.py
│ │ ├── hsyncnet_templates.py
│ │ ├── integration
│ │ │ ├── __init__.py
│ │ │ ├── it_agglomerative.py
│ │ │ ├── it_bsas.py
│ │ │ ├── it_clique.py
│ │ │ ├── it_cure.py
│ │ │ ├── it_dbscan.py
│ │ │ ├── it_elbow.py
│ │ │ ├── it_fcm.py
│ │ │ ├── it_gmeans.py
│ │ │ ├── it_hsyncnet.py
│ │ │ ├── it_kmeans.py
│ │ │ ├── it_kmedians.py
│ │ │ ├── it_kmedoids.py
│ │ │ ├── it_mbsas.py
│ │ │ ├── it_optics.py
│ │ │ ├── it_rock.py
│ │ │ ├── it_silhouette.py
│ │ │ ├── it_somsc.py
│ │ │ ├── it_syncnet.py
│ │ │ ├── it_ttsas.py
│ │ │ └── it_xmeans.py
│ │ ├── kmeans_templates.py
│ │ ├── kmedians_templates.py
│ │ ├── kmedoids_templates.py
│ │ ├── mbsas_templates.py
│ │ ├── optics_templates.py
│ │ ├── rock_templates.py
│ │ ├── silhouette_templates.py
│ │ ├── somsc_templates.py
│ │ ├── syncnet_templates.py
│ │ ├── ttsas_template.py
│ │ ├── unit
│ │ │ ├── __init__.py
│ │ │ ├── ut_agglomerative.py
│ │ │ ├── ut_bang.py
│ │ │ ├── ut_birch.py
│ │ │ ├── ut_bsas.py
│ │ │ ├── ut_center_initializer.py
│ │ │ ├── ut_clarans.py
│ │ │ ├── ut_clique.py
│ │ │ ├── ut_cure.py
│ │ │ ├── ut_dbscan.py
│ │ │ ├── ut_elbow.py
│ │ │ ├── ut_ema.py
│ │ │ ├── ut_encoder.py
│ │ │ ├── ut_fcm.py
│ │ │ ├── ut_ga.py
│ │ │ ├── ut_general.py
│ │ │ ├── ut_generator.py
│ │ │ ├── ut_gmeans.py
│ │ │ ├── ut_hsyncnet.py
│ │ │ ├── ut_kmeans.py
│ │ │ ├── ut_kmedians.py
│ │ │ ├── ut_kmedoids.py
│ │ │ ├── ut_mbsas.py
│ │ │ ├── ut_optics.py
│ │ │ ├── ut_rock.py
│ │ │ ├── ut_silhouette.py
│ │ │ ├── ut_somsc.py
│ │ │ ├── ut_syncnet.py
│ │ │ ├── ut_syncsom.py
│ │ │ ├── ut_ttsas.py
│ │ │ ├── ut_visualizer.py
│ │ │ └── ut_xmeans.py
│ │ └── xmeans_templates.py
│ ├── ttsas.py
│ └── xmeans.py
├── container
│ ├── __init__.py
│ ├── cftree.py
│ ├── examples
│ │ ├── __init__.py
│ │ └── kdtree_examples.py
│ ├── kdtree.py
│ └── tests
│ │ ├── __init__.py
│ │ └── unit
│ │ ├── __init__.py
│ │ ├── ut_cftree.py
│ │ └── ut_kdtree.py
├── core
│ ├── 32-bit
│ │ ├── linux
│ │ │ └── .linux.info
│ │ ├── macos
│ │ │ └── .macos.info
│ │ └── win
│ │ │ └── .win.info
│ ├── 64-bit
│ │ ├── linux
│ │ │ └── .linux.info
│ │ ├── macos
│ │ │ └── .macos.info
│ │ └── win
│ │ │ └── .win.info
│ ├── __init__.py
│ ├── agglomerative_wrapper.py
│ ├── bsas_wrapper.py
│ ├── clique_wrapper.py
│ ├── converter.py
│ ├── cure_wrapper.py
│ ├── dbscan_wrapper.py
│ ├── definitions.py
│ ├── elbow_wrapper.py
│ ├── fcm_wrapper.py
│ ├── gmeans_wrapper.py
│ ├── hhn_wrapper.py
│ ├── hsyncnet_wrapper.py
│ ├── kmeans_wrapper.py
│ ├── kmedians_wrapper.py
│ ├── kmedoids_wrapper.py
│ ├── legion_wrapper.py
│ ├── mbsas_wrapper.py
│ ├── metric_wrapper.py
│ ├── optics_wrapper.py
│ ├── pam_build_wrapper.py
│ ├── pcnn_wrapper.py
│ ├── pyclustering_package.py
│ ├── rock_wrapper.py
│ ├── silhouette_wrapper.py
│ ├── som_wrapper.py
│ ├── sync_wrapper.py
│ ├── syncnet_wrapper.py
│ ├── syncpr_wrapper.py
│ ├── tests
│ │ ├── __init__.py
│ │ └── ut_package.py
│ ├── ttsas_wrapper.py
│ ├── wrapper.py
│ └── xmeans_wrapper.py
├── gcolor
│ ├── __init__.py
│ ├── dsatur.py
│ ├── examples
│ │ ├── __init__.py
│ │ ├── dsatur_examples.py
│ │ ├── hysteresis_examples.py
│ │ └── sync_examples.py
│ ├── hysteresis.py
│ ├── sync.py
│ └── tests
│ │ ├── __init__.py
│ │ ├── ut_dsatur.py
│ │ ├── ut_hysteresis.py
│ │ └── ut_sync.py
├── nnet
│ ├── __init__.py
│ ├── cnn.py
│ ├── dynamic_visualizer.py
│ ├── examples
│ │ ├── __init__.py
│ │ ├── cnn_examples.py
│ │ ├── fsync_examples.py
│ │ ├── hhn_examples.py
│ │ ├── hhn_segmentation.py
│ │ ├── hysteresis_examples.py
│ │ ├── legion_examples.py
│ │ ├── legion_segmentation.py
│ │ ├── pcnn_examples.py
│ │ ├── pcnn_segmentation.py
│ │ ├── som_examples.py
│ │ ├── som_recognition.py
│ │ ├── sync_examples.py
│ │ ├── syncpr_examples.py
│ │ └── syncsegm_examples.py
│ ├── fsync.py
│ ├── hhn.py
│ ├── hysteresis.py
│ ├── legion.py
│ ├── pcnn.py
│ ├── som.py
│ ├── sync.py
│ ├── syncpr.py
│ ├── syncsegm.py
│ └── tests
│ │ ├── __init__.py
│ │ ├── hhn_templates.py
│ │ ├── integration
│ │ ├── __init__.py
│ │ ├── it_hhn.py
│ │ ├── it_legion.py
│ │ ├── it_pcnn.py
│ │ ├── it_som.py
│ │ ├── it_sync.py
│ │ ├── it_syncpr.py
│ │ └── it_syncsegm.py
│ │ ├── legion_templates.py
│ │ ├── pcnn_templates.py
│ │ ├── som_templates.py
│ │ ├── sync_templates.py
│ │ ├── syncpr_templates.py
│ │ ├── syncsegm_templates.py
│ │ └── unit
│ │ ├── __init__.py
│ │ ├── ut_cnn.py
│ │ ├── ut_dynamic_visualizer.py
│ │ ├── ut_fsync.py
│ │ ├── ut_hhn.py
│ │ ├── ut_hysteresis.py
│ │ ├── ut_legion.py
│ │ ├── ut_nnet.py
│ │ ├── ut_pcnn.py
│ │ ├── ut_som.py
│ │ ├── ut_sync.py
│ │ ├── ut_syncpr.py
│ │ └── ut_syncsegm.py
├── samples
│ ├── __init__.py
│ ├── definitions.py
│ ├── graphs
│ │ ├── GraphBrokenCircle1.grpr
│ │ ├── GraphBrokenCircle2.grpr
│ │ ├── GraphFivePointedFrameStar.grpr
│ │ ├── GraphFivePointedStar.grpr
│ │ ├── GraphFull1.grpr
│ │ ├── GraphFull2.grpr
│ │ ├── GraphOneCircle1.grpr
│ │ ├── GraphOneCircle2.grpr
│ │ ├── GraphOneCircle3.grpr
│ │ ├── GraphOneCrossroad.grpr
│ │ ├── GraphOneLine.grpr
│ │ ├── GraphSimple1.grpr
│ │ ├── GraphSimple2.grpr
│ │ ├── GraphSimple3.grpr
│ │ └── GraphTwoCrossroads.grpr
│ ├── images
│ │ ├── ImageBuildings.png
│ │ ├── ImageFieldFlower.png
│ │ ├── ImageFieldTree.png
│ │ ├── ImageNile.png
│ │ ├── ImageNileSmall.png
│ │ ├── ImageSimple01.png
│ │ ├── ImageSimple02.png
│ │ ├── ImageSimple03.png
│ │ ├── ImageSimple04.png
│ │ ├── ImageSimple05.png
│ │ ├── ImageSimple06.png
│ │ ├── ImageSimple07.png
│ │ ├── ImageSimple08.png
│ │ ├── ImageSimple09.png
│ │ ├── ImageSimple10.png
│ │ ├── ImageSimple11.png
│ │ ├── ImageSimple12.png
│ │ ├── ImageSimple13.png
│ │ ├── ImageSimple14.png
│ │ ├── ImageSimple15.png
│ │ ├── ImageSimple16.png
│ │ ├── ImageSimple17.png
│ │ ├── ImageSimple18.png
│ │ ├── ImageSimpleBeach.png
│ │ ├── ImageSimpleBuilding.png
│ │ ├── ImageSimpleFruits.png
│ │ ├── ImageSimpleFruitsSmall.png
│ │ ├── ImageThinBlackLines01.png
│ │ ├── ImageThinBlackLines02.png
│ │ ├── ImageThinBlackLines03.png
│ │ ├── ImageWhiteSea.png
│ │ ├── ImageWhiteSeaSmall.png
│ │ ├── digits
│ │ │ ├── Digit_0_Sample01.png
│ │ │ ├── Digit_0_Sample02.png
│ │ │ ├── Digit_0_Sample03.png
│ │ │ ├── Digit_0_Sample04.png
│ │ │ ├── Digit_0_Sample05.png
│ │ │ ├── Digit_0_Sample06.png
│ │ │ ├── Digit_0_Sample07.png
│ │ │ ├── Digit_0_Sample08.png
│ │ │ ├── Digit_0_Sample09.png
│ │ │ ├── Digit_0_Sample10.png
│ │ │ ├── Digit_0_Sample11.png
│ │ │ ├── Digit_0_Sample12.png
│ │ │ ├── Digit_0_Sample13.png
│ │ │ ├── Digit_0_Sample14.png
│ │ │ ├── Digit_0_Sample15.png
│ │ │ ├── Digit_0_Sample16.png
│ │ │ ├── Digit_0_Sample17.png
│ │ │ ├── Digit_0_Sample18.png
│ │ │ ├── Digit_0_Sample19.png
│ │ │ ├── Digit_0_Sample20.png
│ │ │ ├── Digit_0_Sample21.png
│ │ │ ├── Digit_0_Sample22.png
│ │ │ ├── Digit_0_Sample23.png
│ │ │ ├── Digit_0_Sample24.png
│ │ │ ├── Digit_0_Sample25.png
│ │ │ ├── Digit_1_Sample01.png
│ │ │ ├── Digit_1_Sample02.png
│ │ │ ├── Digit_1_Sample03.png
│ │ │ ├── Digit_1_Sample04.png
│ │ │ ├── Digit_1_Sample05.png
│ │ │ ├── Digit_1_Sample06.png
│ │ │ ├── Digit_1_Sample07.png
│ │ │ ├── Digit_1_Sample08.png
│ │ │ ├── Digit_1_Sample09.png
│ │ │ ├── Digit_1_Sample10.png
│ │ │ ├── Digit_1_Sample11.png
│ │ │ ├── Digit_1_Sample12.png
│ │ │ ├── Digit_1_Sample13.png
│ │ │ ├── Digit_1_Sample14.png
│ │ │ ├── Digit_1_Sample15.png
│ │ │ ├── Digit_1_Sample16.png
│ │ │ ├── Digit_1_Sample17.png
│ │ │ ├── Digit_1_Sample18.png
│ │ │ ├── Digit_1_Sample19.png
│ │ │ ├── Digit_1_Sample20.png
│ │ │ ├── Digit_1_Sample21.png
│ │ │ ├── Digit_1_Sample22.png
│ │ │ ├── Digit_1_Sample23.png
│ │ │ ├── Digit_1_Sample24.png
│ │ │ ├── Digit_1_Sample25.png
│ │ │ ├── Digit_2_Sample01.png
│ │ │ ├── Digit_2_Sample02.png
│ │ │ ├── Digit_2_Sample03.png
│ │ │ ├── Digit_2_Sample04.png
│ │ │ ├── Digit_2_Sample05.png
│ │ │ ├── Digit_2_Sample06.png
│ │ │ ├── Digit_2_Sample07.png
│ │ │ ├── Digit_2_Sample08.png
│ │ │ ├── Digit_2_Sample09.png
│ │ │ ├── Digit_2_Sample10.png
│ │ │ ├── Digit_2_Sample11.png
│ │ │ ├── Digit_2_Sample12.png
│ │ │ ├── Digit_2_Sample13.png
│ │ │ ├── Digit_2_Sample14.png
│ │ │ ├── Digit_2_Sample15.png
│ │ │ ├── Digit_2_Sample16.png
│ │ │ ├── Digit_2_Sample17.png
│ │ │ ├── Digit_2_Sample18.png
│ │ │ ├── Digit_2_Sample19.png
│ │ │ ├── Digit_2_Sample20.png
│ │ │ ├── Digit_2_Sample21.png
│ │ │ ├── Digit_2_Sample22.png
│ │ │ ├── Digit_2_Sample23.png
│ │ │ ├── Digit_2_Sample24.png
│ │ │ ├── Digit_2_Sample25.png
│ │ │ ├── Digit_3_Sample01.png
│ │ │ ├── Digit_3_Sample02.png
│ │ │ ├── Digit_3_Sample03.png
│ │ │ ├── Digit_3_Sample04.png
│ │ │ ├── Digit_3_Sample05.png
│ │ │ ├── Digit_3_Sample06.png
│ │ │ ├── Digit_3_Sample07.png
│ │ │ ├── Digit_3_Sample08.png
│ │ │ ├── Digit_3_Sample09.png
│ │ │ ├── Digit_3_Sample10.png
│ │ │ ├── Digit_3_Sample11.png
│ │ │ ├── Digit_3_Sample12.png
│ │ │ ├── Digit_3_Sample13.png
│ │ │ ├── Digit_3_Sample14.png
│ │ │ ├── Digit_3_Sample15.png
│ │ │ ├── Digit_3_Sample16.png
│ │ │ ├── Digit_3_Sample17.png
│ │ │ ├── Digit_3_Sample18.png
│ │ │ ├── Digit_3_Sample19.png
│ │ │ ├── Digit_3_Sample20.png
│ │ │ ├── Digit_3_Sample21.png
│ │ │ ├── Digit_3_Sample22.png
│ │ │ ├── Digit_3_Sample23.png
│ │ │ ├── Digit_3_Sample24.png
│ │ │ ├── Digit_3_Sample25.png
│ │ │ ├── Digit_4_Sample01.png
│ │ │ ├── Digit_4_Sample02.png
│ │ │ ├── Digit_4_Sample03.png
│ │ │ ├── Digit_4_Sample04.png
│ │ │ ├── Digit_4_Sample05.png
│ │ │ ├── Digit_4_Sample06.png
│ │ │ ├── Digit_4_Sample07.png
│ │ │ ├── Digit_4_Sample08.png
│ │ │ ├── Digit_4_Sample09.png
│ │ │ ├── Digit_4_Sample10.png
│ │ │ ├── Digit_4_Sample11.png
│ │ │ ├── Digit_4_Sample12.png
│ │ │ ├── Digit_4_Sample13.png
│ │ │ ├── Digit_4_Sample14.png
│ │ │ ├── Digit_4_Sample15.png
│ │ │ ├── Digit_4_Sample16.png
│ │ │ ├── Digit_4_Sample17.png
│ │ │ ├── Digit_4_Sample18.png
│ │ │ ├── Digit_4_Sample19.png
│ │ │ ├── Digit_4_Sample20.png
│ │ │ ├── Digit_4_Sample21.png
│ │ │ ├── Digit_4_Sample22.png
│ │ │ ├── Digit_4_Sample23.png
│ │ │ ├── Digit_4_Sample24.png
│ │ │ ├── Digit_4_Sample25.png
│ │ │ ├── Digit_5_Sample01.png
│ │ │ ├── Digit_5_Sample02.png
│ │ │ ├── Digit_5_Sample03.png
│ │ │ ├── Digit_5_Sample04.png
│ │ │ ├── Digit_5_Sample05.png
│ │ │ ├── Digit_5_Sample06.png
│ │ │ ├── Digit_5_Sample07.png
│ │ │ ├── Digit_5_Sample08.png
│ │ │ ├── Digit_5_Sample09.png
│ │ │ ├── Digit_5_Sample10.png
│ │ │ ├── Digit_5_Sample11.png
│ │ │ ├── Digit_5_Sample12.png
│ │ │ ├── Digit_5_Sample13.png
│ │ │ ├── Digit_5_Sample14.png
│ │ │ ├── Digit_5_Sample15.png
│ │ │ ├── Digit_5_Sample16.png
│ │ │ ├── Digit_5_Sample17.png
│ │ │ ├── Digit_5_Sample18.png
│ │ │ ├── Digit_5_Sample19.png
│ │ │ ├── Digit_5_Sample20.png
│ │ │ ├── Digit_5_Sample21.png
│ │ │ ├── Digit_5_Sample22.png
│ │ │ ├── Digit_5_Sample23.png
│ │ │ ├── Digit_5_Sample24.png
│ │ │ ├── Digit_5_Sample25.png
│ │ │ ├── Digit_6_Sample01.png
│ │ │ ├── Digit_6_Sample02.png
│ │ │ ├── Digit_6_Sample03.png
│ │ │ ├── Digit_6_Sample04.png
│ │ │ ├── Digit_6_Sample05.png
│ │ │ ├── Digit_6_Sample06.png
│ │ │ ├── Digit_6_Sample07.png
│ │ │ ├── Digit_6_Sample08.png
│ │ │ ├── Digit_6_Sample09.png
│ │ │ ├── Digit_6_Sample10.png
│ │ │ ├── Digit_6_Sample11.png
│ │ │ ├── Digit_6_Sample12.png
│ │ │ ├── Digit_6_Sample13.png
│ │ │ ├── Digit_6_Sample14.png
│ │ │ ├── Digit_6_Sample15.png
│ │ │ ├── Digit_6_Sample16.png
│ │ │ ├── Digit_6_Sample17.png
│ │ │ ├── Digit_6_Sample18.png
│ │ │ ├── Digit_6_Sample19.png
│ │ │ ├── Digit_6_Sample20.png
│ │ │ ├── Digit_6_Sample21.png
│ │ │ ├── Digit_6_Sample22.png
│ │ │ ├── Digit_6_Sample23.png
│ │ │ ├── Digit_6_Sample24.png
│ │ │ ├── Digit_6_Sample25.png
│ │ │ ├── Digit_7_Sample01.png
│ │ │ ├── Digit_7_Sample02.png
│ │ │ ├── Digit_7_Sample03.png
│ │ │ ├── Digit_7_Sample04.png
│ │ │ ├── Digit_7_Sample05.png
│ │ │ ├── Digit_7_Sample06.png
│ │ │ ├── Digit_7_Sample07.png
│ │ │ ├── Digit_7_Sample08.png
│ │ │ ├── Digit_7_Sample09.png
│ │ │ ├── Digit_7_Sample10.png
│ │ │ ├── Digit_7_Sample11.png
│ │ │ ├── Digit_7_Sample12.png
│ │ │ ├── Digit_7_Sample13.png
│ │ │ ├── Digit_7_Sample14.png
│ │ │ ├── Digit_7_Sample15.png
│ │ │ ├── Digit_7_Sample16.png
│ │ │ ├── Digit_7_Sample17.png
│ │ │ ├── Digit_7_Sample18.png
│ │ │ ├── Digit_7_Sample19.png
│ │ │ ├── Digit_7_Sample20.png
│ │ │ ├── Digit_7_Sample21.png
│ │ │ ├── Digit_7_Sample22.png
│ │ │ ├── Digit_7_Sample23.png
│ │ │ ├── Digit_7_Sample24.png
│ │ │ ├── Digit_7_Sample25.png
│ │ │ ├── Digit_8_Sample01.png
│ │ │ ├── Digit_8_Sample02.png
│ │ │ ├── Digit_8_Sample03.png
│ │ │ ├── Digit_8_Sample04.png
│ │ │ ├── Digit_8_Sample05.png
│ │ │ ├── Digit_8_Sample06.png
│ │ │ ├── Digit_8_Sample07.png
│ │ │ ├── Digit_8_Sample08.png
│ │ │ ├── Digit_8_Sample09.png
│ │ │ ├── Digit_8_Sample10.png
│ │ │ ├── Digit_8_Sample11.png
│ │ │ ├── Digit_8_Sample12.png
│ │ │ ├── Digit_8_Sample13.png
│ │ │ ├── Digit_8_Sample14.png
│ │ │ ├── Digit_8_Sample15.png
│ │ │ ├── Digit_8_Sample16.png
│ │ │ ├── Digit_8_Sample17.png
│ │ │ ├── Digit_8_Sample18.png
│ │ │ ├── Digit_8_Sample19.png
│ │ │ ├── Digit_8_Sample20.png
│ │ │ ├── Digit_8_Sample21.png
│ │ │ ├── Digit_8_Sample22.png
│ │ │ ├── Digit_8_Sample23.png
│ │ │ ├── Digit_8_Sample24.png
│ │ │ ├── Digit_8_Sample25.png
│ │ │ ├── Digit_9_Sample01.png
│ │ │ ├── Digit_9_Sample02.png
│ │ │ ├── Digit_9_Sample03.png
│ │ │ ├── Digit_9_Sample04.png
│ │ │ ├── Digit_9_Sample05.png
│ │ │ ├── Digit_9_Sample06.png
│ │ │ ├── Digit_9_Sample07.png
│ │ │ ├── Digit_9_Sample08.png
│ │ │ ├── Digit_9_Sample09.png
│ │ │ ├── Digit_9_Sample10.png
│ │ │ ├── Digit_9_Sample11.png
│ │ │ ├── Digit_9_Sample12.png
│ │ │ ├── Digit_9_Sample13.png
│ │ │ ├── Digit_9_Sample14.png
│ │ │ ├── Digit_9_Sample15.png
│ │ │ ├── Digit_9_Sample16.png
│ │ │ ├── Digit_9_Sample17.png
│ │ │ ├── Digit_9_Sample18.png
│ │ │ ├── Digit_9_Sample19.png
│ │ │ ├── Digit_9_Sample20.png
│ │ │ ├── Digit_9_Sample21.png
│ │ │ ├── Digit_9_Sample22.png
│ │ │ ├── Digit_9_Sample23.png
│ │ │ ├── Digit_9_Sample24.png
│ │ │ └── Digit_9_Sample25.png
│ │ └── symbols
│ │ │ ├── Symbol_A_Sample01.png
│ │ │ ├── Symbol_B_Sample01.png
│ │ │ ├── Symbol_C_Sample01.png
│ │ │ ├── Symbol_D_Sample01.png
│ │ │ ├── Symbol_E_Sample01.png
│ │ │ ├── Symbol_F_Sample01.png
│ │ │ ├── Symbol_G_Sample01.png
│ │ │ ├── Symbol_H_Sample01.png
│ │ │ ├── Symbol_I_Sample01.png
│ │ │ ├── Symbol_J_Sample01.png
│ │ │ ├── Symbol_K_Sample01.png
│ │ │ ├── Symbol_L_Sample01.png
│ │ │ ├── Symbol_M_Sample01.png
│ │ │ ├── Symbol_N_Sample01.png
│ │ │ ├── Symbol_O_Sample01.png
│ │ │ ├── Symbol_P_Sample01.png
│ │ │ ├── Symbol_Q_Sample01.png
│ │ │ ├── Symbol_R_Sample01.png
│ │ │ ├── Symbol_S_Sample01.png
│ │ │ ├── Symbol_T_Sample01.png
│ │ │ ├── Symbol_U_Sample01.png
│ │ │ ├── Symbol_V_Sample01.png
│ │ │ ├── Symbol_W_Sample01.png
│ │ │ ├── Symbol_X_Sample01.png
│ │ │ ├── Symbol_Y_Sample01.png
│ │ │ └── Symbol_Z_Sample01.png
│ └── samples
│ │ ├── famous
│ │ ├── Iris.answer
│ │ ├── Iris.data
│ │ └── OldFaithful.data
│ │ ├── fcps
│ │ ├── Atom.data
│ │ ├── Chainlink.data
│ │ ├── EngyTime.data
│ │ ├── GolfBall.data
│ │ ├── Hepta.data
│ │ ├── Lsun.data
│ │ ├── Target.data
│ │ ├── Tetra.data
│ │ ├── TwoDiamonds.data
│ │ └── WingNut.data
│ │ └── simple
│ │ ├── Elongate.answer
│ │ ├── Elongate.data
│ │ ├── Simple01.answer
│ │ ├── Simple01.data
│ │ ├── Simple02.answer
│ │ ├── Simple02.data
│ │ ├── Simple03.answer
│ │ ├── Simple03.data
│ │ ├── Simple04.answer
│ │ ├── Simple04.data
│ │ ├── Simple05.answer
│ │ ├── Simple05.data
│ │ ├── Simple06.answer
│ │ ├── Simple06.data
│ │ ├── Simple07.answer
│ │ ├── Simple07.data
│ │ ├── Simple08.answer
│ │ ├── Simple08.data
│ │ ├── Simple09.answer
│ │ ├── Simple09.data
│ │ ├── Simple10.answer
│ │ ├── Simple10.data
│ │ ├── Simple11.answer
│ │ ├── Simple11.data
│ │ ├── Simple12.answer
│ │ ├── Simple12.data
│ │ ├── Simple13.answer
│ │ ├── Simple13.data
│ │ ├── Simple14.answer
│ │ ├── Simple14.data
│ │ ├── Simple15.answer
│ │ └── Simple15.data
├── tests
│ ├── __init__.py
│ ├── __main__.py
│ ├── assertion.py
│ ├── suite_holder.py
│ └── tests_runner.py
└── utils
│ ├── __init__.py
│ ├── color.py
│ ├── dimension.py
│ ├── examples
│ ├── __init__.py
│ └── utils_examples.py
│ ├── graph.py
│ ├── metric.py
│ ├── sampling.py
│ └── tests
│ ├── __init__.py
│ ├── integration
│ ├── __init__.py
│ └── it_metric.py
│ ├── sampling_templates.py
│ └── unit
│ ├── __init__.py
│ ├── ut_dimension.py
│ ├── ut_metric.py
│ ├── ut_sampling.py
│ └── ut_utils.py
└── setup.py
/.codedocs:
--------------------------------------------------------------------------------
1 | DOXYFILE = docs/doxygen_conf_pyclustering
--------------------------------------------------------------------------------
/.github/workflows/build-pyclustering.yml:
--------------------------------------------------------------------------------
1 | name: Build and Test PyClustering Library
2 |
3 | on: [push, pull_request]
4 |
5 | jobs:
6 | test-pypi:
7 | name: Build and Test PyClustering Library
8 | runs-on: ubuntu-latest
9 | steps:
10 | - name: Clone repository
11 | uses: actions/checkout@v1
12 | - name: Set rights to run CI script
13 | run: chmod u+x ci/github-ci.sh
14 | - name: Run a multi-line script
15 | run: ./ci/github-ci.sh TEST_CMAKE_PYCLUSTERING_BUILD
16 |
--------------------------------------------------------------------------------
/.github/workflows/test-pypi-installer.yml:
--------------------------------------------------------------------------------
1 | name: Test PyPi Installer
2 |
3 | on: [workflow_dispatch]
4 |
5 | jobs:
6 | test-pypi:
7 | name: Test PyPi Installer
8 | runs-on: ubuntu-latest
9 | steps:
10 | - name: Clone repository
11 | uses: actions/checkout@v1
12 | - name: Set rights to run CI script
13 | run: chmod u+x ci/github-ci.sh
14 | - name: Run a multi-line script
15 | run: ./ci/github-ci.sh PYPI_INSTALLER
16 |
--------------------------------------------------------------------------------
/.github/workflows/test-testpypi-installer.yml:
--------------------------------------------------------------------------------
1 | name: Test TestPyPi Installer
2 |
3 | on: [workflow_dispatch]
4 |
5 | jobs:
6 | test-pypi:
7 | name: Test TestPyPi Installer
8 | runs-on: ubuntu-latest
9 | steps:
10 | - name: Clone repository
11 | uses: actions/checkout@v1
12 | - name: Set rights to run CI script
13 | run: chmod u+x ci/github-ci.sh
14 | - name: Run a multi-line script
15 | run: ./ci/github-ci.sh TESTPYPI_INSTALLER
16 |
--------------------------------------------------------------------------------
/MANIFEST.in:
--------------------------------------------------------------------------------
1 | include MANIFEST.in
2 | graft ccore
--------------------------------------------------------------------------------
/appveyor.yml:
--------------------------------------------------------------------------------
1 | version: '{build}'
2 |
3 |
4 | os: Visual Studio 2015
5 |
6 |
7 | platform: x64
8 |
9 |
10 | init: []
11 |
12 |
13 | environment:
14 | CYGWIN_PATH: C:\cygwin64\bin\bash
15 | PYTHON: C:\Python36-x64\python.exe
16 | TESTING_RESULT: "Success"
17 | GITHUB_TOKEN:
18 | secure: gzN7IIwlku2+7LB0SO+41zfT04Iir7WgCypBx/lwniP5JbxFl4dtjjMN/jj7sQZ1
19 | YANDEX_DISK_TOKEN:
20 | secure: R//j8C73CXwMBOyzobmPYGMUz/uPo9QyQrYXpJyvPIR5EeaX7f054/z1uddYdYux
21 | matrix:
22 | - CI_JOB: "BUILD_WINDOWS_CCORE"
23 | - CI_JOB: "UT_WINDOWS_CCORE"
24 | - CI_JOB: "BUILD_CYGWIN_CCORE"
25 | - CI_JOB: "PYCLUSTERING_WINDOWS_X86"
26 | - CI_JOB: "PYCLUSTERING_WINDOWS_X64"
27 |
28 |
29 | build_script:
30 | - ps: ./ci/appveyor-ci.ps1
31 |
--------------------------------------------------------------------------------
/ccore/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | ccore
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.cdt.managedbuilder.core.genmakebuilder
10 | clean,full,incremental,
11 |
12 |
13 |
14 |
15 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
16 | full,incremental,
17 |
18 |
19 |
20 |
21 |
22 | org.eclipse.cdt.core.cnature
23 | org.eclipse.cdt.core.ccnature
24 | org.eclipse.cdt.managedbuilder.core.managedBuildNature
25 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
26 |
27 |
28 |
--------------------------------------------------------------------------------
/ccore/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # @authors Andrei Novikov (pyclustering@yandex.ru)
3 | # @date 2014-2020
4 | # @copyright BSD-3-Clause
5 | #
6 |
7 |
8 | cmake_minimum_required(VERSION 3.10)
9 |
10 |
11 | project(pyclustering VERSION 0.11.0 LANGUAGES CXX)
12 |
13 |
14 | file(MAKE_DIRECTORY build)
15 | set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/build)
16 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/build)
17 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/build)
18 |
19 | add_subdirectory(bvt)
20 | add_subdirectory(external)
21 | add_subdirectory(src)
22 | add_subdirectory(tst)
23 |
--------------------------------------------------------------------------------
/ccore/bvt/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # @authors Andrei Novikov (pyclustering@yandex.ru)
3 | # @date 2014-2020
4 | # @copyright BSD-3-Clause
5 | #
6 |
7 |
8 | cmake_minimum_required(VERSION 3.10)
9 |
10 | # C++ standard
11 | set(CMAKE_CXX_STANDARD 14)
12 | set(CMAKE_CXX_STANDARD_REQUIRED True)
13 |
14 | # Headers
15 | include_directories(${PROJECT_SOURCE_DIR}/include)
16 |
17 | # Build target - build verify test for static library
18 | add_executable(bvt-static static-test.cpp)
19 | add_dependencies(bvt-static pyclustering-static)
20 | target_link_libraries(bvt-static PUBLIC pyclustering-static)
21 |
22 | # Build target - build verify test for shared library
23 | add_executable(bvt-shared shared-test.cpp)
24 | add_dependencies(bvt-shared pyclustering-shared)
25 |
26 | if(CMAKE_DL_LIBS)
27 | target_link_libraries(bvt-shared ${CMAKE_DL_LIBS})
28 | endif()
29 |
--------------------------------------------------------------------------------
/ccore/bvt/static-test.cpp:
--------------------------------------------------------------------------------
1 | /*!
2 |
3 | @authors Andrei Novikov (pyclustering@yandex.ru)
4 | @date 2014-2020
5 | @copyright BSD-3-Clause
6 |
7 | */
8 |
9 |
10 | #include
11 |
12 |
13 | #define SUCCESS 0
14 | #define FAILURE_INCORRECT_RESULT 1
15 |
16 |
17 | int main() {
18 | pyclustering::clst::gmeans_data result;
19 | pyclustering::clst::gmeans algorithm(2);
20 |
21 | algorithm.process({ { 1.0 }, { 1.2 }, { 1.1 }, { 3.0 }, { 3.2 }, { 3.1 }, { 8.0 }, { 8.2 }, { 8.1 } }, result);
22 |
23 | if (result.clusters().empty()) {
24 | return FAILURE_INCORRECT_RESULT;
25 | }
26 |
27 | return SUCCESS;
28 | }
29 |
--------------------------------------------------------------------------------
/ccore/external/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # @authors Andrei Novikov (pyclustering@yandex.ru)
3 | # @date 2014-2020
4 | # @copyright BSD-3-Clause
5 | #
6 |
7 |
8 | cmake_minimum_required(VERSION 3.10)
9 |
10 | # C++ standard
11 | set(CMAKE_CXX_STANDARD 14)
12 | set(CMAKE_CXX_STANDARD_REQUIRED True)
13 |
14 | # Source for google test framework
15 | file(GLOB_RECURSE GTEST_SOURCES src/gtest "*.cpp")
16 |
17 | # Headers
18 | include_directories(include)
19 |
20 | # Build targets
21 | add_library(gtest STATIC ${GTEST_SOURCES})
22 |
--------------------------------------------------------------------------------
/ccore/external/libs/linux/x64/.linux.x64.libs:
--------------------------------------------------------------------------------
1 | Thrird-party libraries for linux x64 are placed here
--------------------------------------------------------------------------------
/ccore/external/libs/linux/x86/.linux.x86.libs:
--------------------------------------------------------------------------------
1 | Thrird-party libraries for linux x86 are placed here
--------------------------------------------------------------------------------
/ccore/external/libs/windows/x64/.win.x64.libs:
--------------------------------------------------------------------------------
1 | Thrird-party libraries for windows x64 are placed here
--------------------------------------------------------------------------------
/ccore/external/libs/windows/x86/.win.x86.libs:
--------------------------------------------------------------------------------
1 | Thrird-party libraries for windows x86 are placed here
--------------------------------------------------------------------------------
/ccore/include/pyclustering/cluster/data_type.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 |
4 | namespace pyclustering {
5 |
6 | namespace clst {
7 |
8 | /*!
9 |
10 | @brief Defines data representation (points, distance matrix) that is used for processing.
11 |
12 | */
13 | enum class data_t {
14 | POINTS,
15 | DISTANCE_MATRIX
16 | };
17 |
18 | }
19 |
20 | }
--------------------------------------------------------------------------------
/ccore/include/pyclustering/cluster/mbsas_data.hpp:
--------------------------------------------------------------------------------
1 | /*!
2 |
3 | @authors Andrei Novikov (pyclustering@yandex.ru)
4 | @date 2014-2020
5 | @copyright BSD-3-Clause
6 |
7 | */
8 |
9 | #pragma once
10 |
11 |
12 | #include
13 | #include
14 |
15 | #include
16 |
17 |
18 | namespace pyclustering {
19 |
20 | namespace clst {
21 |
22 |
23 | using mbsas_data = bsas_data;
24 |
25 |
26 | }
27 |
28 | }
--------------------------------------------------------------------------------
/ccore/include/pyclustering/cluster/silhouette_data.hpp:
--------------------------------------------------------------------------------
1 | /*!
2 |
3 | @authors Andrei Novikov (pyclustering@yandex.ru)
4 | @date 2014-2020
5 | @copyright BSD-3-Clause
6 |
7 | */
8 |
9 | #pragma once
10 |
11 |
12 | #include
13 |
14 |
15 | namespace pyclustering {
16 |
17 | namespace clst {
18 |
19 |
20 | /*!
21 |
22 | @brief Sequence container that contains Silhouette's score for each point.
23 |
24 | */
25 | using silhouette_sequence = std::vector;
26 |
27 |
28 | /*!
29 |
30 | @class silhouette_data silhouette_data.hpp pyclustering/cluster/silhouette_data.hpp
31 |
32 | @brief Silhouette analysis result that contain information about Silhouette score for each point.
33 |
34 | */
35 | class silhouette_data {
36 | private:
37 | silhouette_sequence m_scores;
38 |
39 | public:
40 | /*!
41 |
42 | @brief Returns constant reference to the container with Silhouette score for each point
43 |
44 | */
45 | const silhouette_sequence & get_score() const { return m_scores; }
46 |
47 | /*!
48 |
49 | @brief Returns reference to the container with Silhouette score for each point
50 |
51 | */
52 | silhouette_sequence & get_score() { return m_scores; }
53 | };
54 |
55 |
56 | }
57 |
58 | }
--------------------------------------------------------------------------------
/ccore/include/pyclustering/cluster/somsc_data.hpp:
--------------------------------------------------------------------------------
1 | /*!
2 |
3 | @authors Andrei Novikov (pyclustering@yandex.ru)
4 | @date 2014-2020
5 | @copyright BSD-3-Clause
6 |
7 | */
8 |
9 |
10 | #pragma once
11 |
12 |
13 | #include
14 |
15 |
16 | namespace pyclustering {
17 |
18 | namespace clst {
19 |
20 |
21 | using somsc_data = cluster_data;
22 |
23 |
24 | }
25 |
26 | }
--------------------------------------------------------------------------------
/ccore/include/pyclustering/cluster/ttsas_data.hpp:
--------------------------------------------------------------------------------
1 | /*!
2 |
3 | @authors Andrei Novikov (pyclustering@yandex.ru)
4 | @date 2014-2020
5 | @copyright BSD-3-Clause
6 |
7 | */
8 |
9 | #pragma once
10 |
11 |
12 | #include
13 | #include
14 |
15 | #include
16 |
17 |
18 | namespace pyclustering {
19 |
20 | namespace clst {
21 |
22 |
23 | /*!
24 |
25 | @brief A storage where TTSAS clustering results are stored.
26 |
27 | */
28 | using ttsas_data = bsas_data;
29 |
30 |
31 | }
32 |
33 | }
--------------------------------------------------------------------------------
/ccore/include/pyclustering/cluster/xmeans_data.hpp:
--------------------------------------------------------------------------------
1 | /*!
2 |
3 | @authors Andrei Novikov (pyclustering@yandex.ru)
4 | @date 2014-2020
5 | @copyright BSD-3-Clause
6 |
7 | */
8 |
9 | #pragma once
10 |
11 |
12 | #include
13 | #include
14 |
15 | #include
16 | #include
17 |
18 | #include
19 |
20 |
21 | namespace pyclustering {
22 |
23 | namespace clst {
24 |
25 |
26 | using xmeans_data = kmeans_data;
27 |
28 |
29 | }
30 |
31 | }
--------------------------------------------------------------------------------
/ccore/include/pyclustering/container/ensemble_data.hpp:
--------------------------------------------------------------------------------
1 | /*!
2 |
3 | @authors Andrei Novikov (pyclustering@yandex.ru)
4 | @date 2014-2020
5 | @copyright BSD-3-Clause
6 |
7 | */
8 |
9 | #pragma once
10 |
11 |
12 | #include
13 |
14 |
15 | namespace pyclustering {
16 |
17 | namespace container {
18 |
19 |
20 | template
21 | using ensemble_data = std::vector;
22 |
23 |
24 | using basic_ensemble = std::vector;
25 | using basic_ensemble_data = std::vector;
26 |
27 |
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/ccore/include/pyclustering/differential/equation.hpp:
--------------------------------------------------------------------------------
1 | /*!
2 |
3 | @authors Andrei Novikov (pyclustering@yandex.ru)
4 | @date 2014-2020
5 | @copyright BSD-3-Clause
6 |
7 | */
8 |
9 |
10 | #pragma once
11 |
12 |
13 | #include
14 |
15 | #include
16 | #include
17 |
18 |
19 | namespace pyclustering {
20 |
21 | namespace differential {
22 |
23 |
24 | template
25 | using equation = std::function &, const differ_extra &, differ_state &) >;
26 |
27 |
28 | }
29 |
30 | }
--------------------------------------------------------------------------------
/ccore/include/pyclustering/differential/solve_type.hpp:
--------------------------------------------------------------------------------
1 | /*!
2 |
3 | @authors Andrei Novikov (pyclustering@yandex.ru)
4 | @date 2014-2020
5 | @copyright BSD-3-Clause
6 |
7 | */
8 |
9 |
10 | #pragma once
11 |
12 |
13 | #include
14 |
15 |
16 | namespace pyclustering {
17 |
18 | namespace differential {
19 |
20 |
21 | enum class solve_type {
22 | FORWARD_EULER,
23 | RUNGE_KUTTA_4,
24 | RUNGE_KUTTA_FEHLBERG_45,
25 | };
26 |
27 |
28 | }
29 |
30 | }
--------------------------------------------------------------------------------
/ccore/include/pyclustering/interface/agglomerative_interface.h:
--------------------------------------------------------------------------------
1 | /*!
2 |
3 | @authors Andrei Novikov (pyclustering@yandex.ru)
4 | @date 2014-2020
5 | @copyright BSD-3-Clause
6 |
7 | */
8 |
9 | #pragma once
10 |
11 |
12 | #include
13 |
14 | #include
15 |
16 |
17 | /*!
18 |
19 | @brief Clustering algorithm Agglomerative returns allocated clusters.
20 | @details Caller should destroy returned result in 'pyclustering_package'.
21 |
22 | @param[in] p_sample: input data for clustering.
23 | @param[in] p_number_clusters: amount of clusters that should be allocated.
24 | @param[in] p_link: type of links for merging clusters.
25 |
26 | @return Returns result of clustering - array of allocated clusters. The last cluster in the
27 | array is noise.
28 |
29 | */
30 | extern "C" DECLARATION pyclustering_package * agglomerative_algorithm(const pyclustering_package * const p_sample, const std::size_t p_number_clusters, const std::size_t p_link);
31 |
--------------------------------------------------------------------------------
/ccore/include/pyclustering/interface/interface_property.h:
--------------------------------------------------------------------------------
1 | /*!
2 |
3 | @authors Andrei Novikov (pyclustering@yandex.ru)
4 | @date 2014-2020
5 | @copyright BSD-3-Clause
6 |
7 | */
8 |
9 | #pragma once
10 |
11 |
12 | #include
13 |
14 |
15 | /**
16 | *
17 | * @brief Returns text description of the library
18 | *
19 | * @returns Returns const char pointer to text library description.
20 | *
21 | */
22 | extern "C" DECLARATION void * get_interface_description();
23 |
24 |
25 | /**
26 | *
27 | * @brief Returns version of the library interface
28 | *
29 | * @returns Returns const char pointer to version of the library interface.
30 | *
31 | */
32 | extern "C" DECLARATION void * get_interface_version();
--------------------------------------------------------------------------------
/ccore/include/pyclustering/interface/pyclustering_interface.h:
--------------------------------------------------------------------------------
1 | /*!
2 |
3 | @authors Andrei Novikov (pyclustering@yandex.ru)
4 | @date 2014-2020
5 | @copyright BSD-3-Clause
6 |
7 | */
8 |
9 |
10 | #pragma once
11 |
12 |
13 | #include
14 |
15 |
16 | /**
17 | *
18 | * @brief Deallocate pyclustering package.
19 | *
20 | * @param[in]: package: pointer to clustering results.
21 | *
22 | */
23 | extern "C" DECLARATION void free_pyclustering_package(pyclustering_package * package);
24 |
25 |
--------------------------------------------------------------------------------
/ccore/include/pyclustering/interface/rock_interface.h:
--------------------------------------------------------------------------------
1 | /*!
2 |
3 | @authors Andrei Novikov (pyclustering@yandex.ru)
4 | @date 2014-2020
5 | @copyright BSD-3-Clause
6 |
7 | */
8 |
9 | #pragma once
10 |
11 |
12 | #include
13 |
14 | #include
15 |
16 |
17 | /**
18 | *
19 | * @brief Clustering algorithm ROCK returns allocated clusters.
20 | * @details Caller should destroy returned result in 'pyclustering_package'.
21 | *
22 | * @param[in] p_sample: input data for clustering.
23 | * @param[in] p_radius: connectivity radius (similarity threshold).
24 | * @param[in] p_number_clusters: defines number of clusters that should be allocated from the input data set.
25 | * @param[in] p_threshold: value that defines degree of normalization that influences
26 | * on choice of clusters for merging during processing.
27 | *
28 | * @return Returns result of clustering - array of allocated clusters in the pyclustering package.
29 | *
30 | */
31 | extern "C" DECLARATION pyclustering_package * rock_algorithm(const pyclustering_package * const p_sample, const double p_radius, const size_t p_number_clusters, const double p_threshold);
32 |
--------------------------------------------------------------------------------
/ccore/include/pyclustering/nnet/network.hpp:
--------------------------------------------------------------------------------
1 | /*!
2 |
3 | @authors Andrei Novikov (pyclustering@yandex.ru)
4 | @date 2014-2020
5 | @copyright BSD-3-Clause
6 |
7 | */
8 |
9 |
10 | #pragma once
11 |
12 |
13 | namespace pyclustering {
14 |
15 | namespace nnet {
16 |
17 |
18 | enum class initial_type {
19 | RANDOM_GAUSSIAN,
20 | EQUIPARTITION,
21 | };
22 |
23 |
24 | }
25 |
26 | }
--------------------------------------------------------------------------------
/ccore/include/pyclustering/utils/linalg.hpp:
--------------------------------------------------------------------------------
1 | /*!
2 |
3 | @authors Andrei Novikov (pyclustering@yandex.ru)
4 | @date 2014-2020
5 | @copyright BSD-3-Clause
6 |
7 | */
8 |
9 | #pragma once
10 |
11 |
12 | #include
13 |
14 |
15 |
16 | namespace pyclustering {
17 |
18 | namespace utils {
19 |
20 | namespace linalg {
21 |
22 | using sequence = std::vector;
23 | using matrix = std::vector;
24 |
25 |
26 | sequence subtract(const sequence & a, const sequence & b);
27 |
28 | sequence subtract(const sequence & a, const double b);
29 |
30 | sequence multiply(const sequence & a, const sequence & b);
31 |
32 | sequence multiply(const sequence & a, const double b);
33 |
34 | matrix multiply(const matrix & a, const sequence & b);
35 |
36 | sequence divide(const sequence & a, const sequence & b);
37 |
38 | sequence divide(const sequence & a, const double b);
39 |
40 | double sum(const sequence & a);
41 |
42 | sequence sum(const matrix & a, std::size_t axis = 0);
43 |
44 | }
45 |
46 | }
47 |
48 | }
--------------------------------------------------------------------------------
/ccore/include/pyclustering/utils/random.hpp:
--------------------------------------------------------------------------------
1 | /*!
2 |
3 | @authors Andrei Novikov (pyclustering@yandex.ru)
4 | @date 2014-2020
5 | @copyright BSD-3-Clause
6 |
7 | */
8 |
9 |
10 | #pragma once
11 |
12 |
13 | namespace pyclustering {
14 |
15 | namespace utils {
16 |
17 | namespace random {
18 |
19 |
20 | /**
21 | *
22 | * @brief Returns random value in specified range using uniform distribution.
23 | *
24 | * @param[in] p_from: Mean.
25 | * @param[in] p_to: Standard deviation.
26 | *
27 | * @return Returns random variable.
28 | *
29 | */
30 | double generate_uniform_random(const double p_from = 0.0, const double p_to = 1.0);
31 |
32 |
33 | }
34 |
35 | }
36 |
37 | }
--------------------------------------------------------------------------------
/ccore/src/cluster/cluster_data.cpp:
--------------------------------------------------------------------------------
1 | /*!
2 |
3 | @authors Andrei Novikov (pyclustering@yandex.ru)
4 | @date 2014-2020
5 | @copyright BSD-3-Clause
6 |
7 | */
8 |
9 | #include
10 |
11 |
12 | namespace pyclustering {
13 |
14 | namespace clst {
15 |
16 |
17 | cluster_sequence & cluster_data::clusters() { return m_clusters; }
18 |
19 |
20 | const cluster_sequence & cluster_data::clusters() const { return m_clusters; }
21 |
22 |
23 | size_t cluster_data::size() const { return m_clusters.size(); }
24 |
25 |
26 | cluster & cluster_data::operator[](const size_t p_index) { return m_clusters[p_index]; }
27 |
28 |
29 | const cluster & cluster_data::operator[](const size_t p_index) const { return m_clusters[p_index]; }
30 |
31 |
32 | bool cluster_data::operator==(const cluster_data & p_other) const {
33 | return (m_clusters == p_other.m_clusters);
34 | }
35 |
36 |
37 | bool cluster_data::operator!=(const cluster_data & p_other) const {
38 | return !(*this == p_other);
39 | }
40 |
41 |
42 | }
43 |
44 | }
--------------------------------------------------------------------------------
/ccore/src/cluster/kmeans_data.cpp:
--------------------------------------------------------------------------------
1 | /*!
2 |
3 | @authors Andrei Novikov (pyclustering@yandex.ru)
4 | @date 2014-2020
5 | @copyright BSD-3-Clause
6 |
7 | */
8 |
9 |
10 | #include
11 |
12 |
13 | namespace pyclustering {
14 |
15 | namespace clst {
16 |
17 |
18 | kmeans_data::kmeans_data(const bool p_iteration_observe) :
19 | m_observed(p_iteration_observe)
20 | { }
21 |
22 |
23 | }
24 |
25 | }
--------------------------------------------------------------------------------
/ccore/src/cluster/optics_descriptor.cpp:
--------------------------------------------------------------------------------
1 | /*!
2 |
3 | @authors Andrei Novikov (pyclustering@yandex.ru)
4 | @date 2014-2020
5 | @copyright BSD-3-Clause
6 |
7 | */
8 |
9 |
10 | #include
11 |
12 | #include
13 |
14 |
15 | namespace pyclustering {
16 |
17 | namespace clst {
18 |
19 |
20 | const double optics_descriptor::NONE_DISTANCE = -1.0;
21 |
22 |
23 | optics_descriptor::optics_descriptor(const std::size_t p_index, const double p_core_distance, const double p_reachability_distance) :
24 | m_index(p_index),
25 | m_core_distance(p_core_distance),
26 | m_reachability_distance(p_reachability_distance),
27 | m_processed(false)
28 | { }
29 |
30 |
31 | void optics_descriptor::clear() {
32 | m_core_distance = optics_descriptor::NONE_DISTANCE;
33 | m_reachability_distance = optics_descriptor::NONE_DISTANCE;
34 | m_processed = false;
35 | }
36 |
37 |
38 | bool optics_pointer_descriptor_less::operator()(const optics_descriptor * p_object1, const optics_descriptor * p_object2) const {
39 | return p_object1->m_reachability_distance < p_object2->m_reachability_distance;
40 | }
41 |
42 |
43 | }
44 |
45 | }
--------------------------------------------------------------------------------
/ccore/src/cluster/somsc.cpp:
--------------------------------------------------------------------------------
1 | /*!
2 |
3 | @authors Andrei Novikov (pyclustering@yandex.ru)
4 | @date 2014-2020
5 | @copyright BSD-3-Clause
6 |
7 | */
8 |
9 | #include
10 |
11 |
12 | using namespace pyclustering::nnet;
13 |
14 |
15 | namespace pyclustering {
16 |
17 | namespace clst {
18 |
19 |
20 | somsc::somsc(const std::size_t p_amount_clusters, const std::size_t p_epoch) :
21 | m_amount_clusters(p_amount_clusters),
22 | m_epoch(p_epoch)
23 | { }
24 |
25 |
26 | void somsc::process(const dataset & p_data, somsc_data & p_result) {
27 | som_parameters params;
28 | som som_map(1, m_amount_clusters, som_conn_type::SOM_GRID_FOUR, params);
29 | som_map.train(p_data, m_epoch, true);
30 |
31 | p_result.clusters() = som_map.get_capture_objects();
32 | }
33 |
34 |
35 | }
36 |
37 | }
--------------------------------------------------------------------------------
/ccore/src/container/adjacency_connector.cpp:
--------------------------------------------------------------------------------
1 | /*!
2 |
3 | @authors Andrei Novikov (pyclustering@yandex.ru)
4 | @date 2014-2020
5 | @copyright BSD-3-Clause
6 |
7 | */
8 |
9 | #include
10 |
11 |
12 | namespace pyclustering {
13 |
14 | namespace container {
15 |
16 | std::ostream & operator<<(std::ostream & p_stream, const connection_t & p_structure) {
17 | switch (p_structure) {
18 | case connection_t::CONNECTION_ALL_TO_ALL:
19 | p_stream << "all-to-all";
20 | break;
21 |
22 | case connection_t::CONNECTION_GRID_EIGHT:
23 | p_stream << "grid eight";
24 | break;
25 |
26 | case connection_t::CONNECTION_GRID_FOUR:
27 | p_stream << "grid four";
28 | break;
29 |
30 | case connection_t::CONNECTION_LIST_BIDIRECTIONAL:
31 | p_stream << "bidirectional list";
32 | break;
33 |
34 | case connection_t::CONNECTION_NONE:
35 | p_stream << "none structure";
36 | break;
37 |
38 | default:
39 | p_stream << "unknown structure";
40 | break;
41 | }
42 |
43 | return p_stream;
44 | }
45 |
46 |
47 | }
48 |
49 | }
--------------------------------------------------------------------------------
/ccore/src/interface/agglomerative_interface.cpp:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | @authors Andrei Novikov (pyclustering@yandex.ru)
4 | @date 2014-2020
5 | @copyright BSD-3-Clause
6 |
7 | */
8 |
9 |
10 | #include
11 |
12 | #include
13 |
14 |
15 | pyclustering_package * agglomerative_algorithm(const pyclustering_package * const p_sample, const std::size_t p_number_clusters, const std::size_t p_link) {
16 | pyclustering::clst::agglomerative algorithm(p_number_clusters, (pyclustering::clst::agglomerative::type_link) p_link);
17 |
18 | pyclustering::dataset data;
19 | p_sample->extract(data);
20 |
21 | pyclustering::clst::agglomerative_data result;
22 | algorithm.process(data, result);
23 |
24 | pyclustering_package * package = create_package(&result.clusters());
25 |
26 | return package;
27 | }
28 |
--------------------------------------------------------------------------------
/ccore/src/interface/interface_property.cpp:
--------------------------------------------------------------------------------
1 | /*!
2 |
3 | @authors Andrei Novikov (pyclustering@yandex.ru)
4 | @date 2014-2020
5 | @copyright BSD-3-Clause
6 |
7 | */
8 |
9 |
10 | #include
11 |
12 |
13 | const char * INTERFACE_DESCRIPTION = "pyclustering library is a C/C++ part of python pyclustering library";
14 | const char * INTERFACE_VERSION = "0.11.0";
15 |
16 |
17 | void * get_interface_description() {
18 | return (void *) INTERFACE_DESCRIPTION;
19 | }
20 |
21 |
22 | void * get_interface_version() {
23 | return (void *) INTERFACE_VERSION;
24 | }
--------------------------------------------------------------------------------
/ccore/src/interface/pyclustering_interface.cpp:
--------------------------------------------------------------------------------
1 | /*!
2 |
3 | @authors Andrei Novikov (pyclustering@yandex.ru)
4 | @date 2014-2020
5 | @copyright BSD-3-Clause
6 |
7 | */
8 |
9 |
10 | #include
11 |
12 |
13 | void free_pyclustering_package(pyclustering_package * package) {
14 | delete package;
15 | }
16 |
--------------------------------------------------------------------------------
/ccore/src/interface/rock_interface.cpp:
--------------------------------------------------------------------------------
1 | /*!
2 |
3 | @authors Andrei Novikov (pyclustering@yandex.ru)
4 | @date 2014-2020
5 | @copyright BSD-3-Clause
6 |
7 | */
8 |
9 | #include
10 |
11 | #include
12 |
13 |
14 | pyclustering_package * rock_algorithm(const pyclustering_package * const p_sample, const double p_radius, const size_t p_number_clusters, const double p_threshold) {
15 | pyclustering::dataset input_dataset;
16 | p_sample->extract(input_dataset);
17 |
18 | pyclustering::clst::rock solver(p_radius, p_number_clusters, p_threshold);
19 |
20 | pyclustering::clst::rock_data output_result;
21 | solver.process(input_dataset, output_result);
22 |
23 | pyclustering_package * package = create_package(&output_result.clusters());
24 | return package;
25 | }
26 |
--------------------------------------------------------------------------------
/ccore/src/parallel/spinlock.cpp:
--------------------------------------------------------------------------------
1 | /*!
2 |
3 | @authors Andrei Novikov (pyclustering@yandex.ru)
4 | @date 2014-2020
5 | @copyright BSD-3-Clause
6 |
7 | */
8 |
9 |
10 | #include
11 |
12 | #include
13 |
14 |
15 | namespace pyclustering {
16 |
17 | namespace parallel {
18 |
19 |
20 | bool spinlock::try_lock() {
21 | return !m_lock.test_and_set(std::memory_order_acquire);
22 | }
23 |
24 | void spinlock::lock() {
25 | for(std::size_t i = 0; !try_lock(); i++) {
26 | if (i % 100) {
27 | std::this_thread::yield();
28 | }
29 | }
30 | }
31 |
32 | void spinlock::unlock() {
33 | m_lock.clear(std::memory_order_release);
34 | }
35 |
36 |
37 | }
38 |
39 | }
--------------------------------------------------------------------------------
/ccore/src/parallel/task.cpp:
--------------------------------------------------------------------------------
1 | /*!
2 |
3 | @authors Andrei Novikov (pyclustering@yandex.ru)
4 | @date 2014-2020
5 | @copyright BSD-3-Clause
6 |
7 | */
8 |
9 |
10 | #include
11 |
12 |
13 | namespace pyclustering {
14 |
15 | namespace parallel {
16 |
17 |
18 | task::task(const proc & p_task) :
19 | m_task(p_task)
20 | {
21 | m_ready.lock();
22 | }
23 |
24 |
25 | void task::set_ready() {
26 | m_ready.unlock();
27 | }
28 |
29 |
30 | void task::wait_ready() const {
31 | m_ready.lock();
32 | }
33 |
34 |
35 | void task::operator()() {
36 | m_task();
37 | }
38 |
39 |
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/ccore/src/parallel/thread_executor.cpp:
--------------------------------------------------------------------------------
1 | /*!
2 |
3 | @authors Andrei Novikov (pyclustering@yandex.ru)
4 | @date 2014-2020
5 | @copyright BSD-3-Clause
6 |
7 | */
8 |
9 |
10 | #include
11 |
12 | #include
13 |
14 |
15 | namespace pyclustering {
16 |
17 | namespace parallel {
18 |
19 |
20 | thread_executor::thread_executor(const task_getter & p_getter) :
21 | m_stop(false),
22 | m_getter(p_getter),
23 | m_executor(&thread_executor::run, this)
24 | { }
25 |
26 |
27 | void thread_executor::run() {
28 | while(!m_stop) {
29 | task::ptr task = nullptr;
30 | m_getter(task);
31 |
32 | if (task) {
33 | (*task)();
34 | task->set_ready();
35 | }
36 | else {
37 | m_stop = true;
38 | }
39 | }
40 | }
41 |
42 |
43 | void thread_executor::stop() {
44 | m_stop = true;
45 |
46 | if (m_executor.joinable()) {
47 | m_executor.join();
48 | }
49 | }
50 |
51 |
52 | }
53 |
54 | }
55 |
--------------------------------------------------------------------------------
/ccore/src/utils/math.cpp:
--------------------------------------------------------------------------------
1 | /*!
2 |
3 | @authors Andrei Novikov (pyclustering@yandex.ru)
4 | @date 2014-2020
5 | @copyright BSD-3-Clause
6 |
7 | */
8 |
9 |
10 | #include
11 |
12 |
13 |
14 | namespace pyclustering {
15 |
16 | namespace utils {
17 |
18 | namespace math {
19 |
20 |
21 | double heaviside(const double value) {
22 | if (value >= 0.0) { return 1.0; }
23 | return 0.0;
24 | }
25 |
26 |
27 | }
28 |
29 | }
30 |
31 | }
--------------------------------------------------------------------------------
/ccore/src/utils/random.cpp:
--------------------------------------------------------------------------------
1 | /*!
2 |
3 | @authors Andrei Novikov (pyclustering@yandex.ru)
4 | @date 2014-2020
5 | @copyright BSD-3-Clause
6 |
7 | */
8 |
9 | #include
10 |
11 | #include
12 | #include
13 |
14 |
15 | namespace pyclustering {
16 |
17 | namespace utils {
18 |
19 | namespace random {
20 |
21 |
22 | double generate_uniform_random(const double p_from, const double p_to) {
23 | unsigned seed = (unsigned) std::chrono::system_clock::now().time_since_epoch().count();
24 | std::default_random_engine generator(seed);
25 |
26 | std::uniform_real_distribution distribution(p_from, p_to);
27 | return distribution(generator);
28 | }
29 |
30 |
31 | }
32 |
33 | }
34 |
35 | }
--------------------------------------------------------------------------------
/ccore/src/utils/stats.cpp:
--------------------------------------------------------------------------------
1 | /*!
2 |
3 | @authors Andrei Novikov (pyclustering@yandex.ru)
4 | @date 2014-2020
5 | @copyright BSD-3-Clause
6 |
7 | */
8 |
9 |
10 | #include
11 |
12 |
13 | namespace pyclustering {
14 |
15 | namespace utils {
16 |
17 | namespace stats {
18 |
19 |
20 | std::vector critical_values(const std::size_t p_data_size) {
21 | std::vector result = { 0.576, 0.656, 0.787, 0.918, 1.092 };
22 | const double size = static_cast(p_data_size);
23 | for (auto & value : result) {
24 | value /= (1.0 + 4.0 / size - 25.0 / size / size);
25 | }
26 |
27 | return result;
28 | }
29 |
30 |
31 | }
32 |
33 | }
34 |
35 | }
--------------------------------------------------------------------------------
/ccore/tst/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # @authors Andrei Novikov (pyclustering@yandex.ru)
3 | # @date 2014-2020
4 | # @copyright BSD-3-Clause
5 | #
6 |
7 |
8 | cmake_minimum_required(VERSION 3.10)
9 |
10 |
11 | # C++ standard
12 | set(CMAKE_CXX_STANDARD 14)
13 | set(CMAKE_CXX_STANDARD_REQUIRED True)
14 |
15 |
16 | # Sources
17 | file(GLOB_RECURSE UT_SOURCES "*.cpp")
18 |
19 |
20 | # Header folders
21 | include_directories(${PROJECT_SOURCE_DIR}/include)
22 | include_directories(${PROJECT_SOURCE_DIR}/external/include)
23 |
24 |
25 | # Library folders
26 | link_directories(${PROJECT_SOURCE_DIR}/build)
27 |
28 |
29 | # Build targets
30 | add_executable(utcore ${UT_SOURCES})
31 |
32 | # Dependecies
33 | add_dependencies(utcore pyclustering-static)
34 | add_dependencies(utcore gtest)
35 | target_link_libraries(utcore PUBLIC pyclustering-static)
36 | target_link_libraries(utcore PUBLIC gtest)
37 |
--------------------------------------------------------------------------------
/ccore/tst/answer.hpp:
--------------------------------------------------------------------------------
1 | /*!
2 |
3 | @authors Andrei Novikov (pyclustering@yandex.ru)
4 | @date 2014-2020
5 | @copyright BSD-3-Clause
6 |
7 | */
8 | #pragma once
9 |
10 |
11 | #include
12 |
13 |
14 | using cluster = std::vector;
15 | using cluster_sequence = std::vector;
16 |
17 | using length_sequence = std::vector;
18 |
19 |
20 | class answer {
21 | private:
22 | cluster_sequence m_clusters;
23 | length_sequence m_cluster_lengths;
24 | cluster m_noise;
25 |
26 | public:
27 | const cluster_sequence & clusters() const { return m_clusters; }
28 |
29 | cluster_sequence & clusters() { return m_clusters; }
30 |
31 | const length_sequence & cluster_lengths() const { return m_cluster_lengths; }
32 |
33 | length_sequence & cluster_lengths() { return m_cluster_lengths; }
34 |
35 | const cluster & noise() const { return m_noise; }
36 |
37 | cluster & noise() { return m_noise; }
38 | };
--------------------------------------------------------------------------------
/ccore/tst/answer_reader.hpp:
--------------------------------------------------------------------------------
1 | /*!
2 |
3 | @authors Andrei Novikov (pyclustering@yandex.ru)
4 | @date 2014-2020
5 | @copyright BSD-3-Clause
6 |
7 | */
8 |
9 | #pragma once
10 |
11 |
12 | #include "answer.hpp"
13 |
14 | #include "samples.hpp"
15 |
16 | #include