Pick centers in KMeans++ with a probability proportional to their distance^2, instead of simple distance, to previous centers
Apply to KMeansIndex KMeanspp the same modification as in HierarchicalClusteringIndex
As some processed distances are already ^2, use template to select whether or not we have to ^2 in KMeanspp
Move templates in dist.h in order to share them between KMeansIndex and HierarchicalClusteringIndex classes.
When a cluster is empty for KMeans, it's better to give it the point from another cluster j that is the furthest one from center j.
fixing bug #3345
Improved documentation for neural network
Added throwing exception when saving untrained SVM model
fixing bug #3345. don't use BORDER_ISOLATED alone. it should be combined with some border type
Revert "fixed bug #3319"

See 092f916 for explanation.

This reverts commit 4f9c081dc313f8fdfee3f0a4572779ae13e27e40.
Re-fix bug #3319 with less side effects.
Removed an unnecessary workaround for matrix-to-vector copyTo.
Added a test for matrix-to-vector copy and convert.
Merge pull request #2140 from Daniil-Osokin:fix_saving_untrained_svm_model
Merge pull request #2159 from SpecLad:1xN
Fixed bug #3489: The code assumed that two global variables would be constructed in a particular order, but global variable initialization order is compiler-dependent.
Merge pull request #2171 from djetter99:fix_static_init_order
Viz initial backport, compilation fixes, moved viz/viz.hpp header according to 2.4 style
fixed documentation warnings
fix cross-compilation issue with Numpy