diff --git a/doc/conf.py b/doc/conf.py
index 86b4f20cf24f0..a02882ffdde2e 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -72,9 +72,9 @@
# built documents.
#
# The short X.Y version.
-version = '0.16.dev0'
-# The full version, including alpha/beta/rc tags.
import sklearn
+version = sklearn.__version__
+# The full version, including alpha/beta/rc tags.
release = sklearn.__version__
# The language for content autogenerated by Sphinx. Refer to documentation
diff --git a/doc/documentation.rst b/doc/documentation.rst
index 1cc7415914545..b0bd741fcab71 100644
--- a/doc/documentation.rst
+++ b/doc/documentation.rst
@@ -2,7 +2,7 @@
-Documentation of scikit-learn 0.16.dev0
+Documentation of scikit-learn 0.17.dev0
=======================================
.. raw:: html
@@ -29,7 +29,7 @@ Documentation of scikit-learn 0.16.dev0
Other Versions
- scikit-learn 0.15 (stable)
- - scikit-learn 0.16 (development)
+ - scikit-learn 0.17 (development)
- scikit-learn 0.14
- scikit-learn 0.13
- scikit-learn 0.12
diff --git a/doc/modules/manifold.rst b/doc/modules/manifold.rst
index 5cf546906a72b..6d86cacb0e769 100644
--- a/doc/modules/manifold.rst
+++ b/doc/modules/manifold.rst
@@ -479,12 +479,37 @@ t-distributed Stochastic Neighbor Embedding (t-SNE)
t-SNE (:class:`TSNE`) converts affinities of data points to probabilities.
The affinities in the original space are represented by Gaussian joint
probabilities and the affinities in the embedded space are represented by
-Student's t-distributions. The Kullback-Leibler (KL) divergence of the joint
+Student's t-distributions. This allows t-SNE to be particularly sensitive
+to local structure and has a few other advantages over existing techniques:
+
+* Revealing the structure at many scales on a single map
+* Revealing data that lie in multiple, different, manifolds or clusters
+* Reducing the tendency to crowd points together at the center
+
+While Isomap, LLE and variants are best suited to unfold a single continuous
+low dimensional manifold, t-SNE will focus on the local structure of the data
+and will tend to extract clustered local groups of samples as highlighted on
+the S-curve example. This ability to group samples based on the local structure
+might be beneficial to visually disentangle a dataset that comprises several
+manifolds at once as is the case in the digits dataset.
+
+The Kullback-Leibler (KL) divergence of the joint
probabilities in the original space and the embedded space will be minimized
by gradient descent. Note that the KL divergence is not convex, i.e.
multiple restarts with different initializations will end up in local minima
of the KL divergence. Hence, it is sometimes useful to try different seeds
-and select the embedding with the lowest KL divergence.
+and select the embedding with the lowest KL divergence.
+
+The disadvantages to using t-SNE are roughly:
+
+* t-SNE is computationally expensive, and can take several hours on million-sample
+ datasets where PCA will finish in seconds or minutes
+* The Barnes-Hut t-SNE method is limited to two or three dimensional embeddings.
+* The algorithm is stochastic and multiple restarts with different seeds can
+ yield different embeddings. However, it is perfectly legitimate to pick the the
+ embedding with the least error.
+* Global structure is not explicitly preserved. This is problem is mitigated by
+ initializing points with PCA (using `init='pca'`).
.. figure:: ../auto_examples/manifold/images/plot_lle_digits_013.png
@@ -492,17 +517,27 @@ and select the embedding with the lowest KL divergence.
:align: center
:scale: 50
-
+Optimizing t-SNE
+----------------
The main purpose of t-SNE is visualization of high-dimensional data. Hence,
it works best when the data will be embedded on two or three dimensions.
Optimizing the KL divergence can be a little bit tricky sometimes. There are
-three parameters that control the optimization of t-SNE:
+five parameters that control the optimization of t-SNE and therefore possibly
+the quality of the resulting embedding:
+* perplexity
* early exaggeration factor
* learning rate
* maximum number of iterations
-
+* angle (not used in the exact method)
+
+The perplexity is defined as :math:`k=2^(S)` where :math:`S` is the Shannon
+entropy of the conditional probability distribution. The perplexity of a
+:math:`k`-sided die is :math:`k`, so that :math:`k` is effectively the number of
+nearest neighbors t-SNE considers when generating the conditional probabilities.
+Larger perplexities lead to more nearest neighbors and less sensitive to small
+structure. Larger datasets tend to require larger perplexities.
The maximum number of iterations is usually high enough and does not need
any tuning. The optimization consists of two phases: the early exaggeration
phase and the final optimization. During early exaggeration the joint
@@ -513,19 +548,37 @@ divergence could increase during this phase. Usually it does not have to be
tuned. A critical parameter is the learning rate. If it is too low gradient
descent will get stuck in a bad local minimum. If it is too high the KL
divergence will increase during optimization. More tips can be found in
-Laurens van der Maaten's FAQ (see references).
+Laurens van der Maaten's FAQ (see references). The last parameter, angle,
+is a tradeoff between performance and accuracy. Larger angles imply that we
+can approximate larger regions by a single point,leading to better speed
+but less accurate results.
-Standard t-SNE that has been implemented here is usually much slower than
-other manifold learning algorithms. The optimization is quite difficult
-and the computation of the gradient is on :math:`O[d N^2]`, where :math:`d`
-is the number of output dimensions and :math:`N` is the number of samples.
+Barnes-Hut t-SNE
+----------------
-While Isomap, LLE and variants are best suited to unfold a single continuous
-low dimensional manifold, t-SNE will focus on the local structure of the data
-and will tend to extract clustered local groups of samples as highlighted on
-the S-curve example. This ability to group samples based on the local structure
-might be beneficial to visually disentangle a dataset that comprises several
-manifolds at once as is the case in the digits dataset.
+The Barnes-Hut t-SNE that has been implemented here is usually much slower than
+other manifold learning algorithms. The optimization is quite difficult
+and the computation of the gradient is :math:`O[d N log(N)]`, where :math:`d`
+is the number of output dimensions and :math:`N` is the number of samples. The
+Barnes-Hut method improves on the exact method where t-SNE complexity is
+:math:`O[d N^2]`, but has several other notable differences:
+
+* The Barnes-Hut implementation only works when the target dimensionality is 3
+ or less. The 2D case is typical when building visualizations.
+* Barnes-Hut only works with dense input data. Sparse data matrices can only be
+ embedded with the exact method or can be approximated by a dense low rank
+ projection for instance using :class:`sklearn.decomposition.TruncatedSVD`
+* Barnes-Hut is an approximation of the exact method. The approximation is
+ parameterized with the angle parameter, therefore the angle parameter is
+ unused when method="exact"
+* Barnes-Hut is significantly more scalable. Barnes-Hut can be used to embed
+ hundred of thousands of data points while the exact method can handle
+ thousands of samples before becoming computationally intractable
+
+For visualization purpose (which is the main use case of t-SNE), using the
+Barnes-Hut method is strongly recommended. The exact t-SNE method is useful
+for checking the theoretically properties of the embedding possibly in higher
+dimensional space but limit to small datasets due to computational constraints.
Also note that the digits labels roughly match the natural grouping found by
t-SNE while the linear 2D projection of the PCA model yields a representation
@@ -546,9 +599,13 @@ the internal structure of the data.
(2008)
* `"t-Distributed Stochastic Neighbor Embedding"
- `_
+ `_
van der Maaten, L.J.P.
+ * `"Accelerating t-SNE using Tree-Based Algorithms."
+ `_
+ L.J.P. van der Maaten. Journal of Machine Learning Research 15(Oct):3221-3245, 2014.
+
Tips on practical use
=====================
diff --git a/examples/manifold/plot_tsne_faces.py b/examples/manifold/plot_tsne_faces.py
new file mode 100644
index 0000000000000..2f78e422c6fcf
--- /dev/null
+++ b/examples/manifold/plot_tsne_faces.py
@@ -0,0 +1,148 @@
+"""
+===================================
+Comparison of t-SNE methods and options
+===================================
+
+A comparison of t-SNE applied to the Olivetti faces data. The 'exact' and
+'barnes-hut' methods are visualized, as well as init='pca' and init='random'.
+In addition to varying method & init, the script also compares preprocessing
+the input data by reducing the dimensionality via PCA and also varying the
+perplexity.
+
+For a discussion and comparison of these algorithms, see the
+:ref:`manifold module page `
+
+"""
+# Authors: Christopher Erick Moody
+# License: BSD 3 clause
+
+from sklearn.datasets import fetch_olivetti_faces
+from sklearn.decomposition import RandomizedPCA
+from sklearn import manifold
+from matplotlib import offsetbox
+import matplotlib.pyplot as plt
+import numpy as np
+from time import time
+
+
+faces = fetch_olivetti_faces()
+
+verbose = 5
+
+#----------------------------------------------------------------------
+# Scale and visualize the embedding vectors
+def plot_embedding(dataset, X, title=None, ax=None):
+ x_min, x_max = np.min(X, 0), np.max(X, 0)
+ X = (X - x_min) / (x_max - x_min)
+ y = dataset.target
+ if ax is None:
+ plt.figure(figsize=(18, 15))
+ ax = plt.gca()
+ for i in range(X.shape[0]):
+ ax.text(X[i, 0], X[i, 1], str(dataset.target[i]),
+ color=plt.cm.Set1(y[i] / 10.),
+ fontdict={'weight': 'bold', 'size': 30})
+
+ if hasattr(offsetbox, 'AnnotationBbox'):
+ # only print thumbnails with matplotlib > 1.0
+ shown_images = np.array([[1., 1.]]) # just something big
+ for i in range(dataset.data.shape[0]):
+ shown_images = np.r_[shown_images, [X[i]]]
+ r, g, b, a = plt.cm.Paired(i * 1.0 / dataset.data.shape[0])
+ gray = dataset.images[i]
+ rgb_image = np.zeros((64, 64, 3))
+ rgb_image[:, :, 0] = gray * r
+ rgb_image[:, :, 1] = gray * g
+ rgb_image[:, :, 2] = gray * b
+ imagebox = offsetbox.AnnotationBbox(
+ offsetbox.OffsetImage(rgb_image),
+ X[i], frameon=False)
+ ax.add_artist(imagebox)
+ ax.set_xticks([]), ax.set_yticks([])
+ if title is not None:
+ ax.set_title(title, loc='left')
+
+
+#----------------------------------------------------------------------
+# Fit t-SNE on 50 PCA-reduced dimensions with random initialization.
+# We will frequently want to reduce the dimensionality when we have many
+# dimensions since the t-SNE complexity grows linearly with the dimensionality.
+tsne = manifold.TSNE(n_components=2, init='random', random_state=3,
+ n_iter=1000, verbose=verbose, early_exaggeration=50.0,
+ learning_rate=100, perplexity=50)
+rpca = RandomizedPCA(n_components=50)
+time_start = time()
+reduced = rpca.fit_transform(faces.data)
+embedded = tsne.fit_transform(reduced)
+time_end = time()
+dt = time_end - time_start
+
+
+title = ("Barnes-Hut t-SNE Visualization of Olivetti Faces\n" +
+ "in %1.1f seconds on 50-dimensional PCA-reduced data ")
+title = title % dt
+plot_embedding(faces, embedded, title=title)
+
+
+#-------------------------------------------------------------------------
+# Fit t-SNE on all 4096 dimensions, but use PCA to initialize the embedding
+# Initializing the embedding with PCA allows the final emebedding to preserve
+# global structure leaving t-SNE to optimize the local structure
+tsne = manifold.TSNE(n_components=2, init='pca', random_state=3,
+ n_iter=1000, verbose=verbose, early_exaggeration=50.0,
+ learning_rate=100, perplexity=5)
+time_start = time()
+embedded = tsne.fit_transform(faces.data)
+time_end = time()
+dt = time_end - time_start
+
+
+title = ("Barnes-Hut t-SNE Visualization of Olivetti Faces\n" +
+ "in %1.1f seconds & initialized embedding with PCA ")
+title = title % dt
+plot_embedding(faces, embedded, title=title)
+
+
+#----------------------------------------------------------------------
+# Fit t-SNE on 50 PCA-reduced dimensions with random initialization, but reduce
+# the perplexity. Note that the increased perplexity roughly increases the
+# number of neighbors, which effectively decreases the number of clusters.
+# For the example here, theres about 5 images per person, which with a
+# perplexity of 50 forces multiple face-clusters to come together
+tsne = manifold.TSNE(n_components=2, init='random', random_state=3,
+ n_iter=1000, verbose=verbose, early_exaggeration=50.0,
+ learning_rate=100, perplexity=50)
+rpca = RandomizedPCA(n_components=50)
+time_start = time()
+reduced = rpca.fit_transform(faces.data)
+embedded = tsne.fit_transform(reduced)
+time_end = time()
+dt = time_end - time_start
+
+
+title = ("Barnes-Hut t-SNE Visualization of Olivetti Faces\n" +
+ "in %1.1f seconds on 50-dimensional PCA-reduced data\n" +
+ "with perplexity increased from 5 to 50")
+title = title % dt
+plot_embedding(faces, embedded, title=title)
+
+
+#----------------------------------------------------------------------
+# Fit t-SNE by random embedding and the exact method. The exact method
+# is similar to Barnes-Hut, but this visualization reinforces the idea
+# that the two methods yield similar results
+tsne = manifold.TSNE(n_components=2, init='random', random_state=3,
+ method='exact', n_iter=10000, verbose=verbose,
+ learning_rate=100, perplexity=5)
+time_start = time()
+embedded = tsne.fit_transform(faces.data)
+time_end = time()
+dt = time_end - time_start
+
+
+title = ("Exact t-SNE Visualization of Olivetti Faces\n" +
+ "in %1.1f seconds with random initialization")
+title = title % dt
+plot_embedding(faces, embedded, title=title)
+
+plt.show()
diff --git a/sklearn/__init__.py b/sklearn/__init__.py
index 6360d0296c6cf..634129f8082d0 100644
--- a/sklearn/__init__.py
+++ b/sklearn/__init__.py
@@ -37,7 +37,7 @@
# Dev branch marker is: 'X.Y.dev' or 'X.Y.devN' where N is an integer.
# 'X.Y.dev0' is the canonical version of 'X.Y.dev'
#
-__version__ = '0.16.dev0'
+__version__ = '0.17.dev0'
try:
@@ -61,7 +61,7 @@
'cross_validation', 'datasets', 'decomposition', 'dummy',
'ensemble', 'externals', 'feature_extraction',
'feature_selection', 'gaussian_process', 'grid_search', 'hmm',
- 'isotonic', 'kernel_approximation', 'kernel_ridge',
+ 'isotonic', 'kernel_approximation', 'kernel_ridge',
'lda', 'learning_curve',
'linear_model', 'manifold', 'metrics', 'mixture', 'multiclass',
'naive_bayes', 'neighbors', 'neural_network', 'pipeline',
diff --git a/sklearn/isotonic.py b/sklearn/isotonic.py
index ff4121d17b7b7..bb0a210efb5eb 100644
--- a/sklearn/isotonic.py
+++ b/sklearn/isotonic.py
@@ -252,8 +252,6 @@ def _build_y(self, X, y, sample_weight):
"""Build the y_ IsotonicRegression."""
check_consistent_length(X, y, sample_weight)
X, y = [check_array(x, ensure_2d=False) for x in [X, y]]
- if sample_weight is not None:
- sample_weight = check_array(sample_weight, ensure_2d=False)
y = as_float_array(y)
self._check_fit_data(X, y, sample_weight)
@@ -264,10 +262,16 @@ def _build_y(self, X, y, sample_weight):
else:
self.increasing_ = self.increasing
+ # If sample_weights is passed, removed zero-weight values and clean order
+ if sample_weight is not None:
+ sample_weight = check_array(sample_weight, ensure_2d=False)
+ mask = sample_weight > 0
+ X, y, sample_weight = X[mask], y[mask], sample_weight[mask]
+ else:
+ sample_weight = np.ones(len(y))
+
order = np.lexsort((y, X))
order_inv = np.argsort(order)
- if sample_weight is None:
- sample_weight = np.ones(len(y))
X, y, sample_weight = [astype(array[order], np.float64, copy=False)
for array in [X, y, sample_weight]]
unique_X, unique_y, unique_sample_weight = _make_unique(X, y, sample_weight)
diff --git a/sklearn/manifold/_barnes_hut_tsne.c b/sklearn/manifold/_barnes_hut_tsne.c
new file mode 100644
index 0000000000000..9d741bd051a20
--- /dev/null
+++ b/sklearn/manifold/_barnes_hut_tsne.c
@@ -0,0 +1,25636 @@
+/* Generated by Cython 0.21 */
+
+#define PY_SSIZE_T_CLEAN
+#ifndef CYTHON_USE_PYLONG_INTERNALS
+#ifdef PYLONG_BITS_IN_DIGIT
+#define CYTHON_USE_PYLONG_INTERNALS 0
+#else
+#include "pyconfig.h"
+#ifdef PYLONG_BITS_IN_DIGIT
+#define CYTHON_USE_PYLONG_INTERNALS 1
+#else
+#define CYTHON_USE_PYLONG_INTERNALS 0
+#endif
+#endif
+#endif
+#include "Python.h"
+#ifndef Py_PYTHON_H
+ #error Python headers needed to compile C extensions, please install development version of Python.
+#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
+ #error Cython requires Python 2.6+ or Python 3.2+.
+#else
+#define CYTHON_ABI "0_21"
+#include
+#ifndef offsetof
+#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
+#endif
+#if !defined(WIN32) && !defined(MS_WINDOWS)
+ #ifndef __stdcall
+ #define __stdcall
+ #endif
+ #ifndef __cdecl
+ #define __cdecl
+ #endif
+ #ifndef __fastcall
+ #define __fastcall
+ #endif
+#endif
+#ifndef DL_IMPORT
+ #define DL_IMPORT(t) t
+#endif
+#ifndef DL_EXPORT
+ #define DL_EXPORT(t) t
+#endif
+#ifndef PY_LONG_LONG
+ #define PY_LONG_LONG LONG_LONG
+#endif
+#ifndef Py_HUGE_VAL
+ #define Py_HUGE_VAL HUGE_VAL
+#endif
+#ifdef PYPY_VERSION
+#define CYTHON_COMPILING_IN_PYPY 1
+#define CYTHON_COMPILING_IN_CPYTHON 0
+#else
+#define CYTHON_COMPILING_IN_PYPY 0
+#define CYTHON_COMPILING_IN_CPYTHON 1
+#endif
+#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600
+#define Py_OptimizeFlag 0
+#endif
+#define __PYX_BUILD_PY_SSIZE_T "n"
+#define CYTHON_FORMAT_SSIZE_T "z"
+#if PY_MAJOR_VERSION < 3
+ #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
+ #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
+ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+ #define __Pyx_DefaultClassType PyClass_Type
+#else
+ #define __Pyx_BUILTIN_MODULE_NAME "builtins"
+ #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
+ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+ #define __Pyx_DefaultClassType PyType_Type
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define Py_TPFLAGS_CHECKTYPES 0
+ #define Py_TPFLAGS_HAVE_INDEX 0
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define Py_TPFLAGS_HAVE_NEWBUFFER 0
+#endif
+#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
+ #define Py_TPFLAGS_HAVE_FINALIZE 0
+#endif
+#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
+ #define CYTHON_PEP393_ENABLED 1
+ #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \
+ 0 : _PyUnicode_Ready((PyObject *)(op)))
+ #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
+ #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
+ #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
+ #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
+ #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
+#else
+ #define CYTHON_PEP393_ENABLED 0
+ #define __Pyx_PyUnicode_READY(op) (0)
+ #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
+ #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
+ #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
+ #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
+ #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
+#endif
+#if CYTHON_COMPILING_IN_PYPY
+ #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
+ #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
+#else
+ #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
+ #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \
+ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
+#endif
+#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
+#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
+#else
+ #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define PyBaseString_Type PyUnicode_Type
+ #define PyStringObject PyUnicodeObject
+ #define PyString_Type PyUnicode_Type
+ #define PyString_Check PyUnicode_Check
+ #define PyString_CheckExact PyUnicode_CheckExact
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
+ #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
+#else
+ #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
+ #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
+#endif
+#ifndef PySet_CheckExact
+ #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
+#endif
+#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
+#if PY_MAJOR_VERSION >= 3
+ #define PyIntObject PyLongObject
+ #define PyInt_Type PyLong_Type
+ #define PyInt_Check(op) PyLong_Check(op)
+ #define PyInt_CheckExact(op) PyLong_CheckExact(op)
+ #define PyInt_FromString PyLong_FromString
+ #define PyInt_FromUnicode PyLong_FromUnicode
+ #define PyInt_FromLong PyLong_FromLong
+ #define PyInt_FromSize_t PyLong_FromSize_t
+ #define PyInt_FromSsize_t PyLong_FromSsize_t
+ #define PyInt_AsLong PyLong_AsLong
+ #define PyInt_AS_LONG PyLong_AS_LONG
+ #define PyInt_AsSsize_t PyLong_AsSsize_t
+ #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
+ #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
+ #define PyNumber_Int PyNumber_Long
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define PyBoolObject PyLongObject
+#endif
+#if PY_VERSION_HEX < 0x030200A4
+ typedef long Py_hash_t;
+ #define __Pyx_PyInt_FromHash_t PyInt_FromLong
+ #define __Pyx_PyInt_AsHash_t PyInt_AsLong
+#else
+ #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
+ #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
+#endif
+#ifndef CYTHON_INLINE
+ #if defined(__GNUC__)
+ #define CYTHON_INLINE __inline__
+ #elif defined(_MSC_VER)
+ #define CYTHON_INLINE __inline
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define CYTHON_INLINE inline
+ #else
+ #define CYTHON_INLINE
+ #endif
+#endif
+#ifndef CYTHON_RESTRICT
+ #if defined(__GNUC__)
+ #define CYTHON_RESTRICT __restrict__
+ #elif defined(_MSC_VER) && _MSC_VER >= 1400
+ #define CYTHON_RESTRICT __restrict
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define CYTHON_RESTRICT restrict
+ #else
+ #define CYTHON_RESTRICT
+ #endif
+#endif
+#ifdef NAN
+#define __PYX_NAN() ((float) NAN)
+#else
+static CYTHON_INLINE float __PYX_NAN() {
+ /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
+ a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
+ a quiet NaN. */
+ float value;
+ memset(&value, 0xFF, sizeof(value));
+ return value;
+}
+#endif
+#ifdef __cplusplus
+template
+void __Pyx_call_destructor(T* x) {
+ x->~T();
+}
+#endif
+
+
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
+#else
+ #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
+#endif
+
+#ifndef __PYX_EXTERN_C
+ #ifdef __cplusplus
+ #define __PYX_EXTERN_C extern "C"
+ #else
+ #define __PYX_EXTERN_C extern
+ #endif
+#endif
+
+#if defined(WIN32) || defined(MS_WINDOWS)
+#define _USE_MATH_DEFINES
+#endif
+#include
+#define __PYX_HAVE__sklearn__manifold___barnes_hut_tsne
+#define __PYX_HAVE_API__sklearn__manifold___barnes_hut_tsne
+#include "string.h"
+#include "stdlib.h"
+#include "stdio.h"
+#include "math.h"
+#include "numpy/arrayobject.h"
+#include "numpy/ufuncobject.h"
+#include "time.h"
+#include "cblas.h"
+#include "pythread.h"
+#include "pystate.h"
+#ifdef _OPENMP
+#include
+#endif /* _OPENMP */
+
+#ifdef PYREX_WITHOUT_ASSERTIONS
+#define CYTHON_WITHOUT_ASSERTIONS
+#endif
+
+#ifndef CYTHON_UNUSED
+# if defined(__GNUC__)
+# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+#endif
+typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
+ const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
+
+#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
+#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
+#define __PYX_DEFAULT_STRING_ENCODING ""
+#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
+#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
+#define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \
+ (sizeof(type) < sizeof(Py_ssize_t)) || \
+ (sizeof(type) > sizeof(Py_ssize_t) && \
+ likely(v < (type)PY_SSIZE_T_MAX || \
+ v == (type)PY_SSIZE_T_MAX) && \
+ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \
+ v == (type)PY_SSIZE_T_MIN))) || \
+ (sizeof(type) == sizeof(Py_ssize_t) && \
+ (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \
+ v == (type)PY_SSIZE_T_MAX))) )
+static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
+static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
+#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
+#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
+#define __Pyx_PyBytes_FromString PyBytes_FromString
+#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
+static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
+#if PY_MAJOR_VERSION < 3
+ #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
+ #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
+#else
+ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
+ #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
+#endif
+#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((const char*)s)
+#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((const char*)s)
+#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((const char*)s)
+#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((const char*)s)
+#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s)
+#if PY_MAJOR_VERSION < 3
+static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
+{
+ const Py_UNICODE *u_end = u;
+ while (*u_end++) ;
+ return (size_t)(u_end - u - 1);
+}
+#else
+#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
+#endif
+#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
+#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
+#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
+#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
+#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
+static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
+static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
+static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
+#if CYTHON_COMPILING_IN_CPYTHON
+#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
+#else
+#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
+#endif
+#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
+#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+static int __Pyx_sys_getdefaultencoding_not_ascii;
+static int __Pyx_init_sys_getdefaultencoding_params(void) {
+ PyObject* sys;
+ PyObject* default_encoding = NULL;
+ PyObject* ascii_chars_u = NULL;
+ PyObject* ascii_chars_b = NULL;
+ const char* default_encoding_c;
+ sys = PyImport_ImportModule("sys");
+ if (!sys) goto bad;
+ default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
+ Py_DECREF(sys);
+ if (!default_encoding) goto bad;
+ default_encoding_c = PyBytes_AsString(default_encoding);
+ if (!default_encoding_c) goto bad;
+ if (strcmp(default_encoding_c, "ascii") == 0) {
+ __Pyx_sys_getdefaultencoding_not_ascii = 0;
+ } else {
+ char ascii_chars[128];
+ int c;
+ for (c = 0; c < 128; c++) {
+ ascii_chars[c] = c;
+ }
+ __Pyx_sys_getdefaultencoding_not_ascii = 1;
+ ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
+ if (!ascii_chars_u) goto bad;
+ ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
+ if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
+ PyErr_Format(
+ PyExc_ValueError,
+ "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
+ default_encoding_c);
+ goto bad;
+ }
+ Py_DECREF(ascii_chars_u);
+ Py_DECREF(ascii_chars_b);
+ }
+ Py_DECREF(default_encoding);
+ return 0;
+bad:
+ Py_XDECREF(default_encoding);
+ Py_XDECREF(ascii_chars_u);
+ Py_XDECREF(ascii_chars_b);
+ return -1;
+}
+#endif
+#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
+#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
+#else
+#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
+#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+static char* __PYX_DEFAULT_STRING_ENCODING;
+static int __Pyx_init_sys_getdefaultencoding_params(void) {
+ PyObject* sys;
+ PyObject* default_encoding = NULL;
+ char* default_encoding_c;
+ sys = PyImport_ImportModule("sys");
+ if (!sys) goto bad;
+ default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
+ Py_DECREF(sys);
+ if (!default_encoding) goto bad;
+ default_encoding_c = PyBytes_AsString(default_encoding);
+ if (!default_encoding_c) goto bad;
+ __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
+ if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
+ strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
+ Py_DECREF(default_encoding);
+ return 0;
+bad:
+ Py_XDECREF(default_encoding);
+ return -1;
+}
+#endif
+#endif
+
+
+/* Test for GCC > 2.95 */
+#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
+ #define likely(x) __builtin_expect(!!(x), 1)
+ #define unlikely(x) __builtin_expect(!!(x), 0)
+#else /* !__GNUC__ or GCC < 2.95 */
+ #define likely(x) (x)
+ #define unlikely(x) (x)
+#endif /* __GNUC__ */
+
+static PyObject *__pyx_m;
+static PyObject *__pyx_d;
+static PyObject *__pyx_b;
+static PyObject *__pyx_empty_tuple;
+static PyObject *__pyx_empty_bytes;
+static int __pyx_lineno;
+static int __pyx_clineno = 0;
+static const char * __pyx_cfilenm= __FILE__;
+static const char *__pyx_filename;
+
+#if !defined(CYTHON_CCOMPLEX)
+ #if defined(__cplusplus)
+ #define CYTHON_CCOMPLEX 1
+ #elif defined(_Complex_I)
+ #define CYTHON_CCOMPLEX 1
+ #else
+ #define CYTHON_CCOMPLEX 0
+ #endif
+#endif
+#if CYTHON_CCOMPLEX
+ #ifdef __cplusplus
+ #include
+ #else
+ #include
+ #endif
+#endif
+#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
+ #undef _Complex_I
+ #define _Complex_I 1.0fj
+#endif
+
+
+static const char *__pyx_f[] = {
+ "sklearn/manifold/_barnes_hut_tsne.pyx",
+ "__init__.pxd",
+ "sklearn/manifold/stringsource",
+ "type.pxd",
+};
+struct __pyx_memoryview_obj;
+typedef struct {
+ struct __pyx_memoryview_obj *memview;
+ char *data;
+ Py_ssize_t shape[8];
+ Py_ssize_t strides[8];
+ Py_ssize_t suboffsets[8];
+} __Pyx_memviewslice;
+
+#define IS_UNSIGNED(type) (((type) -1) > 0)
+struct __Pyx_StructField_;
+#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
+typedef struct {
+ const char* name;
+ struct __Pyx_StructField_* fields;
+ size_t size;
+ size_t arraysize[8];
+ int ndim;
+ char typegroup;
+ char is_unsigned;
+ int flags;
+} __Pyx_TypeInfo;
+typedef struct __Pyx_StructField_ {
+ __Pyx_TypeInfo* type;
+ const char* name;
+ size_t offset;
+} __Pyx_StructField;
+typedef struct {
+ __Pyx_StructField* field;
+ size_t parent_offset;
+} __Pyx_BufFmt_StackElem;
+typedef struct {
+ __Pyx_StructField root;
+ __Pyx_BufFmt_StackElem* head;
+ size_t fmt_offset;
+ size_t new_count, enc_count;
+ size_t struct_alignment;
+ int is_complex;
+ char enc_type;
+ char new_packmode;
+ char enc_packmode;
+ char is_valid_array;
+} __Pyx_BufFmt_Context;
+
+#include
+#ifndef CYTHON_ATOMICS
+ #define CYTHON_ATOMICS 1
+#endif
+#define __pyx_atomic_int_type int
+#if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 || \
+ (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) && \
+ !defined(__i386__)
+ #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
+ #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
+ #ifdef __PYX_DEBUG_ATOMICS
+ #warning "Using GNU atomics"
+ #endif
+#elif CYTHON_ATOMICS && MSC_VER
+ #include
+ #define __pyx_atomic_int_type LONG
+ #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
+ #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
+ #ifdef __PYX_DEBUG_ATOMICS
+ #warning "Using MSVC atomics"
+ #endif
+#elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
+ #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
+ #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
+ #ifdef __PYX_DEBUG_ATOMICS
+ #warning "Using Intel atomics"
+ #endif
+#else
+ #undef CYTHON_ATOMICS
+ #define CYTHON_ATOMICS 0
+ #ifdef __PYX_DEBUG_ATOMICS
+ #warning "Not using atomics"
+ #endif
+#endif
+typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
+#if CYTHON_ATOMICS
+ #define __pyx_add_acquisition_count(memview) \
+ __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
+ #define __pyx_sub_acquisition_count(memview) \
+ __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
+#else
+ #define __pyx_add_acquisition_count(memview) \
+ __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
+ #define __pyx_sub_acquisition_count(memview) \
+ __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
+#endif
+
+
+/* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":723
+ * # in Cython to enable them only on the right systems.
+ *
+ * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
+ * ctypedef npy_int16 int16_t
+ * ctypedef npy_int32 int32_t
+ */
+typedef npy_int8 __pyx_t_5numpy_int8_t;
+
+/* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":724
+ *
+ * ctypedef npy_int8 int8_t
+ * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
+ * ctypedef npy_int32 int32_t
+ * ctypedef npy_int64 int64_t
+ */
+typedef npy_int16 __pyx_t_5numpy_int16_t;
+
+/* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":725
+ * ctypedef npy_int8 int8_t
+ * ctypedef npy_int16 int16_t
+ * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
+ * ctypedef npy_int64 int64_t
+ * #ctypedef npy_int96 int96_t
+ */
+typedef npy_int32 __pyx_t_5numpy_int32_t;
+
+/* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":726
+ * ctypedef npy_int16 int16_t
+ * ctypedef npy_int32 int32_t
+ * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
+ * #ctypedef npy_int96 int96_t
+ * #ctypedef npy_int128 int128_t
+ */
+typedef npy_int64 __pyx_t_5numpy_int64_t;
+
+/* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":730
+ * #ctypedef npy_int128 int128_t
+ *
+ * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
+ * ctypedef npy_uint16 uint16_t
+ * ctypedef npy_uint32 uint32_t
+ */
+typedef npy_uint8 __pyx_t_5numpy_uint8_t;
+
+/* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":731
+ *
+ * ctypedef npy_uint8 uint8_t
+ * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
+ * ctypedef npy_uint32 uint32_t
+ * ctypedef npy_uint64 uint64_t
+ */
+typedef npy_uint16 __pyx_t_5numpy_uint16_t;
+
+/* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":732
+ * ctypedef npy_uint8 uint8_t
+ * ctypedef npy_uint16 uint16_t
+ * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
+ * ctypedef npy_uint64 uint64_t
+ * #ctypedef npy_uint96 uint96_t
+ */
+typedef npy_uint32 __pyx_t_5numpy_uint32_t;
+
+/* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":733
+ * ctypedef npy_uint16 uint16_t
+ * ctypedef npy_uint32 uint32_t
+ * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
+ * #ctypedef npy_uint96 uint96_t
+ * #ctypedef npy_uint128 uint128_t
+ */
+typedef npy_uint64 __pyx_t_5numpy_uint64_t;
+
+/* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":737
+ * #ctypedef npy_uint128 uint128_t
+ *
+ * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
+ * ctypedef npy_float64 float64_t
+ * #ctypedef npy_float80 float80_t
+ */
+typedef npy_float32 __pyx_t_5numpy_float32_t;
+
+/* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":738
+ *
+ * ctypedef npy_float32 float32_t
+ * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
+ * #ctypedef npy_float80 float80_t
+ * #ctypedef npy_float128 float128_t
+ */
+typedef npy_float64 __pyx_t_5numpy_float64_t;
+
+/* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":747
+ * # The int types are mapped a bit surprising --
+ * # numpy.int corresponds to 'l' and numpy.long to 'q'
+ * ctypedef npy_long int_t # <<<<<<<<<<<<<<
+ * ctypedef npy_longlong long_t
+ * ctypedef npy_longlong longlong_t
+ */
+typedef npy_long __pyx_t_5numpy_int_t;
+
+/* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":748
+ * # numpy.int corresponds to 'l' and numpy.long to 'q'
+ * ctypedef npy_long int_t
+ * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
+ * ctypedef npy_longlong longlong_t
+ *
+ */
+typedef npy_longlong __pyx_t_5numpy_long_t;
+
+/* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":749
+ * ctypedef npy_long int_t
+ * ctypedef npy_longlong long_t
+ * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
+ *
+ * ctypedef npy_ulong uint_t
+ */
+typedef npy_longlong __pyx_t_5numpy_longlong_t;
+
+/* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":751
+ * ctypedef npy_longlong longlong_t
+ *
+ * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
+ * ctypedef npy_ulonglong ulong_t
+ * ctypedef npy_ulonglong ulonglong_t
+ */
+typedef npy_ulong __pyx_t_5numpy_uint_t;
+
+/* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":752
+ *
+ * ctypedef npy_ulong uint_t
+ * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
+ * ctypedef npy_ulonglong ulonglong_t
+ *
+ */
+typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
+
+/* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":753
+ * ctypedef npy_ulong uint_t
+ * ctypedef npy_ulonglong ulong_t
+ * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
+ *
+ * ctypedef npy_intp intp_t
+ */
+typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
+
+/* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":755
+ * ctypedef npy_ulonglong ulonglong_t
+ *
+ * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
+ * ctypedef npy_uintp uintp_t
+ *
+ */
+typedef npy_intp __pyx_t_5numpy_intp_t;
+
+/* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":756
+ *
+ * ctypedef npy_intp intp_t
+ * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
+ *
+ * ctypedef npy_double float_t
+ */
+typedef npy_uintp __pyx_t_5numpy_uintp_t;
+
+/* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":758
+ * ctypedef npy_uintp uintp_t
+ *
+ * ctypedef npy_double float_t # <<<<<<<<<<<<<<
+ * ctypedef npy_double double_t
+ * ctypedef npy_longdouble longdouble_t
+ */
+typedef npy_double __pyx_t_5numpy_float_t;
+
+/* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":759
+ *
+ * ctypedef npy_double float_t
+ * ctypedef npy_double double_t # <<<<<<<<<<<<<<
+ * ctypedef npy_longdouble longdouble_t
+ *
+ */
+typedef npy_double __pyx_t_5numpy_double_t;
+
+/* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":760
+ * ctypedef npy_double float_t
+ * ctypedef npy_double double_t
+ * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
+ *
+ * ctypedef npy_cfloat cfloat_t
+ */
+typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
+#if CYTHON_CCOMPLEX
+ #ifdef __cplusplus
+ typedef ::std::complex< float > __pyx_t_float_complex;
+ #else
+ typedef float _Complex __pyx_t_float_complex;
+ #endif
+#else
+ typedef struct { float real, imag; } __pyx_t_float_complex;
+#endif
+
+#if CYTHON_CCOMPLEX
+ #ifdef __cplusplus
+ typedef ::std::complex< double > __pyx_t_double_complex;
+ #else
+ typedef double _Complex __pyx_t_double_complex;
+ #endif
+#else
+ typedef struct { double real, imag; } __pyx_t_double_complex;
+#endif
+
+
+/*--- Type declarations ---*/
+struct __pyx_array_obj;
+struct __pyx_MemviewEnum_obj;
+struct __pyx_memoryview_obj;
+struct __pyx_memoryviewslice_obj;
+
+/* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":762
+ * ctypedef npy_longdouble longdouble_t
+ *
+ * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
+ * ctypedef npy_cdouble cdouble_t
+ * ctypedef npy_clongdouble clongdouble_t
+ */
+typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
+
+/* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":763
+ *
+ * ctypedef npy_cfloat cfloat_t
+ * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
+ * ctypedef npy_clongdouble clongdouble_t
+ *
+ */
+typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
+
+/* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":764
+ * ctypedef npy_cfloat cfloat_t
+ * ctypedef npy_cdouble cdouble_t
+ * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
+ *
+ * ctypedef npy_cdouble complex_t
+ */
+typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
+
+/* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":766
+ * ctypedef npy_clongdouble clongdouble_t
+ *
+ * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
+ *
+ * cdef inline object PyArray_MultiIterNew1(a):
+ */
+typedef npy_cdouble __pyx_t_5numpy_complex_t;
+struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Node;
+struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Tree;
+
+/* "sklearn/manifold/_barnes_hut_tsne.pyx":28
+ * # It allows us to write printf debugging lines
+ * # and remove them at compile time
+ * cdef enum: # <<<<<<<<<<<<<<
+ * DEBUGFLAG = 0
+ *
+ */
+enum {
+ __pyx_e_7sklearn_8manifold_16_barnes_hut_tsne_DEBUGFLAG = 0
+};
+
+/* "sklearn/manifold/_barnes_hut_tsne.pyx":42
+ *
+ *
+ * cdef struct Node: # <<<<<<<<<<<<<<
+ * # Keep track of the center of mass
+ * float* barycenter
+ */
+struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Node {
+ float *barycenter;
+ float *leaf_point_position;
+ long cumulative_size;
+ long size;
+ long point_index;
+ long level;
+ float *left_edge;
+ float *center;
+ float *width;
+ float max_width;
+ int is_leaf;
+ struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Node **children;
+ struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Node *parent;
+ struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Tree *tree;
+};
+
+/* "sklearn/manifold/_barnes_hut_tsne.pyx":78
+ * Tree* tree
+ *
+ * cdef struct Tree: # <<<<<<<<<<<<<<
+ * # Holds a pointer to the root node
+ * Node* root_node
+ */
+struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Tree {
+ struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Node *root_node;
+ int n_dimensions;
+ long n_cells;
+ long n_points;
+ int verbose;
+ int n_cell_per_node;
+};
+
+/* "View.MemoryView":99
+ *
+ * @cname("__pyx_array")
+ * cdef class array: # <<<<<<<<<<<<<<
+ *
+ * cdef:
+ */
+struct __pyx_array_obj {
+ PyObject_HEAD
+ char *data;
+ Py_ssize_t len;
+ char *format;
+ int ndim;
+ Py_ssize_t *_shape;
+ Py_ssize_t *_strides;
+ Py_ssize_t itemsize;
+ PyObject *mode;
+ PyObject *_format;
+ void (*callback_free_data)(void *);
+ int free_data;
+ int dtype_is_object;
+};
+
+
+/* "View.MemoryView":269
+ *
+ * @cname('__pyx_MemviewEnum')
+ * cdef class Enum(object): # <<<<<<<<<<<<<<
+ * cdef object name
+ * def __init__(self, name):
+ */
+struct __pyx_MemviewEnum_obj {
+ PyObject_HEAD
+ PyObject *name;
+};
+
+
+/* "View.MemoryView":302
+ *
+ * @cname('__pyx_memoryview')
+ * cdef class memoryview(object): # <<<<<<<<<<<<<<
+ *
+ * cdef object obj
+ */
+struct __pyx_memoryview_obj {
+ PyObject_HEAD
+ struct __pyx_vtabstruct_memoryview *__pyx_vtab;
+ PyObject *obj;
+ PyObject *_size;
+ PyObject *_array_interface;
+ PyThread_type_lock lock;
+ __pyx_atomic_int acquisition_count[2];
+ __pyx_atomic_int *acquisition_count_aligned_p;
+ Py_buffer view;
+ int flags;
+ int dtype_is_object;
+ __Pyx_TypeInfo *typeinfo;
+};
+
+
+/* "View.MemoryView":922
+ *
+ * @cname('__pyx_memoryviewslice')
+ * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
+ * "Internal class for passing memoryview slices to Python"
+ *
+ */
+struct __pyx_memoryviewslice_obj {
+ struct __pyx_memoryview_obj __pyx_base;
+ __Pyx_memviewslice from_slice;
+ PyObject *from_object;
+ PyObject *(*to_object_func)(char *);
+ int (*to_dtype_func)(char *, PyObject *);
+};
+
+
+
+/* "View.MemoryView":302
+ *
+ * @cname('__pyx_memoryview')
+ * cdef class memoryview(object): # <<<<<<<<<<<<<<
+ *
+ * cdef object obj
+ */
+
+struct __pyx_vtabstruct_memoryview {
+ char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
+ PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
+ PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
+ PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
+ PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
+ PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
+ PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
+};
+static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
+
+
+/* "View.MemoryView":922
+ *
+ * @cname('__pyx_memoryviewslice')
+ * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
+ * "Internal class for passing memoryview slices to Python"
+ *
+ */
+
+struct __pyx_vtabstruct__memoryviewslice {
+ struct __pyx_vtabstruct_memoryview __pyx_base;
+};
+static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
+#ifndef CYTHON_REFNANNY
+ #define CYTHON_REFNANNY 0
+#endif
+#if CYTHON_REFNANNY
+ typedef struct {
+ void (*INCREF)(void*, PyObject*, int);
+ void (*DECREF)(void*, PyObject*, int);
+ void (*GOTREF)(void*, PyObject*, int);
+ void (*GIVEREF)(void*, PyObject*, int);
+ void* (*SetupContext)(const char*, int, const char*);
+ void (*FinishContext)(void**);
+ } __Pyx_RefNannyAPIStruct;
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
+ #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
+#ifdef WITH_THREAD
+ #define __Pyx_RefNannySetupContext(name, acquire_gil) \
+ if (acquire_gil) { \
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
+ PyGILState_Release(__pyx_gilstate_save); \
+ } else { \
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
+ }
+#else
+ #define __Pyx_RefNannySetupContext(name, acquire_gil) \
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
+#endif
+ #define __Pyx_RefNannyFinishContext() \
+ __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
+ #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
+ #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
+ #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
+ #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
+#else
+ #define __Pyx_RefNannyDeclarations
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)
+ #define __Pyx_RefNannyFinishContext()
+ #define __Pyx_INCREF(r) Py_INCREF(r)
+ #define __Pyx_DECREF(r) Py_DECREF(r)
+ #define __Pyx_GOTREF(r)
+ #define __Pyx_GIVEREF(r)
+ #define __Pyx_XINCREF(r) Py_XINCREF(r)
+ #define __Pyx_XDECREF(r) Py_XDECREF(r)
+ #define __Pyx_XGOTREF(r)
+ #define __Pyx_XGIVEREF(r)
+#endif
+#define __Pyx_XDECREF_SET(r, v) do { \
+ PyObject *tmp = (PyObject *) r; \
+ r = v; __Pyx_XDECREF(tmp); \
+ } while (0)
+#define __Pyx_DECREF_SET(r, v) do { \
+ PyObject *tmp = (PyObject *) r; \
+ r = v; __Pyx_DECREF(tmp); \
+ } while (0)
+#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
+#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
+ PyTypeObject* tp = Py_TYPE(obj);
+ if (likely(tp->tp_getattro))
+ return tp->tp_getattro(obj, attr_name);
+#if PY_MAJOR_VERSION < 3
+ if (likely(tp->tp_getattr))
+ return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
+#endif
+ return PyObject_GetAttr(obj, attr_name);
+}
+#else
+#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
+#endif
+
+static PyObject *__Pyx_GetBuiltinName(PyObject *name);
+
+static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
+#else
+#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
+#endif
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
+#endif
+
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
+
+static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
+ Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
+
+static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
+
+static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
+ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
+ const char* function_name);
+
+static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
+
+static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
+
+static CYTHON_INLINE int __Pyx_IterFinish(void);
+
+static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
+
+static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
+ __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
+static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);
+
+#define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
+#define __Pyx_MEMVIEW_DIRECT 1
+#define __Pyx_MEMVIEW_PTR 2
+#define __Pyx_MEMVIEW_FULL 4
+#define __Pyx_MEMVIEW_CONTIG 8
+#define __Pyx_MEMVIEW_STRIDED 16
+#define __Pyx_MEMVIEW_FOLLOW 32
+#define __Pyx_IS_C_CONTIG 1
+#define __Pyx_IS_F_CONTIG 2
+static int __Pyx_init_memviewslice(
+ struct __pyx_memoryview_obj *memview,
+ int ndim,
+ __Pyx_memviewslice *memviewslice,
+ int memview_is_new_reference);
+static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
+ __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
+static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
+ __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
+#define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
+#define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
+#define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
+#define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
+static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
+static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
+
+static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb);
+static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb);
+
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
+
+static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
+
+static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
+
+static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
+ const char *name, int exact);
+
+#include
+
+static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
+
+static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
+
+#if PY_MAJOR_VERSION >= 3
+#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
+#else
+#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
+#endif
+
+#ifndef __PYX_FORCE_INIT_THREADS
+ #define __PYX_FORCE_INIT_THREADS 0
+#endif
+
+#define UNARY_NEG_WOULD_OVERFLOW(x) (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
+
+static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
+static PyObject *get_memview(PyObject *__pyx_v_self); /*proto*/
+static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
+
+static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
+ const char* cstring, Py_ssize_t start, Py_ssize_t stop,
+ const char* encoding, const char* errors,
+ PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
+
+static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb);
+static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb);
+
+static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
+
+static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
+
+#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
+ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
+ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) : \
+ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) : \
+ __Pyx_GetItemInt_Generic(o, to_py_func(i))))
+#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
+ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
+ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
+ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
+ int wraparound, int boundscheck);
+#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
+ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
+ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
+ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
+ int wraparound, int boundscheck);
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
+ int is_list, int wraparound, int boundscheck);
+
+static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
+static PyObject *__pyx_memoryview_transpose(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview__get__base(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview_get_shape(PyObject *__pyx_v_self); /*proto*/
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
+ PyListObject* L = (PyListObject*) list;
+ Py_ssize_t len = Py_SIZE(list);
+ if (likely(L->allocated > len)) {
+ Py_INCREF(x);
+ PyList_SET_ITEM(list, len, x);
+ Py_SIZE(list) = len+1;
+ return 0;
+ }
+ return PyList_Append(list, x);
+}
+#else
+#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
+#endif
+
+static PyObject *__pyx_memoryview_get_strides(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview_get_suboffsets(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview_get_ndim(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview_get_itemsize(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview_get_nbytes(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview_get_size(PyObject *__pyx_v_self); /*proto*/
+static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyObject* none = _PyList_Extend((PyListObject*)L, v);
+ if (unlikely(!none))
+ return -1;
+ Py_DECREF(none);
+ return 0;
+#else
+ return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
+#endif
+}
+
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
+ PyListObject* L = (PyListObject*) list;
+ Py_ssize_t len = Py_SIZE(list);
+ if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
+ Py_INCREF(x);
+ PyList_SET_ITEM(list, len, x);
+ Py_SIZE(list) = len+1;
+ return 0;
+ }
+ return PyList_Append(list, x);
+}
+#else
+#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
+#endif
+
+static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
+
+static PyObject *__pyx_memoryviewslice__get__base(PyObject *__pyx_v_self); /*proto*/
+static void __Pyx_WriteUnraisable(const char *name, int clineno,
+ int lineno, const char *filename,
+ int full_traceback);
+
+static int __Pyx_SetVtable(PyObject *dict, void *vtable);
+
+typedef struct {
+ int code_line;
+ PyCodeObject* code_object;
+} __Pyx_CodeObjectCacheEntry;
+struct __Pyx_CodeObjectCache {
+ int count;
+ int max_count;
+ __Pyx_CodeObjectCacheEntry* entries;
+};
+static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
+static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
+static PyCodeObject *__pyx_find_code_object(int code_line);
+static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
+
+static void __Pyx_AddTraceback(const char *funcname, int c_line,
+ int py_line, const char *filename);
+
+typedef struct {
+ Py_ssize_t shape, strides, suboffsets;
+} __Pyx_Buf_DimInfo;
+typedef struct {
+ size_t refcount;
+ Py_buffer pybuffer;
+} __Pyx_Buffer;
+typedef struct {
+ __Pyx_Buffer *rcbuffer;
+ char *data;
+ __Pyx_Buf_DimInfo diminfo[8];
+} __Pyx_LocalBuf_ND;
+
+#if PY_MAJOR_VERSION < 3
+ static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
+ static void __Pyx_ReleaseBuffer(Py_buffer *view);
+#else
+ #define __Pyx_GetBuffer PyObject_GetBuffer
+ #define __Pyx_ReleaseBuffer PyBuffer_Release
+#endif
+
+
+static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0};
+static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1};
+
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
+
+static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
+
+static int __Pyx_ValidateAndInit_memviewslice(
+ int *axes_specs,
+ int c_or_f_flag,
+ int buf_flags,
+ int ndim,
+ __Pyx_TypeInfo *dtype,
+ __Pyx_BufFmt_StackElem stack[],
+ __Pyx_memviewslice *memviewslice,
+ PyObject *original_obj);
+
+static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_float(PyObject *);
+
+static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_long(PyObject *);
+
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
+
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
+
+static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_long(PyObject *);
+
+static CYTHON_INLINE long __Pyx_pow_long(long, long); /* proto */
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
+
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_clock_t(clock_t value);
+
+static PyObject *__pyx_memview_get_float(const char *itemp);
+static int __pyx_memview_set_float(const char *itemp, PyObject *obj);
+
+static PyObject *__pyx_memview_get_long(const char *itemp);
+static int __pyx_memview_set_long(const char *itemp, PyObject *obj);
+
+#if CYTHON_CCOMPLEX
+ #ifdef __cplusplus
+ #define __Pyx_CREAL(z) ((z).real())
+ #define __Pyx_CIMAG(z) ((z).imag())
+ #else
+ #define __Pyx_CREAL(z) (__real__(z))
+ #define __Pyx_CIMAG(z) (__imag__(z))
+ #endif
+#else
+ #define __Pyx_CREAL(z) ((z).real)
+ #define __Pyx_CIMAG(z) ((z).imag)
+#endif
+#if (defined(_WIN32) || defined(__clang__)) && defined(__cplusplus) && CYTHON_CCOMPLEX
+ #define __Pyx_SET_CREAL(z,x) ((z).real(x))
+ #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
+#else
+ #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
+ #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
+#endif
+
+static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
+
+#if CYTHON_CCOMPLEX
+ #define __Pyx_c_eqf(a, b) ((a)==(b))
+ #define __Pyx_c_sumf(a, b) ((a)+(b))
+ #define __Pyx_c_difff(a, b) ((a)-(b))
+ #define __Pyx_c_prodf(a, b) ((a)*(b))
+ #define __Pyx_c_quotf(a, b) ((a)/(b))
+ #define __Pyx_c_negf(a) (-(a))
+ #ifdef __cplusplus
+ #define __Pyx_c_is_zerof(z) ((z)==(float)0)
+ #define __Pyx_c_conjf(z) (::std::conj(z))
+ #if 1
+ #define __Pyx_c_absf(z) (::std::abs(z))
+ #define __Pyx_c_powf(a, b) (::std::pow(a, b))
+ #endif
+ #else
+ #define __Pyx_c_is_zerof(z) ((z)==0)
+ #define __Pyx_c_conjf(z) (conjf(z))
+ #if 1
+ #define __Pyx_c_absf(z) (cabsf(z))
+ #define __Pyx_c_powf(a, b) (cpowf(a, b))
+ #endif
+ #endif
+#else
+ static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex);
+ static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex);
+ #if 1
+ static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex);
+ #endif
+#endif
+
+static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
+
+#if CYTHON_CCOMPLEX
+ #define __Pyx_c_eq(a, b) ((a)==(b))
+ #define __Pyx_c_sum(a, b) ((a)+(b))
+ #define __Pyx_c_diff(a, b) ((a)-(b))
+ #define __Pyx_c_prod(a, b) ((a)*(b))
+ #define __Pyx_c_quot(a, b) ((a)/(b))
+ #define __Pyx_c_neg(a) (-(a))
+ #ifdef __cplusplus
+ #define __Pyx_c_is_zero(z) ((z)==(double)0)
+ #define __Pyx_c_conj(z) (::std::conj(z))
+ #if 1
+ #define __Pyx_c_abs(z) (::std::abs(z))
+ #define __Pyx_c_pow(a, b) (::std::pow(a, b))
+ #endif
+ #else
+ #define __Pyx_c_is_zero(z) ((z)==0)
+ #define __Pyx_c_conj(z) (conj(z))
+ #if 1
+ #define __Pyx_c_abs(z) (cabs(z))
+ #define __Pyx_c_pow(a, b) (cpow(a, b))
+ #endif
+ #endif
+#else
+ static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex);
+ static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex);
+ #if 1
+ static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex);
+ #endif
+#endif
+
+static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice *mvs,
+ char order, int ndim);
+
+static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
+ __Pyx_memviewslice *slice2,
+ int ndim, size_t itemsize);
+
+static __Pyx_memviewslice
+__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
+ const char *mode, int ndim,
+ size_t sizeof_dtype, int contig_flag,
+ int dtype_is_object);
+
+static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
+
+static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
+
+static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *);
+
+static int __Pyx_check_binary_version(void);
+
+#if !defined(__Pyx_PyIdentifier_FromString)
+#if PY_MAJOR_VERSION < 3
+ #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
+#else
+ #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
+#endif
+#endif
+
+static PyObject *__Pyx_ImportModule(const char *name);
+
+static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);
+
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
+
+static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
+static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
+static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
+static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
+static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
+static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
+static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
+static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
+static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
+
+/* Module declarations from 'libc.string' */
+
+/* Module declarations from 'libc.stdlib' */
+
+/* Module declarations from 'libc.stdio' */
+
+/* Module declarations from 'libc.math' */
+
+/* Module declarations from 'cpython.buffer' */
+
+/* Module declarations from 'cpython.ref' */
+
+/* Module declarations from 'cpython.object' */
+
+/* Module declarations from '__builtin__' */
+
+/* Module declarations from 'cpython.type' */
+static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
+
+/* Module declarations from 'numpy' */
+
+/* Module declarations from 'numpy' */
+static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
+static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
+static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
+static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
+static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
+static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
+
+/* Module declarations from 'sklearn.manifold._barnes_hut_tsne' */
+static PyTypeObject *__pyx_array_type = 0;
+static PyTypeObject *__pyx_MemviewEnum_type = 0;
+static PyTypeObject *__pyx_memoryview_type = 0;
+static PyTypeObject *__pyx_memoryviewslice_type = 0;
+static float __pyx_v_7sklearn_8manifold_16_barnes_hut_tsne_EPSILON;
+static PyObject *generic = 0;
+static PyObject *strided = 0;
+static PyObject *indirect = 0;
+static PyObject *contiguous = 0;
+static PyObject *indirect_contiguous = 0;
+static struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Tree *__pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_init_tree(__Pyx_memviewslice, __Pyx_memviewslice, int, int); /*proto*/
+static struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Node *__pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_create_root(__Pyx_memviewslice, __Pyx_memviewslice, int); /*proto*/
+static struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Node *__pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_create_child(struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Node *, int *); /*proto*/
+static struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Node *__pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_select_child(struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Node *, float *, long); /*proto*/
+static CYTHON_INLINE void __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_index2offset(int *, int, int); /*proto*/
+static CYTHON_INLINE int __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_offset2index(int *, int); /*proto*/
+static void __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_subdivide(struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Node *); /*proto*/
+static int __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_insert(struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Node *, float *, long, long, long); /*proto*/
+static int __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_insert_many(struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Tree *, __Pyx_memviewslice); /*proto*/
+static int __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_free_tree(struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Tree *); /*proto*/
+static void __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_free_recursive(struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Tree *, struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Node *, long *); /*proto*/
+static long __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_count_points(struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Node *, long); /*proto*/
+static float __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_compute_gradient(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Node *, float, float, long, long); /*proto*/
+static float __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_compute_gradient_positive(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, float *, int, float, float, long, int); /*proto*/
+static void __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_compute_gradient_negative(__Pyx_memviewslice, __Pyx_memviewslice, float *, struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Node *, float *, float, float, long, long); /*proto*/
+static void __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_compute_non_edge_forces(struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Node *, float, long, float *, float *, float *, long *, float *, long *); /*proto*/
+static float __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_compute_error(__Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, float, int, int); /*proto*/
+static int __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_helper_test_index2offset(int *, int, int); /*proto*/
+static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
+static void *__pyx_align_pointer(void *, size_t); /*proto*/
+static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
+static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
+static PyObject *_unellipsify(PyObject *, int); /*proto*/
+static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
+static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
+static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
+static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
+static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
+static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
+static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
+static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
+static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
+static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
+static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
+static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
+static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
+static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
+static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
+static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
+static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
+static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
+static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
+static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
+static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
+static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
+static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
+static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
+static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
+static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
+static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
+static __Pyx_TypeInfo __Pyx_TypeInfo_float = { "float", NULL, sizeof(float), { 0 }, 0, 'R', 0, 0 };
+static __Pyx_TypeInfo __Pyx_TypeInfo_long = { "long", NULL, sizeof(long), { 0 }, 0, IS_UNSIGNED(long) ? 'U' : 'I', IS_UNSIGNED(long), 0 };
+#define __Pyx_MODULE_NAME "sklearn.manifold._barnes_hut_tsne"
+int __pyx_module_is_main_sklearn__manifold___barnes_hut_tsne = 0;
+
+/* Implementation of 'sklearn.manifold._barnes_hut_tsne' */
+static PyObject *__pyx_builtin_range;
+static PyObject *__pyx_builtin_ValueError;
+static PyObject *__pyx_builtin_RuntimeError;
+static PyObject *__pyx_builtin_MemoryError;
+static PyObject *__pyx_builtin_enumerate;
+static PyObject *__pyx_builtin_Ellipsis;
+static PyObject *__pyx_builtin_TypeError;
+static PyObject *__pyx_builtin_xrange;
+static PyObject *__pyx_builtin_id;
+static PyObject *__pyx_builtin_IndexError;
+static PyObject *__pyx_pf_7sklearn_8manifold_16_barnes_hut_tsne_calculate_edge(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_pos_output); /* proto */
+static PyObject *__pyx_pf_7sklearn_8manifold_16_barnes_hut_tsne_2gradient(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_pij_input, __Pyx_memviewslice __pyx_v_pos_output, __Pyx_memviewslice __pyx_v_neighbors, __Pyx_memviewslice __pyx_v_forces, float __pyx_v_theta, int __pyx_v_n_dimensions, int __pyx_v_verbose, float __pyx_v_dof, long __pyx_v_skip_num_points); /* proto */
+static PyObject *__pyx_pf_7sklearn_8manifold_16_barnes_hut_tsne_4check_quadtree(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_X, __Pyx_memviewslice __pyx_v_counts); /* proto */
+static PyObject *__pyx_pf_7sklearn_8manifold_16_barnes_hut_tsne_6test_index2offset(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
+static PyObject *__pyx_pf_7sklearn_8manifold_16_barnes_hut_tsne_8test_index_offset(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
+static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
+static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
+static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
+static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
+static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
+static PyObject *get_memview_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_array_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
+static PyObject *__pyx_array_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
+static int __pyx_array_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
+static int __pyx_MemviewEnum_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
+static PyObject *__pyx_MemviewEnum_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
+static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
+static void __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
+static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
+static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
+static PyObject *__pyx_memoryview_transpose_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview__get__base_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_get_shape_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_get_strides_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_get_suboffsets_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_get_ndim_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_get_itemsize_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static void __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static char __pyx_k_B[] = "B";
+static char __pyx_k_C[] = "C";
+static char __pyx_k_H[] = "H";
+static char __pyx_k_I[] = "I";
+static char __pyx_k_L[] = "L";
+static char __pyx_k_O[] = "O";
+static char __pyx_k_Q[] = "Q";
+static char __pyx_k_X[] = "X";
+static char __pyx_k_b[] = "b";
+static char __pyx_k_c[] = "c";
+static char __pyx_k_d[] = "d";
+static char __pyx_k_f[] = "f";
+static char __pyx_k_g[] = "g";
+static char __pyx_k_h[] = "h";
+static char __pyx_k_i[] = " %i";
+static char __pyx_k_k[] = "k";
+static char __pyx_k_l[] = "l";
+static char __pyx_k_m[] = "m";
+static char __pyx_k_n[] = "n";
+static char __pyx_k_q[] = "q";
+static char __pyx_k_Zd[] = "Zd";
+static char __pyx_k_Zf[] = "Zf";
+static char __pyx_k_Zg[] = "Zg";
+static char __pyx_k_id[] = "id";
+static char __pyx_k_np[] = "np";
+static char __pyx_k_qt[] = "qt";
+static char __pyx_k_dof[] = "dof";
+static char __pyx_k_err[] = "err";
+static char __pyx_k_i_2[] = "i";
+static char __pyx_k_idx[] = "idx";
+static char __pyx_k_max[] = "max";
+static char __pyx_k_min[] = "min";
+static char __pyx_k_obj[] = "obj";
+static char __pyx_k_ret[] = "ret";
+static char __pyx_k_axis[] = "axis";
+static char __pyx_k_base[] = "base";
+static char __pyx_k_main[] = "__main__";
+static char __pyx_k_mode[] = "mode";
+static char __pyx_k_name[] = "name";
+static char __pyx_k_ndim[] = "ndim";
+static char __pyx_k_pack[] = "pack";
+static char __pyx_k_size[] = "size";
+static char __pyx_k_step[] = "step";
+static char __pyx_k_stop[] = "stop";
+static char __pyx_k_test[] = "__test__";
+static char __pyx_k_tidx[] = "tidx";
+static char __pyx_k_class[] = "__class__";
+static char __pyx_k_count[] = "count";
+static char __pyx_k_error[] = "error";
+static char __pyx_k_flags[] = "flags";
+static char __pyx_k_numpy[] = "numpy";
+static char __pyx_k_range[] = "range";
+static char __pyx_k_shape[] = "shape";
+static char __pyx_k_start[] = "start";
+static char __pyx_k_sum_Q[] = "sum_Q";
+static char __pyx_k_theta[] = "theta";
+static char __pyx_k_width[] = "width";
+static char __pyx_k_astype[] = "astype";
+static char __pyx_k_center[] = "center";
+static char __pyx_k_counts[] = "counts";
+static char __pyx_k_forces[] = "forces";
+static char __pyx_k_format[] = "format";
+static char __pyx_k_import[] = "__import__";
+static char __pyx_k_name_2[] = "__name__";
+static char __pyx_k_offset[] = "offset";
+static char __pyx_k_struct[] = "struct";
+static char __pyx_k_unpack[] = "unpack";
+static char __pyx_k_xrange[] = "xrange";
+static char __pyx_k_float32[] = "float32";
+static char __pyx_k_fortran[] = "fortran";
+static char __pyx_k_maximum[] = "maximum";
+static char __pyx_k_memview[] = "memview";
+static char __pyx_k_verbose[] = "verbose";
+static char __pyx_k_Ellipsis[] = "Ellipsis";
+static char __pyx_k_gradient[] = "gradient";
+static char __pyx_k_itemsize[] = "itemsize";
+static char __pyx_k_subtract[] = "subtract";
+static char __pyx_k_TypeError[] = "TypeError";
+static char __pyx_k_enumerate[] = "enumerate";
+static char __pyx_k_left_edge[] = "left_edge";
+static char __pyx_k_neighbors[] = "neighbors";
+static char __pyx_k_pij_input[] = "pij_input";
+static char __pyx_k_IndexError[] = "IndexError";
+static char __pyx_k_ValueError[] = "ValueError";
+static char __pyx_k_pos_output[] = "pos_output";
+static char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
+static char __pyx_k_right_edge[] = "right_edge";
+static char __pyx_k_MemoryError[] = "MemoryError";
+static char __pyx_k_error_check[] = "error_check";
+static char __pyx_k_t_SNE_ERROR[] = "[t-SNE] ERROR\n";
+static char __pyx_k_RuntimeError[] = "RuntimeError";
+static char __pyx_k_n_dimensions[] = "n_dimensions";
+static char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
+static char __pyx_k_calculate_edge[] = "calculate_edge";
+static char __pyx_k_check_quadtree[] = "check_quadtree";
+static char __pyx_k_n_dimensions_i[] = " n_dimensions %i\n";
+static char __pyx_k_allocate_buffer[] = "allocate_buffer";
+static char __pyx_k_dtype_is_object[] = "dtype_is_object";
+static char __pyx_k_skip_num_points[] = "skip_num_points";
+static char __pyx_k_test_index2offset[] = "test_index2offset";
+static char __pyx_k_test_index_offset[] = "test_index_offset";
+static char __pyx_k_strided_and_direct[] = "";
+static char __pyx_k_strided_and_indirect[] = "";
+static char __pyx_k_contiguous_and_direct[] = "";
+static char __pyx_k_MemoryView_of_r_object[] = "";
+static char __pyx_k_t_SNE_Child_has_size_d[] = "[t-SNE] Child has size %d\n";
+static char __pyx_k_t_SNE_Insertion_failed[] = "[t-SNE] Insertion failed";
+static char __pyx_k_MemoryView_of_r_at_0x_x[] = "";
+static char __pyx_k_contiguous_and_indirect[] = "";
+static char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
+static char __pyx_k_getbuffer_obj_view_flags[] = "getbuffer(obj, view, flags)";
+static char __pyx_k_o2i_index_i_dim_i_offset[] = "o2i index %i dim %i offset";
+static char __pyx_k_t_SNE_Computing_gradient[] = "[t-SNE] Computing gradient\n";
+static char __pyx_k_t_SNE_Inserting_i_points[] = "[t-SNE] Inserting %i points\n";
+static char __pyx_k_t_SNE_Tree_i_clock_ticks[] = "[t-SNE] Tree: %i clock ticks | ";
+static char __pyx_k_t_SNE_i_points_in_node_p[] = "[t-SNE] %i points in node %p\n";
+static char __pyx_k_Dimension_d_is_not_direct[] = "Dimension %d is not direct";
+static char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
+static char __pyx_k_t_SNE_Created_root_node_p[] = "[t-SNE] Created root node %p\n";
+static char __pyx_k_Index_out_of_bounds_axis_d[] = "Index out of bounds (axis %d)";
+static char __pyx_k_Step_may_not_be_zero_axis_d[] = "Step may not be zero (axis %d)";
+static char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
+static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
+static char __pyx_k_t_SNE_i_points_in_this_node[] = "[t-SNE] %i points in this node\n";
+static char __pyx_k_t_SNE_inserting_point_i_f_f[] = "[t-SNE] inserting point %i: [%f, %f]\n";
+static char __pyx_k_i2o_index_i_k_i_rem_i_offset[] = "i2o index %i k %i rem %i offset";
+static char __pyx_k_t_SNE_Offset_i_i_with_LE_f_f[] = "[t-SNE] Offset [%i, %i] with LE [%f, %f]\n";
+static char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
+static char __pyx_k_strided_and_direct_or_indirect[] = "";
+static char __pyx_k_t_SNE_Allocating_i_elements_in[] = "[t-SNE] Allocating %i elements in force arrays\n";
+static char __pyx_k_t_SNE_Computed_error_1_4f_in_1[] = "[t-SNE] Computed error=%1.4f in %1.1e ticks\n";
+static char __pyx_k_t_SNE_Tree_initialised_Width_1[] = "[t-SNE] Tree initialised. Width = (%1.9e, %1.9e, %1.9e)\n";
+static char __pyx_k_t_SNE_d_i_Node_p_leaf_i_Size_i[] = "[t-SNE] [d=%i] Node %p leaf = %i. Size %i\n";
+static char __pyx_k_t_SNE_d_i_Relocating_old_point[] = "[t-SNE] [d=%i] Relocating old point to node %p\n";
+static char __pyx_k_Force_computation_i_clock_ticks[] = "Force computation: %i clock ticks\n";
+static char __pyx_k_Users_chrismoody_code_scikit_le[] = "/Users/chrismoody/code/scikit-learn/sklearn/manifold/_barnes_hut_tsne.pyx";
+static char __pyx_k_t_SNE_Checking_tree_consistency[] = "[t-SNE] Checking tree consistency \n";
+static char __pyx_k_t_SNE_Child_is_not_a_leaf_Desce[] = "[t-SNE] Child is not a leaf. Descending\n";
+static char __pyx_k_t_SNE_Computing_negative_gradie[] = "[t-SNE] Computing negative gradient: %e ticks\n";
+static char __pyx_k_t_SNE_Computing_positive_gradie[] = "[t-SNE] Computing positive gradient: %e ticks\n";
+static char __pyx_k_t_SNE_Counting_nodes_at_root_no[] = "[t-SNE] Counting nodes at root node %p\n";
+static char __pyx_k_t_SNE_Counting_points_for_child[] = "[t-SNE] Counting points for child %p\n";
+static char __pyx_k_t_SNE_Error_point_1_9e_is_above[] = "[t-SNE] Error: point (%1.9e) is above right edge of node (%1.9e)\n";
+static char __pyx_k_t_SNE_Error_point_1_9e_is_below[] = "[t-SNE] Error: point (%1.9e) is below left edge of node (%1.9e)\n";
+static char __pyx_k_t_SNE_Initializing_tree_of_n_di[] = "[t-SNE] Initializing tree of n_dimensions %i\n";
+static char __pyx_k_t_SNE_Tree_initialised_Left_edg[] = "[t-SNE] Tree initialised. Left_edge = (%1.9e, %1.9e, %1.9e)\n";
+static char __pyx_k_t_SNE_Warning_d_i_Detected_iden[] = "[t-SNE] Warning: [d=%i] Detected identical points. Returning. Leaf now has size %i\n";
+static char __pyx_k_t_SNE_d_i_Inserting_f_f_into_bl[] = "[t-SNE] [d=%i] Inserting [%f, %f] into blank cell\n";
+static char __pyx_k_t_SNE_d_i_Inserting_pos_i_f_f_d[] = "[t-SNE] [d=%i] Inserting pos %i [%f, %f] duplicate_count=%i into child %p\n";
+static char __pyx_k_t_SNE_d_i_Node_p_is_occupied_or[] = "[t-SNE] [d=%i] Node %p is occupied or is a leaf.\n";
+static char __pyx_k_t_SNE_d_i_Selecting_node_for_ne[] = "[t-SNE] [d=%i] Selecting node for new point\n";
+static char __pyx_k_t_SNE_d_i_Subdividing_this_leaf[] = "[t-SNE] [d=%i] Subdividing this leaf node %p\n";
+static char __pyx_k_t_SNE_p_is_a_leaf_node_no_child[] = "[t-SNE] %p is a leaf node, no children\n";
+static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
+static char __pyx_k_All_dimensions_preceding_dimensi[] = "All dimensions preceding dimension %d must be indexed and not sliced";
+static char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
+static char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
+static char __pyx_k_Cannot_transpose_memoryview_with[] = "Cannot transpose memoryview with indirect dimensions";
+static char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
+static char __pyx_k_Forces_array_and_pos_output_shap[] = "Forces array and pos_output shapes are incompatible";
+static char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
+static char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
+static char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
+static char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
+static char __pyx_k_Number_of_neighbors_must_be_of_p[] = "Number of neighbors must be < # of points - 1";
+static char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
+static char __pyx_k_Pij_and_pos_output_shapes_are_in[] = "Pij and pos_output shapes are incompatible";
+static char __pyx_k_Tree_consistency_failed_unexpect[] = "Tree consistency failed: unexpected number of points=%i at root node=%i";
+static char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
+static char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
+static char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
+static char __pyx_k_neighbors_array_and_pos_output_s[] = "neighbors array and pos_output shapes are incompatible";
+static char __pyx_k_sklearn_manifold__barnes_hut_tsn[] = "sklearn.manifold._barnes_hut_tsne";
+static char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
+static char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
+static char __pyx_k_Tree_consistency_failed_unexpect_2[] = "Tree consistency failed: unexpected number of points on the tree";
+static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
+static PyObject *__pyx_n_s_C;
+static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
+static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
+static PyObject *__pyx_n_s_Ellipsis;
+static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
+static PyObject *__pyx_kp_s_Forces_array_and_pos_output_shap;
+static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
+static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
+static PyObject *__pyx_n_s_IndexError;
+static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
+static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
+static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
+static PyObject *__pyx_n_s_MemoryError;
+static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
+static PyObject *__pyx_kp_s_MemoryView_of_r_object;
+static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
+static PyObject *__pyx_kp_s_Number_of_neighbors_must_be_of_p;
+static PyObject *__pyx_n_b_O;
+static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
+static PyObject *__pyx_kp_s_Pij_and_pos_output_shapes_are_in;
+static PyObject *__pyx_n_s_RuntimeError;
+static PyObject *__pyx_kp_s_Tree_consistency_failed_unexpect;
+static PyObject *__pyx_kp_s_Tree_consistency_failed_unexpect_2;
+static PyObject *__pyx_n_s_TypeError;
+static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
+static PyObject *__pyx_kp_s_Users_chrismoody_code_scikit_le;
+static PyObject *__pyx_n_s_ValueError;
+static PyObject *__pyx_n_s_X;
+static PyObject *__pyx_n_s_allocate_buffer;
+static PyObject *__pyx_n_s_astype;
+static PyObject *__pyx_n_s_axis;
+static PyObject *__pyx_n_s_base;
+static PyObject *__pyx_n_s_c;
+static PyObject *__pyx_n_u_c;
+static PyObject *__pyx_n_s_calculate_edge;
+static PyObject *__pyx_n_s_center;
+static PyObject *__pyx_n_s_check_quadtree;
+static PyObject *__pyx_n_s_class;
+static PyObject *__pyx_kp_s_contiguous_and_direct;
+static PyObject *__pyx_kp_s_contiguous_and_indirect;
+static PyObject *__pyx_n_s_count;
+static PyObject *__pyx_n_s_counts;
+static PyObject *__pyx_n_s_dof;
+static PyObject *__pyx_n_s_dtype_is_object;
+static PyObject *__pyx_n_s_enumerate;
+static PyObject *__pyx_n_s_err;
+static PyObject *__pyx_n_s_error;
+static PyObject *__pyx_n_s_error_check;
+static PyObject *__pyx_n_s_flags;
+static PyObject *__pyx_n_s_float32;
+static PyObject *__pyx_n_s_forces;
+static PyObject *__pyx_n_s_format;
+static PyObject *__pyx_n_s_fortran;
+static PyObject *__pyx_n_u_fortran;
+static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
+static PyObject *__pyx_n_s_gradient;
+static PyObject *__pyx_n_s_id;
+static PyObject *__pyx_n_s_idx;
+static PyObject *__pyx_n_s_import;
+static PyObject *__pyx_n_s_itemsize;
+static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
+static PyObject *__pyx_n_s_k;
+static PyObject *__pyx_n_s_left_edge;
+static PyObject *__pyx_n_s_m;
+static PyObject *__pyx_n_s_main;
+static PyObject *__pyx_n_s_max;
+static PyObject *__pyx_n_s_maximum;
+static PyObject *__pyx_n_s_memview;
+static PyObject *__pyx_n_s_min;
+static PyObject *__pyx_n_s_mode;
+static PyObject *__pyx_n_s_n;
+static PyObject *__pyx_n_s_n_dimensions;
+static PyObject *__pyx_n_s_name;
+static PyObject *__pyx_n_s_name_2;
+static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
+static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
+static PyObject *__pyx_n_s_ndim;
+static PyObject *__pyx_n_s_neighbors;
+static PyObject *__pyx_kp_s_neighbors_array_and_pos_output_s;
+static PyObject *__pyx_n_s_np;
+static PyObject *__pyx_n_s_numpy;
+static PyObject *__pyx_n_s_obj;
+static PyObject *__pyx_n_s_offset;
+static PyObject *__pyx_n_s_pack;
+static PyObject *__pyx_n_s_pij_input;
+static PyObject *__pyx_n_s_pos_output;
+static PyObject *__pyx_n_s_pyx_getbuffer;
+static PyObject *__pyx_n_s_pyx_vtable;
+static PyObject *__pyx_n_s_qt;
+static PyObject *__pyx_n_s_range;
+static PyObject *__pyx_n_s_ret;
+static PyObject *__pyx_n_s_right_edge;
+static PyObject *__pyx_n_s_shape;
+static PyObject *__pyx_n_s_size;
+static PyObject *__pyx_n_s_skip_num_points;
+static PyObject *__pyx_n_s_sklearn_manifold__barnes_hut_tsn;
+static PyObject *__pyx_n_s_start;
+static PyObject *__pyx_n_s_step;
+static PyObject *__pyx_n_s_stop;
+static PyObject *__pyx_kp_s_strided_and_direct;
+static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
+static PyObject *__pyx_kp_s_strided_and_indirect;
+static PyObject *__pyx_n_s_struct;
+static PyObject *__pyx_n_s_subtract;
+static PyObject *__pyx_n_s_sum_Q;
+static PyObject *__pyx_kp_s_t_SNE_Insertion_failed;
+static PyObject *__pyx_n_s_test;
+static PyObject *__pyx_n_s_test_index2offset;
+static PyObject *__pyx_n_s_test_index_offset;
+static PyObject *__pyx_n_s_theta;
+static PyObject *__pyx_n_s_tidx;
+static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
+static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
+static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
+static PyObject *__pyx_n_s_unpack;
+static PyObject *__pyx_n_s_verbose;
+static PyObject *__pyx_n_s_width;
+static PyObject *__pyx_n_s_xrange;
+static PyObject *__pyx_float_0_5;
+static PyObject *__pyx_float_2_0;
+static PyObject *__pyx_float_1_001;
+static PyObject *__pyx_int_0;
+static PyObject *__pyx_int_1;
+static PyObject *__pyx_int_4;
+static PyObject *__pyx_int_neg_1;
+static PyObject *__pyx_tuple_;
+static PyObject *__pyx_tuple__2;
+static PyObject *__pyx_tuple__3;
+static PyObject *__pyx_tuple__4;
+static PyObject *__pyx_tuple__5;
+static PyObject *__pyx_tuple__6;
+static PyObject *__pyx_tuple__7;
+static PyObject *__pyx_tuple__8;
+static PyObject *__pyx_tuple__9;
+static PyObject *__pyx_slice__14;
+static PyObject *__pyx_slice__15;
+static PyObject *__pyx_slice__16;
+static PyObject *__pyx_tuple__10;
+static PyObject *__pyx_tuple__11;
+static PyObject *__pyx_tuple__12;
+static PyObject *__pyx_tuple__13;
+static PyObject *__pyx_tuple__17;
+static PyObject *__pyx_tuple__18;
+static PyObject *__pyx_tuple__20;
+static PyObject *__pyx_tuple__22;
+static PyObject *__pyx_tuple__24;
+static PyObject *__pyx_tuple__26;
+static PyObject *__pyx_tuple__28;
+static PyObject *__pyx_tuple__29;
+static PyObject *__pyx_tuple__30;
+static PyObject *__pyx_tuple__31;
+static PyObject *__pyx_tuple__32;
+static PyObject *__pyx_codeobj__19;
+static PyObject *__pyx_codeobj__21;
+static PyObject *__pyx_codeobj__23;
+static PyObject *__pyx_codeobj__25;
+static PyObject *__pyx_codeobj__27;
+
+/* "sklearn/manifold/_barnes_hut_tsne.pyx":92
+ * int n_cell_per_node
+ *
+ * cdef Tree* init_tree(float[:] left_edge, float[:] width, int n_dimensions, # <<<<<<<<<<<<<<
+ * int verbose) nogil:
+ * # tree is freed by free_tree
+ */
+
+static struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Tree *__pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_init_tree(__Pyx_memviewslice __pyx_v_left_edge, __Pyx_memviewslice __pyx_v_width, int __pyx_v_n_dimensions, int __pyx_v_verbose) {
+ struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Tree *__pyx_v_tree;
+ struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Tree *__pyx_r;
+ Py_ssize_t __pyx_t_1;
+ Py_ssize_t __pyx_t_2;
+ Py_ssize_t __pyx_t_3;
+ Py_ssize_t __pyx_t_4;
+ Py_ssize_t __pyx_t_5;
+ Py_ssize_t __pyx_t_6;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":95
+ * int verbose) nogil:
+ * # tree is freed by free_tree
+ * cdef Tree* tree = malloc(sizeof(Tree)) # <<<<<<<<<<<<<<
+ * tree.n_dimensions = n_dimensions
+ * tree.n_cells = 0
+ */
+ __pyx_v_tree = ((struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Tree *)malloc((sizeof(struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Tree))));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":96
+ * # tree is freed by free_tree
+ * cdef Tree* tree = malloc(sizeof(Tree))
+ * tree.n_dimensions = n_dimensions # <<<<<<<<<<<<<<
+ * tree.n_cells = 0
+ * tree.n_points = 0
+ */
+ __pyx_v_tree->n_dimensions = __pyx_v_n_dimensions;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":97
+ * cdef Tree* tree = malloc(sizeof(Tree))
+ * tree.n_dimensions = n_dimensions
+ * tree.n_cells = 0 # <<<<<<<<<<<<<<
+ * tree.n_points = 0
+ * tree.verbose = verbose
+ */
+ __pyx_v_tree->n_cells = 0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":98
+ * tree.n_dimensions = n_dimensions
+ * tree.n_cells = 0
+ * tree.n_points = 0 # <<<<<<<<<<<<<<
+ * tree.verbose = verbose
+ * tree.root_node = create_root(left_edge, width, n_dimensions)
+ */
+ __pyx_v_tree->n_points = 0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":99
+ * tree.n_cells = 0
+ * tree.n_points = 0
+ * tree.verbose = verbose # <<<<<<<<<<<<<<
+ * tree.root_node = create_root(left_edge, width, n_dimensions)
+ * tree.root_node.tree = tree
+ */
+ __pyx_v_tree->verbose = __pyx_v_verbose;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":100
+ * tree.n_points = 0
+ * tree.verbose = verbose
+ * tree.root_node = create_root(left_edge, width, n_dimensions) # <<<<<<<<<<<<<<
+ * tree.root_node.tree = tree
+ * tree.n_cells += 1
+ */
+ __pyx_v_tree->root_node = __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_create_root(__pyx_v_left_edge, __pyx_v_width, __pyx_v_n_dimensions);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":101
+ * tree.verbose = verbose
+ * tree.root_node = create_root(left_edge, width, n_dimensions)
+ * tree.root_node.tree = tree # <<<<<<<<<<<<<<
+ * tree.n_cells += 1
+ * tree.n_cell_per_node = 2 ** n_dimensions
+ */
+ __pyx_v_tree->root_node->tree = __pyx_v_tree;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":102
+ * tree.root_node = create_root(left_edge, width, n_dimensions)
+ * tree.root_node.tree = tree
+ * tree.n_cells += 1 # <<<<<<<<<<<<<<
+ * tree.n_cell_per_node = 2 ** n_dimensions
+ * if DEBUGFLAG:
+ */
+ __pyx_v_tree->n_cells = (__pyx_v_tree->n_cells + 1);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":103
+ * tree.root_node.tree = tree
+ * tree.n_cells += 1
+ * tree.n_cell_per_node = 2 ** n_dimensions # <<<<<<<<<<<<<<
+ * if DEBUGFLAG:
+ * printf("[t-SNE] Tree initialised. Left_edge = (%1.9e, %1.9e, %1.9e)\n",
+ */
+ __pyx_v_tree->n_cell_per_node = __Pyx_pow_long(2, ((long)__pyx_v_n_dimensions));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":104
+ * tree.n_cells += 1
+ * tree.n_cell_per_node = 2 ** n_dimensions
+ * if DEBUGFLAG: # <<<<<<<<<<<<<<
+ * printf("[t-SNE] Tree initialised. Left_edge = (%1.9e, %1.9e, %1.9e)\n",
+ * left_edge[0], left_edge[1], left_edge[2])
+ */
+ if (__pyx_e_7sklearn_8manifold_16_barnes_hut_tsne_DEBUGFLAG) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":106
+ * if DEBUGFLAG:
+ * printf("[t-SNE] Tree initialised. Left_edge = (%1.9e, %1.9e, %1.9e)\n",
+ * left_edge[0], left_edge[1], left_edge[2]) # <<<<<<<<<<<<<<
+ * printf("[t-SNE] Tree initialised. Width = (%1.9e, %1.9e, %1.9e)\n",
+ * width[0], width[1], width[2])
+ */
+ __pyx_t_1 = 0;
+ __pyx_t_2 = 1;
+ __pyx_t_3 = 2;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":105
+ * tree.n_cell_per_node = 2 ** n_dimensions
+ * if DEBUGFLAG:
+ * printf("[t-SNE] Tree initialised. Left_edge = (%1.9e, %1.9e, %1.9e)\n", # <<<<<<<<<<<<<<
+ * left_edge[0], left_edge[1], left_edge[2])
+ * printf("[t-SNE] Tree initialised. Width = (%1.9e, %1.9e, %1.9e)\n",
+ */
+ printf(__pyx_k_t_SNE_Tree_initialised_Left_edg, (*((float *) ( /* dim=0 */ (__pyx_v_left_edge.data + __pyx_t_1 * __pyx_v_left_edge.strides[0]) ))), (*((float *) ( /* dim=0 */ (__pyx_v_left_edge.data + __pyx_t_2 * __pyx_v_left_edge.strides[0]) ))), (*((float *) ( /* dim=0 */ (__pyx_v_left_edge.data + __pyx_t_3 * __pyx_v_left_edge.strides[0]) ))));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":108
+ * left_edge[0], left_edge[1], left_edge[2])
+ * printf("[t-SNE] Tree initialised. Width = (%1.9e, %1.9e, %1.9e)\n",
+ * width[0], width[1], width[2]) # <<<<<<<<<<<<<<
+ * return tree
+ *
+ */
+ __pyx_t_4 = 0;
+ __pyx_t_5 = 1;
+ __pyx_t_6 = 2;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":107
+ * printf("[t-SNE] Tree initialised. Left_edge = (%1.9e, %1.9e, %1.9e)\n",
+ * left_edge[0], left_edge[1], left_edge[2])
+ * printf("[t-SNE] Tree initialised. Width = (%1.9e, %1.9e, %1.9e)\n", # <<<<<<<<<<<<<<
+ * width[0], width[1], width[2])
+ * return tree
+ */
+ printf(__pyx_k_t_SNE_Tree_initialised_Width_1, (*((float *) ( /* dim=0 */ (__pyx_v_width.data + __pyx_t_4 * __pyx_v_width.strides[0]) ))), (*((float *) ( /* dim=0 */ (__pyx_v_width.data + __pyx_t_5 * __pyx_v_width.strides[0]) ))), (*((float *) ( /* dim=0 */ (__pyx_v_width.data + __pyx_t_6 * __pyx_v_width.strides[0]) ))));
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":109
+ * printf("[t-SNE] Tree initialised. Width = (%1.9e, %1.9e, %1.9e)\n",
+ * width[0], width[1], width[2])
+ * return tree # <<<<<<<<<<<<<<
+ *
+ * cdef Node* create_root(float[:] left_edge, float[:] width, int n_dimensions) nogil:
+ */
+ __pyx_r = __pyx_v_tree;
+ goto __pyx_L0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":92
+ * int n_cell_per_node
+ *
+ * cdef Tree* init_tree(float[:] left_edge, float[:] width, int n_dimensions, # <<<<<<<<<<<<<<
+ * int verbose) nogil:
+ * # tree is freed by free_tree
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "sklearn/manifold/_barnes_hut_tsne.pyx":111
+ * return tree
+ *
+ * cdef Node* create_root(float[:] left_edge, float[:] width, int n_dimensions) nogil: # <<<<<<<<<<<<<<
+ * # Create a default root node
+ * cdef int ax
+ */
+
+static struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Node *__pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_create_root(__Pyx_memviewslice __pyx_v_left_edge, __Pyx_memviewslice __pyx_v_width, int __pyx_v_n_dimensions) {
+ int __pyx_v_ax;
+ CYTHON_UNUSED int __pyx_v_n_cell_per_node;
+ struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Node *__pyx_v_root;
+ struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Node *__pyx_r;
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ float __pyx_t_5;
+ float __pyx_t_6;
+ float __pyx_t_7;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":114
+ * # Create a default root node
+ * cdef int ax
+ * cdef int n_cell_per_node = 2 ** n_dimensions # <<<<<<<<<<<<<<
+ * # root is freed by free_tree
+ * root = malloc(sizeof(Node))
+ */
+ __pyx_v_n_cell_per_node = __Pyx_pow_long(2, ((long)__pyx_v_n_dimensions));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":116
+ * cdef int n_cell_per_node = 2 ** n_dimensions
+ * # root is freed by free_tree
+ * root = malloc(sizeof(Node)) # <<<<<<<<<<<<<<
+ * root.is_leaf = 1
+ * root.parent = NULL
+ */
+ __pyx_v_root = ((struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Node *)malloc((sizeof(struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Node))));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":117
+ * # root is freed by free_tree
+ * root = malloc(sizeof(Node))
+ * root.is_leaf = 1 # <<<<<<<<<<<<<<
+ * root.parent = NULL
+ * root.level = 0
+ */
+ __pyx_v_root->is_leaf = 1;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":118
+ * root = malloc(sizeof(Node))
+ * root.is_leaf = 1
+ * root.parent = NULL # <<<<<<<<<<<<<<
+ * root.level = 0
+ * root.cumulative_size = 0
+ */
+ __pyx_v_root->parent = NULL;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":119
+ * root.is_leaf = 1
+ * root.parent = NULL
+ * root.level = 0 # <<<<<<<<<<<<<<
+ * root.cumulative_size = 0
+ * root.size = 0
+ */
+ __pyx_v_root->level = 0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":120
+ * root.parent = NULL
+ * root.level = 0
+ * root.cumulative_size = 0 # <<<<<<<<<<<<<<
+ * root.size = 0
+ * root.point_index = -1
+ */
+ __pyx_v_root->cumulative_size = 0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":121
+ * root.level = 0
+ * root.cumulative_size = 0
+ * root.size = 0 # <<<<<<<<<<<<<<
+ * root.point_index = -1
+ * root.max_width = 0.0
+ */
+ __pyx_v_root->size = 0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":122
+ * root.cumulative_size = 0
+ * root.size = 0
+ * root.point_index = -1 # <<<<<<<<<<<<<<
+ * root.max_width = 0.0
+ * root.width = malloc(sizeof(float) * n_dimensions)
+ */
+ __pyx_v_root->point_index = -1;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":123
+ * root.size = 0
+ * root.point_index = -1
+ * root.max_width = 0.0 # <<<<<<<<<<<<<<
+ * root.width = malloc(sizeof(float) * n_dimensions)
+ * root.left_edge = malloc(sizeof(float) * n_dimensions)
+ */
+ __pyx_v_root->max_width = 0.0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":124
+ * root.point_index = -1
+ * root.max_width = 0.0
+ * root.width = malloc(sizeof(float) * n_dimensions) # <<<<<<<<<<<<<<
+ * root.left_edge = malloc(sizeof(float) * n_dimensions)
+ * root.center = malloc(sizeof(float) * n_dimensions)
+ */
+ __pyx_v_root->width = ((float *)malloc(((sizeof(float)) * __pyx_v_n_dimensions)));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":125
+ * root.max_width = 0.0
+ * root.width = malloc(sizeof(float) * n_dimensions)
+ * root.left_edge = malloc(sizeof(float) * n_dimensions) # <<<<<<<<<<<<<<
+ * root.center = malloc(sizeof(float) * n_dimensions)
+ * root.barycenter = malloc(sizeof(float) * n_dimensions)
+ */
+ __pyx_v_root->left_edge = ((float *)malloc(((sizeof(float)) * __pyx_v_n_dimensions)));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":126
+ * root.width = malloc(sizeof(float) * n_dimensions)
+ * root.left_edge = malloc(sizeof(float) * n_dimensions)
+ * root.center = malloc(sizeof(float) * n_dimensions) # <<<<<<<<<<<<<<
+ * root.barycenter = malloc(sizeof(float) * n_dimensions)
+ * root.leaf_point_position= malloc(sizeof(float) * n_dimensions)
+ */
+ __pyx_v_root->center = ((float *)malloc(((sizeof(float)) * __pyx_v_n_dimensions)));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":127
+ * root.left_edge = malloc(sizeof(float) * n_dimensions)
+ * root.center = malloc(sizeof(float) * n_dimensions)
+ * root.barycenter = malloc(sizeof(float) * n_dimensions) # <<<<<<<<<<<<<<
+ * root.leaf_point_position= malloc(sizeof(float) * n_dimensions)
+ * root.children = NULL
+ */
+ __pyx_v_root->barycenter = ((float *)malloc(((sizeof(float)) * __pyx_v_n_dimensions)));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":128
+ * root.center = malloc(sizeof(float) * n_dimensions)
+ * root.barycenter = malloc(sizeof(float) * n_dimensions)
+ * root.leaf_point_position= malloc(sizeof(float) * n_dimensions) # <<<<<<<<<<<<<<
+ * root.children = NULL
+ * for ax in range(n_dimensions):
+ */
+ __pyx_v_root->leaf_point_position = ((float *)malloc(((sizeof(float)) * __pyx_v_n_dimensions)));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":129
+ * root.barycenter = malloc(sizeof(float) * n_dimensions)
+ * root.leaf_point_position= malloc(sizeof(float) * n_dimensions)
+ * root.children = NULL # <<<<<<<<<<<<<<
+ * for ax in range(n_dimensions):
+ * root.width[ax] = width[ax]
+ */
+ __pyx_v_root->children = NULL;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":130
+ * root.leaf_point_position= malloc(sizeof(float) * n_dimensions)
+ * root.children = NULL
+ * for ax in range(n_dimensions): # <<<<<<<<<<<<<<
+ * root.width[ax] = width[ax]
+ * root.left_edge[ax] = left_edge[ax]
+ */
+ __pyx_t_1 = __pyx_v_n_dimensions;
+ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
+ __pyx_v_ax = __pyx_t_2;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":131
+ * root.children = NULL
+ * for ax in range(n_dimensions):
+ * root.width[ax] = width[ax] # <<<<<<<<<<<<<<
+ * root.left_edge[ax] = left_edge[ax]
+ * root.center[ax] = 0.0
+ */
+ __pyx_t_3 = __pyx_v_ax;
+ (__pyx_v_root->width[__pyx_v_ax]) = (*((float *) ( /* dim=0 */ (__pyx_v_width.data + __pyx_t_3 * __pyx_v_width.strides[0]) )));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":132
+ * for ax in range(n_dimensions):
+ * root.width[ax] = width[ax]
+ * root.left_edge[ax] = left_edge[ax] # <<<<<<<<<<<<<<
+ * root.center[ax] = 0.0
+ * root.barycenter[ax] = 0.
+ */
+ __pyx_t_4 = __pyx_v_ax;
+ (__pyx_v_root->left_edge[__pyx_v_ax]) = (*((float *) ( /* dim=0 */ (__pyx_v_left_edge.data + __pyx_t_4 * __pyx_v_left_edge.strides[0]) )));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":133
+ * root.width[ax] = width[ax]
+ * root.left_edge[ax] = left_edge[ax]
+ * root.center[ax] = 0.0 # <<<<<<<<<<<<<<
+ * root.barycenter[ax] = 0.
+ * root.leaf_point_position[ax] = -1
+ */
+ (__pyx_v_root->center[__pyx_v_ax]) = 0.0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":134
+ * root.left_edge[ax] = left_edge[ax]
+ * root.center[ax] = 0.0
+ * root.barycenter[ax] = 0. # <<<<<<<<<<<<<<
+ * root.leaf_point_position[ax] = -1
+ * for ax in range(n_dimensions):
+ */
+ (__pyx_v_root->barycenter[__pyx_v_ax]) = 0.;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":135
+ * root.center[ax] = 0.0
+ * root.barycenter[ax] = 0.
+ * root.leaf_point_position[ax] = -1 # <<<<<<<<<<<<<<
+ * for ax in range(n_dimensions):
+ * root.max_width = max(root.max_width, root.width[ax])
+ */
+ (__pyx_v_root->leaf_point_position[__pyx_v_ax]) = -1.0;
+ }
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":136
+ * root.barycenter[ax] = 0.
+ * root.leaf_point_position[ax] = -1
+ * for ax in range(n_dimensions): # <<<<<<<<<<<<<<
+ * root.max_width = max(root.max_width, root.width[ax])
+ * if DEBUGFLAG:
+ */
+ __pyx_t_1 = __pyx_v_n_dimensions;
+ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
+ __pyx_v_ax = __pyx_t_2;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":137
+ * root.leaf_point_position[ax] = -1
+ * for ax in range(n_dimensions):
+ * root.max_width = max(root.max_width, root.width[ax]) # <<<<<<<<<<<<<<
+ * if DEBUGFLAG:
+ * printf("[t-SNE] Created root node %p\n", root)
+ */
+ __pyx_t_5 = (__pyx_v_root->width[__pyx_v_ax]);
+ __pyx_t_6 = __pyx_v_root->max_width;
+ if (((__pyx_t_5 > __pyx_t_6) != 0)) {
+ __pyx_t_7 = __pyx_t_5;
+ } else {
+ __pyx_t_7 = __pyx_t_6;
+ }
+ __pyx_v_root->max_width = __pyx_t_7;
+ }
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":138
+ * for ax in range(n_dimensions):
+ * root.max_width = max(root.max_width, root.width[ax])
+ * if DEBUGFLAG: # <<<<<<<<<<<<<<
+ * printf("[t-SNE] Created root node %p\n", root)
+ * return root
+ */
+ if (__pyx_e_7sklearn_8manifold_16_barnes_hut_tsne_DEBUGFLAG) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":139
+ * root.max_width = max(root.max_width, root.width[ax])
+ * if DEBUGFLAG:
+ * printf("[t-SNE] Created root node %p\n", root) # <<<<<<<<<<<<<<
+ * return root
+ *
+ */
+ printf(__pyx_k_t_SNE_Created_root_node_p, __pyx_v_root);
+ goto __pyx_L7;
+ }
+ __pyx_L7:;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":140
+ * if DEBUGFLAG:
+ * printf("[t-SNE] Created root node %p\n", root)
+ * return root # <<<<<<<<<<<<<<
+ *
+ * cdef Node* create_child(Node *parent, int[3] offset) nogil:
+ */
+ __pyx_r = __pyx_v_root;
+ goto __pyx_L0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":111
+ * return tree
+ *
+ * cdef Node* create_root(float[:] left_edge, float[:] width, int n_dimensions) nogil: # <<<<<<<<<<<<<<
+ * # Create a default root node
+ * cdef int ax
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "sklearn/manifold/_barnes_hut_tsne.pyx":142
+ * return root
+ *
+ * cdef Node* create_child(Node *parent, int[3] offset) nogil: # <<<<<<<<<<<<<<
+ * # Create a new child node with default parameters
+ * cdef int ax
+ */
+
+static struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Node *__pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_create_child(struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Node *__pyx_v_parent, int *__pyx_v_offset) {
+ int __pyx_v_ax;
+ struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Node *__pyx_v_child;
+ struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Node *__pyx_r;
+ struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Tree *__pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ float __pyx_t_4;
+ float __pyx_t_5;
+ float __pyx_t_6;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":146
+ * cdef int ax
+ * # these children are freed by free_recursive
+ * child = malloc(sizeof(Node)) # <<<<<<<<<<<<<<
+ * child.is_leaf = 1
+ * child.parent = parent
+ */
+ __pyx_v_child = ((struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Node *)malloc((sizeof(struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Node))));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":147
+ * # these children are freed by free_recursive
+ * child = malloc(sizeof(Node))
+ * child.is_leaf = 1 # <<<<<<<<<<<<<<
+ * child.parent = parent
+ * child.level = parent.level + 1
+ */
+ __pyx_v_child->is_leaf = 1;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":148
+ * child = malloc(sizeof(Node))
+ * child.is_leaf = 1
+ * child.parent = parent # <<<<<<<<<<<<<<
+ * child.level = parent.level + 1
+ * child.size = 0
+ */
+ __pyx_v_child->parent = __pyx_v_parent;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":149
+ * child.is_leaf = 1
+ * child.parent = parent
+ * child.level = parent.level + 1 # <<<<<<<<<<<<<<
+ * child.size = 0
+ * child.cumulative_size = 0
+ */
+ __pyx_v_child->level = (__pyx_v_parent->level + 1);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":150
+ * child.parent = parent
+ * child.level = parent.level + 1
+ * child.size = 0 # <<<<<<<<<<<<<<
+ * child.cumulative_size = 0
+ * child.point_index = -1
+ */
+ __pyx_v_child->size = 0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":151
+ * child.level = parent.level + 1
+ * child.size = 0
+ * child.cumulative_size = 0 # <<<<<<<<<<<<<<
+ * child.point_index = -1
+ * child.tree = parent.tree
+ */
+ __pyx_v_child->cumulative_size = 0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":152
+ * child.size = 0
+ * child.cumulative_size = 0
+ * child.point_index = -1 # <<<<<<<<<<<<<<
+ * child.tree = parent.tree
+ * child.max_width = 0.0
+ */
+ __pyx_v_child->point_index = -1;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":153
+ * child.cumulative_size = 0
+ * child.point_index = -1
+ * child.tree = parent.tree # <<<<<<<<<<<<<<
+ * child.max_width = 0.0
+ * child.width = malloc(sizeof(float) * parent.tree.n_dimensions)
+ */
+ __pyx_t_1 = __pyx_v_parent->tree;
+ __pyx_v_child->tree = __pyx_t_1;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":154
+ * child.point_index = -1
+ * child.tree = parent.tree
+ * child.max_width = 0.0 # <<<<<<<<<<<<<<
+ * child.width = malloc(sizeof(float) * parent.tree.n_dimensions)
+ * child.left_edge = malloc(sizeof(float) * parent.tree.n_dimensions)
+ */
+ __pyx_v_child->max_width = 0.0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":155
+ * child.tree = parent.tree
+ * child.max_width = 0.0
+ * child.width = malloc(sizeof(float) * parent.tree.n_dimensions) # <<<<<<<<<<<<<<
+ * child.left_edge = malloc(sizeof(float) * parent.tree.n_dimensions)
+ * child.center = malloc(sizeof(float) * parent.tree.n_dimensions)
+ */
+ __pyx_v_child->width = ((float *)malloc(((sizeof(float)) * __pyx_v_parent->tree->n_dimensions)));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":156
+ * child.max_width = 0.0
+ * child.width = malloc(sizeof(float) * parent.tree.n_dimensions)
+ * child.left_edge = malloc(sizeof(float) * parent.tree.n_dimensions) # <<<<<<<<<<<<<<
+ * child.center = malloc(sizeof(float) * parent.tree.n_dimensions)
+ * child.barycenter = malloc(sizeof(float) * parent.tree.n_dimensions)
+ */
+ __pyx_v_child->left_edge = ((float *)malloc(((sizeof(float)) * __pyx_v_parent->tree->n_dimensions)));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":157
+ * child.width = malloc(sizeof(float) * parent.tree.n_dimensions)
+ * child.left_edge = malloc(sizeof(float) * parent.tree.n_dimensions)
+ * child.center = malloc(sizeof(float) * parent.tree.n_dimensions) # <<<<<<<<<<<<<<
+ * child.barycenter = malloc(sizeof(float) * parent.tree.n_dimensions)
+ * child.leaf_point_position = malloc(sizeof(float) * parent.tree.n_dimensions)
+ */
+ __pyx_v_child->center = ((float *)malloc(((sizeof(float)) * __pyx_v_parent->tree->n_dimensions)));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":158
+ * child.left_edge = malloc(sizeof(float) * parent.tree.n_dimensions)
+ * child.center = malloc(sizeof(float) * parent.tree.n_dimensions)
+ * child.barycenter = malloc(sizeof(float) * parent.tree.n_dimensions) # <<<<<<<<<<<<<<
+ * child.leaf_point_position = malloc(sizeof(float) * parent.tree.n_dimensions)
+ * child.children = NULL
+ */
+ __pyx_v_child->barycenter = ((float *)malloc(((sizeof(float)) * __pyx_v_parent->tree->n_dimensions)));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":159
+ * child.center = malloc(sizeof(float) * parent.tree.n_dimensions)
+ * child.barycenter = malloc(sizeof(float) * parent.tree.n_dimensions)
+ * child.leaf_point_position = malloc(sizeof(float) * parent.tree.n_dimensions) # <<<<<<<<<<<<<<
+ * child.children = NULL
+ * for ax in range(parent.tree.n_dimensions):
+ */
+ __pyx_v_child->leaf_point_position = ((float *)malloc(((sizeof(float)) * __pyx_v_parent->tree->n_dimensions)));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":160
+ * child.barycenter = malloc(sizeof(float) * parent.tree.n_dimensions)
+ * child.leaf_point_position = malloc(sizeof(float) * parent.tree.n_dimensions)
+ * child.children = NULL # <<<<<<<<<<<<<<
+ * for ax in range(parent.tree.n_dimensions):
+ * child.width[ax] = parent.width[ax] / 2.0
+ */
+ __pyx_v_child->children = NULL;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":161
+ * child.leaf_point_position = malloc(sizeof(float) * parent.tree.n_dimensions)
+ * child.children = NULL
+ * for ax in range(parent.tree.n_dimensions): # <<<<<<<<<<<<<<
+ * child.width[ax] = parent.width[ax] / 2.0
+ * child.left_edge[ax] = parent.left_edge[ax] + offset[ax] * parent.width[ax] / 2.0
+ */
+ __pyx_t_2 = __pyx_v_parent->tree->n_dimensions;
+ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
+ __pyx_v_ax = __pyx_t_3;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":162
+ * child.children = NULL
+ * for ax in range(parent.tree.n_dimensions):
+ * child.width[ax] = parent.width[ax] / 2.0 # <<<<<<<<<<<<<<
+ * child.left_edge[ax] = parent.left_edge[ax] + offset[ax] * parent.width[ax] / 2.0
+ * child.center[ax] = child.left_edge[ax] + child.width[ax] / 2.0
+ */
+ (__pyx_v_child->width[__pyx_v_ax]) = ((__pyx_v_parent->width[__pyx_v_ax]) / 2.0);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":163
+ * for ax in range(parent.tree.n_dimensions):
+ * child.width[ax] = parent.width[ax] / 2.0
+ * child.left_edge[ax] = parent.left_edge[ax] + offset[ax] * parent.width[ax] / 2.0 # <<<<<<<<<<<<<<
+ * child.center[ax] = child.left_edge[ax] + child.width[ax] / 2.0
+ * child.barycenter[ax] = 0.
+ */
+ (__pyx_v_child->left_edge[__pyx_v_ax]) = ((__pyx_v_parent->left_edge[__pyx_v_ax]) + (((__pyx_v_offset[__pyx_v_ax]) * (__pyx_v_parent->width[__pyx_v_ax])) / 2.0));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":164
+ * child.width[ax] = parent.width[ax] / 2.0
+ * child.left_edge[ax] = parent.left_edge[ax] + offset[ax] * parent.width[ax] / 2.0
+ * child.center[ax] = child.left_edge[ax] + child.width[ax] / 2.0 # <<<<<<<<<<<<<<
+ * child.barycenter[ax] = 0.
+ * child.leaf_point_position[ax] = -1.
+ */
+ (__pyx_v_child->center[__pyx_v_ax]) = ((__pyx_v_child->left_edge[__pyx_v_ax]) + ((__pyx_v_child->width[__pyx_v_ax]) / 2.0));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":165
+ * child.left_edge[ax] = parent.left_edge[ax] + offset[ax] * parent.width[ax] / 2.0
+ * child.center[ax] = child.left_edge[ax] + child.width[ax] / 2.0
+ * child.barycenter[ax] = 0. # <<<<<<<<<<<<<<
+ * child.leaf_point_position[ax] = -1.
+ * for ax in range(parent.tree.n_dimensions):
+ */
+ (__pyx_v_child->barycenter[__pyx_v_ax]) = 0.;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":166
+ * child.center[ax] = child.left_edge[ax] + child.width[ax] / 2.0
+ * child.barycenter[ax] = 0.
+ * child.leaf_point_position[ax] = -1. # <<<<<<<<<<<<<<
+ * for ax in range(parent.tree.n_dimensions):
+ * child.max_width = max(child.max_width, child.width[ax])
+ */
+ (__pyx_v_child->leaf_point_position[__pyx_v_ax]) = -1.;
+ }
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":167
+ * child.barycenter[ax] = 0.
+ * child.leaf_point_position[ax] = -1.
+ * for ax in range(parent.tree.n_dimensions): # <<<<<<<<<<<<<<
+ * child.max_width = max(child.max_width, child.width[ax])
+ * child.tree.n_cells += 1
+ */
+ __pyx_t_2 = __pyx_v_parent->tree->n_dimensions;
+ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
+ __pyx_v_ax = __pyx_t_3;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":168
+ * child.leaf_point_position[ax] = -1.
+ * for ax in range(parent.tree.n_dimensions):
+ * child.max_width = max(child.max_width, child.width[ax]) # <<<<<<<<<<<<<<
+ * child.tree.n_cells += 1
+ * return child
+ */
+ __pyx_t_4 = (__pyx_v_child->width[__pyx_v_ax]);
+ __pyx_t_5 = __pyx_v_child->max_width;
+ if (((__pyx_t_4 > __pyx_t_5) != 0)) {
+ __pyx_t_6 = __pyx_t_4;
+ } else {
+ __pyx_t_6 = __pyx_t_5;
+ }
+ __pyx_v_child->max_width = __pyx_t_6;
+ }
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":169
+ * for ax in range(parent.tree.n_dimensions):
+ * child.max_width = max(child.max_width, child.width[ax])
+ * child.tree.n_cells += 1 # <<<<<<<<<<<<<<
+ * return child
+ *
+ */
+ __pyx_v_child->tree->n_cells = (__pyx_v_child->tree->n_cells + 1);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":170
+ * child.max_width = max(child.max_width, child.width[ax])
+ * child.tree.n_cells += 1
+ * return child # <<<<<<<<<<<<<<
+ *
+ * cdef Node* select_child(Node *node, float[3] pos, long index) nogil:
+ */
+ __pyx_r = __pyx_v_child;
+ goto __pyx_L0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":142
+ * return root
+ *
+ * cdef Node* create_child(Node *parent, int[3] offset) nogil: # <<<<<<<<<<<<<<
+ * # Create a new child node with default parameters
+ * cdef int ax
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "sklearn/manifold/_barnes_hut_tsne.pyx":172
+ * return child
+ *
+ * cdef Node* select_child(Node *node, float[3] pos, long index) nogil: # <<<<<<<<<<<<<<
+ * # Find which sub-node a position should go into
+ * # And return the appropriate node
+ */
+
+static struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Node *__pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_select_child(struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Node *__pyx_v_node, float *__pyx_v_pos, CYTHON_UNUSED long __pyx_v_index) {
+ int *__pyx_v_offset;
+ int __pyx_v_ax;
+ int __pyx_v_idx;
+ struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Node *__pyx_v_child;
+ struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Node *__pyx_r;
+ int __pyx_t_1;
+ int __pyx_t_2;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":175
+ * # Find which sub-node a position should go into
+ * # And return the appropriate node
+ * cdef int* offset = malloc(sizeof(int) * node.tree.n_dimensions) # <<<<<<<<<<<<<<
+ * cdef int ax, idx
+ * cdef Node* child
+ */
+ __pyx_v_offset = ((int *)malloc(((sizeof(int)) * __pyx_v_node->tree->n_dimensions)));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":179
+ * cdef Node* child
+ * cdef int error
+ * for ax in range(node.tree.n_dimensions): # <<<<<<<<<<<<<<
+ * offset[ax] = (pos[ax] - (node.left_edge[ax] + node.width[ax] / 2.0)) > 0.
+ * idx = offset2index(offset, node.tree.n_dimensions)
+ */
+ __pyx_t_1 = __pyx_v_node->tree->n_dimensions;
+ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
+ __pyx_v_ax = __pyx_t_2;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":180
+ * cdef int error
+ * for ax in range(node.tree.n_dimensions):
+ * offset[ax] = (pos[ax] - (node.left_edge[ax] + node.width[ax] / 2.0)) > 0. # <<<<<<<<<<<<<<
+ * idx = offset2index(offset, node.tree.n_dimensions)
+ * child = node.children[idx]
+ */
+ (__pyx_v_offset[__pyx_v_ax]) = (((__pyx_v_pos[__pyx_v_ax]) - ((__pyx_v_node->left_edge[__pyx_v_ax]) + ((__pyx_v_node->width[__pyx_v_ax]) / 2.0))) > 0.);
+ }
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":181
+ * for ax in range(node.tree.n_dimensions):
+ * offset[ax] = (pos[ax] - (node.left_edge[ax] + node.width[ax] / 2.0)) > 0.
+ * idx = offset2index(offset, node.tree.n_dimensions) # <<<<<<<<<<<<<<
+ * child = node.children[idx]
+ * if DEBUGFLAG:
+ */
+ __pyx_v_idx = __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_offset2index(__pyx_v_offset, __pyx_v_node->tree->n_dimensions);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":182
+ * offset[ax] = (pos[ax] - (node.left_edge[ax] + node.width[ax] / 2.0)) > 0.
+ * idx = offset2index(offset, node.tree.n_dimensions)
+ * child = node.children[idx] # <<<<<<<<<<<<<<
+ * if DEBUGFLAG:
+ * printf("[t-SNE] Offset [%i, %i] with LE [%f, %f]\n",
+ */
+ __pyx_v_child = (__pyx_v_node->children[__pyx_v_idx]);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":183
+ * idx = offset2index(offset, node.tree.n_dimensions)
+ * child = node.children[idx]
+ * if DEBUGFLAG: # <<<<<<<<<<<<<<
+ * printf("[t-SNE] Offset [%i, %i] with LE [%f, %f]\n",
+ * offset[0], offset[1], child.left_edge[0], child.left_edge[1])
+ */
+ if (__pyx_e_7sklearn_8manifold_16_barnes_hut_tsne_DEBUGFLAG) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":184
+ * child = node.children[idx]
+ * if DEBUGFLAG:
+ * printf("[t-SNE] Offset [%i, %i] with LE [%f, %f]\n", # <<<<<<<<<<<<<<
+ * offset[0], offset[1], child.left_edge[0], child.left_edge[1])
+ * free(offset)
+ */
+ printf(__pyx_k_t_SNE_Offset_i_i_with_LE_f_f, (__pyx_v_offset[0]), (__pyx_v_offset[1]), (__pyx_v_child->left_edge[0]), (__pyx_v_child->left_edge[1]));
+ goto __pyx_L5;
+ }
+ __pyx_L5:;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":186
+ * printf("[t-SNE] Offset [%i, %i] with LE [%f, %f]\n",
+ * offset[0], offset[1], child.left_edge[0], child.left_edge[1])
+ * free(offset) # <<<<<<<<<<<<<<
+ * return child
+ *
+ */
+ free(__pyx_v_offset);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":187
+ * offset[0], offset[1], child.left_edge[0], child.left_edge[1])
+ * free(offset)
+ * return child # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = __pyx_v_child;
+ goto __pyx_L0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":172
+ * return child
+ *
+ * cdef Node* select_child(Node *node, float[3] pos, long index) nogil: # <<<<<<<<<<<<<<
+ * # Find which sub-node a position should go into
+ * # And return the appropriate node
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "sklearn/manifold/_barnes_hut_tsne.pyx":190
+ *
+ *
+ * cdef inline void index2offset(int* offset, int index, int n_dimensions) nogil: # <<<<<<<<<<<<<<
+ * # Convert a 1D index into N-D index; useful for indexing
+ * # children of a quadtree, octree, N-tree
+ */
+
+static CYTHON_INLINE void __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_index2offset(int *__pyx_v_offset, int __pyx_v_index, int __pyx_v_n_dimensions) {
+ int __pyx_v_rem;
+ int __pyx_v_k;
+ int __pyx_v_shift;
+ int __pyx_v_j;
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_t_4;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":199
+ * # such that the least significat bit is on the right
+ * cdef int rem, k, shift
+ * for k in range(n_dimensions): # <<<<<<<<<<<<<<
+ * shift = n_dimensions -k -1
+ * rem = ((index >> shift) << shift)
+ */
+ __pyx_t_1 = __pyx_v_n_dimensions;
+ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
+ __pyx_v_k = __pyx_t_2;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":200
+ * cdef int rem, k, shift
+ * for k in range(n_dimensions):
+ * shift = n_dimensions -k -1 # <<<<<<<<<<<<<<
+ * rem = ((index >> shift) << shift)
+ * offset[k] = rem > 0
+ */
+ __pyx_v_shift = ((__pyx_v_n_dimensions - __pyx_v_k) - 1);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":201
+ * for k in range(n_dimensions):
+ * shift = n_dimensions -k -1
+ * rem = ((index >> shift) << shift) # <<<<<<<<<<<<<<
+ * offset[k] = rem > 0
+ * if DEBUGFLAG:
+ */
+ __pyx_v_rem = ((__pyx_v_index >> __pyx_v_shift) << __pyx_v_shift);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":202
+ * shift = n_dimensions -k -1
+ * rem = ((index >> shift) << shift)
+ * offset[k] = rem > 0 # <<<<<<<<<<<<<<
+ * if DEBUGFLAG:
+ * printf("i2o index %i k %i rem %i offset", index, k, rem)
+ */
+ (__pyx_v_offset[__pyx_v_k]) = (__pyx_v_rem > 0);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":203
+ * rem = ((index >> shift) << shift)
+ * offset[k] = rem > 0
+ * if DEBUGFLAG: # <<<<<<<<<<<<<<
+ * printf("i2o index %i k %i rem %i offset", index, k, rem)
+ * for j in range(n_dimensions):
+ */
+ if (__pyx_e_7sklearn_8manifold_16_barnes_hut_tsne_DEBUGFLAG) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":204
+ * offset[k] = rem > 0
+ * if DEBUGFLAG:
+ * printf("i2o index %i k %i rem %i offset", index, k, rem) # <<<<<<<<<<<<<<
+ * for j in range(n_dimensions):
+ * printf(" %i", offset[j])
+ */
+ printf(__pyx_k_i2o_index_i_k_i_rem_i_offset, __pyx_v_index, __pyx_v_k, __pyx_v_rem);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":205
+ * if DEBUGFLAG:
+ * printf("i2o index %i k %i rem %i offset", index, k, rem)
+ * for j in range(n_dimensions): # <<<<<<<<<<<<<<
+ * printf(" %i", offset[j])
+ * printf(" n_dimensions %i\n", n_dimensions)
+ */
+ __pyx_t_3 = __pyx_v_n_dimensions;
+ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
+ __pyx_v_j = __pyx_t_4;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":206
+ * printf("i2o index %i k %i rem %i offset", index, k, rem)
+ * for j in range(n_dimensions):
+ * printf(" %i", offset[j]) # <<<<<<<<<<<<<<
+ * printf(" n_dimensions %i\n", n_dimensions)
+ * index -= rem
+ */
+ printf(__pyx_k_i, (__pyx_v_offset[__pyx_v_j]));
+ }
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":207
+ * for j in range(n_dimensions):
+ * printf(" %i", offset[j])
+ * printf(" n_dimensions %i\n", n_dimensions) # <<<<<<<<<<<<<<
+ * index -= rem
+ *
+ */
+ printf(__pyx_k_n_dimensions_i, __pyx_v_n_dimensions);
+ goto __pyx_L5;
+ }
+ __pyx_L5:;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":208
+ * printf(" %i", offset[j])
+ * printf(" n_dimensions %i\n", n_dimensions)
+ * index -= rem # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_v_index = (__pyx_v_index - __pyx_v_rem);
+ }
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":190
+ *
+ *
+ * cdef inline void index2offset(int* offset, int index, int n_dimensions) nogil: # <<<<<<<<<<<<<<
+ * # Convert a 1D index into N-D index; useful for indexing
+ * # children of a quadtree, octree, N-tree
+ */
+
+ /* function exit code */
+}
+
+/* "sklearn/manifold/_barnes_hut_tsne.pyx":211
+ *
+ *
+ * cdef inline int offset2index(int* offset, int n_dimensions) nogil: # <<<<<<<<<<<<<<
+ * # Calculate the 1:1 index for a given offset array
+ * # We read the the offset array right-to-left
+ */
+
+static CYTHON_INLINE int __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_offset2index(int *__pyx_v_offset, int __pyx_v_n_dimensions) {
+ int __pyx_v_dim;
+ int __pyx_v_index;
+ int __pyx_v_j;
+ int __pyx_r;
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_t_4;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":216
+ * # such that the least significat bit is on the right
+ * cdef int dim
+ * cdef int index = 0 # <<<<<<<<<<<<<<
+ * for dim in range(n_dimensions):
+ * index += (2 ** dim) * offset[n_dimensions - dim - 1]
+ */
+ __pyx_v_index = 0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":217
+ * cdef int dim
+ * cdef int index = 0
+ * for dim in range(n_dimensions): # <<<<<<<<<<<<<<
+ * index += (2 ** dim) * offset[n_dimensions - dim - 1]
+ * if DEBUGFLAG:
+ */
+ __pyx_t_1 = __pyx_v_n_dimensions;
+ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
+ __pyx_v_dim = __pyx_t_2;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":218
+ * cdef int index = 0
+ * for dim in range(n_dimensions):
+ * index += (2 ** dim) * offset[n_dimensions - dim - 1] # <<<<<<<<<<<<<<
+ * if DEBUGFLAG:
+ * printf("o2i index %i dim %i offset", index, dim)
+ */
+ __pyx_v_index = (__pyx_v_index + (__Pyx_pow_long(2, ((long)__pyx_v_dim)) * (__pyx_v_offset[((__pyx_v_n_dimensions - __pyx_v_dim) - 1)])));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":219
+ * for dim in range(n_dimensions):
+ * index += (2 ** dim) * offset[n_dimensions - dim - 1]
+ * if DEBUGFLAG: # <<<<<<<<<<<<<<
+ * printf("o2i index %i dim %i offset", index, dim)
+ * for j in range(n_dimensions):
+ */
+ if (__pyx_e_7sklearn_8manifold_16_barnes_hut_tsne_DEBUGFLAG) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":220
+ * index += (2 ** dim) * offset[n_dimensions - dim - 1]
+ * if DEBUGFLAG:
+ * printf("o2i index %i dim %i offset", index, dim) # <<<<<<<<<<<<<<
+ * for j in range(n_dimensions):
+ * printf(" %i", offset[j])
+ */
+ printf(__pyx_k_o2i_index_i_dim_i_offset, __pyx_v_index, __pyx_v_dim);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":221
+ * if DEBUGFLAG:
+ * printf("o2i index %i dim %i offset", index, dim)
+ * for j in range(n_dimensions): # <<<<<<<<<<<<<<
+ * printf(" %i", offset[j])
+ * printf(" n_dimensions %i\n", n_dimensions)
+ */
+ __pyx_t_3 = __pyx_v_n_dimensions;
+ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
+ __pyx_v_j = __pyx_t_4;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":222
+ * printf("o2i index %i dim %i offset", index, dim)
+ * for j in range(n_dimensions):
+ * printf(" %i", offset[j]) # <<<<<<<<<<<<<<
+ * printf(" n_dimensions %i\n", n_dimensions)
+ * return index
+ */
+ printf(__pyx_k_i, (__pyx_v_offset[__pyx_v_j]));
+ }
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":223
+ * for j in range(n_dimensions):
+ * printf(" %i", offset[j])
+ * printf(" n_dimensions %i\n", n_dimensions) # <<<<<<<<<<<<<<
+ * return index
+ *
+ */
+ printf(__pyx_k_n_dimensions_i, __pyx_v_n_dimensions);
+ goto __pyx_L5;
+ }
+ __pyx_L5:;
+ }
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":224
+ * printf(" %i", offset[j])
+ * printf(" n_dimensions %i\n", n_dimensions)
+ * return index # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = __pyx_v_index;
+ goto __pyx_L0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":211
+ *
+ *
+ * cdef inline int offset2index(int* offset, int n_dimensions) nogil: # <<<<<<<<<<<<<<
+ * # Calculate the 1:1 index for a given offset array
+ * # We read the the offset array right-to-left
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "sklearn/manifold/_barnes_hut_tsne.pyx":227
+ *
+ *
+ * cdef void subdivide(Node* node) nogil: # <<<<<<<<<<<<<<
+ * # This instantiates 2**n_dimensions = n_cell_per_node nodes for the current node
+ * cdef int idx = 0
+ */
+
+static void __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_subdivide(struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Node *__pyx_v_node) {
+ int __pyx_v_idx;
+ int *__pyx_v_offset;
+ int __pyx_t_1;
+ int __pyx_t_2;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":229
+ * cdef void subdivide(Node* node) nogil:
+ * # This instantiates 2**n_dimensions = n_cell_per_node nodes for the current node
+ * cdef int idx = 0 # <<<<<<<<<<<<<<
+ * cdef int* offset = malloc(sizeof(int) * node.tree.n_dimensions)
+ * node.is_leaf = False
+ */
+ __pyx_v_idx = 0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":230
+ * # This instantiates 2**n_dimensions = n_cell_per_node nodes for the current node
+ * cdef int idx = 0
+ * cdef int* offset = malloc(sizeof(int) * node.tree.n_dimensions) # <<<<<<<<<<<<<<
+ * node.is_leaf = False
+ * node.children = malloc(sizeof(Node*) * node.tree.n_cell_per_node)
+ */
+ __pyx_v_offset = ((int *)malloc(((sizeof(int)) * __pyx_v_node->tree->n_dimensions)));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":231
+ * cdef int idx = 0
+ * cdef int* offset = malloc(sizeof(int) * node.tree.n_dimensions)
+ * node.is_leaf = False # <<<<<<<<<<<<<<
+ * node.children = malloc(sizeof(Node*) * node.tree.n_cell_per_node)
+ * for idx in range(node.tree.n_cell_per_node):
+ */
+ __pyx_v_node->is_leaf = 0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":232
+ * cdef int* offset = malloc(sizeof(int) * node.tree.n_dimensions)
+ * node.is_leaf = False
+ * node.children = malloc(sizeof(Node*) * node.tree.n_cell_per_node) # <<<<<<<<<<<<<<
+ * for idx in range(node.tree.n_cell_per_node):
+ * index2offset(offset, idx, node.tree.n_dimensions)
+ */
+ __pyx_v_node->children = ((struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Node **)malloc(((sizeof(struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Node *)) * __pyx_v_node->tree->n_cell_per_node)));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":233
+ * node.is_leaf = False
+ * node.children = malloc(sizeof(Node*) * node.tree.n_cell_per_node)
+ * for idx in range(node.tree.n_cell_per_node): # <<<<<<<<<<<<<<
+ * index2offset(offset, idx, node.tree.n_dimensions)
+ * node.children[idx] = create_child(node, offset)
+ */
+ __pyx_t_1 = __pyx_v_node->tree->n_cell_per_node;
+ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
+ __pyx_v_idx = __pyx_t_2;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":234
+ * node.children = malloc(sizeof(Node*) * node.tree.n_cell_per_node)
+ * for idx in range(node.tree.n_cell_per_node):
+ * index2offset(offset, idx, node.tree.n_dimensions) # <<<<<<<<<<<<<<
+ * node.children[idx] = create_child(node, offset)
+ * free(offset)
+ */
+ __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_index2offset(__pyx_v_offset, __pyx_v_idx, __pyx_v_node->tree->n_dimensions);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":235
+ * for idx in range(node.tree.n_cell_per_node):
+ * index2offset(offset, idx, node.tree.n_dimensions)
+ * node.children[idx] = create_child(node, offset) # <<<<<<<<<<<<<<
+ * free(offset)
+ *
+ */
+ (__pyx_v_node->children[__pyx_v_idx]) = __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_create_child(__pyx_v_node, __pyx_v_offset);
+ }
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":236
+ * index2offset(offset, idx, node.tree.n_dimensions)
+ * node.children[idx] = create_child(node, offset)
+ * free(offset) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ free(__pyx_v_offset);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":227
+ *
+ *
+ * cdef void subdivide(Node* node) nogil: # <<<<<<<<<<<<<<
+ * # This instantiates 2**n_dimensions = n_cell_per_node nodes for the current node
+ * cdef int idx = 0
+ */
+
+ /* function exit code */
+}
+
+/* "sklearn/manifold/_barnes_hut_tsne.pyx":239
+ *
+ *
+ * cdef int insert(Node *root, float pos[3], long point_index, long depth, long # <<<<<<<<<<<<<<
+ * duplicate_count) nogil:
+ * # Introduce a new point into the tree
+ */
+
+static int __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_insert(struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Node *__pyx_v_root, float *__pyx_v_pos, long __pyx_v_point_index, long __pyx_v_depth, long __pyx_v_duplicate_count) {
+ struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Node *__pyx_v_child;
+ int __pyx_v_ax;
+ int __pyx_v_not_identical;
+ int __pyx_v_n_dimensions;
+ double __pyx_v_frac_seen;
+ double __pyx_v_frac_new;
+ int __pyx_r;
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_t_4;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":248
+ * cdef long i
+ * cdef int ax
+ * cdef int not_identical = 1 # <<<<<<<<<<<<<<
+ * cdef int n_dimensions = root.tree.n_dimensions
+ * if DEBUGFLAG:
+ */
+ __pyx_v_not_identical = 1;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":249
+ * cdef int ax
+ * cdef int not_identical = 1
+ * cdef int n_dimensions = root.tree.n_dimensions # <<<<<<<<<<<<<<
+ * if DEBUGFLAG:
+ * printf("[t-SNE] [d=%i] Inserting pos %i [%f, %f] duplicate_count=%i "
+ */
+ __pyx_t_1 = __pyx_v_root->tree->n_dimensions;
+ __pyx_v_n_dimensions = __pyx_t_1;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":250
+ * cdef int not_identical = 1
+ * cdef int n_dimensions = root.tree.n_dimensions
+ * if DEBUGFLAG: # <<<<<<<<<<<<<<
+ * printf("[t-SNE] [d=%i] Inserting pos %i [%f, %f] duplicate_count=%i "
+ * "into child %p\n", depth, point_index, pos[0], pos[1],
+ */
+ if (__pyx_e_7sklearn_8manifold_16_barnes_hut_tsne_DEBUGFLAG) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":251
+ * cdef int n_dimensions = root.tree.n_dimensions
+ * if DEBUGFLAG:
+ * printf("[t-SNE] [d=%i] Inserting pos %i [%f, %f] duplicate_count=%i " # <<<<<<<<<<<<<<
+ * "into child %p\n", depth, point_index, pos[0], pos[1],
+ * duplicate_count, root)
+ */
+ printf(__pyx_k_t_SNE_d_i_Inserting_pos_i_f_f_d, __pyx_v_depth, __pyx_v_point_index, (__pyx_v_pos[0]), (__pyx_v_pos[1]), __pyx_v_duplicate_count, __pyx_v_root);
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":256
+ * # Increment the total number points including this
+ * # node and below it
+ * root.cumulative_size += duplicate_count # <<<<<<<<<<<<<<
+ * # Evaluate the new center of mass, weighting the previous
+ * # center of mass against the new point data
+ */
+ __pyx_v_root->cumulative_size = (__pyx_v_root->cumulative_size + __pyx_v_duplicate_count);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":259
+ * # Evaluate the new center of mass, weighting the previous
+ * # center of mass against the new point data
+ * cdef double frac_seen = (root.cumulative_size - 1) / ( # <<<<<<<<<<<<<<
+ * root.cumulative_size)
+ * cdef double frac_new = 1.0 / root.cumulative_size
+ */
+ __pyx_v_frac_seen = (((double)(__pyx_v_root->cumulative_size - 1)) / ((double)__pyx_v_root->cumulative_size));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":261
+ * cdef double frac_seen = (root.cumulative_size - 1) / (
+ * root.cumulative_size)
+ * cdef double frac_new = 1.0 / root.cumulative_size # <<<<<<<<<<<<<<
+ * # Assert that duplicate_count > 0
+ * if duplicate_count < 1:
+ */
+ __pyx_v_frac_new = (1.0 / ((double)__pyx_v_root->cumulative_size));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":263
+ * cdef double frac_new = 1.0 / root.cumulative_size
+ * # Assert that duplicate_count > 0
+ * if duplicate_count < 1: # <<<<<<<<<<<<<<
+ * return -1
+ * # Assert that the point is inside the left & right edges
+ */
+ __pyx_t_2 = ((__pyx_v_duplicate_count < 1) != 0);
+ if (__pyx_t_2) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":264
+ * # Assert that duplicate_count > 0
+ * if duplicate_count < 1:
+ * return -1 # <<<<<<<<<<<<<<
+ * # Assert that the point is inside the left & right edges
+ * for ax in range(n_dimensions):
+ */
+ __pyx_r = -1;
+ goto __pyx_L0;
+ }
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":266
+ * return -1
+ * # Assert that the point is inside the left & right edges
+ * for ax in range(n_dimensions): # <<<<<<<<<<<<<<
+ * root.barycenter[ax] *= frac_seen
+ * if (pos[ax] > (root.left_edge[ax] + root.width[ax] + EPSILON)):
+ */
+ __pyx_t_1 = __pyx_v_n_dimensions;
+ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) {
+ __pyx_v_ax = __pyx_t_3;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":267
+ * # Assert that the point is inside the left & right edges
+ * for ax in range(n_dimensions):
+ * root.barycenter[ax] *= frac_seen # <<<<<<<<<<<<<<
+ * if (pos[ax] > (root.left_edge[ax] + root.width[ax] + EPSILON)):
+ * printf("[t-SNE] Error: point (%1.9e) is above right edge of node "
+ */
+ __pyx_t_4 = __pyx_v_ax;
+ (__pyx_v_root->barycenter[__pyx_t_4]) = ((__pyx_v_root->barycenter[__pyx_t_4]) * __pyx_v_frac_seen);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":268
+ * for ax in range(n_dimensions):
+ * root.barycenter[ax] *= frac_seen
+ * if (pos[ax] > (root.left_edge[ax] + root.width[ax] + EPSILON)): # <<<<<<<<<<<<<<
+ * printf("[t-SNE] Error: point (%1.9e) is above right edge of node "
+ * "(%1.9e)\n", pos[ax], root.left_edge[ax] + root.width[ax])
+ */
+ __pyx_t_2 = (((__pyx_v_pos[__pyx_v_ax]) > (((__pyx_v_root->left_edge[__pyx_v_ax]) + (__pyx_v_root->width[__pyx_v_ax])) + __pyx_v_7sklearn_8manifold_16_barnes_hut_tsne_EPSILON)) != 0);
+ if (__pyx_t_2) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":269
+ * root.barycenter[ax] *= frac_seen
+ * if (pos[ax] > (root.left_edge[ax] + root.width[ax] + EPSILON)):
+ * printf("[t-SNE] Error: point (%1.9e) is above right edge of node " # <<<<<<<<<<<<<<
+ * "(%1.9e)\n", pos[ax], root.left_edge[ax] + root.width[ax])
+ * return -1
+ */
+ printf(__pyx_k_t_SNE_Error_point_1_9e_is_above, (__pyx_v_pos[__pyx_v_ax]), ((__pyx_v_root->left_edge[__pyx_v_ax]) + (__pyx_v_root->width[__pyx_v_ax])));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":271
+ * printf("[t-SNE] Error: point (%1.9e) is above right edge of node "
+ * "(%1.9e)\n", pos[ax], root.left_edge[ax] + root.width[ax])
+ * return -1 # <<<<<<<<<<<<<<
+ * if (pos[ax] < root.left_edge[ax] - EPSILON):
+ * printf("[t-SNE] Error: point (%1.9e) is below left edge of node "
+ */
+ __pyx_r = -1;
+ goto __pyx_L0;
+ }
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":272
+ * "(%1.9e)\n", pos[ax], root.left_edge[ax] + root.width[ax])
+ * return -1
+ * if (pos[ax] < root.left_edge[ax] - EPSILON): # <<<<<<<<<<<<<<
+ * printf("[t-SNE] Error: point (%1.9e) is below left edge of node "
+ * "(%1.9e)\n", pos[ax], root.left_edge[ax])
+ */
+ __pyx_t_2 = (((__pyx_v_pos[__pyx_v_ax]) < ((__pyx_v_root->left_edge[__pyx_v_ax]) - __pyx_v_7sklearn_8manifold_16_barnes_hut_tsne_EPSILON)) != 0);
+ if (__pyx_t_2) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":273
+ * return -1
+ * if (pos[ax] < root.left_edge[ax] - EPSILON):
+ * printf("[t-SNE] Error: point (%1.9e) is below left edge of node " # <<<<<<<<<<<<<<
+ * "(%1.9e)\n", pos[ax], root.left_edge[ax])
+ * return -1
+ */
+ printf(__pyx_k_t_SNE_Error_point_1_9e_is_below, (__pyx_v_pos[__pyx_v_ax]), (__pyx_v_root->left_edge[__pyx_v_ax]));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":275
+ * printf("[t-SNE] Error: point (%1.9e) is below left edge of node "
+ * "(%1.9e)\n", pos[ax], root.left_edge[ax])
+ * return -1 # <<<<<<<<<<<<<<
+ * for ax in range(n_dimensions):
+ * root.barycenter[ax] += pos[ax] * frac_new
+ */
+ __pyx_r = -1;
+ goto __pyx_L0;
+ }
+ }
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":276
+ * "(%1.9e)\n", pos[ax], root.left_edge[ax])
+ * return -1
+ * for ax in range(n_dimensions): # <<<<<<<<<<<<<<
+ * root.barycenter[ax] += pos[ax] * frac_new
+ *
+ */
+ __pyx_t_1 = __pyx_v_n_dimensions;
+ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) {
+ __pyx_v_ax = __pyx_t_3;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":277
+ * return -1
+ * for ax in range(n_dimensions):
+ * root.barycenter[ax] += pos[ax] * frac_new # <<<<<<<<<<<<<<
+ *
+ * # If this node is unoccupied, fill it.
+ */
+ __pyx_t_4 = __pyx_v_ax;
+ (__pyx_v_root->barycenter[__pyx_t_4]) = ((__pyx_v_root->barycenter[__pyx_t_4]) + ((__pyx_v_pos[__pyx_v_ax]) * __pyx_v_frac_new));
+ }
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":284
+ * # 1) Insert into this node if it is a leaf and empty
+ * # 2) Subdivide this node if it is currently occupied
+ * if (root.size == 0) & root.is_leaf: # <<<<<<<<<<<<<<
+ * # Root node is empty and a leaf
+ * if DEBUGFLAG:
+ */
+ __pyx_t_2 = (((__pyx_v_root->size == 0) & __pyx_v_root->is_leaf) != 0);
+ if (__pyx_t_2) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":286
+ * if (root.size == 0) & root.is_leaf:
+ * # Root node is empty and a leaf
+ * if DEBUGFLAG: # <<<<<<<<<<<<<<
+ * printf("[t-SNE] [d=%i] Inserting [%f, %f] into blank cell\n", depth,
+ * pos[0], pos[1])
+ */
+ if (__pyx_e_7sklearn_8manifold_16_barnes_hut_tsne_DEBUGFLAG) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":287
+ * # Root node is empty and a leaf
+ * if DEBUGFLAG:
+ * printf("[t-SNE] [d=%i] Inserting [%f, %f] into blank cell\n", depth, # <<<<<<<<<<<<<<
+ * pos[0], pos[1])
+ * for ax in range(n_dimensions):
+ */
+ printf(__pyx_k_t_SNE_d_i_Inserting_f_f_into_bl, __pyx_v_depth, (__pyx_v_pos[0]), (__pyx_v_pos[1]));
+ goto __pyx_L12;
+ }
+ __pyx_L12:;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":289
+ * printf("[t-SNE] [d=%i] Inserting [%f, %f] into blank cell\n", depth,
+ * pos[0], pos[1])
+ * for ax in range(n_dimensions): # <<<<<<<<<<<<<<
+ * root.leaf_point_position[ax] = pos[ax]
+ * root.point_index = point_index
+ */
+ __pyx_t_1 = __pyx_v_n_dimensions;
+ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) {
+ __pyx_v_ax = __pyx_t_3;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":290
+ * pos[0], pos[1])
+ * for ax in range(n_dimensions):
+ * root.leaf_point_position[ax] = pos[ax] # <<<<<<<<<<<<<<
+ * root.point_index = point_index
+ * root.size = duplicate_count
+ */
+ (__pyx_v_root->leaf_point_position[__pyx_v_ax]) = (__pyx_v_pos[__pyx_v_ax]);
+ }
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":291
+ * for ax in range(n_dimensions):
+ * root.leaf_point_position[ax] = pos[ax]
+ * root.point_index = point_index # <<<<<<<<<<<<<<
+ * root.size = duplicate_count
+ * return 0
+ */
+ __pyx_v_root->point_index = __pyx_v_point_index;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":292
+ * root.leaf_point_position[ax] = pos[ax]
+ * root.point_index = point_index
+ * root.size = duplicate_count # <<<<<<<<<<<<<<
+ * return 0
+ * else:
+ */
+ __pyx_v_root->size = __pyx_v_duplicate_count;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":293
+ * root.point_index = point_index
+ * root.size = duplicate_count
+ * return 0 # <<<<<<<<<<<<<<
+ * else:
+ * # Root node is occupied or not a leaf
+ */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":296
+ * else:
+ * # Root node is occupied or not a leaf
+ * if DEBUGFLAG: # <<<<<<<<<<<<<<
+ * printf("[t-SNE] [d=%i] Node %p is occupied or is a leaf.\n", depth,
+ * root)
+ */
+ if (__pyx_e_7sklearn_8manifold_16_barnes_hut_tsne_DEBUGFLAG) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":297
+ * # Root node is occupied or not a leaf
+ * if DEBUGFLAG:
+ * printf("[t-SNE] [d=%i] Node %p is occupied or is a leaf.\n", depth, # <<<<<<<<<<<<<<
+ * root)
+ * printf("[t-SNE] [d=%i] Node %p leaf = %i. Size %i\n", depth, root,
+ */
+ printf(__pyx_k_t_SNE_d_i_Node_p_is_occupied_or, __pyx_v_depth, __pyx_v_root);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":299
+ * printf("[t-SNE] [d=%i] Node %p is occupied or is a leaf.\n", depth,
+ * root)
+ * printf("[t-SNE] [d=%i] Node %p leaf = %i. Size %i\n", depth, root, # <<<<<<<<<<<<<<
+ * root.is_leaf, root.size)
+ * if root.is_leaf & (root.size > 0):
+ */
+ printf(__pyx_k_t_SNE_d_i_Node_p_leaf_i_Size_i, __pyx_v_depth, __pyx_v_root, __pyx_v_root->is_leaf, __pyx_v_root->size);
+ goto __pyx_L15;
+ }
+ __pyx_L15:;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":301
+ * printf("[t-SNE] [d=%i] Node %p leaf = %i. Size %i\n", depth, root,
+ * root.is_leaf, root.size)
+ * if root.is_leaf & (root.size > 0): # <<<<<<<<<<<<<<
+ * # is a leaf node and is occupied
+ * for ax in range(n_dimensions):
+ */
+ __pyx_t_2 = ((__pyx_v_root->is_leaf & (__pyx_v_root->size > 0)) != 0);
+ if (__pyx_t_2) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":303
+ * if root.is_leaf & (root.size > 0):
+ * # is a leaf node and is occupied
+ * for ax in range(n_dimensions): # <<<<<<<<<<<<<<
+ * not_identical &= (fabsf(pos[ax] - root.leaf_point_position[ax]) < EPSILON)
+ * not_identical &= (root.point_index != point_index)
+ */
+ __pyx_t_1 = __pyx_v_n_dimensions;
+ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) {
+ __pyx_v_ax = __pyx_t_3;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":304
+ * # is a leaf node and is occupied
+ * for ax in range(n_dimensions):
+ * not_identical &= (fabsf(pos[ax] - root.leaf_point_position[ax]) < EPSILON) # <<<<<<<<<<<<<<
+ * not_identical &= (root.point_index != point_index)
+ * if not_identical == 1:
+ */
+ __pyx_v_not_identical = (__pyx_v_not_identical & (fabsf(((__pyx_v_pos[__pyx_v_ax]) - (__pyx_v_root->leaf_point_position[__pyx_v_ax]))) < __pyx_v_7sklearn_8manifold_16_barnes_hut_tsne_EPSILON));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":305
+ * for ax in range(n_dimensions):
+ * not_identical &= (fabsf(pos[ax] - root.leaf_point_position[ax]) < EPSILON)
+ * not_identical &= (root.point_index != point_index) # <<<<<<<<<<<<<<
+ * if not_identical == 1:
+ * root.size += duplicate_count
+ */
+ __pyx_v_not_identical = (__pyx_v_not_identical & (__pyx_v_root->point_index != __pyx_v_point_index));
+ }
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":306
+ * not_identical &= (fabsf(pos[ax] - root.leaf_point_position[ax]) < EPSILON)
+ * not_identical &= (root.point_index != point_index)
+ * if not_identical == 1: # <<<<<<<<<<<<<<
+ * root.size += duplicate_count
+ * if DEBUGFLAG:
+ */
+ __pyx_t_2 = ((__pyx_v_not_identical == 1) != 0);
+ if (__pyx_t_2) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":307
+ * not_identical &= (root.point_index != point_index)
+ * if not_identical == 1:
+ * root.size += duplicate_count # <<<<<<<<<<<<<<
+ * if DEBUGFLAG:
+ * printf("[t-SNE] Warning: [d=%i] Detected identical "
+ */
+ __pyx_v_root->size = (__pyx_v_root->size + __pyx_v_duplicate_count);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":308
+ * if not_identical == 1:
+ * root.size += duplicate_count
+ * if DEBUGFLAG: # <<<<<<<<<<<<<<
+ * printf("[t-SNE] Warning: [d=%i] Detected identical "
+ * "points. Returning. Leaf now has size %i\n",
+ */
+ if (__pyx_e_7sklearn_8manifold_16_barnes_hut_tsne_DEBUGFLAG) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":309
+ * root.size += duplicate_count
+ * if DEBUGFLAG:
+ * printf("[t-SNE] Warning: [d=%i] Detected identical " # <<<<<<<<<<<<<<
+ * "points. Returning. Leaf now has size %i\n",
+ * depth, root.size)
+ */
+ printf(__pyx_k_t_SNE_Warning_d_i_Detected_iden, __pyx_v_depth, __pyx_v_root->size);
+ goto __pyx_L20;
+ }
+ __pyx_L20:;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":312
+ * "points. Returning. Leaf now has size %i\n",
+ * depth, root.size)
+ * return 0 # <<<<<<<<<<<<<<
+ * # If necessary, subdivide this node before
+ * # descending
+ */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ }
+ goto __pyx_L16;
+ }
+ __pyx_L16:;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":315
+ * # If necessary, subdivide this node before
+ * # descending
+ * if root.is_leaf: # <<<<<<<<<<<<<<
+ * if DEBUGFLAG:
+ * printf("[t-SNE] [d=%i] Subdividing this leaf node %p\n", depth,
+ */
+ __pyx_t_2 = (__pyx_v_root->is_leaf != 0);
+ if (__pyx_t_2) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":316
+ * # descending
+ * if root.is_leaf:
+ * if DEBUGFLAG: # <<<<<<<<<<<<<<
+ * printf("[t-SNE] [d=%i] Subdividing this leaf node %p\n", depth,
+ * root)
+ */
+ if (__pyx_e_7sklearn_8manifold_16_barnes_hut_tsne_DEBUGFLAG) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":317
+ * if root.is_leaf:
+ * if DEBUGFLAG:
+ * printf("[t-SNE] [d=%i] Subdividing this leaf node %p\n", depth, # <<<<<<<<<<<<<<
+ * root)
+ * subdivide(root)
+ */
+ printf(__pyx_k_t_SNE_d_i_Subdividing_this_leaf, __pyx_v_depth, __pyx_v_root);
+ goto __pyx_L22;
+ }
+ __pyx_L22:;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":319
+ * printf("[t-SNE] [d=%i] Subdividing this leaf node %p\n", depth,
+ * root)
+ * subdivide(root) # <<<<<<<<<<<<<<
+ * # We have two points to relocate: the one previously
+ * # at this node, and the new one we're attempting
+ */
+ __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_subdivide(__pyx_v_root);
+ goto __pyx_L21;
+ }
+ __pyx_L21:;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":323
+ * # at this node, and the new one we're attempting
+ * # to insert
+ * if root.size > 0: # <<<<<<<<<<<<<<
+ * child = select_child(root, root.leaf_point_position, root.point_index)
+ * if DEBUGFLAG:
+ */
+ __pyx_t_2 = ((__pyx_v_root->size > 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":324
+ * # to insert
+ * if root.size > 0:
+ * child = select_child(root, root.leaf_point_position, root.point_index) # <<<<<<<<<<<<<<
+ * if DEBUGFLAG:
+ * printf("[t-SNE] [d=%i] Relocating old point to node %p\n",
+ */
+ __pyx_v_child = __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_select_child(__pyx_v_root, __pyx_v_root->leaf_point_position, __pyx_v_root->point_index);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":325
+ * if root.size > 0:
+ * child = select_child(root, root.leaf_point_position, root.point_index)
+ * if DEBUGFLAG: # <<<<<<<<<<<<<<
+ * printf("[t-SNE] [d=%i] Relocating old point to node %p\n",
+ * depth, child)
+ */
+ if (__pyx_e_7sklearn_8manifold_16_barnes_hut_tsne_DEBUGFLAG) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":326
+ * child = select_child(root, root.leaf_point_position, root.point_index)
+ * if DEBUGFLAG:
+ * printf("[t-SNE] [d=%i] Relocating old point to node %p\n", # <<<<<<<<<<<<<<
+ * depth, child)
+ * insert(child, root.leaf_point_position, root.point_index, depth + 1, root.size)
+ */
+ printf(__pyx_k_t_SNE_d_i_Relocating_old_point, __pyx_v_depth, __pyx_v_child);
+ goto __pyx_L24;
+ }
+ __pyx_L24:;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":328
+ * printf("[t-SNE] [d=%i] Relocating old point to node %p\n",
+ * depth, child)
+ * insert(child, root.leaf_point_position, root.point_index, depth + 1, root.size) # <<<<<<<<<<<<<<
+ * # Insert the new point
+ * if DEBUGFLAG:
+ */
+ __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_insert(__pyx_v_child, __pyx_v_root->leaf_point_position, __pyx_v_root->point_index, (__pyx_v_depth + 1), __pyx_v_root->size);
+ goto __pyx_L23;
+ }
+ __pyx_L23:;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":330
+ * insert(child, root.leaf_point_position, root.point_index, depth + 1, root.size)
+ * # Insert the new point
+ * if DEBUGFLAG: # <<<<<<<<<<<<<<
+ * printf("[t-SNE] [d=%i] Selecting node for new point\n", depth)
+ * child = select_child(root, pos, point_index)
+ */
+ if (__pyx_e_7sklearn_8manifold_16_barnes_hut_tsne_DEBUGFLAG) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":331
+ * # Insert the new point
+ * if DEBUGFLAG:
+ * printf("[t-SNE] [d=%i] Selecting node for new point\n", depth) # <<<<<<<<<<<<<<
+ * child = select_child(root, pos, point_index)
+ * if root.size > 0:
+ */
+ printf(__pyx_k_t_SNE_d_i_Selecting_node_for_ne, __pyx_v_depth);
+ goto __pyx_L25;
+ }
+ __pyx_L25:;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":332
+ * if DEBUGFLAG:
+ * printf("[t-SNE] [d=%i] Selecting node for new point\n", depth)
+ * child = select_child(root, pos, point_index) # <<<<<<<<<<<<<<
+ * if root.size > 0:
+ * # Remove the point from this node
+ */
+ __pyx_v_child = __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_select_child(__pyx_v_root, __pyx_v_pos, __pyx_v_point_index);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":333
+ * printf("[t-SNE] [d=%i] Selecting node for new point\n", depth)
+ * child = select_child(root, pos, point_index)
+ * if root.size > 0: # <<<<<<<<<<<<<<
+ * # Remove the point from this node
+ * for ax in range(n_dimensions):
+ */
+ __pyx_t_2 = ((__pyx_v_root->size > 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":335
+ * if root.size > 0:
+ * # Remove the point from this node
+ * for ax in range(n_dimensions): # <<<<<<<<<<<<<<
+ * root.leaf_point_position[ax] = -1
+ * root.size = 0
+ */
+ __pyx_t_1 = __pyx_v_n_dimensions;
+ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) {
+ __pyx_v_ax = __pyx_t_3;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":336
+ * # Remove the point from this node
+ * for ax in range(n_dimensions):
+ * root.leaf_point_position[ax] = -1 # <<<<<<<<<<<<<<
+ * root.size = 0
+ * root.point_index = -1
+ */
+ (__pyx_v_root->leaf_point_position[__pyx_v_ax]) = -1.0;
+ }
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":337
+ * for ax in range(n_dimensions):
+ * root.leaf_point_position[ax] = -1
+ * root.size = 0 # <<<<<<<<<<<<<<
+ * root.point_index = -1
+ * return insert(child, pos, point_index, depth + 1, 1)
+ */
+ __pyx_v_root->size = 0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":338
+ * root.leaf_point_position[ax] = -1
+ * root.size = 0
+ * root.point_index = -1 # <<<<<<<<<<<<<<
+ * return insert(child, pos, point_index, depth + 1, 1)
+ *
+ */
+ __pyx_v_root->point_index = -1;
+ goto __pyx_L26;
+ }
+ __pyx_L26:;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":339
+ * root.size = 0
+ * root.point_index = -1
+ * return insert(child, pos, point_index, depth + 1, 1) # <<<<<<<<<<<<<<
+ *
+ * cdef int insert_many(Tree* tree, float[:,:] pos_array) nogil:
+ */
+ __pyx_r = __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_insert(__pyx_v_child, __pyx_v_pos, __pyx_v_point_index, (__pyx_v_depth + 1), 1);
+ goto __pyx_L0;
+ }
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":239
+ *
+ *
+ * cdef int insert(Node *root, float pos[3], long point_index, long depth, long # <<<<<<<<<<<<<<
+ * duplicate_count) nogil:
+ * # Introduce a new point into the tree
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "sklearn/manifold/_barnes_hut_tsne.pyx":341
+ * return insert(child, pos, point_index, depth + 1, 1)
+ *
+ * cdef int insert_many(Tree* tree, float[:,:] pos_array) nogil: # <<<<<<<<<<<<<<
+ * # Insert each data point into the tree one at a time
+ * cdef long nrows = pos_array.shape[0]
+ */
+
+static int __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_insert_many(struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Tree *__pyx_v_tree, __Pyx_memviewslice __pyx_v_pos_array) {
+ long __pyx_v_nrows;
+ long __pyx_v_i;
+ int __pyx_v_ax;
+ float __pyx_v_row[3];
+ long __pyx_v_err;
+ int __pyx_r;
+ long __pyx_t_1;
+ long __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ long __pyx_t_5;
+ int __pyx_t_6;
+ int __pyx_t_7;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":343
+ * cdef int insert_many(Tree* tree, float[:,:] pos_array) nogil:
+ * # Insert each data point into the tree one at a time
+ * cdef long nrows = pos_array.shape[0] # <<<<<<<<<<<<<<
+ * cdef long i
+ * cdef int ax
+ */
+ __pyx_v_nrows = (__pyx_v_pos_array.shape[0]);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":347
+ * cdef int ax
+ * cdef float row[3]
+ * cdef long err = 0 # <<<<<<<<<<<<<<
+ * for i in range(nrows):
+ * for ax in range(tree.n_dimensions):
+ */
+ __pyx_v_err = 0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":348
+ * cdef float row[3]
+ * cdef long err = 0
+ * for i in range(nrows): # <<<<<<<<<<<<<<
+ * for ax in range(tree.n_dimensions):
+ * row[ax] = pos_array[i, ax]
+ */
+ __pyx_t_1 = __pyx_v_nrows;
+ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
+ __pyx_v_i = __pyx_t_2;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":349
+ * cdef long err = 0
+ * for i in range(nrows):
+ * for ax in range(tree.n_dimensions): # <<<<<<<<<<<<<<
+ * row[ax] = pos_array[i, ax]
+ * if DEBUGFLAG:
+ */
+ __pyx_t_3 = __pyx_v_tree->n_dimensions;
+ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
+ __pyx_v_ax = __pyx_t_4;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":350
+ * for i in range(nrows):
+ * for ax in range(tree.n_dimensions):
+ * row[ax] = pos_array[i, ax] # <<<<<<<<<<<<<<
+ * if DEBUGFLAG:
+ * printf("[t-SNE] inserting point %i: [%f, %f]\n", i, row[0], row[1])
+ */
+ __pyx_t_5 = __pyx_v_i;
+ __pyx_t_6 = __pyx_v_ax;
+ (__pyx_v_row[__pyx_v_ax]) = (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_pos_array.data + __pyx_t_5 * __pyx_v_pos_array.strides[0]) ) + __pyx_t_6 * __pyx_v_pos_array.strides[1]) )));
+ }
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":351
+ * for ax in range(tree.n_dimensions):
+ * row[ax] = pos_array[i, ax]
+ * if DEBUGFLAG: # <<<<<<<<<<<<<<
+ * printf("[t-SNE] inserting point %i: [%f, %f]\n", i, row[0], row[1])
+ * err = insert(tree.root_node, row, i, 0, 1)
+ */
+ if (__pyx_e_7sklearn_8manifold_16_barnes_hut_tsne_DEBUGFLAG) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":352
+ * row[ax] = pos_array[i, ax]
+ * if DEBUGFLAG:
+ * printf("[t-SNE] inserting point %i: [%f, %f]\n", i, row[0], row[1]) # <<<<<<<<<<<<<<
+ * err = insert(tree.root_node, row, i, 0, 1)
+ * if err != 0:
+ */
+ printf(__pyx_k_t_SNE_inserting_point_i_f_f, __pyx_v_i, (__pyx_v_row[0]), (__pyx_v_row[1]));
+ goto __pyx_L7;
+ }
+ __pyx_L7:;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":353
+ * if DEBUGFLAG:
+ * printf("[t-SNE] inserting point %i: [%f, %f]\n", i, row[0], row[1])
+ * err = insert(tree.root_node, row, i, 0, 1) # <<<<<<<<<<<<<<
+ * if err != 0:
+ * printf("[t-SNE] ERROR\n")
+ */
+ __pyx_v_err = __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_insert(__pyx_v_tree->root_node, __pyx_v_row, __pyx_v_i, 0, 1);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":354
+ * printf("[t-SNE] inserting point %i: [%f, %f]\n", i, row[0], row[1])
+ * err = insert(tree.root_node, row, i, 0, 1)
+ * if err != 0: # <<<<<<<<<<<<<<
+ * printf("[t-SNE] ERROR\n")
+ * return err
+ */
+ __pyx_t_7 = ((__pyx_v_err != 0) != 0);
+ if (__pyx_t_7) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":355
+ * err = insert(tree.root_node, row, i, 0, 1)
+ * if err != 0:
+ * printf("[t-SNE] ERROR\n") # <<<<<<<<<<<<<<
+ * return err
+ * tree.n_points += 1
+ */
+ printf(__pyx_k_t_SNE_ERROR);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":356
+ * if err != 0:
+ * printf("[t-SNE] ERROR\n")
+ * return err # <<<<<<<<<<<<<<
+ * tree.n_points += 1
+ * return err
+ */
+ __pyx_r = __pyx_v_err;
+ goto __pyx_L0;
+ }
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":357
+ * printf("[t-SNE] ERROR\n")
+ * return err
+ * tree.n_points += 1 # <<<<<<<<<<<<<<
+ * return err
+ *
+ */
+ __pyx_v_tree->n_points = (__pyx_v_tree->n_points + 1);
+ }
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":358
+ * return err
+ * tree.n_points += 1
+ * return err # <<<<<<<<<<<<<<
+ *
+ * cdef int free_tree(Tree* tree) nogil:
+ */
+ __pyx_r = __pyx_v_err;
+ goto __pyx_L0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":341
+ * return insert(child, pos, point_index, depth + 1, 1)
+ *
+ * cdef int insert_many(Tree* tree, float[:,:] pos_array) nogil: # <<<<<<<<<<<<<<
+ * # Insert each data point into the tree one at a time
+ * cdef long nrows = pos_array.shape[0]
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "sklearn/manifold/_barnes_hut_tsne.pyx":360
+ * return err
+ *
+ * cdef int free_tree(Tree* tree) nogil: # <<<<<<<<<<<<<<
+ * cdef int check
+ * cdef long* cnt = malloc(sizeof(long) * 3)
+ */
+
+static int __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_free_tree(struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Tree *__pyx_v_tree) {
+ int __pyx_v_check;
+ long *__pyx_v_cnt;
+ long __pyx_v_i;
+ int __pyx_r;
+ long __pyx_t_1;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":362
+ * cdef int free_tree(Tree* tree) nogil:
+ * cdef int check
+ * cdef long* cnt = malloc(sizeof(long) * 3) # <<<<<<<<<<<<<<
+ * for i in range(3):
+ * cnt[i] = 0
+ */
+ __pyx_v_cnt = ((long *)malloc(((sizeof(long)) * 3)));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":363
+ * cdef int check
+ * cdef long* cnt = malloc(sizeof(long) * 3)
+ * for i in range(3): # <<<<<<<<<<<<<<
+ * cnt[i] = 0
+ * free_recursive(tree, tree.root_node, cnt)
+ */
+ for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
+ __pyx_v_i = __pyx_t_1;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":364
+ * cdef long* cnt = malloc(sizeof(long) * 3)
+ * for i in range(3):
+ * cnt[i] = 0 # <<<<<<<<<<<<<<
+ * free_recursive(tree, tree.root_node, cnt)
+ * free(tree.root_node)
+ */
+ (__pyx_v_cnt[__pyx_v_i]) = 0;
+ }
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":365
+ * for i in range(3):
+ * cnt[i] = 0
+ * free_recursive(tree, tree.root_node, cnt) # <<<<<<<<<<<<<<
+ * free(tree.root_node)
+ * free(tree)
+ */
+ __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_free_recursive(__pyx_v_tree, __pyx_v_tree->root_node, __pyx_v_cnt);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":366
+ * cnt[i] = 0
+ * free_recursive(tree, tree.root_node, cnt)
+ * free(tree.root_node) # <<<<<<<<<<<<<<
+ * free(tree)
+ * check = cnt[0] == tree.n_cells
+ */
+ free(__pyx_v_tree->root_node);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":367
+ * free_recursive(tree, tree.root_node, cnt)
+ * free(tree.root_node)
+ * free(tree) # <<<<<<<<<<<<<<
+ * check = cnt[0] == tree.n_cells
+ * check &= cnt[2] == tree.n_points
+ */
+ free(__pyx_v_tree);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":368
+ * free(tree.root_node)
+ * free(tree)
+ * check = cnt[0] == tree.n_cells # <<<<<<<<<<<<<<
+ * check &= cnt[2] == tree.n_points
+ * free(cnt)
+ */
+ __pyx_v_check = ((__pyx_v_cnt[0]) == __pyx_v_tree->n_cells);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":369
+ * free(tree)
+ * check = cnt[0] == tree.n_cells
+ * check &= cnt[2] == tree.n_points # <<<<<<<<<<<<<<
+ * free(cnt)
+ * return check
+ */
+ __pyx_v_check = (__pyx_v_check & ((__pyx_v_cnt[2]) == __pyx_v_tree->n_points));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":370
+ * check = cnt[0] == tree.n_cells
+ * check &= cnt[2] == tree.n_points
+ * free(cnt) # <<<<<<<<<<<<<<
+ * return check
+ *
+ */
+ free(__pyx_v_cnt);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":371
+ * check &= cnt[2] == tree.n_points
+ * free(cnt)
+ * return check # <<<<<<<<<<<<<<
+ *
+ * cdef void free_recursive(Tree* tree, Node *root, long* counts) nogil:
+ */
+ __pyx_r = __pyx_v_check;
+ goto __pyx_L0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":360
+ * return err
+ *
+ * cdef int free_tree(Tree* tree) nogil: # <<<<<<<<<<<<<<
+ * cdef int check
+ * cdef long* cnt = malloc(sizeof(long) * 3)
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "sklearn/manifold/_barnes_hut_tsne.pyx":373
+ * return check
+ *
+ * cdef void free_recursive(Tree* tree, Node *root, long* counts) nogil: # <<<<<<<<<<<<<<
+ * # Free up all of the tree nodes recursively
+ * # while counting the number of nodes visited
+ */
+
+static void __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_free_recursive(struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Tree *__pyx_v_tree, struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Node *__pyx_v_root, long *__pyx_v_counts) {
+ int __pyx_v_idx;
+ struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Node *__pyx_v_child;
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ long __pyx_t_4;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":379
+ * cdef int idx
+ * cdef Node* child
+ * if not root.is_leaf: # <<<<<<<<<<<<<<
+ * for idx in range(tree.n_cell_per_node):
+ * child = root.children[idx]
+ */
+ __pyx_t_1 = ((!(__pyx_v_root->is_leaf != 0)) != 0);
+ if (__pyx_t_1) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":380
+ * cdef Node* child
+ * if not root.is_leaf:
+ * for idx in range(tree.n_cell_per_node): # <<<<<<<<<<<<<<
+ * child = root.children[idx]
+ * free_recursive(tree, child, counts)
+ */
+ __pyx_t_2 = __pyx_v_tree->n_cell_per_node;
+ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
+ __pyx_v_idx = __pyx_t_3;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":381
+ * if not root.is_leaf:
+ * for idx in range(tree.n_cell_per_node):
+ * child = root.children[idx] # <<<<<<<<<<<<<<
+ * free_recursive(tree, child, counts)
+ * counts[0] += 1
+ */
+ __pyx_v_child = (__pyx_v_root->children[__pyx_v_idx]);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":382
+ * for idx in range(tree.n_cell_per_node):
+ * child = root.children[idx]
+ * free_recursive(tree, child, counts) # <<<<<<<<<<<<<<
+ * counts[0] += 1
+ * if child.is_leaf:
+ */
+ __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_free_recursive(__pyx_v_tree, __pyx_v_child, __pyx_v_counts);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":383
+ * child = root.children[idx]
+ * free_recursive(tree, child, counts)
+ * counts[0] += 1 # <<<<<<<<<<<<<<
+ * if child.is_leaf:
+ * counts[1] += 1
+ */
+ __pyx_t_4 = 0;
+ (__pyx_v_counts[__pyx_t_4]) = ((__pyx_v_counts[__pyx_t_4]) + 1);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":384
+ * free_recursive(tree, child, counts)
+ * counts[0] += 1
+ * if child.is_leaf: # <<<<<<<<<<<<<<
+ * counts[1] += 1
+ * if child.size > 0:
+ */
+ __pyx_t_1 = (__pyx_v_child->is_leaf != 0);
+ if (__pyx_t_1) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":385
+ * counts[0] += 1
+ * if child.is_leaf:
+ * counts[1] += 1 # <<<<<<<<<<<<<<
+ * if child.size > 0:
+ * counts[2] +=1
+ */
+ __pyx_t_4 = 1;
+ (__pyx_v_counts[__pyx_t_4]) = ((__pyx_v_counts[__pyx_t_4]) + 1);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":386
+ * if child.is_leaf:
+ * counts[1] += 1
+ * if child.size > 0: # <<<<<<<<<<<<<<
+ * counts[2] +=1
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_child->size > 0) != 0);
+ if (__pyx_t_1) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":387
+ * counts[1] += 1
+ * if child.size > 0:
+ * counts[2] +=1 # <<<<<<<<<<<<<<
+ * else:
+ * free(child.children)
+ */
+ __pyx_t_4 = 2;
+ (__pyx_v_counts[__pyx_t_4]) = ((__pyx_v_counts[__pyx_t_4]) + 1);
+ goto __pyx_L7;
+ }
+ __pyx_L7:;
+ goto __pyx_L6;
+ }
+ /*else*/ {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":389
+ * counts[2] +=1
+ * else:
+ * free(child.children) # <<<<<<<<<<<<<<
+ * free(child.width)
+ * free(child.left_edge)
+ */
+ free(__pyx_v_child->children);
+ }
+ __pyx_L6:;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":390
+ * else:
+ * free(child.children)
+ * free(child.width) # <<<<<<<<<<<<<<
+ * free(child.left_edge)
+ * free(child.center)
+ */
+ free(__pyx_v_child->width);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":391
+ * free(child.children)
+ * free(child.width)
+ * free(child.left_edge) # <<<<<<<<<<<<<<
+ * free(child.center)
+ * free(child.barycenter)
+ */
+ free(__pyx_v_child->left_edge);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":392
+ * free(child.width)
+ * free(child.left_edge)
+ * free(child.center) # <<<<<<<<<<<<<<
+ * free(child.barycenter)
+ * free(child.leaf_point_position)
+ */
+ free(__pyx_v_child->center);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":393
+ * free(child.left_edge)
+ * free(child.center)
+ * free(child.barycenter) # <<<<<<<<<<<<<<
+ * free(child.leaf_point_position)
+ * free(child)
+ */
+ free(__pyx_v_child->barycenter);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":394
+ * free(child.center)
+ * free(child.barycenter)
+ * free(child.leaf_point_position) # <<<<<<<<<<<<<<
+ * free(child)
+ *
+ */
+ free(__pyx_v_child->leaf_point_position);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":395
+ * free(child.barycenter)
+ * free(child.leaf_point_position)
+ * free(child) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ free(__pyx_v_child);
+ }
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":373
+ * return check
+ *
+ * cdef void free_recursive(Tree* tree, Node *root, long* counts) nogil: # <<<<<<<<<<<<<<
+ * # Free up all of the tree nodes recursively
+ * # while counting the number of nodes visited
+ */
+
+ /* function exit code */
+}
+
+/* "sklearn/manifold/_barnes_hut_tsne.pyx":398
+ *
+ *
+ * cdef long count_points(Node* root, long count) nogil: # <<<<<<<<<<<<<<
+ * # Walk through the whole tree and count the number
+ * # of points at the leaf nodes
+ */
+
+static long __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_count_points(struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Node *__pyx_v_root, long __pyx_v_count) {
+ struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Node *__pyx_v_child;
+ int __pyx_v_idx;
+ long __pyx_r;
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_t_4;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":401
+ * # Walk through the whole tree and count the number
+ * # of points at the leaf nodes
+ * if DEBUGFLAG: # <<<<<<<<<<<<<<
+ * printf("[t-SNE] Counting nodes at root node %p\n", root)
+ * cdef Node* child
+ */
+ if (__pyx_e_7sklearn_8manifold_16_barnes_hut_tsne_DEBUGFLAG) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":402
+ * # of points at the leaf nodes
+ * if DEBUGFLAG:
+ * printf("[t-SNE] Counting nodes at root node %p\n", root) # <<<<<<<<<<<<<<
+ * cdef Node* child
+ * cdef int idx
+ */
+ printf(__pyx_k_t_SNE_Counting_nodes_at_root_no, __pyx_v_root);
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":405
+ * cdef Node* child
+ * cdef int idx
+ * if root.is_leaf: # <<<<<<<<<<<<<<
+ * count += root.size
+ * if DEBUGFLAG :
+ */
+ __pyx_t_1 = (__pyx_v_root->is_leaf != 0);
+ if (__pyx_t_1) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":406
+ * cdef int idx
+ * if root.is_leaf:
+ * count += root.size # <<<<<<<<<<<<<<
+ * if DEBUGFLAG :
+ * printf("[t-SNE] %p is a leaf node, no children\n", root)
+ */
+ __pyx_v_count = (__pyx_v_count + __pyx_v_root->size);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":407
+ * if root.is_leaf:
+ * count += root.size
+ * if DEBUGFLAG : # <<<<<<<<<<<<<<
+ * printf("[t-SNE] %p is a leaf node, no children\n", root)
+ * printf("[t-SNE] %i points in node %p\n", count, root)
+ */
+ if (__pyx_e_7sklearn_8manifold_16_barnes_hut_tsne_DEBUGFLAG) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":408
+ * count += root.size
+ * if DEBUGFLAG :
+ * printf("[t-SNE] %p is a leaf node, no children\n", root) # <<<<<<<<<<<<<<
+ * printf("[t-SNE] %i points in node %p\n", count, root)
+ * return count
+ */
+ printf(__pyx_k_t_SNE_p_is_a_leaf_node_no_child, __pyx_v_root);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":409
+ * if DEBUGFLAG :
+ * printf("[t-SNE] %p is a leaf node, no children\n", root)
+ * printf("[t-SNE] %i points in node %p\n", count, root) # <<<<<<<<<<<<<<
+ * return count
+ * # Otherwise, get the children
+ */
+ printf(__pyx_k_t_SNE_i_points_in_node_p, __pyx_v_count, __pyx_v_root);
+ goto __pyx_L5;
+ }
+ __pyx_L5:;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":410
+ * printf("[t-SNE] %p is a leaf node, no children\n", root)
+ * printf("[t-SNE] %i points in node %p\n", count, root)
+ * return count # <<<<<<<<<<<<<<
+ * # Otherwise, get the children
+ * for idx in range(root.tree.n_cell_per_node):
+ */
+ __pyx_r = __pyx_v_count;
+ goto __pyx_L0;
+ }
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":412
+ * return count
+ * # Otherwise, get the children
+ * for idx in range(root.tree.n_cell_per_node): # <<<<<<<<<<<<<<
+ * child = root.children[idx]
+ * if DEBUGFLAG:
+ */
+ __pyx_t_2 = __pyx_v_root->tree->n_cell_per_node;
+ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
+ __pyx_v_idx = __pyx_t_3;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":413
+ * # Otherwise, get the children
+ * for idx in range(root.tree.n_cell_per_node):
+ * child = root.children[idx] # <<<<<<<<<<<<<<
+ * if DEBUGFLAG:
+ * printf("[t-SNE] Counting points for child %p\n", child)
+ */
+ __pyx_v_child = (__pyx_v_root->children[__pyx_v_idx]);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":414
+ * for idx in range(root.tree.n_cell_per_node):
+ * child = root.children[idx]
+ * if DEBUGFLAG: # <<<<<<<<<<<<<<
+ * printf("[t-SNE] Counting points for child %p\n", child)
+ * if child.is_leaf and child.size > 0:
+ */
+ if (__pyx_e_7sklearn_8manifold_16_barnes_hut_tsne_DEBUGFLAG) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":415
+ * child = root.children[idx]
+ * if DEBUGFLAG:
+ * printf("[t-SNE] Counting points for child %p\n", child) # <<<<<<<<<<<<<<
+ * if child.is_leaf and child.size > 0:
+ * if DEBUGFLAG:
+ */
+ printf(__pyx_k_t_SNE_Counting_points_for_child, __pyx_v_child);
+ goto __pyx_L8;
+ }
+ __pyx_L8:;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":416
+ * if DEBUGFLAG:
+ * printf("[t-SNE] Counting points for child %p\n", child)
+ * if child.is_leaf and child.size > 0: # <<<<<<<<<<<<<<
+ * if DEBUGFLAG:
+ * printf("[t-SNE] Child has size %d\n", child.size)
+ */
+ __pyx_t_4 = (__pyx_v_child->is_leaf != 0);
+ if (__pyx_t_4) {
+ goto __pyx_L11_next_and;
+ } else {
+ __pyx_t_1 = __pyx_t_4;
+ goto __pyx_L10_bool_binop_done;
+ }
+ __pyx_L11_next_and:;
+ __pyx_t_4 = ((__pyx_v_child->size > 0) != 0);
+ __pyx_t_1 = __pyx_t_4;
+ __pyx_L10_bool_binop_done:;
+ if (__pyx_t_1) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":417
+ * printf("[t-SNE] Counting points for child %p\n", child)
+ * if child.is_leaf and child.size > 0:
+ * if DEBUGFLAG: # <<<<<<<<<<<<<<
+ * printf("[t-SNE] Child has size %d\n", child.size)
+ * count += child.size
+ */
+ if (__pyx_e_7sklearn_8manifold_16_barnes_hut_tsne_DEBUGFLAG) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":418
+ * if child.is_leaf and child.size > 0:
+ * if DEBUGFLAG:
+ * printf("[t-SNE] Child has size %d\n", child.size) # <<<<<<<<<<<<<<
+ * count += child.size
+ * elif not child.is_leaf:
+ */
+ printf(__pyx_k_t_SNE_Child_has_size_d, __pyx_v_child->size);
+ goto __pyx_L12;
+ }
+ __pyx_L12:;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":419
+ * if DEBUGFLAG:
+ * printf("[t-SNE] Child has size %d\n", child.size)
+ * count += child.size # <<<<<<<<<<<<<<
+ * elif not child.is_leaf:
+ * if DEBUGFLAG:
+ */
+ __pyx_v_count = (__pyx_v_count + __pyx_v_child->size);
+ goto __pyx_L9;
+ }
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":420
+ * printf("[t-SNE] Child has size %d\n", child.size)
+ * count += child.size
+ * elif not child.is_leaf: # <<<<<<<<<<<<<<
+ * if DEBUGFLAG:
+ * printf("[t-SNE] Child is not a leaf. Descending\n")
+ */
+ __pyx_t_1 = ((!(__pyx_v_child->is_leaf != 0)) != 0);
+ if (__pyx_t_1) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":421
+ * count += child.size
+ * elif not child.is_leaf:
+ * if DEBUGFLAG: # <<<<<<<<<<<<<<
+ * printf("[t-SNE] Child is not a leaf. Descending\n")
+ * count = count_points(child, count)
+ */
+ if (__pyx_e_7sklearn_8manifold_16_barnes_hut_tsne_DEBUGFLAG) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":422
+ * elif not child.is_leaf:
+ * if DEBUGFLAG:
+ * printf("[t-SNE] Child is not a leaf. Descending\n") # <<<<<<<<<<<<<<
+ * count = count_points(child, count)
+ * # else case is we have an empty leaf node
+ */
+ printf(__pyx_k_t_SNE_Child_is_not_a_leaf_Desce);
+ goto __pyx_L13;
+ }
+ __pyx_L13:;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":423
+ * if DEBUGFLAG:
+ * printf("[t-SNE] Child is not a leaf. Descending\n")
+ * count = count_points(child, count) # <<<<<<<<<<<<<<
+ * # else case is we have an empty leaf node
+ * # which happens when we create a quadtree for
+ */
+ __pyx_v_count = __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_count_points(__pyx_v_child, __pyx_v_count);
+ goto __pyx_L9;
+ }
+ __pyx_L9:;
+ }
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":428
+ * # one point, and then the other neighboring cells
+ * # don't get filled in
+ * if DEBUGFLAG: # <<<<<<<<<<<<<<
+ * printf("[t-SNE] %i points in this node\n", count)
+ * return count
+ */
+ if (__pyx_e_7sklearn_8manifold_16_barnes_hut_tsne_DEBUGFLAG) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":429
+ * # don't get filled in
+ * if DEBUGFLAG:
+ * printf("[t-SNE] %i points in this node\n", count) # <<<<<<<<<<<<<<
+ * return count
+ *
+ */
+ printf(__pyx_k_t_SNE_i_points_in_this_node, __pyx_v_count);
+ goto __pyx_L14;
+ }
+ __pyx_L14:;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":430
+ * if DEBUGFLAG:
+ * printf("[t-SNE] %i points in this node\n", count)
+ * return count # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = __pyx_v_count;
+ goto __pyx_L0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":398
+ *
+ *
+ * cdef long count_points(Node* root, long count) nogil: # <<<<<<<<<<<<<<
+ * # Walk through the whole tree and count the number
+ * # of points at the leaf nodes
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "sklearn/manifold/_barnes_hut_tsne.pyx":433
+ *
+ *
+ * cdef float compute_gradient(float[:,:] val_P, # <<<<<<<<<<<<<<
+ * float[:,:] pos_reference,
+ * long[:,:] neighbors,
+ */
+
+static float __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_compute_gradient(__Pyx_memviewslice __pyx_v_val_P, __Pyx_memviewslice __pyx_v_pos_reference, __Pyx_memviewslice __pyx_v_neighbors, __Pyx_memviewslice __pyx_v_tot_force, struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Node *__pyx_v_root_node, float __pyx_v_theta, float __pyx_v_dof, long __pyx_v_start, long __pyx_v_stop) {
+ long __pyx_v_i;
+ long __pyx_v_coord;
+ int __pyx_v_ax;
+ long __pyx_v_n;
+ int __pyx_v_n_dimensions;
+ float *__pyx_v_sum_Q;
+ float *__pyx_v_neg_f;
+ float *__pyx_v_neg_f_fast;
+ float *__pyx_v_pos_f;
+ clock_t __pyx_v_t1;
+ clock_t __pyx_v_t2;
+ float __pyx_v_sQ;
+ CYTHON_UNUSED float __pyx_v_error;
+ float __pyx_r;
+ int __pyx_t_1;
+ int __pyx_t_2;
+ long __pyx_t_3;
+ long __pyx_t_4;
+ int __pyx_t_5;
+ long __pyx_t_6;
+ int __pyx_t_7;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":446
+ * cdef long i, coord
+ * cdef int ax
+ * cdef long n = pos_reference.shape[0] # <<<<<<<<<<<<<<
+ * cdef int n_dimensions = root_node.tree.n_dimensions
+ * if root_node.tree.verbose > 11:
+ */
+ __pyx_v_n = (__pyx_v_pos_reference.shape[0]);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":447
+ * cdef int ax
+ * cdef long n = pos_reference.shape[0]
+ * cdef int n_dimensions = root_node.tree.n_dimensions # <<<<<<<<<<<<<<
+ * if root_node.tree.verbose > 11:
+ * printf("[t-SNE] Allocating %i elements in force arrays\n",
+ */
+ __pyx_t_1 = __pyx_v_root_node->tree->n_dimensions;
+ __pyx_v_n_dimensions = __pyx_t_1;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":448
+ * cdef long n = pos_reference.shape[0]
+ * cdef int n_dimensions = root_node.tree.n_dimensions
+ * if root_node.tree.verbose > 11: # <<<<<<<<<<<<<<
+ * printf("[t-SNE] Allocating %i elements in force arrays\n",
+ * n * n_dimensions * 2)
+ */
+ __pyx_t_2 = ((__pyx_v_root_node->tree->verbose > 11) != 0);
+ if (__pyx_t_2) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":449
+ * cdef int n_dimensions = root_node.tree.n_dimensions
+ * if root_node.tree.verbose > 11:
+ * printf("[t-SNE] Allocating %i elements in force arrays\n", # <<<<<<<<<<<<<<
+ * n * n_dimensions * 2)
+ * cdef float* sum_Q = malloc(sizeof(float))
+ */
+ printf(__pyx_k_t_SNE_Allocating_i_elements_in, ((__pyx_v_n * __pyx_v_n_dimensions) * 2));
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":451
+ * printf("[t-SNE] Allocating %i elements in force arrays\n",
+ * n * n_dimensions * 2)
+ * cdef float* sum_Q = malloc(sizeof(float)) # <<<<<<<<<<<<<<
+ * cdef float* neg_f = malloc(sizeof(float) * n * n_dimensions)
+ * cdef float* neg_f_fast = malloc(sizeof(float) * n * n_dimensions)
+ */
+ __pyx_v_sum_Q = ((float *)malloc((sizeof(float))));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":452
+ * n * n_dimensions * 2)
+ * cdef float* sum_Q = malloc(sizeof(float))
+ * cdef float* neg_f = malloc(sizeof(float) * n * n_dimensions) # <<<<<<<<<<<<<<
+ * cdef float* neg_f_fast = malloc(sizeof(float) * n * n_dimensions)
+ * cdef float* pos_f = malloc(sizeof(float) * n * n_dimensions)
+ */
+ __pyx_v_neg_f = ((float *)malloc((((sizeof(float)) * __pyx_v_n) * __pyx_v_n_dimensions)));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":453
+ * cdef float* sum_Q = malloc(sizeof(float))
+ * cdef float* neg_f = malloc(sizeof(float) * n * n_dimensions)
+ * cdef float* neg_f_fast = malloc(sizeof(float) * n * n_dimensions) # <<<<<<<<<<<<<<
+ * cdef float* pos_f = malloc(sizeof(float) * n * n_dimensions)
+ * cdef clock_t t1, t2
+ */
+ __pyx_v_neg_f_fast = ((float *)malloc((((sizeof(float)) * __pyx_v_n) * __pyx_v_n_dimensions)));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":454
+ * cdef float* neg_f = malloc(sizeof(float) * n * n_dimensions)
+ * cdef float* neg_f_fast = malloc(sizeof(float) * n * n_dimensions)
+ * cdef float* pos_f = malloc(sizeof(float) * n * n_dimensions) # <<<<<<<<<<<<<<
+ * cdef clock_t t1, t2
+ * cdef float sQ, error
+ */
+ __pyx_v_pos_f = ((float *)malloc((((sizeof(float)) * __pyx_v_n) * __pyx_v_n_dimensions)));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":458
+ * cdef float sQ, error
+ *
+ * sum_Q[0] = 0.0 # <<<<<<<<<<<<<<
+ * t1 = clock()
+ * compute_gradient_negative(val_P, pos_reference, neg_f, root_node, sum_Q,
+ */
+ (__pyx_v_sum_Q[0]) = 0.0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":459
+ *
+ * sum_Q[0] = 0.0
+ * t1 = clock() # <<<<<<<<<<<<<<
+ * compute_gradient_negative(val_P, pos_reference, neg_f, root_node, sum_Q,
+ * dof, theta, start, stop)
+ */
+ __pyx_v_t1 = clock();
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":460
+ * sum_Q[0] = 0.0
+ * t1 = clock()
+ * compute_gradient_negative(val_P, pos_reference, neg_f, root_node, sum_Q, # <<<<<<<<<<<<<<
+ * dof, theta, start, stop)
+ * t2 = clock()
+ */
+ __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_compute_gradient_negative(__pyx_v_val_P, __pyx_v_pos_reference, __pyx_v_neg_f, __pyx_v_root_node, __pyx_v_sum_Q, __pyx_v_dof, __pyx_v_theta, __pyx_v_start, __pyx_v_stop);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":462
+ * compute_gradient_negative(val_P, pos_reference, neg_f, root_node, sum_Q,
+ * dof, theta, start, stop)
+ * t2 = clock() # <<<<<<<<<<<<<<
+ * if root_node.tree.verbose > 15:
+ * printf("[t-SNE] Computing negative gradient: %e ticks\n", ((float) (t2 - t1)))
+ */
+ __pyx_v_t2 = clock();
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":463
+ * dof, theta, start, stop)
+ * t2 = clock()
+ * if root_node.tree.verbose > 15: # <<<<<<<<<<<<<<
+ * printf("[t-SNE] Computing negative gradient: %e ticks\n", ((float) (t2 - t1)))
+ * sQ = sum_Q[0]
+ */
+ __pyx_t_2 = ((__pyx_v_root_node->tree->verbose > 15) != 0);
+ if (__pyx_t_2) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":464
+ * t2 = clock()
+ * if root_node.tree.verbose > 15:
+ * printf("[t-SNE] Computing negative gradient: %e ticks\n", ((float) (t2 - t1))) # <<<<<<<<<<<<<<
+ * sQ = sum_Q[0]
+ * t1 = clock()
+ */
+ printf(__pyx_k_t_SNE_Computing_negative_gradie, ((double)(__pyx_v_t2 - __pyx_v_t1)));
+ goto __pyx_L4;
+ }
+ __pyx_L4:;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":465
+ * if root_node.tree.verbose > 15:
+ * printf("[t-SNE] Computing negative gradient: %e ticks\n", ((float) (t2 - t1)))
+ * sQ = sum_Q[0] # <<<<<<<<<<<<<<
+ * t1 = clock()
+ * error = compute_gradient_positive(val_P, pos_reference, neighbors, pos_f,
+ */
+ __pyx_v_sQ = (__pyx_v_sum_Q[0]);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":466
+ * printf("[t-SNE] Computing negative gradient: %e ticks\n", ((float) (t2 - t1)))
+ * sQ = sum_Q[0]
+ * t1 = clock() # <<<<<<<<<<<<<<
+ * error = compute_gradient_positive(val_P, pos_reference, neighbors, pos_f,
+ * n_dimensions, dof, sQ, start, root_node.tree.verbose)
+ */
+ __pyx_v_t1 = clock();
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":467
+ * sQ = sum_Q[0]
+ * t1 = clock()
+ * error = compute_gradient_positive(val_P, pos_reference, neighbors, pos_f, # <<<<<<<<<<<<<<
+ * n_dimensions, dof, sQ, start, root_node.tree.verbose)
+ * t2 = clock()
+ */
+ __pyx_v_error = __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_compute_gradient_positive(__pyx_v_val_P, __pyx_v_pos_reference, __pyx_v_neighbors, __pyx_v_pos_f, __pyx_v_n_dimensions, __pyx_v_dof, __pyx_v_sQ, __pyx_v_start, __pyx_v_root_node->tree->verbose);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":469
+ * error = compute_gradient_positive(val_P, pos_reference, neighbors, pos_f,
+ * n_dimensions, dof, sQ, start, root_node.tree.verbose)
+ * t2 = clock() # <<<<<<<<<<<<<<
+ * if root_node.tree.verbose > 15:
+ * printf("[t-SNE] Computing positive gradient: %e ticks\n", ((float) (t2 - t1)))
+ */
+ __pyx_v_t2 = clock();
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":470
+ * n_dimensions, dof, sQ, start, root_node.tree.verbose)
+ * t2 = clock()
+ * if root_node.tree.verbose > 15: # <<<<<<<<<<<<<<
+ * printf("[t-SNE] Computing positive gradient: %e ticks\n", ((float) (t2 - t1)))
+ * for i in range(start, n):
+ */
+ __pyx_t_2 = ((__pyx_v_root_node->tree->verbose > 15) != 0);
+ if (__pyx_t_2) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":471
+ * t2 = clock()
+ * if root_node.tree.verbose > 15:
+ * printf("[t-SNE] Computing positive gradient: %e ticks\n", ((float) (t2 - t1))) # <<<<<<<<<<<<<<
+ * for i in range(start, n):
+ * for ax in range(n_dimensions):
+ */
+ printf(__pyx_k_t_SNE_Computing_positive_gradie, ((double)(__pyx_v_t2 - __pyx_v_t1)));
+ goto __pyx_L5;
+ }
+ __pyx_L5:;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":472
+ * if root_node.tree.verbose > 15:
+ * printf("[t-SNE] Computing positive gradient: %e ticks\n", ((float) (t2 - t1)))
+ * for i in range(start, n): # <<<<<<<<<<<<<<
+ * for ax in range(n_dimensions):
+ * coord = i * n_dimensions + ax
+ */
+ __pyx_t_3 = __pyx_v_n;
+ for (__pyx_t_4 = __pyx_v_start; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
+ __pyx_v_i = __pyx_t_4;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":473
+ * printf("[t-SNE] Computing positive gradient: %e ticks\n", ((float) (t2 - t1)))
+ * for i in range(start, n):
+ * for ax in range(n_dimensions): # <<<<<<<<<<<<<<
+ * coord = i * n_dimensions + ax
+ * tot_force[i, ax] = pos_f[coord] - (neg_f[coord] / sum_Q[0])
+ */
+ __pyx_t_1 = __pyx_v_n_dimensions;
+ for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_1; __pyx_t_5+=1) {
+ __pyx_v_ax = __pyx_t_5;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":474
+ * for i in range(start, n):
+ * for ax in range(n_dimensions):
+ * coord = i * n_dimensions + ax # <<<<<<<<<<<<<<
+ * tot_force[i, ax] = pos_f[coord] - (neg_f[coord] / sum_Q[0])
+ * free(sum_Q)
+ */
+ __pyx_v_coord = ((__pyx_v_i * __pyx_v_n_dimensions) + __pyx_v_ax);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":475
+ * for ax in range(n_dimensions):
+ * coord = i * n_dimensions + ax
+ * tot_force[i, ax] = pos_f[coord] - (neg_f[coord] / sum_Q[0]) # <<<<<<<<<<<<<<
+ * free(sum_Q)
+ * free(neg_f)
+ */
+ __pyx_t_6 = __pyx_v_i;
+ __pyx_t_7 = __pyx_v_ax;
+ *((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_tot_force.data + __pyx_t_6 * __pyx_v_tot_force.strides[0]) ) + __pyx_t_7 * __pyx_v_tot_force.strides[1]) )) = ((__pyx_v_pos_f[__pyx_v_coord]) - ((__pyx_v_neg_f[__pyx_v_coord]) / (__pyx_v_sum_Q[0])));
+ }
+ }
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":476
+ * coord = i * n_dimensions + ax
+ * tot_force[i, ax] = pos_f[coord] - (neg_f[coord] / sum_Q[0])
+ * free(sum_Q) # <<<<<<<<<<<<<<
+ * free(neg_f)
+ * free(neg_f_fast)
+ */
+ free(__pyx_v_sum_Q);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":477
+ * tot_force[i, ax] = pos_f[coord] - (neg_f[coord] / sum_Q[0])
+ * free(sum_Q)
+ * free(neg_f) # <<<<<<<<<<<<<<
+ * free(neg_f_fast)
+ * free(pos_f)
+ */
+ free(__pyx_v_neg_f);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":478
+ * free(sum_Q)
+ * free(neg_f)
+ * free(neg_f_fast) # <<<<<<<<<<<<<<
+ * free(pos_f)
+ * return sQ
+ */
+ free(__pyx_v_neg_f_fast);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":479
+ * free(neg_f)
+ * free(neg_f_fast)
+ * free(pos_f) # <<<<<<<<<<<<<<
+ * return sQ
+ *
+ */
+ free(__pyx_v_pos_f);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":480
+ * free(neg_f_fast)
+ * free(pos_f)
+ * return sQ # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = __pyx_v_sQ;
+ goto __pyx_L0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":433
+ *
+ *
+ * cdef float compute_gradient(float[:,:] val_P, # <<<<<<<<<<<<<<
+ * float[:,:] pos_reference,
+ * long[:,:] neighbors,
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "sklearn/manifold/_barnes_hut_tsne.pyx":483
+ *
+ *
+ * cdef float compute_gradient_positive(float[:,:] val_P, # <<<<<<<<<<<<<<
+ * float[:,:] pos_reference,
+ * long[:,:] neighbors,
+ */
+
+static float __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_compute_gradient_positive(__Pyx_memviewslice __pyx_v_val_P, __Pyx_memviewslice __pyx_v_pos_reference, __Pyx_memviewslice __pyx_v_neighbors, float *__pyx_v_pos_f, int __pyx_v_n_dimensions, float __pyx_v_dof, float __pyx_v_sum_Q, long __pyx_v_start, int __pyx_v_verbose) {
+ int __pyx_v_ax;
+ long __pyx_v_i;
+ long __pyx_v_j;
+ long __pyx_v_k;
+ long __pyx_v_K;
+ long __pyx_v_n;
+ float __pyx_v_buff[3];
+ float __pyx_v_D;
+ float __pyx_v_Q;
+ float __pyx_v_pij;
+ float __pyx_v_C;
+ float __pyx_v_exponent;
+ clock_t __pyx_v_t1;
+ clock_t __pyx_v_t2;
+ double __pyx_v_dt;
+ float __pyx_r;
+ long __pyx_t_1;
+ long __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ long __pyx_t_5;
+ long __pyx_t_6;
+ long __pyx_t_7;
+ long __pyx_t_8;
+ long __pyx_t_9;
+ long __pyx_t_10;
+ long __pyx_t_11;
+ int __pyx_t_12;
+ long __pyx_t_13;
+ int __pyx_t_14;
+ long __pyx_t_15;
+ int __pyx_t_16;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":500
+ * int ax
+ * long i, j, k
+ * long K = neighbors.shape[1] # <<<<<<<<<<<<<<
+ * long n = val_P.shape[0]
+ * float[3] buff
+ */
+ __pyx_v_K = (__pyx_v_neighbors.shape[1]);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":501
+ * long i, j, k
+ * long K = neighbors.shape[1]
+ * long n = val_P.shape[0] # <<<<<<<<<<<<<<
+ * float[3] buff
+ * float D, Q, pij
+ */
+ __pyx_v_n = (__pyx_v_val_P.shape[0]);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":504
+ * float[3] buff
+ * float D, Q, pij
+ * float C = 0.0 # <<<<<<<<<<<<<<
+ * float exponent = (dof + 1.0) / -2.0
+ * cdef clock_t t1, t2
+ */
+ __pyx_v_C = 0.0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":505
+ * float D, Q, pij
+ * float C = 0.0
+ * float exponent = (dof + 1.0) / -2.0 # <<<<<<<<<<<<<<
+ * cdef clock_t t1, t2
+ * t1 = clock()
+ */
+ __pyx_v_exponent = ((__pyx_v_dof + 1.0) / -2.0);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":507
+ * float exponent = (dof + 1.0) / -2.0
+ * cdef clock_t t1, t2
+ * t1 = clock() # <<<<<<<<<<<<<<
+ * for i in range(start, n):
+ * for ax in range(n_dimensions):
+ */
+ __pyx_v_t1 = clock();
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":508
+ * cdef clock_t t1, t2
+ * t1 = clock()
+ * for i in range(start, n): # <<<<<<<<<<<<<<
+ * for ax in range(n_dimensions):
+ * pos_f[i * n_dimensions + ax] = 0.0
+ */
+ __pyx_t_1 = __pyx_v_n;
+ for (__pyx_t_2 = __pyx_v_start; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
+ __pyx_v_i = __pyx_t_2;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":509
+ * t1 = clock()
+ * for i in range(start, n):
+ * for ax in range(n_dimensions): # <<<<<<<<<<<<<<
+ * pos_f[i * n_dimensions + ax] = 0.0
+ * for k in range(K):
+ */
+ __pyx_t_3 = __pyx_v_n_dimensions;
+ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
+ __pyx_v_ax = __pyx_t_4;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":510
+ * for i in range(start, n):
+ * for ax in range(n_dimensions):
+ * pos_f[i * n_dimensions + ax] = 0.0 # <<<<<<<<<<<<<<
+ * for k in range(K):
+ * j = neighbors[i, k]
+ */
+ (__pyx_v_pos_f[((__pyx_v_i * __pyx_v_n_dimensions) + __pyx_v_ax)]) = 0.0;
+ }
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":511
+ * for ax in range(n_dimensions):
+ * pos_f[i * n_dimensions + ax] = 0.0
+ * for k in range(K): # <<<<<<<<<<<<<<
+ * j = neighbors[i, k]
+ * # we don't need to exclude the i==j case since we've
+ */
+ __pyx_t_5 = __pyx_v_K;
+ for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
+ __pyx_v_k = __pyx_t_6;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":512
+ * pos_f[i * n_dimensions + ax] = 0.0
+ * for k in range(K):
+ * j = neighbors[i, k] # <<<<<<<<<<<<<<
+ * # we don't need to exclude the i==j case since we've
+ * # already thrown it out from the list of neighbors
+ */
+ __pyx_t_7 = __pyx_v_i;
+ __pyx_t_8 = __pyx_v_k;
+ __pyx_v_j = (*((long *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_neighbors.data + __pyx_t_7 * __pyx_v_neighbors.strides[0]) ) + __pyx_t_8 * __pyx_v_neighbors.strides[1]) )));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":515
+ * # we don't need to exclude the i==j case since we've
+ * # already thrown it out from the list of neighbors
+ * D = 0.0 # <<<<<<<<<<<<<<
+ * Q = 0.0
+ * pij = val_P[i, j]
+ */
+ __pyx_v_D = 0.0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":516
+ * # already thrown it out from the list of neighbors
+ * D = 0.0
+ * Q = 0.0 # <<<<<<<<<<<<<<
+ * pij = val_P[i, j]
+ * for ax in range(n_dimensions):
+ */
+ __pyx_v_Q = 0.0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":517
+ * D = 0.0
+ * Q = 0.0
+ * pij = val_P[i, j] # <<<<<<<<<<<<<<
+ * for ax in range(n_dimensions):
+ * buff[ax] = pos_reference[i, ax] - pos_reference[j, ax]
+ */
+ __pyx_t_9 = __pyx_v_i;
+ __pyx_t_10 = __pyx_v_j;
+ __pyx_v_pij = (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_val_P.data + __pyx_t_9 * __pyx_v_val_P.strides[0]) ) + __pyx_t_10 * __pyx_v_val_P.strides[1]) )));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":518
+ * Q = 0.0
+ * pij = val_P[i, j]
+ * for ax in range(n_dimensions): # <<<<<<<<<<<<<<
+ * buff[ax] = pos_reference[i, ax] - pos_reference[j, ax]
+ * D += buff[ax] ** 2.0
+ */
+ __pyx_t_3 = __pyx_v_n_dimensions;
+ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
+ __pyx_v_ax = __pyx_t_4;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":519
+ * pij = val_P[i, j]
+ * for ax in range(n_dimensions):
+ * buff[ax] = pos_reference[i, ax] - pos_reference[j, ax] # <<<<<<<<<<<<<<
+ * D += buff[ax] ** 2.0
+ * Q = (((1.0 + D) / dof) ** exponent)
+ */
+ __pyx_t_11 = __pyx_v_i;
+ __pyx_t_12 = __pyx_v_ax;
+ __pyx_t_13 = __pyx_v_j;
+ __pyx_t_14 = __pyx_v_ax;
+ (__pyx_v_buff[__pyx_v_ax]) = ((*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_pos_reference.data + __pyx_t_11 * __pyx_v_pos_reference.strides[0]) ) + __pyx_t_12 * __pyx_v_pos_reference.strides[1]) ))) - (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_pos_reference.data + __pyx_t_13 * __pyx_v_pos_reference.strides[0]) ) + __pyx_t_14 * __pyx_v_pos_reference.strides[1]) ))));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":520
+ * for ax in range(n_dimensions):
+ * buff[ax] = pos_reference[i, ax] - pos_reference[j, ax]
+ * D += buff[ax] ** 2.0 # <<<<<<<<<<<<<<
+ * Q = (((1.0 + D) / dof) ** exponent)
+ * D = pij * Q
+ */
+ __pyx_v_D = (__pyx_v_D + pow(((double)(__pyx_v_buff[__pyx_v_ax])), 2.0));
+ }
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":521
+ * buff[ax] = pos_reference[i, ax] - pos_reference[j, ax]
+ * D += buff[ax] ** 2.0
+ * Q = (((1.0 + D) / dof) ** exponent) # <<<<<<<<<<<<<<
+ * D = pij * Q
+ * Q /= sum_Q
+ */
+ __pyx_v_Q = pow(((1.0 + __pyx_v_D) / __pyx_v_dof), ((double)__pyx_v_exponent));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":522
+ * D += buff[ax] ** 2.0
+ * Q = (((1.0 + D) / dof) ** exponent)
+ * D = pij * Q # <<<<<<<<<<<<<<
+ * Q /= sum_Q
+ * C += pij * log((pij + EPSILON) / (Q + EPSILON))
+ */
+ __pyx_v_D = (__pyx_v_pij * __pyx_v_Q);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":523
+ * Q = (((1.0 + D) / dof) ** exponent)
+ * D = pij * Q
+ * Q /= sum_Q # <<<<<<<<<<<<<<
+ * C += pij * log((pij + EPSILON) / (Q + EPSILON))
+ * for ax in range(n_dimensions):
+ */
+ __pyx_v_Q = (__pyx_v_Q / __pyx_v_sum_Q);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":524
+ * D = pij * Q
+ * Q /= sum_Q
+ * C += pij * log((pij + EPSILON) / (Q + EPSILON)) # <<<<<<<<<<<<<<
+ * for ax in range(n_dimensions):
+ * pos_f[i * n_dimensions + ax] += D * buff[ax]
+ */
+ __pyx_v_C = (__pyx_v_C + (__pyx_v_pij * log(((__pyx_v_pij + __pyx_v_7sklearn_8manifold_16_barnes_hut_tsne_EPSILON) / (__pyx_v_Q + __pyx_v_7sklearn_8manifold_16_barnes_hut_tsne_EPSILON)))));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":525
+ * Q /= sum_Q
+ * C += pij * log((pij + EPSILON) / (Q + EPSILON))
+ * for ax in range(n_dimensions): # <<<<<<<<<<<<<<
+ * pos_f[i * n_dimensions + ax] += D * buff[ax]
+ * t2 = clock()
+ */
+ __pyx_t_3 = __pyx_v_n_dimensions;
+ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
+ __pyx_v_ax = __pyx_t_4;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":526
+ * C += pij * log((pij + EPSILON) / (Q + EPSILON))
+ * for ax in range(n_dimensions):
+ * pos_f[i * n_dimensions + ax] += D * buff[ax] # <<<<<<<<<<<<<<
+ * t2 = clock()
+ * dt = ((float) (t2 - t1))
+ */
+ __pyx_t_15 = ((__pyx_v_i * __pyx_v_n_dimensions) + __pyx_v_ax);
+ (__pyx_v_pos_f[__pyx_t_15]) = ((__pyx_v_pos_f[__pyx_t_15]) + (__pyx_v_D * (__pyx_v_buff[__pyx_v_ax])));
+ }
+ }
+ }
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":527
+ * for ax in range(n_dimensions):
+ * pos_f[i * n_dimensions + ax] += D * buff[ax]
+ * t2 = clock() # <<<<<<<<<<<<<<
+ * dt = ((float) (t2 - t1))
+ * if verbose > 10:
+ */
+ __pyx_v_t2 = clock();
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":528
+ * pos_f[i * n_dimensions + ax] += D * buff[ax]
+ * t2 = clock()
+ * dt = ((float) (t2 - t1)) # <<<<<<<<<<<<<<
+ * if verbose > 10:
+ * printf("[t-SNE] Computed error=%1.4f in %1.1e ticks\n", C, dt)
+ */
+ __pyx_v_dt = ((double)(__pyx_v_t2 - __pyx_v_t1));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":529
+ * t2 = clock()
+ * dt = ((float) (t2 - t1))
+ * if verbose > 10: # <<<<<<<<<<<<<<
+ * printf("[t-SNE] Computed error=%1.4f in %1.1e ticks\n", C, dt)
+ * return C
+ */
+ __pyx_t_16 = ((__pyx_v_verbose > 10) != 0);
+ if (__pyx_t_16) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":530
+ * dt = ((float) (t2 - t1))
+ * if verbose > 10:
+ * printf("[t-SNE] Computed error=%1.4f in %1.1e ticks\n", C, dt) # <<<<<<<<<<<<<<
+ * return C
+ *
+ */
+ printf(__pyx_k_t_SNE_Computed_error_1_4f_in_1, __pyx_v_C, __pyx_v_dt);
+ goto __pyx_L13;
+ }
+ __pyx_L13:;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":531
+ * if verbose > 10:
+ * printf("[t-SNE] Computed error=%1.4f in %1.1e ticks\n", C, dt)
+ * return C # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = __pyx_v_C;
+ goto __pyx_L0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":483
+ *
+ *
+ * cdef float compute_gradient_positive(float[:,:] val_P, # <<<<<<<<<<<<<<
+ * float[:,:] pos_reference,
+ * long[:,:] neighbors,
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "sklearn/manifold/_barnes_hut_tsne.pyx":535
+ *
+ *
+ * cdef void compute_gradient_negative(float[:,:] val_P, # <<<<<<<<<<<<<<
+ * float[:,:] pos_reference,
+ * float* neg_f,
+ */
+
+static void __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_compute_gradient_negative(CYTHON_UNUSED __Pyx_memviewslice __pyx_v_val_P, __Pyx_memviewslice __pyx_v_pos_reference, float *__pyx_v_neg_f, struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Node *__pyx_v_root_node, float *__pyx_v_sum_Q, float __pyx_v_dof, float __pyx_v_theta, long __pyx_v_start, long __pyx_v_stop) {
+ int __pyx_v_ax;
+ long __pyx_v_i;
+ long __pyx_v_j;
+ long __pyx_v_n;
+ float *__pyx_v_force;
+ float *__pyx_v_iQ;
+ float *__pyx_v_pos;
+ float *__pyx_v_dist2s;
+ long *__pyx_v_sizes;
+ float *__pyx_v_deltas;
+ long *__pyx_v_l;
+ int __pyx_v_n_dimensions;
+ float __pyx_v_qijZ;
+ float __pyx_v_mult;
+ long __pyx_v_idx;
+ long __pyx_v_dta;
+ long __pyx_v_dtb;
+ clock_t __pyx_v_t1;
+ clock_t __pyx_v_t2;
+ clock_t __pyx_v_t3;
+ float *__pyx_v_neg_force;
+ double __pyx_v_exponent;
+ int __pyx_t_1;
+ int __pyx_t_2;
+ long __pyx_t_3;
+ long __pyx_t_4;
+ int __pyx_t_5;
+ long __pyx_t_6;
+ int __pyx_t_7;
+ long __pyx_t_8;
+ long __pyx_t_9;
+ long __pyx_t_10;
+ int __pyx_t_11;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":544
+ * long start,
+ * long stop) nogil:
+ * if stop == -1: # <<<<<<<<<<<<<<
+ * stop = pos_reference.shape[0]
+ * cdef:
+ */
+ __pyx_t_1 = ((__pyx_v_stop == -1) != 0);
+ if (__pyx_t_1) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":545
+ * long stop) nogil:
+ * if stop == -1:
+ * stop = pos_reference.shape[0] # <<<<<<<<<<<<<<
+ * cdef:
+ * int ax
+ */
+ __pyx_v_stop = (__pyx_v_pos_reference.shape[0]);
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":549
+ * int ax
+ * long i, j
+ * long n = stop - start # <<<<<<<<<<<<<<
+ * float* force
+ * float* iQ
+ */
+ __pyx_v_n = (__pyx_v_stop - __pyx_v_start);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":557
+ * float* deltas
+ * long* l
+ * int n_dimensions = root_node.tree.n_dimensions # <<<<<<<<<<<<<<
+ * float qijZ, mult
+ * long idx,
+ */
+ __pyx_t_2 = __pyx_v_root_node->tree->n_dimensions;
+ __pyx_v_n_dimensions = __pyx_t_2;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":560
+ * float qijZ, mult
+ * long idx,
+ * long dta = 0 # <<<<<<<<<<<<<<
+ * long dtb = 0
+ * clock_t t1, t2, t3
+ */
+ __pyx_v_dta = 0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":561
+ * long idx,
+ * long dta = 0
+ * long dtb = 0 # <<<<<<<<<<<<<<
+ * clock_t t1, t2, t3
+ * float* neg_force
+ */
+ __pyx_v_dtb = 0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":565
+ * float* neg_force
+ *
+ * iQ = malloc(sizeof(float)) # <<<<<<<<<<<<<<
+ * force = malloc(sizeof(float) * n_dimensions)
+ * pos = malloc(sizeof(float) * n_dimensions)
+ */
+ __pyx_v_iQ = ((float *)malloc((sizeof(float))));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":566
+ *
+ * iQ = malloc(sizeof(float))
+ * force = malloc(sizeof(float) * n_dimensions) # <<<<<<<<<<<<<<
+ * pos = malloc(sizeof(float) * n_dimensions)
+ * dist2s = malloc(sizeof(float) * n)
+ */
+ __pyx_v_force = ((float *)malloc(((sizeof(float)) * __pyx_v_n_dimensions)));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":567
+ * iQ = malloc(sizeof(float))
+ * force = malloc(sizeof(float) * n_dimensions)
+ * pos = malloc(sizeof(float) * n_dimensions) # <<<<<<<<<<<<<<
+ * dist2s = malloc(sizeof(float) * n)
+ * sizes = malloc(sizeof(long) * n)
+ */
+ __pyx_v_pos = ((float *)malloc(((sizeof(float)) * __pyx_v_n_dimensions)));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":568
+ * force = malloc(sizeof(float) * n_dimensions)
+ * pos = malloc(sizeof(float) * n_dimensions)
+ * dist2s = malloc(sizeof(float) * n) # <<<<<<<<<<<<<<
+ * sizes = malloc(sizeof(long) * n)
+ * deltas = malloc(sizeof(float) * n * n_dimensions)
+ */
+ __pyx_v_dist2s = ((float *)malloc(((sizeof(float)) * __pyx_v_n)));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":569
+ * pos = malloc(sizeof(float) * n_dimensions)
+ * dist2s = malloc(sizeof(float) * n)
+ * sizes = malloc(sizeof(long) * n) # <<<<<<<<<<<<<<
+ * deltas = malloc(sizeof(float) * n * n_dimensions)
+ * l = malloc(sizeof(long))
+ */
+ __pyx_v_sizes = ((long *)malloc(((sizeof(long)) * __pyx_v_n)));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":570
+ * dist2s = malloc(sizeof(float) * n)
+ * sizes = malloc(sizeof(long) * n)
+ * deltas = malloc(sizeof(float) * n * n_dimensions) # <<<<<<<<<<<<<<
+ * l = malloc(sizeof(long))
+ * neg_force= malloc(sizeof(float) * n_dimensions)
+ */
+ __pyx_v_deltas = ((float *)malloc((((sizeof(float)) * __pyx_v_n) * __pyx_v_n_dimensions)));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":571
+ * sizes = malloc(sizeof(long) * n)
+ * deltas = malloc(sizeof(float) * n * n_dimensions)
+ * l = malloc(sizeof(long)) # <<<<<<<<<<<<<<
+ * neg_force= malloc(sizeof(float) * n_dimensions)
+ *
+ */
+ __pyx_v_l = ((long *)malloc((sizeof(long))));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":572
+ * deltas = malloc(sizeof(float) * n * n_dimensions)
+ * l = malloc(sizeof(long))
+ * neg_force= malloc(sizeof(float) * n_dimensions) # <<<<<<<<<<<<<<
+ *
+ * for i in range(start, stop):
+ */
+ __pyx_v_neg_force = ((float *)malloc(((sizeof(float)) * __pyx_v_n_dimensions)));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":574
+ * neg_force= malloc(sizeof(float) * n_dimensions)
+ *
+ * for i in range(start, stop): # <<<<<<<<<<<<<<
+ * # Clear the arrays
+ * for ax in range(n_dimensions):
+ */
+ __pyx_t_3 = __pyx_v_stop;
+ for (__pyx_t_4 = __pyx_v_start; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
+ __pyx_v_i = __pyx_t_4;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":576
+ * for i in range(start, stop):
+ * # Clear the arrays
+ * for ax in range(n_dimensions): # <<<<<<<<<<<<<<
+ * force[ax] = 0.0
+ * neg_force[ax] = 0.0
+ */
+ __pyx_t_2 = __pyx_v_n_dimensions;
+ for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_2; __pyx_t_5+=1) {
+ __pyx_v_ax = __pyx_t_5;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":577
+ * # Clear the arrays
+ * for ax in range(n_dimensions):
+ * force[ax] = 0.0 # <<<<<<<<<<<<<<
+ * neg_force[ax] = 0.0
+ * pos[ax] = pos_reference[i, ax]
+ */
+ (__pyx_v_force[__pyx_v_ax]) = 0.0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":578
+ * for ax in range(n_dimensions):
+ * force[ax] = 0.0
+ * neg_force[ax] = 0.0 # <<<<<<<<<<<<<<
+ * pos[ax] = pos_reference[i, ax]
+ * iQ[0] = 0.0
+ */
+ (__pyx_v_neg_force[__pyx_v_ax]) = 0.0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":579
+ * force[ax] = 0.0
+ * neg_force[ax] = 0.0
+ * pos[ax] = pos_reference[i, ax] # <<<<<<<<<<<<<<
+ * iQ[0] = 0.0
+ * l[0] = 0
+ */
+ __pyx_t_6 = __pyx_v_i;
+ __pyx_t_7 = __pyx_v_ax;
+ (__pyx_v_pos[__pyx_v_ax]) = (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_pos_reference.data + __pyx_t_6 * __pyx_v_pos_reference.strides[0]) ) + __pyx_t_7 * __pyx_v_pos_reference.strides[1]) )));
+ }
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":580
+ * neg_force[ax] = 0.0
+ * pos[ax] = pos_reference[i, ax]
+ * iQ[0] = 0.0 # <<<<<<<<<<<<<<
+ * l[0] = 0
+ * # Find which nodes are summarizing and collect their centers of mass
+ */
+ (__pyx_v_iQ[0]) = 0.0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":581
+ * pos[ax] = pos_reference[i, ax]
+ * iQ[0] = 0.0
+ * l[0] = 0 # <<<<<<<<<<<<<<
+ * # Find which nodes are summarizing and collect their centers of mass
+ * # deltas, and sizes, into vectorized arrays
+ */
+ (__pyx_v_l[0]) = 0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":584
+ * # Find which nodes are summarizing and collect their centers of mass
+ * # deltas, and sizes, into vectorized arrays
+ * t1 = clock() # <<<<<<<<<<<<<<
+ * compute_non_edge_forces(root_node, theta, i, pos, force, dist2s,
+ * sizes, deltas, l)
+ */
+ __pyx_v_t1 = clock();
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":585
+ * # deltas, and sizes, into vectorized arrays
+ * t1 = clock()
+ * compute_non_edge_forces(root_node, theta, i, pos, force, dist2s, # <<<<<<<<<<<<<<
+ * sizes, deltas, l)
+ * t2 = clock()
+ */
+ __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_compute_non_edge_forces(__pyx_v_root_node, __pyx_v_theta, __pyx_v_i, __pyx_v_pos, __pyx_v_force, __pyx_v_dist2s, __pyx_v_sizes, __pyx_v_deltas, __pyx_v_l);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":587
+ * compute_non_edge_forces(root_node, theta, i, pos, force, dist2s,
+ * sizes, deltas, l)
+ * t2 = clock() # <<<<<<<<<<<<<<
+ * # Compute the t-SNE negative force
+ * # for the digits dataset, walking the tree
+ */
+ __pyx_v_t2 = clock();
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":592
+ * # is about 10-15x more expensive than the
+ * # following for loop
+ * exponent = (dof + 1.0) / -2.0 # <<<<<<<<<<<<<<
+ * for j in range(l[0]):
+ * qijZ = ((1.0 + dist2s[j]) / dof) ** exponent
+ */
+ __pyx_v_exponent = ((__pyx_v_dof + 1.0) / -2.0);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":593
+ * # following for loop
+ * exponent = (dof + 1.0) / -2.0
+ * for j in range(l[0]): # <<<<<<<<<<<<<<
+ * qijZ = ((1.0 + dist2s[j]) / dof) ** exponent
+ * sum_Q[0] += sizes[j] * qijZ
+ */
+ __pyx_t_8 = (__pyx_v_l[0]);
+ for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
+ __pyx_v_j = __pyx_t_9;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":594
+ * exponent = (dof + 1.0) / -2.0
+ * for j in range(l[0]):
+ * qijZ = ((1.0 + dist2s[j]) / dof) ** exponent # <<<<<<<<<<<<<<
+ * sum_Q[0] += sizes[j] * qijZ
+ * mult = sizes[j] * qijZ * qijZ
+ */
+ __pyx_v_qijZ = pow(((1.0 + (__pyx_v_dist2s[__pyx_v_j])) / __pyx_v_dof), __pyx_v_exponent);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":595
+ * for j in range(l[0]):
+ * qijZ = ((1.0 + dist2s[j]) / dof) ** exponent
+ * sum_Q[0] += sizes[j] * qijZ # <<<<<<<<<<<<<<
+ * mult = sizes[j] * qijZ * qijZ
+ * for ax in range(n_dimensions):
+ */
+ __pyx_t_10 = 0;
+ (__pyx_v_sum_Q[__pyx_t_10]) = ((__pyx_v_sum_Q[__pyx_t_10]) + ((__pyx_v_sizes[__pyx_v_j]) * __pyx_v_qijZ));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":596
+ * qijZ = ((1.0 + dist2s[j]) / dof) ** exponent
+ * sum_Q[0] += sizes[j] * qijZ
+ * mult = sizes[j] * qijZ * qijZ # <<<<<<<<<<<<<<
+ * for ax in range(n_dimensions):
+ * idx = j * n_dimensions + ax
+ */
+ __pyx_v_mult = (((__pyx_v_sizes[__pyx_v_j]) * __pyx_v_qijZ) * __pyx_v_qijZ);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":597
+ * sum_Q[0] += sizes[j] * qijZ
+ * mult = sizes[j] * qijZ * qijZ
+ * for ax in range(n_dimensions): # <<<<<<<<<<<<<<
+ * idx = j * n_dimensions + ax
+ * neg_force[ax] += mult * deltas[idx]
+ */
+ __pyx_t_2 = __pyx_v_n_dimensions;
+ for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_2; __pyx_t_5+=1) {
+ __pyx_v_ax = __pyx_t_5;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":598
+ * mult = sizes[j] * qijZ * qijZ
+ * for ax in range(n_dimensions):
+ * idx = j * n_dimensions + ax # <<<<<<<<<<<<<<
+ * neg_force[ax] += mult * deltas[idx]
+ * t3 = clock()
+ */
+ __pyx_v_idx = ((__pyx_v_j * __pyx_v_n_dimensions) + __pyx_v_ax);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":599
+ * for ax in range(n_dimensions):
+ * idx = j * n_dimensions + ax
+ * neg_force[ax] += mult * deltas[idx] # <<<<<<<<<<<<<<
+ * t3 = clock()
+ * for ax in range(n_dimensions):
+ */
+ __pyx_t_11 = __pyx_v_ax;
+ (__pyx_v_neg_force[__pyx_t_11]) = ((__pyx_v_neg_force[__pyx_t_11]) + (__pyx_v_mult * (__pyx_v_deltas[__pyx_v_idx])));
+ }
+ }
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":600
+ * idx = j * n_dimensions + ax
+ * neg_force[ax] += mult * deltas[idx]
+ * t3 = clock() # <<<<<<<<<<<<<<
+ * for ax in range(n_dimensions):
+ * neg_f[i * n_dimensions + ax] = neg_force[ax]
+ */
+ __pyx_v_t3 = clock();
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":601
+ * neg_force[ax] += mult * deltas[idx]
+ * t3 = clock()
+ * for ax in range(n_dimensions): # <<<<<<<<<<<<<<
+ * neg_f[i * n_dimensions + ax] = neg_force[ax]
+ * dta += t2 - t1
+ */
+ __pyx_t_2 = __pyx_v_n_dimensions;
+ for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_2; __pyx_t_5+=1) {
+ __pyx_v_ax = __pyx_t_5;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":602
+ * t3 = clock()
+ * for ax in range(n_dimensions):
+ * neg_f[i * n_dimensions + ax] = neg_force[ax] # <<<<<<<<<<<<<<
+ * dta += t2 - t1
+ * dtb += t3 - t2
+ */
+ (__pyx_v_neg_f[((__pyx_v_i * __pyx_v_n_dimensions) + __pyx_v_ax)]) = (__pyx_v_neg_force[__pyx_v_ax]);
+ }
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":603
+ * for ax in range(n_dimensions):
+ * neg_f[i * n_dimensions + ax] = neg_force[ax]
+ * dta += t2 - t1 # <<<<<<<<<<<<<<
+ * dtb += t3 - t2
+ * if root_node.tree.verbose > 20:
+ */
+ __pyx_v_dta = (__pyx_v_dta + (__pyx_v_t2 - __pyx_v_t1));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":604
+ * neg_f[i * n_dimensions + ax] = neg_force[ax]
+ * dta += t2 - t1
+ * dtb += t3 - t2 # <<<<<<<<<<<<<<
+ * if root_node.tree.verbose > 20:
+ * printf("[t-SNE] Tree: %i clock ticks | ", dta)
+ */
+ __pyx_v_dtb = (__pyx_v_dtb + (__pyx_v_t3 - __pyx_v_t2));
+ }
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":605
+ * dta += t2 - t1
+ * dtb += t3 - t2
+ * if root_node.tree.verbose > 20: # <<<<<<<<<<<<<<
+ * printf("[t-SNE] Tree: %i clock ticks | ", dta)
+ * printf("Force computation: %i clock ticks\n", dtb)
+ */
+ __pyx_t_1 = ((__pyx_v_root_node->tree->verbose > 20) != 0);
+ if (__pyx_t_1) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":606
+ * dtb += t3 - t2
+ * if root_node.tree.verbose > 20:
+ * printf("[t-SNE] Tree: %i clock ticks | ", dta) # <<<<<<<<<<<<<<
+ * printf("Force computation: %i clock ticks\n", dtb)
+ * free(iQ)
+ */
+ printf(__pyx_k_t_SNE_Tree_i_clock_ticks, __pyx_v_dta);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":607
+ * if root_node.tree.verbose > 20:
+ * printf("[t-SNE] Tree: %i clock ticks | ", dta)
+ * printf("Force computation: %i clock ticks\n", dtb) # <<<<<<<<<<<<<<
+ * free(iQ)
+ * free(force)
+ */
+ printf(__pyx_k_Force_computation_i_clock_ticks, __pyx_v_dtb);
+ goto __pyx_L14;
+ }
+ __pyx_L14:;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":608
+ * printf("[t-SNE] Tree: %i clock ticks | ", dta)
+ * printf("Force computation: %i clock ticks\n", dtb)
+ * free(iQ) # <<<<<<<<<<<<<<
+ * free(force)
+ * free(pos)
+ */
+ free(__pyx_v_iQ);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":609
+ * printf("Force computation: %i clock ticks\n", dtb)
+ * free(iQ)
+ * free(force) # <<<<<<<<<<<<<<
+ * free(pos)
+ * free(dist2s)
+ */
+ free(__pyx_v_force);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":610
+ * free(iQ)
+ * free(force)
+ * free(pos) # <<<<<<<<<<<<<<
+ * free(dist2s)
+ * free(sizes)
+ */
+ free(__pyx_v_pos);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":611
+ * free(force)
+ * free(pos)
+ * free(dist2s) # <<<<<<<<<<<<<<
+ * free(sizes)
+ * free(deltas)
+ */
+ free(__pyx_v_dist2s);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":612
+ * free(pos)
+ * free(dist2s)
+ * free(sizes) # <<<<<<<<<<<<<<
+ * free(deltas)
+ * free(l)
+ */
+ free(__pyx_v_sizes);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":613
+ * free(dist2s)
+ * free(sizes)
+ * free(deltas) # <<<<<<<<<<<<<<
+ * free(l)
+ * free(neg_force)
+ */
+ free(__pyx_v_deltas);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":614
+ * free(sizes)
+ * free(deltas)
+ * free(l) # <<<<<<<<<<<<<<
+ * free(neg_force)
+ *
+ */
+ free(__pyx_v_l);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":615
+ * free(deltas)
+ * free(l)
+ * free(neg_force) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ free(__pyx_v_neg_force);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":535
+ *
+ *
+ * cdef void compute_gradient_negative(float[:,:] val_P, # <<<<<<<<<<<<<<
+ * float[:,:] pos_reference,
+ * float* neg_f,
+ */
+
+ /* function exit code */
+}
+
+/* "sklearn/manifold/_barnes_hut_tsne.pyx":618
+ *
+ *
+ * cdef void compute_non_edge_forces(Node* node, # <<<<<<<<<<<<<<
+ * float theta,
+ * long point_index,
+ */
+
+static void __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_compute_non_edge_forces(struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Node *__pyx_v_node, float __pyx_v_theta, long __pyx_v_point_index, float *__pyx_v_pos, float *__pyx_v_force, float *__pyx_v_dist2s, long *__pyx_v_sizes, float *__pyx_v_deltas, long *__pyx_v_l) {
+ struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Node *__pyx_v_child;
+ int __pyx_v_i;
+ int __pyx_v_n_dimensions;
+ long __pyx_v_idx;
+ long __pyx_v_idx1;
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ int __pyx_t_5;
+ long __pyx_t_6;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":631
+ * Node* child
+ * int i, j
+ * int n_dimensions = node.tree.n_dimensions # <<<<<<<<<<<<<<
+ * long idx, idx1
+ * float dist_check
+ */
+ __pyx_t_1 = __pyx_v_node->tree->n_dimensions;
+ __pyx_v_n_dimensions = __pyx_t_1;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":638
+ * # so do not bother to calculate any force contributions
+ * # Also do not compute self-interactions
+ * if node.cumulative_size > 0 and not (node.is_leaf and (node.point_index == # <<<<<<<<<<<<<<
+ * point_index)):
+ * # Compute distance between node center of mass and the reference point
+ */
+ __pyx_t_3 = ((__pyx_v_node->cumulative_size > 0) != 0);
+ if (__pyx_t_3) {
+ goto __pyx_L5_next_and;
+ } else {
+ __pyx_t_2 = __pyx_t_3;
+ goto __pyx_L4_bool_binop_done;
+ }
+ __pyx_L5_next_and:;
+ __pyx_t_4 = (__pyx_v_node->is_leaf != 0);
+ if (__pyx_t_4) {
+ goto __pyx_L7_next_and;
+ } else {
+ __pyx_t_3 = __pyx_t_4;
+ goto __pyx_L6_bool_binop_done;
+ }
+ __pyx_L7_next_and:;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":639
+ * # Also do not compute self-interactions
+ * if node.cumulative_size > 0 and not (node.is_leaf and (node.point_index ==
+ * point_index)): # <<<<<<<<<<<<<<
+ * # Compute distance between node center of mass and the reference point
+ * # I've tried rewriting this in terms of BLAS functions, but it's about
+ */
+ __pyx_t_4 = ((__pyx_v_node->point_index == __pyx_v_point_index) != 0);
+ __pyx_t_3 = __pyx_t_4;
+ __pyx_L6_bool_binop_done:;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":638
+ * # so do not bother to calculate any force contributions
+ * # Also do not compute self-interactions
+ * if node.cumulative_size > 0 and not (node.is_leaf and (node.point_index == # <<<<<<<<<<<<<<
+ * point_index)):
+ * # Compute distance between node center of mass and the reference point
+ */
+ __pyx_t_4 = ((!__pyx_t_3) != 0);
+ __pyx_t_2 = __pyx_t_4;
+ __pyx_L4_bool_binop_done:;
+ if (__pyx_t_2) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":643
+ * # I've tried rewriting this in terms of BLAS functions, but it's about
+ * # 1.5x worse when we do so, probbaly because the vectors are small
+ * idx1 = l[0] * n_dimensions # <<<<<<<<<<<<<<
+ * deltas[idx1] = pos[0] - node.barycenter[0]
+ * idx = idx1
+ */
+ __pyx_v_idx1 = ((__pyx_v_l[0]) * __pyx_v_n_dimensions);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":644
+ * # 1.5x worse when we do so, probbaly because the vectors are small
+ * idx1 = l[0] * n_dimensions
+ * deltas[idx1] = pos[0] - node.barycenter[0] # <<<<<<<<<<<<<<
+ * idx = idx1
+ * for i in range(1, n_dimensions):
+ */
+ (__pyx_v_deltas[__pyx_v_idx1]) = ((__pyx_v_pos[0]) - (__pyx_v_node->barycenter[0]));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":645
+ * idx1 = l[0] * n_dimensions
+ * deltas[idx1] = pos[0] - node.barycenter[0]
+ * idx = idx1 # <<<<<<<<<<<<<<
+ * for i in range(1, n_dimensions):
+ * idx += 1
+ */
+ __pyx_v_idx = __pyx_v_idx1;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":646
+ * deltas[idx1] = pos[0] - node.barycenter[0]
+ * idx = idx1
+ * for i in range(1, n_dimensions): # <<<<<<<<<<<<<<
+ * idx += 1
+ * deltas[idx] = pos[i] - node.barycenter[i]
+ */
+ __pyx_t_1 = __pyx_v_n_dimensions;
+ for (__pyx_t_5 = 1; __pyx_t_5 < __pyx_t_1; __pyx_t_5+=1) {
+ __pyx_v_i = __pyx_t_5;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":647
+ * idx = idx1
+ * for i in range(1, n_dimensions):
+ * idx += 1 # <<<<<<<<<<<<<<
+ * deltas[idx] = pos[i] - node.barycenter[i]
+ * # do np.sqrt(np.sum(deltas**2.0))
+ */
+ __pyx_v_idx = (__pyx_v_idx + 1);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":648
+ * for i in range(1, n_dimensions):
+ * idx += 1
+ * deltas[idx] = pos[i] - node.barycenter[i] # <<<<<<<<<<<<<<
+ * # do np.sqrt(np.sum(deltas**2.0))
+ * dist2s[l[0]] = snrm2(n_dimensions, &deltas[idx1], 1)
+ */
+ (__pyx_v_deltas[__pyx_v_idx]) = ((__pyx_v_pos[__pyx_v_i]) - (__pyx_v_node->barycenter[__pyx_v_i]));
+ }
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":650
+ * deltas[idx] = pos[i] - node.barycenter[i]
+ * # do np.sqrt(np.sum(deltas**2.0))
+ * dist2s[l[0]] = snrm2(n_dimensions, &deltas[idx1], 1) # <<<<<<<<<<<<<<
+ * # Check whether we can use this node as a summary
+ * # It's a summary node if the angular size as measured from the point
+ */
+ (__pyx_v_dist2s[(__pyx_v_l[0])]) = cblas_snrm2(__pyx_v_n_dimensions, (&(__pyx_v_deltas[__pyx_v_idx1])), 1);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":656
+ * # If it can be summarized, we use the cell center of mass
+ * # Otherwise, we go a higher level of resolution and into the leaves.
+ * if node.is_leaf or ((node.max_width / dist2s[l[0]]) < theta): # <<<<<<<<<<<<<<
+ * # Compute the t-SNE force between the reference point and the
+ * # current node
+ */
+ __pyx_t_4 = (__pyx_v_node->is_leaf != 0);
+ if (!__pyx_t_4) {
+ goto __pyx_L12_next_or;
+ } else {
+ __pyx_t_2 = __pyx_t_4;
+ goto __pyx_L11_bool_binop_done;
+ }
+ __pyx_L12_next_or:;
+ __pyx_t_4 = (((__pyx_v_node->max_width / (__pyx_v_dist2s[(__pyx_v_l[0])])) < __pyx_v_theta) != 0);
+ __pyx_t_2 = __pyx_t_4;
+ __pyx_L11_bool_binop_done:;
+ if (__pyx_t_2) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":659
+ * # Compute the t-SNE force between the reference point and the
+ * # current node
+ * sizes[l[0]] = node.cumulative_size # <<<<<<<<<<<<<<
+ * dist2s[l[0]] = dist2s[l[0]] * dist2s[l[0]]
+ * l[0] += 1
+ */
+ __pyx_t_6 = __pyx_v_node->cumulative_size;
+ (__pyx_v_sizes[(__pyx_v_l[0])]) = __pyx_t_6;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":660
+ * # current node
+ * sizes[l[0]] = node.cumulative_size
+ * dist2s[l[0]] = dist2s[l[0]] * dist2s[l[0]] # <<<<<<<<<<<<<<
+ * l[0] += 1
+ * else:
+ */
+ (__pyx_v_dist2s[(__pyx_v_l[0])]) = ((__pyx_v_dist2s[(__pyx_v_l[0])]) * (__pyx_v_dist2s[(__pyx_v_l[0])]));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":661
+ * sizes[l[0]] = node.cumulative_size
+ * dist2s[l[0]] = dist2s[l[0]] * dist2s[l[0]]
+ * l[0] += 1 # <<<<<<<<<<<<<<
+ * else:
+ * # Recursively apply Barnes-Hut to child nodes
+ */
+ __pyx_t_6 = 0;
+ (__pyx_v_l[__pyx_t_6]) = ((__pyx_v_l[__pyx_t_6]) + 1);
+ goto __pyx_L10;
+ }
+ /*else*/ {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":664
+ * else:
+ * # Recursively apply Barnes-Hut to child nodes
+ * for idx in range(node.tree.n_cell_per_node): # <<<<<<<<<<<<<<
+ * child = node.children[idx]
+ * if child.cumulative_size == 0:
+ */
+ __pyx_t_1 = __pyx_v_node->tree->n_cell_per_node;
+ for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_1; __pyx_t_6+=1) {
+ __pyx_v_idx = __pyx_t_6;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":665
+ * # Recursively apply Barnes-Hut to child nodes
+ * for idx in range(node.tree.n_cell_per_node):
+ * child = node.children[idx] # <<<<<<<<<<<<<<
+ * if child.cumulative_size == 0:
+ * continue
+ */
+ __pyx_v_child = (__pyx_v_node->children[__pyx_v_idx]);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":666
+ * for idx in range(node.tree.n_cell_per_node):
+ * child = node.children[idx]
+ * if child.cumulative_size == 0: # <<<<<<<<<<<<<<
+ * continue
+ * compute_non_edge_forces(child, theta,
+ */
+ __pyx_t_2 = ((__pyx_v_child->cumulative_size == 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":667
+ * child = node.children[idx]
+ * if child.cumulative_size == 0:
+ * continue # <<<<<<<<<<<<<<
+ * compute_non_edge_forces(child, theta,
+ * point_index, pos, force, dist2s, sizes, deltas,
+ */
+ goto __pyx_L13_continue;
+ }
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":668
+ * if child.cumulative_size == 0:
+ * continue
+ * compute_non_edge_forces(child, theta, # <<<<<<<<<<<<<<
+ * point_index, pos, force, dist2s, sizes, deltas,
+ * l)
+ */
+ __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_compute_non_edge_forces(__pyx_v_child, __pyx_v_theta, __pyx_v_point_index, __pyx_v_pos, __pyx_v_force, __pyx_v_dist2s, __pyx_v_sizes, __pyx_v_deltas, __pyx_v_l);
+ __pyx_L13_continue:;
+ }
+ }
+ __pyx_L10:;
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":618
+ *
+ *
+ * cdef void compute_non_edge_forces(Node* node, # <<<<<<<<<<<<<<
+ * float theta,
+ * long point_index,
+ */
+
+ /* function exit code */
+}
+
+/* "sklearn/manifold/_barnes_hut_tsne.pyx":673
+ *
+ *
+ * cdef float compute_error(float[:, :] val_P, # <<<<<<<<<<<<<<
+ * float[:, :] pos_reference,
+ * long[:,:] neighbors,
+ */
+
+static float __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_compute_error(__Pyx_memviewslice __pyx_v_val_P, __Pyx_memviewslice __pyx_v_pos_reference, __Pyx_memviewslice __pyx_v_neighbors, float __pyx_v_sum_Q, int __pyx_v_n_dimensions, int __pyx_v_verbose) {
+ int __pyx_v_i;
+ int __pyx_v_j;
+ int __pyx_v_ax;
+ int __pyx_v_I;
+ int __pyx_v_K;
+ float __pyx_v_pij;
+ float __pyx_v_Q;
+ float __pyx_v_C;
+ clock_t __pyx_v_t1;
+ clock_t __pyx_v_t2;
+ float __pyx_v_dt;
+ float __pyx_v_delta;
+ int __pyx_v_k;
+ float __pyx_r;
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ int __pyx_t_5;
+ int __pyx_t_6;
+ int __pyx_t_7;
+ int __pyx_t_8;
+ int __pyx_t_9;
+ int __pyx_t_10;
+ int __pyx_t_11;
+ int __pyx_t_12;
+ int __pyx_t_13;
+ int __pyx_t_14;
+ int __pyx_t_15;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":680
+ * int verbose) nogil:
+ * cdef int i, j, ax
+ * cdef int I = neighbors.shape[0] # <<<<<<<<<<<<<<
+ * cdef int K = neighbors.shape[1]
+ * cdef float pij, Q
+ */
+ __pyx_v_I = (__pyx_v_neighbors.shape[0]);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":681
+ * cdef int i, j, ax
+ * cdef int I = neighbors.shape[0]
+ * cdef int K = neighbors.shape[1] # <<<<<<<<<<<<<<
+ * cdef float pij, Q
+ * cdef float C = 0.0
+ */
+ __pyx_v_K = (__pyx_v_neighbors.shape[1]);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":683
+ * cdef int K = neighbors.shape[1]
+ * cdef float pij, Q
+ * cdef float C = 0.0 # <<<<<<<<<<<<<<
+ * cdef clock_t t1, t2
+ * cdef float dt, delta
+ */
+ __pyx_v_C = 0.0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":686
+ * cdef clock_t t1, t2
+ * cdef float dt, delta
+ * t1 = clock() # <<<<<<<<<<<<<<
+ * for i in range(I):
+ * for k in range(K):
+ */
+ __pyx_v_t1 = clock();
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":687
+ * cdef float dt, delta
+ * t1 = clock()
+ * for i in range(I): # <<<<<<<<<<<<<<
+ * for k in range(K):
+ * j = neighbors[i, k]
+ */
+ __pyx_t_1 = __pyx_v_I;
+ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
+ __pyx_v_i = __pyx_t_2;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":688
+ * t1 = clock()
+ * for i in range(I):
+ * for k in range(K): # <<<<<<<<<<<<<<
+ * j = neighbors[i, k]
+ * pij = val_P[i, j]
+ */
+ __pyx_t_3 = __pyx_v_K;
+ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
+ __pyx_v_k = __pyx_t_4;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":689
+ * for i in range(I):
+ * for k in range(K):
+ * j = neighbors[i, k] # <<<<<<<<<<<<<<
+ * pij = val_P[i, j]
+ * Q = 0.0
+ */
+ __pyx_t_5 = __pyx_v_i;
+ __pyx_t_6 = __pyx_v_k;
+ __pyx_v_j = (*((long *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_neighbors.data + __pyx_t_5 * __pyx_v_neighbors.strides[0]) ) + __pyx_t_6 * __pyx_v_neighbors.strides[1]) )));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":690
+ * for k in range(K):
+ * j = neighbors[i, k]
+ * pij = val_P[i, j] # <<<<<<<<<<<<<<
+ * Q = 0.0
+ * for ax in range(n_dimensions):
+ */
+ __pyx_t_7 = __pyx_v_i;
+ __pyx_t_8 = __pyx_v_j;
+ __pyx_v_pij = (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_val_P.data + __pyx_t_7 * __pyx_v_val_P.strides[0]) ) + __pyx_t_8 * __pyx_v_val_P.strides[1]) )));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":691
+ * j = neighbors[i, k]
+ * pij = val_P[i, j]
+ * Q = 0.0 # <<<<<<<<<<<<<<
+ * for ax in range(n_dimensions):
+ * delta = (pos_reference[i, ax] - pos_reference[j, ax])
+ */
+ __pyx_v_Q = 0.0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":692
+ * pij = val_P[i, j]
+ * Q = 0.0
+ * for ax in range(n_dimensions): # <<<<<<<<<<<<<<
+ * delta = (pos_reference[i, ax] - pos_reference[j, ax])
+ * Q += delta * delta
+ */
+ __pyx_t_9 = __pyx_v_n_dimensions;
+ for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
+ __pyx_v_ax = __pyx_t_10;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":693
+ * Q = 0.0
+ * for ax in range(n_dimensions):
+ * delta = (pos_reference[i, ax] - pos_reference[j, ax]) # <<<<<<<<<<<<<<
+ * Q += delta * delta
+ * Q = (1.0 / (sum_Q + Q * sum_Q))
+ */
+ __pyx_t_11 = __pyx_v_i;
+ __pyx_t_12 = __pyx_v_ax;
+ __pyx_t_13 = __pyx_v_j;
+ __pyx_t_14 = __pyx_v_ax;
+ __pyx_v_delta = ((*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_pos_reference.data + __pyx_t_11 * __pyx_v_pos_reference.strides[0]) ) + __pyx_t_12 * __pyx_v_pos_reference.strides[1]) ))) - (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_pos_reference.data + __pyx_t_13 * __pyx_v_pos_reference.strides[0]) ) + __pyx_t_14 * __pyx_v_pos_reference.strides[1]) ))));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":694
+ * for ax in range(n_dimensions):
+ * delta = (pos_reference[i, ax] - pos_reference[j, ax])
+ * Q += delta * delta # <<<<<<<<<<<<<<
+ * Q = (1.0 / (sum_Q + Q * sum_Q))
+ * C += pij * log((pij + EPSILON) / (Q + EPSILON))
+ */
+ __pyx_v_Q = (__pyx_v_Q + (__pyx_v_delta * __pyx_v_delta));
+ }
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":695
+ * delta = (pos_reference[i, ax] - pos_reference[j, ax])
+ * Q += delta * delta
+ * Q = (1.0 / (sum_Q + Q * sum_Q)) # <<<<<<<<<<<<<<
+ * C += pij * log((pij + EPSILON) / (Q + EPSILON))
+ * t2 = clock()
+ */
+ __pyx_v_Q = (1.0 / (__pyx_v_sum_Q + (__pyx_v_Q * __pyx_v_sum_Q)));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":696
+ * Q += delta * delta
+ * Q = (1.0 / (sum_Q + Q * sum_Q))
+ * C += pij * log((pij + EPSILON) / (Q + EPSILON)) # <<<<<<<<<<<<<<
+ * t2 = clock()
+ * dt = ((float) (t2 - t1))
+ */
+ __pyx_v_C = (__pyx_v_C + (__pyx_v_pij * log(((__pyx_v_pij + __pyx_v_7sklearn_8manifold_16_barnes_hut_tsne_EPSILON) / (__pyx_v_Q + __pyx_v_7sklearn_8manifold_16_barnes_hut_tsne_EPSILON)))));
+ }
+ }
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":697
+ * Q = (1.0 / (sum_Q + Q * sum_Q))
+ * C += pij * log((pij + EPSILON) / (Q + EPSILON))
+ * t2 = clock() # <<<<<<<<<<<<<<
+ * dt = ((float) (t2 - t1))
+ * if verbose > 10:
+ */
+ __pyx_v_t2 = clock();
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":698
+ * C += pij * log((pij + EPSILON) / (Q + EPSILON))
+ * t2 = clock()
+ * dt = ((float) (t2 - t1)) # <<<<<<<<<<<<<<
+ * if verbose > 10:
+ * printf("[t-SNE] Computed error=%1.4f in %1.1e ticks\n", C, dt)
+ */
+ __pyx_v_dt = ((double)(__pyx_v_t2 - __pyx_v_t1));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":699
+ * t2 = clock()
+ * dt = ((float) (t2 - t1))
+ * if verbose > 10: # <<<<<<<<<<<<<<
+ * printf("[t-SNE] Computed error=%1.4f in %1.1e ticks\n", C, dt)
+ * return C
+ */
+ __pyx_t_15 = ((__pyx_v_verbose > 10) != 0);
+ if (__pyx_t_15) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":700
+ * dt = ((float) (t2 - t1))
+ * if verbose > 10:
+ * printf("[t-SNE] Computed error=%1.4f in %1.1e ticks\n", C, dt) # <<<<<<<<<<<<<<
+ * return C
+ *
+ */
+ printf(__pyx_k_t_SNE_Computed_error_1_4f_in_1, __pyx_v_C, __pyx_v_dt);
+ goto __pyx_L9;
+ }
+ __pyx_L9:;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":701
+ * if verbose > 10:
+ * printf("[t-SNE] Computed error=%1.4f in %1.1e ticks\n", C, dt)
+ * return C # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = __pyx_v_C;
+ goto __pyx_L0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":673
+ *
+ *
+ * cdef float compute_error(float[:, :] val_P, # <<<<<<<<<<<<<<
+ * float[:, :] pos_reference,
+ * long[:,:] neighbors,
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "sklearn/manifold/_barnes_hut_tsne.pyx":704
+ *
+ *
+ * def calculate_edge(pos_output): # <<<<<<<<<<<<<<
+ * # Make the boundaries slightly outside of the data
+ * # to avoid floating point error near the edge
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7sklearn_8manifold_16_barnes_hut_tsne_1calculate_edge(PyObject *__pyx_self, PyObject *__pyx_v_pos_output); /*proto*/
+static PyMethodDef __pyx_mdef_7sklearn_8manifold_16_barnes_hut_tsne_1calculate_edge = {"calculate_edge", (PyCFunction)__pyx_pw_7sklearn_8manifold_16_barnes_hut_tsne_1calculate_edge, METH_O, 0};
+static PyObject *__pyx_pw_7sklearn_8manifold_16_barnes_hut_tsne_1calculate_edge(PyObject *__pyx_self, PyObject *__pyx_v_pos_output) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("calculate_edge (wrapper)", 0);
+ __pyx_r = __pyx_pf_7sklearn_8manifold_16_barnes_hut_tsne_calculate_edge(__pyx_self, ((PyObject *)__pyx_v_pos_output));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_7sklearn_8manifold_16_barnes_hut_tsne_calculate_edge(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_pos_output) {
+ PyObject *__pyx_v_left_edge = NULL;
+ PyObject *__pyx_v_right_edge = NULL;
+ PyObject *__pyx_v_center = NULL;
+ PyObject *__pyx_v_width = NULL;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ Py_ssize_t __pyx_t_6;
+ PyObject *__pyx_t_7 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("calculate_edge", 0);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":707
+ * # Make the boundaries slightly outside of the data
+ * # to avoid floating point error near the edge
+ * left_edge = np.min(pos_output, axis=0) # <<<<<<<<<<<<<<
+ * right_edge = np.max(pos_output, axis=0)
+ * center = (right_edge + left_edge) * 0.5
+ */
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_min); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_v_pos_output);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_pos_output);
+ __Pyx_GIVEREF(__pyx_v_pos_output);
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_axis, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_left_edge = __pyx_t_4;
+ __pyx_t_4 = 0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":708
+ * # to avoid floating point error near the edge
+ * left_edge = np.min(pos_output, axis=0)
+ * right_edge = np.max(pos_output, axis=0) # <<<<<<<<<<<<<<
+ * center = (right_edge + left_edge) * 0.5
+ * width = np.maximum(np.subtract(right_edge, left_edge), EPSILON)
+ */
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_max); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_v_pos_output);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_pos_output);
+ __Pyx_GIVEREF(__pyx_v_pos_output);
+ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_axis, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_v_right_edge = __pyx_t_2;
+ __pyx_t_2 = 0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":709
+ * left_edge = np.min(pos_output, axis=0)
+ * right_edge = np.max(pos_output, axis=0)
+ * center = (right_edge + left_edge) * 0.5 # <<<<<<<<<<<<<<
+ * width = np.maximum(np.subtract(right_edge, left_edge), EPSILON)
+ * # Exagerate width to avoid boundary edge
+ */
+ __pyx_t_2 = PyNumber_Add(__pyx_v_right_edge, __pyx_v_left_edge); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_float_0_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_v_center = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":710
+ * right_edge = np.max(pos_output, axis=0)
+ * center = (right_edge + left_edge) * 0.5
+ * width = np.maximum(np.subtract(right_edge, left_edge), EPSILON) # <<<<<<<<<<<<<<
+ * # Exagerate width to avoid boundary edge
+ * width = width.astype(np.float32) * 1.001
+ */
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_maximum); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_subtract); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = NULL;
+ __pyx_t_6 = 0;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+ __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_3)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+ __Pyx_INCREF(__pyx_t_3);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_5, function);
+ __pyx_t_6 = 1;
+ }
+ }
+ __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ if (__pyx_t_3) {
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
+ }
+ __Pyx_INCREF(__pyx_v_right_edge);
+ PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_right_edge);
+ __Pyx_GIVEREF(__pyx_v_right_edge);
+ __Pyx_INCREF(__pyx_v_left_edge);
+ PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_left_edge);
+ __Pyx_GIVEREF(__pyx_v_left_edge);
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = PyFloat_FromDouble(__pyx_v_7sklearn_8manifold_16_barnes_hut_tsne_EPSILON); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_7 = NULL;
+ __pyx_t_6 = 0;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
+ __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
+ if (likely(__pyx_t_7)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_7);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_4, function);
+ __pyx_t_6 = 1;
+ }
+ }
+ __pyx_t_3 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ if (__pyx_t_7) {
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
+ }
+ PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_6, __pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_6, __pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
+ __pyx_t_2 = 0;
+ __pyx_t_5 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_v_width = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":712
+ * width = np.maximum(np.subtract(right_edge, left_edge), EPSILON)
+ * # Exagerate width to avoid boundary edge
+ * width = width.astype(np.float32) * 1.001 # <<<<<<<<<<<<<<
+ * left_edge = center - width / 2.0
+ * right_edge = center + width / 2.0
+ */
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_width, __pyx_n_s_astype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
+ __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
+ if (likely(__pyx_t_3)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_3);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_4, function);
+ }
+ }
+ if (!__pyx_t_3) {
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else {
+ __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
+ PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = PyNumber_Multiply(__pyx_t_1, __pyx_float_1_001); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF_SET(__pyx_v_width, __pyx_t_4);
+ __pyx_t_4 = 0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":713
+ * # Exagerate width to avoid boundary edge
+ * width = width.astype(np.float32) * 1.001
+ * left_edge = center - width / 2.0 # <<<<<<<<<<<<<<
+ * right_edge = center + width / 2.0
+ * return left_edge, right_edge, width
+ */
+ __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_v_width, __pyx_float_2_0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_1 = PyNumber_Subtract(__pyx_v_center, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF_SET(__pyx_v_left_edge, __pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":714
+ * width = width.astype(np.float32) * 1.001
+ * left_edge = center - width / 2.0
+ * right_edge = center + width / 2.0 # <<<<<<<<<<<<<<
+ * return left_edge, right_edge, width
+ *
+ */
+ __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_v_width, __pyx_float_2_0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_4 = PyNumber_Add(__pyx_v_center, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF_SET(__pyx_v_right_edge, __pyx_t_4);
+ __pyx_t_4 = 0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":715
+ * left_edge = center - width / 2.0
+ * right_edge = center + width / 2.0
+ * return left_edge, right_edge, width # <<<<<<<<<<<<<<
+ *
+ * def gradient(float[:,:] pij_input,
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_v_left_edge);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_left_edge);
+ __Pyx_GIVEREF(__pyx_v_left_edge);
+ __Pyx_INCREF(__pyx_v_right_edge);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_right_edge);
+ __Pyx_GIVEREF(__pyx_v_right_edge);
+ __Pyx_INCREF(__pyx_v_width);
+ PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_width);
+ __Pyx_GIVEREF(__pyx_v_width);
+ __pyx_r = __pyx_t_4;
+ __pyx_t_4 = 0;
+ goto __pyx_L0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":704
+ *
+ *
+ * def calculate_edge(pos_output): # <<<<<<<<<<<<<<
+ * # Make the boundaries slightly outside of the data
+ * # to avoid floating point error near the edge
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_AddTraceback("sklearn.manifold._barnes_hut_tsne.calculate_edge", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_left_edge);
+ __Pyx_XDECREF(__pyx_v_right_edge);
+ __Pyx_XDECREF(__pyx_v_center);
+ __Pyx_XDECREF(__pyx_v_width);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "sklearn/manifold/_barnes_hut_tsne.pyx":717
+ * return left_edge, right_edge, width
+ *
+ * def gradient(float[:,:] pij_input, # <<<<<<<<<<<<<<
+ * float[:,:] pos_output,
+ * long[:,:] neighbors,
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7sklearn_8manifold_16_barnes_hut_tsne_3gradient(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_mdef_7sklearn_8manifold_16_barnes_hut_tsne_3gradient = {"gradient", (PyCFunction)__pyx_pw_7sklearn_8manifold_16_barnes_hut_tsne_3gradient, METH_VARARGS|METH_KEYWORDS, 0};
+static PyObject *__pyx_pw_7sklearn_8manifold_16_barnes_hut_tsne_3gradient(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ __Pyx_memviewslice __pyx_v_pij_input = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __Pyx_memviewslice __pyx_v_pos_output = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __Pyx_memviewslice __pyx_v_neighbors = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __Pyx_memviewslice __pyx_v_forces = { 0, 0, { 0 }, { 0 }, { 0 } };
+ float __pyx_v_theta;
+ int __pyx_v_n_dimensions;
+ int __pyx_v_verbose;
+ float __pyx_v_dof;
+ long __pyx_v_skip_num_points;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("gradient (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pij_input,&__pyx_n_s_pos_output,&__pyx_n_s_neighbors,&__pyx_n_s_forces,&__pyx_n_s_theta,&__pyx_n_s_n_dimensions,&__pyx_n_s_verbose,&__pyx_n_s_dof,&__pyx_n_s_skip_num_points,0};
+ PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
+ case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
+ case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
+ case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
+ case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+ case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pij_input)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pos_output)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("gradient", 0, 7, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 2:
+ if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_neighbors)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("gradient", 0, 7, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 3:
+ if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_forces)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("gradient", 0, 7, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 4:
+ if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_theta)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("gradient", 0, 7, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 5:
+ if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n_dimensions)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("gradient", 0, 7, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 6:
+ if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_verbose)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("gradient", 0, 7, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 7:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dof);
+ if (value) { values[7] = value; kw_args--; }
+ }
+ case 8:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_skip_num_points);
+ if (value) { values[8] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gradient") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else {
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
+ case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
+ case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
+ values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
+ values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+ values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+ values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ }
+ __pyx_v_pij_input = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(values[0]); if (unlikely(!__pyx_v_pij_input.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_pos_output = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(values[1]); if (unlikely(!__pyx_v_pos_output.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_neighbors = __Pyx_PyObject_to_MemoryviewSlice_dsds_long(values[2]); if (unlikely(!__pyx_v_neighbors.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_forces = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(values[3]); if (unlikely(!__pyx_v_forces.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_theta = __pyx_PyFloat_AsFloat(values[4]); if (unlikely((__pyx_v_theta == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_n_dimensions = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_n_dimensions == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_verbose = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_verbose == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (values[7]) {
+ __pyx_v_dof = __pyx_PyFloat_AsFloat(values[7]); if (unlikely((__pyx_v_dof == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ } else {
+ __pyx_v_dof = ((float)1.0);
+ }
+ if (values[8]) {
+ __pyx_v_skip_num_points = __Pyx_PyInt_As_long(values[8]); if (unlikely((__pyx_v_skip_num_points == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ } else {
+ __pyx_v_skip_num_points = ((long)0);
+ }
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("gradient", 0, 7, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("sklearn.manifold._barnes_hut_tsne.gradient", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_7sklearn_8manifold_16_barnes_hut_tsne_2gradient(__pyx_self, __pyx_v_pij_input, __pyx_v_pos_output, __pyx_v_neighbors, __pyx_v_forces, __pyx_v_theta, __pyx_v_n_dimensions, __pyx_v_verbose, __pyx_v_dof, __pyx_v_skip_num_points);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_7sklearn_8manifold_16_barnes_hut_tsne_2gradient(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_pij_input, __Pyx_memviewslice __pyx_v_pos_output, __Pyx_memviewslice __pyx_v_neighbors, __Pyx_memviewslice __pyx_v_forces, float __pyx_v_theta, int __pyx_v_n_dimensions, int __pyx_v_verbose, float __pyx_v_dof, long __pyx_v_skip_num_points) {
+ float __pyx_v_C;
+ PyObject *__pyx_v_n = NULL;
+ PyObject *__pyx_v_left_edge = NULL;
+ CYTHON_UNUSED PyObject *__pyx_v_right_edge = NULL;
+ PyObject *__pyx_v_width = NULL;
+ PyObject *__pyx_v_m = NULL;
+ struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Tree *__pyx_v_qt;
+ int __pyx_v_err;
+ PyObject *__pyx_v_sum_Q = NULL;
+ long __pyx_v_count;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *(*__pyx_t_6)(PyObject *);
+ int __pyx_t_7;
+ __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ float __pyx_t_10;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("gradient", 0);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":730
+ * # up in-place
+ * cdef float C
+ * n = pos_output.shape[0] # <<<<<<<<<<<<<<
+ * left_edge, right_edge, width = calculate_edge(pos_output)
+ * assert width.itemsize == 4
+ */
+ __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_pos_output.shape[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_v_n = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":731
+ * cdef float C
+ * n = pos_output.shape[0]
+ * left_edge, right_edge, width = calculate_edge(pos_output) # <<<<<<<<<<<<<<
+ * assert width.itemsize == 4
+ * assert pij_input.itemsize == 4
+ */
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_calculate_edge); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_pos_output, 2, (PyObject *(*)(char *)) __pyx_memview_get_float, (int (*)(char *, PyObject *)) __pyx_memview_set_float, 0);; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
+ if (likely(__pyx_t_4)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+ __Pyx_INCREF(__pyx_t_4);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_2, function);
+ }
+ }
+ if (!__pyx_t_4) {
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else {
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
+ PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
+ PyObject* sequence = __pyx_t_1;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ Py_ssize_t size = Py_SIZE(sequence);
+ #else
+ Py_ssize_t size = PySequence_Size(sequence);
+ #endif
+ if (unlikely(size != 3)) {
+ if (size > 3) __Pyx_RaiseTooManyValuesError(3);
+ else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ #if CYTHON_COMPILING_IN_CPYTHON
+ if (likely(PyTuple_CheckExact(sequence))) {
+ __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
+ __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
+ __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2);
+ } else {
+ __pyx_t_2 = PyList_GET_ITEM(sequence, 0);
+ __pyx_t_5 = PyList_GET_ITEM(sequence, 1);
+ __pyx_t_3 = PyList_GET_ITEM(sequence, 2);
+ }
+ __Pyx_INCREF(__pyx_t_2);
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_INCREF(__pyx_t_3);
+ #else
+ __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_3 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ #endif
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else {
+ Py_ssize_t index = -1;
+ __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
+ index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
+ __Pyx_GOTREF(__pyx_t_2);
+ index = 1; __pyx_t_5 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_5)) goto __pyx_L3_unpacking_failed;
+ __Pyx_GOTREF(__pyx_t_5);
+ index = 2; __pyx_t_3 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
+ __Pyx_GOTREF(__pyx_t_3);
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_4), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = NULL;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ goto __pyx_L4_unpacking_done;
+ __pyx_L3_unpacking_failed:;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_6 = NULL;
+ if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_L4_unpacking_done:;
+ }
+ __pyx_v_left_edge = __pyx_t_2;
+ __pyx_t_2 = 0;
+ __pyx_v_right_edge = __pyx_t_5;
+ __pyx_t_5 = 0;
+ __pyx_v_width = __pyx_t_3;
+ __pyx_t_3 = 0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":732
+ * n = pos_output.shape[0]
+ * left_edge, right_edge, width = calculate_edge(pos_output)
+ * assert width.itemsize == 4 # <<<<<<<<<<<<<<
+ * assert pij_input.itemsize == 4
+ * assert pos_output.itemsize == 4
+ */
+ #ifndef CYTHON_WITHOUT_ASSERTIONS
+ if (unlikely(!Py_OptimizeFlag)) {
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_width, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_int_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (unlikely(!__pyx_t_7)) {
+ PyErr_SetNone(PyExc_AssertionError);
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ }
+ #endif
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":733
+ * left_edge, right_edge, width = calculate_edge(pos_output)
+ * assert width.itemsize == 4
+ * assert pij_input.itemsize == 4 # <<<<<<<<<<<<<<
+ * assert pos_output.itemsize == 4
+ * assert forces.itemsize == 4
+ */
+ #ifndef CYTHON_WITHOUT_ASSERTIONS
+ if (unlikely(!Py_OptimizeFlag)) {
+ __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_pij_input, 2, (PyObject *(*)(char *)) __pyx_memview_get_float, (int (*)(char *, PyObject *)) __pyx_memview_set_float, 0);; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_int_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (unlikely(!__pyx_t_7)) {
+ PyErr_SetNone(PyExc_AssertionError);
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ }
+ #endif
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":734
+ * assert width.itemsize == 4
+ * assert pij_input.itemsize == 4
+ * assert pos_output.itemsize == 4 # <<<<<<<<<<<<<<
+ * assert forces.itemsize == 4
+ * m = "Number of neighbors must be < # of points - 1"
+ */
+ #ifndef CYTHON_WITHOUT_ASSERTIONS
+ if (unlikely(!Py_OptimizeFlag)) {
+ __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_pos_output, 2, (PyObject *(*)(char *)) __pyx_memview_get_float, (int (*)(char *, PyObject *)) __pyx_memview_set_float, 0);; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_int_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (unlikely(!__pyx_t_7)) {
+ PyErr_SetNone(PyExc_AssertionError);
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ }
+ #endif
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":735
+ * assert pij_input.itemsize == 4
+ * assert pos_output.itemsize == 4
+ * assert forces.itemsize == 4 # <<<<<<<<<<<<<<
+ * m = "Number of neighbors must be < # of points - 1"
+ * assert n - 1 >= neighbors.shape[1], m
+ */
+ #ifndef CYTHON_WITHOUT_ASSERTIONS
+ if (unlikely(!Py_OptimizeFlag)) {
+ __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_forces, 2, (PyObject *(*)(char *)) __pyx_memview_get_float, (int (*)(char *, PyObject *)) __pyx_memview_set_float, 0);; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_int_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (unlikely(!__pyx_t_7)) {
+ PyErr_SetNone(PyExc_AssertionError);
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ }
+ #endif
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":736
+ * assert pos_output.itemsize == 4
+ * assert forces.itemsize == 4
+ * m = "Number of neighbors must be < # of points - 1" # <<<<<<<<<<<<<<
+ * assert n - 1 >= neighbors.shape[1], m
+ * m = "neighbors array and pos_output shapes are incompatible"
+ */
+ __Pyx_INCREF(__pyx_kp_s_Number_of_neighbors_must_be_of_p);
+ __pyx_v_m = __pyx_kp_s_Number_of_neighbors_must_be_of_p;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":737
+ * assert forces.itemsize == 4
+ * m = "Number of neighbors must be < # of points - 1"
+ * assert n - 1 >= neighbors.shape[1], m # <<<<<<<<<<<<<<
+ * m = "neighbors array and pos_output shapes are incompatible"
+ * assert n == neighbors.shape[0], m
+ */
+ #ifndef CYTHON_WITHOUT_ASSERTIONS
+ if (unlikely(!Py_OptimizeFlag)) {
+ __pyx_t_3 = PyNumber_Subtract(__pyx_v_n, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_neighbors.shape[1])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ if (unlikely(!__pyx_t_7)) {
+ __pyx_t_5 = PyTuple_Pack(1, __pyx_v_m); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ PyErr_SetObject(PyExc_AssertionError, __pyx_t_5);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ }
+ #endif
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":738
+ * m = "Number of neighbors must be < # of points - 1"
+ * assert n - 1 >= neighbors.shape[1], m
+ * m = "neighbors array and pos_output shapes are incompatible" # <<<<<<<<<<<<<<
+ * assert n == neighbors.shape[0], m
+ * m = "Forces array and pos_output shapes are incompatible"
+ */
+ __Pyx_INCREF(__pyx_kp_s_neighbors_array_and_pos_output_s);
+ __Pyx_DECREF_SET(__pyx_v_m, __pyx_kp_s_neighbors_array_and_pos_output_s);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":739
+ * assert n - 1 >= neighbors.shape[1], m
+ * m = "neighbors array and pos_output shapes are incompatible"
+ * assert n == neighbors.shape[0], m # <<<<<<<<<<<<<<
+ * m = "Forces array and pos_output shapes are incompatible"
+ * assert n == forces.shape[0], m
+ */
+ #ifndef CYTHON_WITHOUT_ASSERTIONS
+ if (unlikely(!Py_OptimizeFlag)) {
+ __pyx_t_5 = PyInt_FromSsize_t((__pyx_v_neighbors.shape[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_1 = PyObject_RichCompare(__pyx_v_n, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ if (unlikely(!__pyx_t_7)) {
+ __pyx_t_1 = PyTuple_Pack(1, __pyx_v_m); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ PyErr_SetObject(PyExc_AssertionError, __pyx_t_1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ }
+ #endif
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":740
+ * m = "neighbors array and pos_output shapes are incompatible"
+ * assert n == neighbors.shape[0], m
+ * m = "Forces array and pos_output shapes are incompatible" # <<<<<<<<<<<<<<
+ * assert n == forces.shape[0], m
+ * m = "Pij and pos_output shapes are incompatible"
+ */
+ __Pyx_INCREF(__pyx_kp_s_Forces_array_and_pos_output_shap);
+ __Pyx_DECREF_SET(__pyx_v_m, __pyx_kp_s_Forces_array_and_pos_output_shap);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":741
+ * assert n == neighbors.shape[0], m
+ * m = "Forces array and pos_output shapes are incompatible"
+ * assert n == forces.shape[0], m # <<<<<<<<<<<<<<
+ * m = "Pij and pos_output shapes are incompatible"
+ * assert n == pij_input.shape[0], m
+ */
+ #ifndef CYTHON_WITHOUT_ASSERTIONS
+ if (unlikely(!Py_OptimizeFlag)) {
+ __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_forces.shape[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_5 = PyObject_RichCompare(__pyx_v_n, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ if (unlikely(!__pyx_t_7)) {
+ __pyx_t_5 = PyTuple_Pack(1, __pyx_v_m); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ PyErr_SetObject(PyExc_AssertionError, __pyx_t_5);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ }
+ #endif
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":742
+ * m = "Forces array and pos_output shapes are incompatible"
+ * assert n == forces.shape[0], m
+ * m = "Pij and pos_output shapes are incompatible" # <<<<<<<<<<<<<<
+ * assert n == pij_input.shape[0], m
+ * m = "Pij and pos_output shapes are incompatible"
+ */
+ __Pyx_INCREF(__pyx_kp_s_Pij_and_pos_output_shapes_are_in);
+ __Pyx_DECREF_SET(__pyx_v_m, __pyx_kp_s_Pij_and_pos_output_shapes_are_in);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":743
+ * assert n == forces.shape[0], m
+ * m = "Pij and pos_output shapes are incompatible"
+ * assert n == pij_input.shape[0], m # <<<<<<<<<<<<<<
+ * m = "Pij and pos_output shapes are incompatible"
+ * assert n == pij_input.shape[1], m
+ */
+ #ifndef CYTHON_WITHOUT_ASSERTIONS
+ if (unlikely(!Py_OptimizeFlag)) {
+ __pyx_t_5 = PyInt_FromSsize_t((__pyx_v_pij_input.shape[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_1 = PyObject_RichCompare(__pyx_v_n, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ if (unlikely(!__pyx_t_7)) {
+ __pyx_t_1 = PyTuple_Pack(1, __pyx_v_m); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ PyErr_SetObject(PyExc_AssertionError, __pyx_t_1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ }
+ #endif
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":744
+ * m = "Pij and pos_output shapes are incompatible"
+ * assert n == pij_input.shape[0], m
+ * m = "Pij and pos_output shapes are incompatible" # <<<<<<<<<<<<<<
+ * assert n == pij_input.shape[1], m
+ * if verbose > 10:
+ */
+ __Pyx_INCREF(__pyx_kp_s_Pij_and_pos_output_shapes_are_in);
+ __Pyx_DECREF_SET(__pyx_v_m, __pyx_kp_s_Pij_and_pos_output_shapes_are_in);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":745
+ * assert n == pij_input.shape[0], m
+ * m = "Pij and pos_output shapes are incompatible"
+ * assert n == pij_input.shape[1], m # <<<<<<<<<<<<<<
+ * if verbose > 10:
+ * printf("[t-SNE] Initializing tree of n_dimensions %i\n", n_dimensions)
+ */
+ #ifndef CYTHON_WITHOUT_ASSERTIONS
+ if (unlikely(!Py_OptimizeFlag)) {
+ __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_pij_input.shape[1])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_5 = PyObject_RichCompare(__pyx_v_n, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ if (unlikely(!__pyx_t_7)) {
+ __pyx_t_5 = PyTuple_Pack(1, __pyx_v_m); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ PyErr_SetObject(PyExc_AssertionError, __pyx_t_5);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ }
+ #endif
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":746
+ * m = "Pij and pos_output shapes are incompatible"
+ * assert n == pij_input.shape[1], m
+ * if verbose > 10: # <<<<<<<<<<<<<<
+ * printf("[t-SNE] Initializing tree of n_dimensions %i\n", n_dimensions)
+ * cdef Tree* qt = init_tree(left_edge, width, n_dimensions, verbose)
+ */
+ __pyx_t_7 = ((__pyx_v_verbose > 10) != 0);
+ if (__pyx_t_7) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":747
+ * assert n == pij_input.shape[1], m
+ * if verbose > 10:
+ * printf("[t-SNE] Initializing tree of n_dimensions %i\n", n_dimensions) # <<<<<<<<<<<<<<
+ * cdef Tree* qt = init_tree(left_edge, width, n_dimensions, verbose)
+ * if verbose > 10:
+ */
+ printf(__pyx_k_t_SNE_Initializing_tree_of_n_di, __pyx_v_n_dimensions);
+ goto __pyx_L5;
+ }
+ __pyx_L5:;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":748
+ * if verbose > 10:
+ * printf("[t-SNE] Initializing tree of n_dimensions %i\n", n_dimensions)
+ * cdef Tree* qt = init_tree(left_edge, width, n_dimensions, verbose) # <<<<<<<<<<<<<<
+ * if verbose > 10:
+ * printf("[t-SNE] Inserting %i points\n", pos_output.shape[0])
+ */
+ __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_left_edge);
+ if (unlikely(!__pyx_t_8.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_width);
+ if (unlikely(!__pyx_t_9.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_qt = __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_init_tree(__pyx_t_8, __pyx_t_9, __pyx_v_n_dimensions, __pyx_v_verbose);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":749
+ * printf("[t-SNE] Initializing tree of n_dimensions %i\n", n_dimensions)
+ * cdef Tree* qt = init_tree(left_edge, width, n_dimensions, verbose)
+ * if verbose > 10: # <<<<<<<<<<<<<<
+ * printf("[t-SNE] Inserting %i points\n", pos_output.shape[0])
+ * err = insert_many(qt, pos_output)
+ */
+ __pyx_t_7 = ((__pyx_v_verbose > 10) != 0);
+ if (__pyx_t_7) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":750
+ * cdef Tree* qt = init_tree(left_edge, width, n_dimensions, verbose)
+ * if verbose > 10:
+ * printf("[t-SNE] Inserting %i points\n", pos_output.shape[0]) # <<<<<<<<<<<<<<
+ * err = insert_many(qt, pos_output)
+ * assert err == 0, "[t-SNE] Insertion failed"
+ */
+ printf(__pyx_k_t_SNE_Inserting_i_points, (__pyx_v_pos_output.shape[0]));
+ goto __pyx_L6;
+ }
+ __pyx_L6:;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":751
+ * if verbose > 10:
+ * printf("[t-SNE] Inserting %i points\n", pos_output.shape[0])
+ * err = insert_many(qt, pos_output) # <<<<<<<<<<<<<<
+ * assert err == 0, "[t-SNE] Insertion failed"
+ * if verbose > 10:
+ */
+ __pyx_v_err = __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_insert_many(__pyx_v_qt, __pyx_v_pos_output);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":752
+ * printf("[t-SNE] Inserting %i points\n", pos_output.shape[0])
+ * err = insert_many(qt, pos_output)
+ * assert err == 0, "[t-SNE] Insertion failed" # <<<<<<<<<<<<<<
+ * if verbose > 10:
+ * printf("[t-SNE] Computing gradient\n")
+ */
+ #ifndef CYTHON_WITHOUT_ASSERTIONS
+ if (unlikely(!Py_OptimizeFlag)) {
+ if (unlikely(!((__pyx_v_err == 0) != 0))) {
+ PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_t_SNE_Insertion_failed);
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ }
+ #endif
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":753
+ * err = insert_many(qt, pos_output)
+ * assert err == 0, "[t-SNE] Insertion failed"
+ * if verbose > 10: # <<<<<<<<<<<<<<
+ * printf("[t-SNE] Computing gradient\n")
+ * sum_Q = compute_gradient(pij_input, pos_output, neighbors, forces,
+ */
+ __pyx_t_7 = ((__pyx_v_verbose > 10) != 0);
+ if (__pyx_t_7) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":754
+ * assert err == 0, "[t-SNE] Insertion failed"
+ * if verbose > 10:
+ * printf("[t-SNE] Computing gradient\n") # <<<<<<<<<<<<<<
+ * sum_Q = compute_gradient(pij_input, pos_output, neighbors, forces,
+ * qt.root_node, theta, dof, skip_num_points, -1)
+ */
+ printf(__pyx_k_t_SNE_Computing_gradient);
+ goto __pyx_L7;
+ }
+ __pyx_L7:;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":755
+ * if verbose > 10:
+ * printf("[t-SNE] Computing gradient\n")
+ * sum_Q = compute_gradient(pij_input, pos_output, neighbors, forces, # <<<<<<<<<<<<<<
+ * qt.root_node, theta, dof, skip_num_points, -1)
+ * C = compute_error(pij_input, pos_output, neighbors, sum_Q, n_dimensions,
+ */
+ __pyx_t_5 = PyFloat_FromDouble(__pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_compute_gradient(__pyx_v_pij_input, __pyx_v_pos_output, __pyx_v_neighbors, __pyx_v_forces, __pyx_v_qt->root_node, __pyx_v_theta, __pyx_v_dof, __pyx_v_skip_num_points, -1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_v_sum_Q = __pyx_t_5;
+ __pyx_t_5 = 0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":757
+ * sum_Q = compute_gradient(pij_input, pos_output, neighbors, forces,
+ * qt.root_node, theta, dof, skip_num_points, -1)
+ * C = compute_error(pij_input, pos_output, neighbors, sum_Q, n_dimensions, # <<<<<<<<<<<<<<
+ * verbose)
+ * if verbose > 10:
+ */
+ __pyx_t_10 = __pyx_PyFloat_AsFloat(__pyx_v_sum_Q); if (unlikely((__pyx_t_10 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":758
+ * qt.root_node, theta, dof, skip_num_points, -1)
+ * C = compute_error(pij_input, pos_output, neighbors, sum_Q, n_dimensions,
+ * verbose) # <<<<<<<<<<<<<<
+ * if verbose > 10:
+ * printf("[t-SNE] Checking tree consistency \n")
+ */
+ __pyx_v_C = __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_compute_error(__pyx_v_pij_input, __pyx_v_pos_output, __pyx_v_neighbors, __pyx_t_10, __pyx_v_n_dimensions, __pyx_v_verbose);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":759
+ * C = compute_error(pij_input, pos_output, neighbors, sum_Q, n_dimensions,
+ * verbose)
+ * if verbose > 10: # <<<<<<<<<<<<<<
+ * printf("[t-SNE] Checking tree consistency \n")
+ * cdef long count = count_points(qt.root_node, 0)
+ */
+ __pyx_t_7 = ((__pyx_v_verbose > 10) != 0);
+ if (__pyx_t_7) {
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":760
+ * verbose)
+ * if verbose > 10:
+ * printf("[t-SNE] Checking tree consistency \n") # <<<<<<<<<<<<<<
+ * cdef long count = count_points(qt.root_node, 0)
+ * m = ("Tree consistency failed: unexpected number of points=%i "
+ */
+ printf(__pyx_k_t_SNE_Checking_tree_consistency);
+ goto __pyx_L8;
+ }
+ __pyx_L8:;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":761
+ * if verbose > 10:
+ * printf("[t-SNE] Checking tree consistency \n")
+ * cdef long count = count_points(qt.root_node, 0) # <<<<<<<<<<<<<<
+ * m = ("Tree consistency failed: unexpected number of points=%i "
+ * "at root node=%i" % (count, qt.root_node.cumulative_size))
+ */
+ __pyx_v_count = __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_count_points(__pyx_v_qt->root_node, 0);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":763
+ * cdef long count = count_points(qt.root_node, 0)
+ * m = ("Tree consistency failed: unexpected number of points=%i "
+ * "at root node=%i" % (count, qt.root_node.cumulative_size)) # <<<<<<<<<<<<<<
+ * assert count == qt.root_node.cumulative_size, m
+ * m = "Tree consistency failed: unexpected number of points on the tree"
+ */
+ __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_v_count); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_qt->root_node->cumulative_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_5 = 0;
+ __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Tree_consistency_failed_unexpect, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF_SET(__pyx_v_m, __pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":764
+ * m = ("Tree consistency failed: unexpected number of points=%i "
+ * "at root node=%i" % (count, qt.root_node.cumulative_size))
+ * assert count == qt.root_node.cumulative_size, m # <<<<<<<<<<<<<<
+ * m = "Tree consistency failed: unexpected number of points on the tree"
+ * assert count == qt.n_points, m
+ */
+ #ifndef CYTHON_WITHOUT_ASSERTIONS
+ if (unlikely(!Py_OptimizeFlag)) {
+ if (unlikely(!((__pyx_v_count == __pyx_v_qt->root_node->cumulative_size) != 0))) {
+ __pyx_t_1 = PyTuple_Pack(1, __pyx_v_m); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ PyErr_SetObject(PyExc_AssertionError, __pyx_t_1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ }
+ #endif
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":765
+ * "at root node=%i" % (count, qt.root_node.cumulative_size))
+ * assert count == qt.root_node.cumulative_size, m
+ * m = "Tree consistency failed: unexpected number of points on the tree" # <<<<<<<<<<<<<<
+ * assert count == qt.n_points, m
+ * free_tree(qt)
+ */
+ __Pyx_INCREF(__pyx_kp_s_Tree_consistency_failed_unexpect_2);
+ __Pyx_DECREF_SET(__pyx_v_m, __pyx_kp_s_Tree_consistency_failed_unexpect_2);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":766
+ * assert count == qt.root_node.cumulative_size, m
+ * m = "Tree consistency failed: unexpected number of points on the tree"
+ * assert count == qt.n_points, m # <<<<<<<<<<<<<<
+ * free_tree(qt)
+ * return C
+ */
+ #ifndef CYTHON_WITHOUT_ASSERTIONS
+ if (unlikely(!Py_OptimizeFlag)) {
+ if (unlikely(!((__pyx_v_count == __pyx_v_qt->n_points) != 0))) {
+ __pyx_t_1 = PyTuple_Pack(1, __pyx_v_m); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ PyErr_SetObject(PyExc_AssertionError, __pyx_t_1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ }
+ #endif
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":767
+ * m = "Tree consistency failed: unexpected number of points on the tree"
+ * assert count == qt.n_points, m
+ * free_tree(qt) # <<<<<<<<<<<<<<
+ * return C
+ *
+ */
+ __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_free_tree(__pyx_v_qt);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":768
+ * assert count == qt.n_points, m
+ * free_tree(qt)
+ * return C # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = PyFloat_FromDouble(__pyx_v_C); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":717
+ * return left_edge, right_edge, width
+ *
+ * def gradient(float[:,:] pij_input, # <<<<<<<<<<<<<<
+ * float[:,:] pos_output,
+ * long[:,:] neighbors,
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
+ __Pyx_AddTraceback("sklearn.manifold._barnes_hut_tsne.gradient", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_n);
+ __Pyx_XDECREF(__pyx_v_left_edge);
+ __Pyx_XDECREF(__pyx_v_right_edge);
+ __Pyx_XDECREF(__pyx_v_width);
+ __Pyx_XDECREF(__pyx_v_m);
+ __Pyx_XDECREF(__pyx_v_sum_Q);
+ __PYX_XDEC_MEMVIEW(&__pyx_v_pij_input, 1);
+ __PYX_XDEC_MEMVIEW(&__pyx_v_pos_output, 1);
+ __PYX_XDEC_MEMVIEW(&__pyx_v_neighbors, 1);
+ __PYX_XDEC_MEMVIEW(&__pyx_v_forces, 1);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "sklearn/manifold/_barnes_hut_tsne.pyx":772
+ *
+ * # Helper functions
+ * def check_quadtree(X, long[:] counts): # <<<<<<<<<<<<<<
+ * """
+ * Helper function to access quadtree functions for testing
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7sklearn_8manifold_16_barnes_hut_tsne_5check_quadtree(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_7sklearn_8manifold_16_barnes_hut_tsne_4check_quadtree[] = "\n Helper function to access quadtree functions for testing\n ";
+static PyMethodDef __pyx_mdef_7sklearn_8manifold_16_barnes_hut_tsne_5check_quadtree = {"check_quadtree", (PyCFunction)__pyx_pw_7sklearn_8manifold_16_barnes_hut_tsne_5check_quadtree, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7sklearn_8manifold_16_barnes_hut_tsne_4check_quadtree};
+static PyObject *__pyx_pw_7sklearn_8manifold_16_barnes_hut_tsne_5check_quadtree(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_X = 0;
+ __Pyx_memviewslice __pyx_v_counts = { 0, 0, { 0 }, { 0 }, { 0 } };
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("check_quadtree (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_X,&__pyx_n_s_counts,0};
+ PyObject* values[2] = {0,0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_X)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_counts)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("check_quadtree", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "check_quadtree") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
+ goto __pyx_L5_argtuple_error;
+ } else {
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ }
+ __pyx_v_X = values[0];
+ __pyx_v_counts = __Pyx_PyObject_to_MemoryviewSlice_ds_long(values[1]); if (unlikely(!__pyx_v_counts.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("check_quadtree", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("sklearn.manifold._barnes_hut_tsne.check_quadtree", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_7sklearn_8manifold_16_barnes_hut_tsne_4check_quadtree(__pyx_self, __pyx_v_X, __pyx_v_counts);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_7sklearn_8manifold_16_barnes_hut_tsne_4check_quadtree(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_X, __Pyx_memviewslice __pyx_v_counts) {
+ PyObject *__pyx_v_left_edge = NULL;
+ CYTHON_UNUSED PyObject *__pyx_v_right_edge = NULL;
+ PyObject *__pyx_v_width = NULL;
+ struct __pyx_t_7sklearn_8manifold_16_barnes_hut_tsne_Tree *__pyx_v_qt;
+ long __pyx_v_count;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *(*__pyx_t_6)(PyObject *);
+ __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ Py_ssize_t __pyx_t_10;
+ long __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
+ Py_ssize_t __pyx_t_13;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("check_quadtree", 0);
+ __Pyx_INCREF(__pyx_v_X);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":777
+ * """
+ *
+ * X = X.astype(np.float32) # <<<<<<<<<<<<<<
+ * left_edge, right_edge, width = calculate_edge(X)
+ * # Initialise a tree
+ */
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
+ __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+ if (likely(__pyx_t_3)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+ __Pyx_INCREF(__pyx_t_3);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_2, function);
+ }
+ }
+ if (!__pyx_t_3) {
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else {
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
+ PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF_SET(__pyx_v_X, __pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":778
+ *
+ * X = X.astype(np.float32)
+ * left_edge, right_edge, width = calculate_edge(X) # <<<<<<<<<<<<<<
+ * # Initialise a tree
+ * qt = init_tree(left_edge, width, 2, 2)
+ */
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_calculate_edge); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_5 = NULL;
+ if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
+ if (likely(__pyx_t_5)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_2, function);
+ }
+ }
+ if (!__pyx_t_5) {
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_X); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ } else {
+ __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
+ __Pyx_INCREF(__pyx_v_X);
+ PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_X);
+ __Pyx_GIVEREF(__pyx_v_X);
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
+ PyObject* sequence = __pyx_t_1;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ Py_ssize_t size = Py_SIZE(sequence);
+ #else
+ Py_ssize_t size = PySequence_Size(sequence);
+ #endif
+ if (unlikely(size != 3)) {
+ if (size > 3) __Pyx_RaiseTooManyValuesError(3);
+ else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ #if CYTHON_COMPILING_IN_CPYTHON
+ if (likely(PyTuple_CheckExact(sequence))) {
+ __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
+ __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
+ __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
+ } else {
+ __pyx_t_2 = PyList_GET_ITEM(sequence, 0);
+ __pyx_t_4 = PyList_GET_ITEM(sequence, 1);
+ __pyx_t_5 = PyList_GET_ITEM(sequence, 2);
+ }
+ __Pyx_INCREF(__pyx_t_2);
+ __Pyx_INCREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_5);
+ #else
+ __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ #endif
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else {
+ Py_ssize_t index = -1;
+ __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext;
+ index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
+ __Pyx_GOTREF(__pyx_t_2);
+ index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
+ __Pyx_GOTREF(__pyx_t_4);
+ index = 2; __pyx_t_5 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_5)) goto __pyx_L3_unpacking_failed;
+ __Pyx_GOTREF(__pyx_t_5);
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_3), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = NULL;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ goto __pyx_L4_unpacking_done;
+ __pyx_L3_unpacking_failed:;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_6 = NULL;
+ if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_L4_unpacking_done:;
+ }
+ __pyx_v_left_edge = __pyx_t_2;
+ __pyx_t_2 = 0;
+ __pyx_v_right_edge = __pyx_t_4;
+ __pyx_t_4 = 0;
+ __pyx_v_width = __pyx_t_5;
+ __pyx_t_5 = 0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":780
+ * left_edge, right_edge, width = calculate_edge(X)
+ * # Initialise a tree
+ * qt = init_tree(left_edge, width, 2, 2) # <<<<<<<<<<<<<<
+ * # Insert data into the tree
+ * insert_many(qt, X)
+ */
+ __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_left_edge);
+ if (unlikely(!__pyx_t_7.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_width);
+ if (unlikely(!__pyx_t_8.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_qt = __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_init_tree(__pyx_t_7, __pyx_t_8, 2, 2);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":782
+ * qt = init_tree(left_edge, width, 2, 2)
+ * # Insert data into the tree
+ * insert_many(qt, X) # <<<<<<<<<<<<<<
+ *
+ * cdef long count = count_points(qt.root_node, 0)
+ */
+ __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(__pyx_v_X);
+ if (unlikely(!__pyx_t_9.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_insert_many(__pyx_v_qt, __pyx_t_9);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":784
+ * insert_many(qt, X)
+ *
+ * cdef long count = count_points(qt.root_node, 0) # <<<<<<<<<<<<<<
+ * counts[0] = count
+ * counts[1] = qt.root_node.cumulative_size
+ */
+ __pyx_v_count = __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_count_points(__pyx_v_qt->root_node, 0);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":785
+ *
+ * cdef long count = count_points(qt.root_node, 0)
+ * counts[0] = count # <<<<<<<<<<<<<<
+ * counts[1] = qt.root_node.cumulative_size
+ * counts[2] = qt.n_points
+ */
+ __pyx_t_10 = 0;
+ *((long *) ( /* dim=0 */ (__pyx_v_counts.data + __pyx_t_10 * __pyx_v_counts.strides[0]) )) = __pyx_v_count;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":786
+ * cdef long count = count_points(qt.root_node, 0)
+ * counts[0] = count
+ * counts[1] = qt.root_node.cumulative_size # <<<<<<<<<<<<<<
+ * counts[2] = qt.n_points
+ * free_tree(qt)
+ */
+ __pyx_t_11 = __pyx_v_qt->root_node->cumulative_size;
+ __pyx_t_12 = 1;
+ *((long *) ( /* dim=0 */ (__pyx_v_counts.data + __pyx_t_12 * __pyx_v_counts.strides[0]) )) = __pyx_t_11;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":787
+ * counts[0] = count
+ * counts[1] = qt.root_node.cumulative_size
+ * counts[2] = qt.n_points # <<<<<<<<<<<<<<
+ * free_tree(qt)
+ * return counts
+ */
+ __pyx_t_11 = __pyx_v_qt->n_points;
+ __pyx_t_13 = 2;
+ *((long *) ( /* dim=0 */ (__pyx_v_counts.data + __pyx_t_13 * __pyx_v_counts.strides[0]) )) = __pyx_t_11;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":788
+ * counts[1] = qt.root_node.cumulative_size
+ * counts[2] = qt.n_points
+ * free_tree(qt) # <<<<<<<<<<<<<<
+ * return counts
+ *
+ */
+ __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_free_tree(__pyx_v_qt);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":789
+ * counts[2] = qt.n_points
+ * free_tree(qt)
+ * return counts # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_counts, 1, (PyObject *(*)(char *)) __pyx_memview_get_long, (int (*)(char *, PyObject *)) __pyx_memview_set_long, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":772
+ *
+ * # Helper functions
+ * def check_quadtree(X, long[:] counts): # <<<<<<<<<<<<<<
+ * """
+ * Helper function to access quadtree functions for testing
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
+ __Pyx_AddTraceback("sklearn.manifold._barnes_hut_tsne.check_quadtree", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_left_edge);
+ __Pyx_XDECREF(__pyx_v_right_edge);
+ __Pyx_XDECREF(__pyx_v_width);
+ __Pyx_XDECREF(__pyx_v_X);
+ __PYX_XDEC_MEMVIEW(&__pyx_v_counts, 1);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "sklearn/manifold/_barnes_hut_tsne.pyx":792
+ *
+ *
+ * cdef int helper_test_index2offset(int* check, int index, int n_dimensions): # <<<<<<<<<<<<<<
+ * cdef int* offset = malloc(sizeof(int) * n_dimensions)
+ * cdef int error_check = 1
+ */
+
+static int __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_helper_test_index2offset(int *__pyx_v_check, int __pyx_v_index, int __pyx_v_n_dimensions) {
+ int *__pyx_v_offset;
+ int __pyx_v_error_check;
+ int __pyx_v_i;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ __Pyx_RefNannySetupContext("helper_test_index2offset", 0);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":793
+ *
+ * cdef int helper_test_index2offset(int* check, int index, int n_dimensions):
+ * cdef int* offset = malloc(sizeof(int) * n_dimensions) # <<<<<<<<<<<<<<
+ * cdef int error_check = 1
+ * for i in range(n_dimensions):
+ */
+ __pyx_v_offset = ((int *)malloc(((sizeof(int)) * __pyx_v_n_dimensions)));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":794
+ * cdef int helper_test_index2offset(int* check, int index, int n_dimensions):
+ * cdef int* offset = malloc(sizeof(int) * n_dimensions)
+ * cdef int error_check = 1 # <<<<<<<<<<<<<<
+ * for i in range(n_dimensions):
+ * offset[i] = 0
+ */
+ __pyx_v_error_check = 1;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":795
+ * cdef int* offset = malloc(sizeof(int) * n_dimensions)
+ * cdef int error_check = 1
+ * for i in range(n_dimensions): # <<<<<<<<<<<<<<
+ * offset[i] = 0
+ * index2offset(offset, index, n_dimensions)
+ */
+ __pyx_t_1 = __pyx_v_n_dimensions;
+ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
+ __pyx_v_i = __pyx_t_2;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":796
+ * cdef int error_check = 1
+ * for i in range(n_dimensions):
+ * offset[i] = 0 # <<<<<<<<<<<<<<
+ * index2offset(offset, index, n_dimensions)
+ * for i in range(n_dimensions):
+ */
+ (__pyx_v_offset[__pyx_v_i]) = 0;
+ }
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":797
+ * for i in range(n_dimensions):
+ * offset[i] = 0
+ * index2offset(offset, index, n_dimensions) # <<<<<<<<<<<<<<
+ * for i in range(n_dimensions):
+ * error_check &= offset[i] == check[i]
+ */
+ __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_index2offset(__pyx_v_offset, __pyx_v_index, __pyx_v_n_dimensions);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":798
+ * offset[i] = 0
+ * index2offset(offset, index, n_dimensions)
+ * for i in range(n_dimensions): # <<<<<<<<<<<<<<
+ * error_check &= offset[i] == check[i]
+ * free(offset)
+ */
+ __pyx_t_1 = __pyx_v_n_dimensions;
+ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
+ __pyx_v_i = __pyx_t_2;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":799
+ * index2offset(offset, index, n_dimensions)
+ * for i in range(n_dimensions):
+ * error_check &= offset[i] == check[i] # <<<<<<<<<<<<<<
+ * free(offset)
+ * return error_check
+ */
+ __pyx_v_error_check = (__pyx_v_error_check & ((__pyx_v_offset[__pyx_v_i]) == (__pyx_v_check[__pyx_v_i])));
+ }
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":800
+ * for i in range(n_dimensions):
+ * error_check &= offset[i] == check[i]
+ * free(offset) # <<<<<<<<<<<<<<
+ * return error_check
+ *
+ */
+ free(__pyx_v_offset);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":801
+ * error_check &= offset[i] == check[i]
+ * free(offset)
+ * return error_check # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = __pyx_v_error_check;
+ goto __pyx_L0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":792
+ *
+ *
+ * cdef int helper_test_index2offset(int* check, int index, int n_dimensions): # <<<<<<<<<<<<<<
+ * cdef int* offset = malloc(sizeof(int) * n_dimensions)
+ * cdef int error_check = 1
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "sklearn/manifold/_barnes_hut_tsne.pyx":804
+ *
+ *
+ * def test_index2offset(): # <<<<<<<<<<<<<<
+ * ret = 1
+ * ret &= helper_test_index2offset([1, 0, 1], 5, 3) == 1
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7sklearn_8manifold_16_barnes_hut_tsne_7test_index2offset(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyMethodDef __pyx_mdef_7sklearn_8manifold_16_barnes_hut_tsne_7test_index2offset = {"test_index2offset", (PyCFunction)__pyx_pw_7sklearn_8manifold_16_barnes_hut_tsne_7test_index2offset, METH_NOARGS, 0};
+static PyObject *__pyx_pw_7sklearn_8manifold_16_barnes_hut_tsne_7test_index2offset(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("test_index2offset (wrapper)", 0);
+ __pyx_r = __pyx_pf_7sklearn_8manifold_16_barnes_hut_tsne_6test_index2offset(__pyx_self);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_7sklearn_8manifold_16_barnes_hut_tsne_6test_index2offset(CYTHON_UNUSED PyObject *__pyx_self) {
+ PyObject *__pyx_v_ret = NULL;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1[3];
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_t_4[3];
+ int __pyx_t_5[3];
+ int __pyx_t_6[3];
+ int __pyx_t_7[3];
+ int __pyx_t_8[3];
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("test_index2offset", 0);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":805
+ *
+ * def test_index2offset():
+ * ret = 1 # <<<<<<<<<<<<<<
+ * ret &= helper_test_index2offset([1, 0, 1], 5, 3) == 1
+ * ret &= helper_test_index2offset([0, 0, 0], 0, 3) == 1
+ */
+ __Pyx_INCREF(__pyx_int_1);
+ __pyx_v_ret = __pyx_int_1;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":806
+ * def test_index2offset():
+ * ret = 1
+ * ret &= helper_test_index2offset([1, 0, 1], 5, 3) == 1 # <<<<<<<<<<<<<<
+ * ret &= helper_test_index2offset([0, 0, 0], 0, 3) == 1
+ * ret &= helper_test_index2offset([0, 0, 1], 1, 3) == 1
+ */
+ __pyx_t_1[0] = 1;
+ __pyx_t_1[1] = 0;
+ __pyx_t_1[2] = 1;
+ __pyx_t_2 = __Pyx_PyBool_FromLong((__pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_helper_test_index2offset(__pyx_t_1, 5, 3) == 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyNumber_InPlaceAnd(__pyx_v_ret, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF_SET(__pyx_v_ret, __pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":807
+ * ret = 1
+ * ret &= helper_test_index2offset([1, 0, 1], 5, 3) == 1
+ * ret &= helper_test_index2offset([0, 0, 0], 0, 3) == 1 # <<<<<<<<<<<<<<
+ * ret &= helper_test_index2offset([0, 0, 1], 1, 3) == 1
+ * ret &= helper_test_index2offset([0, 1, 0], 2, 3) == 1
+ */
+ __pyx_t_4[0] = 0;
+ __pyx_t_4[1] = 0;
+ __pyx_t_4[2] = 0;
+ __pyx_t_3 = __Pyx_PyBool_FromLong((__pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_helper_test_index2offset(__pyx_t_4, 0, 3) == 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_2 = PyNumber_InPlaceAnd(__pyx_v_ret, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF_SET(__pyx_v_ret, __pyx_t_2);
+ __pyx_t_2 = 0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":808
+ * ret &= helper_test_index2offset([1, 0, 1], 5, 3) == 1
+ * ret &= helper_test_index2offset([0, 0, 0], 0, 3) == 1
+ * ret &= helper_test_index2offset([0, 0, 1], 1, 3) == 1 # <<<<<<<<<<<<<<
+ * ret &= helper_test_index2offset([0, 1, 0], 2, 3) == 1
+ * ret &= helper_test_index2offset([0, 1, 1], 3, 3) == 1
+ */
+ __pyx_t_5[0] = 0;
+ __pyx_t_5[1] = 0;
+ __pyx_t_5[2] = 1;
+ __pyx_t_2 = __Pyx_PyBool_FromLong((__pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_helper_test_index2offset(__pyx_t_5, 1, 3) == 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyNumber_InPlaceAnd(__pyx_v_ret, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF_SET(__pyx_v_ret, __pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":809
+ * ret &= helper_test_index2offset([0, 0, 0], 0, 3) == 1
+ * ret &= helper_test_index2offset([0, 0, 1], 1, 3) == 1
+ * ret &= helper_test_index2offset([0, 1, 0], 2, 3) == 1 # <<<<<<<<<<<<<<
+ * ret &= helper_test_index2offset([0, 1, 1], 3, 3) == 1
+ * ret &= helper_test_index2offset([1, 0, 0], 4, 3) == 1
+ */
+ __pyx_t_6[0] = 0;
+ __pyx_t_6[1] = 1;
+ __pyx_t_6[2] = 0;
+ __pyx_t_3 = __Pyx_PyBool_FromLong((__pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_helper_test_index2offset(__pyx_t_6, 2, 3) == 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_2 = PyNumber_InPlaceAnd(__pyx_v_ret, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF_SET(__pyx_v_ret, __pyx_t_2);
+ __pyx_t_2 = 0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":810
+ * ret &= helper_test_index2offset([0, 0, 1], 1, 3) == 1
+ * ret &= helper_test_index2offset([0, 1, 0], 2, 3) == 1
+ * ret &= helper_test_index2offset([0, 1, 1], 3, 3) == 1 # <<<<<<<<<<<<<<
+ * ret &= helper_test_index2offset([1, 0, 0], 4, 3) == 1
+ * return ret
+ */
+ __pyx_t_7[0] = 0;
+ __pyx_t_7[1] = 1;
+ __pyx_t_7[2] = 1;
+ __pyx_t_2 = __Pyx_PyBool_FromLong((__pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_helper_test_index2offset(__pyx_t_7, 3, 3) == 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyNumber_InPlaceAnd(__pyx_v_ret, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF_SET(__pyx_v_ret, __pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":811
+ * ret &= helper_test_index2offset([0, 1, 0], 2, 3) == 1
+ * ret &= helper_test_index2offset([0, 1, 1], 3, 3) == 1
+ * ret &= helper_test_index2offset([1, 0, 0], 4, 3) == 1 # <<<<<<<<<<<<<<
+ * return ret
+ *
+ */
+ __pyx_t_8[0] = 1;
+ __pyx_t_8[1] = 0;
+ __pyx_t_8[2] = 0;
+ __pyx_t_3 = __Pyx_PyBool_FromLong((__pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_helper_test_index2offset(__pyx_t_8, 4, 3) == 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_2 = PyNumber_InPlaceAnd(__pyx_v_ret, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF_SET(__pyx_v_ret, __pyx_t_2);
+ __pyx_t_2 = 0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":812
+ * ret &= helper_test_index2offset([0, 1, 1], 3, 3) == 1
+ * ret &= helper_test_index2offset([1, 0, 0], 4, 3) == 1
+ * return ret # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_ret);
+ __pyx_r = __pyx_v_ret;
+ goto __pyx_L0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":804
+ *
+ *
+ * def test_index2offset(): # <<<<<<<<<<<<<<
+ * ret = 1
+ * ret &= helper_test_index2offset([1, 0, 1], 5, 3) == 1
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("sklearn.manifold._barnes_hut_tsne.test_index2offset", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_ret);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "sklearn/manifold/_barnes_hut_tsne.pyx":815
+ *
+ *
+ * def test_index_offset(): # <<<<<<<<<<<<<<
+ * cdef int n_dimensions, idx, tidx, k
+ * cdef int error_check = 1
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7sklearn_8manifold_16_barnes_hut_tsne_9test_index_offset(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyMethodDef __pyx_mdef_7sklearn_8manifold_16_barnes_hut_tsne_9test_index_offset = {"test_index_offset", (PyCFunction)__pyx_pw_7sklearn_8manifold_16_barnes_hut_tsne_9test_index_offset, METH_NOARGS, 0};
+static PyObject *__pyx_pw_7sklearn_8manifold_16_barnes_hut_tsne_9test_index_offset(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("test_index_offset (wrapper)", 0);
+ __pyx_r = __pyx_pf_7sklearn_8manifold_16_barnes_hut_tsne_8test_index_offset(__pyx_self);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_7sklearn_8manifold_16_barnes_hut_tsne_8test_index_offset(CYTHON_UNUSED PyObject *__pyx_self) {
+ int __pyx_v_n_dimensions;
+ int __pyx_v_idx;
+ int __pyx_v_tidx;
+ int __pyx_v_k;
+ int __pyx_v_error_check;
+ int *__pyx_v_offset;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ long __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("test_index_offset", 0);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":817
+ * def test_index_offset():
+ * cdef int n_dimensions, idx, tidx, k
+ * cdef int error_check = 1 # <<<<<<<<<<<<<<
+ * cdef int* offset
+ * for n_dimensions in range(2, 10):
+ */
+ __pyx_v_error_check = 1;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":819
+ * cdef int error_check = 1
+ * cdef int* offset
+ * for n_dimensions in range(2, 10): # <<<<<<<<<<<<<<
+ * offset = malloc(sizeof(int) * n_dimensions)
+ * for k in range(n_dimensions):
+ */
+ for (__pyx_t_1 = 2; __pyx_t_1 < 10; __pyx_t_1+=1) {
+ __pyx_v_n_dimensions = __pyx_t_1;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":820
+ * cdef int* offset
+ * for n_dimensions in range(2, 10):
+ * offset = malloc(sizeof(int) * n_dimensions) # <<<<<<<<<<<<<<
+ * for k in range(n_dimensions):
+ * offset[k] = 0
+ */
+ __pyx_v_offset = ((int *)malloc(((sizeof(int)) * __pyx_v_n_dimensions)));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":821
+ * for n_dimensions in range(2, 10):
+ * offset = malloc(sizeof(int) * n_dimensions)
+ * for k in range(n_dimensions): # <<<<<<<<<<<<<<
+ * offset[k] = 0
+ * for idx in range(2 ** n_dimensions):
+ */
+ __pyx_t_2 = __pyx_v_n_dimensions;
+ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
+ __pyx_v_k = __pyx_t_3;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":822
+ * offset = malloc(sizeof(int) * n_dimensions)
+ * for k in range(n_dimensions):
+ * offset[k] = 0 # <<<<<<<<<<<<<<
+ * for idx in range(2 ** n_dimensions):
+ * index2offset(offset, idx, n_dimensions)
+ */
+ (__pyx_v_offset[__pyx_v_k]) = 0;
+ }
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":823
+ * for k in range(n_dimensions):
+ * offset[k] = 0
+ * for idx in range(2 ** n_dimensions): # <<<<<<<<<<<<<<
+ * index2offset(offset, idx, n_dimensions)
+ * tidx = offset2index(offset, n_dimensions)
+ */
+ __pyx_t_4 = __Pyx_pow_long(2, ((long)__pyx_v_n_dimensions));
+ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_4; __pyx_t_2+=1) {
+ __pyx_v_idx = __pyx_t_2;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":824
+ * offset[k] = 0
+ * for idx in range(2 ** n_dimensions):
+ * index2offset(offset, idx, n_dimensions) # <<<<<<<<<<<<<<
+ * tidx = offset2index(offset, n_dimensions)
+ * error_check &= tidx == idx
+ */
+ __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_index2offset(__pyx_v_offset, __pyx_v_idx, __pyx_v_n_dimensions);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":825
+ * for idx in range(2 ** n_dimensions):
+ * index2offset(offset, idx, n_dimensions)
+ * tidx = offset2index(offset, n_dimensions) # <<<<<<<<<<<<<<
+ * error_check &= tidx == idx
+ * assert error_check == 1
+ */
+ __pyx_v_tidx = __pyx_f_7sklearn_8manifold_16_barnes_hut_tsne_offset2index(__pyx_v_offset, __pyx_v_n_dimensions);
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":826
+ * index2offset(offset, idx, n_dimensions)
+ * tidx = offset2index(offset, n_dimensions)
+ * error_check &= tidx == idx # <<<<<<<<<<<<<<
+ * assert error_check == 1
+ * free(offset)
+ */
+ __pyx_v_error_check = (__pyx_v_error_check & (__pyx_v_tidx == __pyx_v_idx));
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":827
+ * tidx = offset2index(offset, n_dimensions)
+ * error_check &= tidx == idx
+ * assert error_check == 1 # <<<<<<<<<<<<<<
+ * free(offset)
+ * return error_check
+ */
+ #ifndef CYTHON_WITHOUT_ASSERTIONS
+ if (unlikely(!Py_OptimizeFlag)) {
+ if (unlikely(!((__pyx_v_error_check == 1) != 0))) {
+ PyErr_SetNone(PyExc_AssertionError);
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ }
+ #endif
+ }
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":828
+ * error_check &= tidx == idx
+ * assert error_check == 1
+ * free(offset) # <<<<<<<<<<<<<<
+ * return error_check
+ */
+ free(__pyx_v_offset);
+ }
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":829
+ * assert error_check == 1
+ * free(offset)
+ * return error_check # <<<<<<<<<<<<<<
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_error_check); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_r = __pyx_t_5;
+ __pyx_t_5 = 0;
+ goto __pyx_L0;
+
+ /* "sklearn/manifold/_barnes_hut_tsne.pyx":815
+ *
+ *
+ * def test_index_offset(): # <<<<<<<<<<<<<<
+ * cdef int n_dimensions, idx, tidx, k
+ * cdef int error_check = 1
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("sklearn.manifold._barnes_hut_tsne.test_index_offset", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":194
+ * # experimental exception made for __getbuffer__ and __releasebuffer__
+ * # -- the details of this may change.
+ * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
+ * # This implementation of getbuffer is geared towards Cython
+ * # requirements, and does not yet fullfill the PEP.
+ */
+
+/* Python wrapper */
+static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
+static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
+ int __pyx_v_copy_shape;
+ int __pyx_v_i;
+ int __pyx_v_ndim;
+ int __pyx_v_endian_detector;
+ int __pyx_v_little_endian;
+ int __pyx_v_t;
+ char *__pyx_v_f;
+ PyArray_Descr *__pyx_v_descr = 0;
+ int __pyx_v_offset;
+ int __pyx_v_hasfields;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_t_4;
+ int __pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
+ char *__pyx_t_7;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__getbuffer__", 0);
+ if (__pyx_v_info != NULL) {
+ __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(__pyx_v_info->obj);
+ }
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":200
+ * # of flags
+ *
+ * if info == NULL: return # <<<<<<<<<<<<<<
+ *
+ * cdef int copy_shape, i, ndim
+ */
+ __pyx_t_1 = ((__pyx_v_info == NULL) != 0);
+ if (__pyx_t_1) {
+ __pyx_r = 0;
+ goto __pyx_L0;
+ }
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":203
+ *
+ * cdef int copy_shape, i, ndim
+ * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
+ * cdef bint little_endian = ((&endian_detector)[0] != 0)
+ *
+ */
+ __pyx_v_endian_detector = 1;
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":204
+ * cdef int copy_shape, i, ndim
+ * cdef int endian_detector = 1
+ * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
+ *
+ * ndim = PyArray_NDIM(self)
+ */
+ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":206
+ * cdef bint little_endian = ((&endian_detector)[0] != 0)
+ *
+ * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<<
+ *
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t):
+ */
+ __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":208
+ * ndim = PyArray_NDIM(self)
+ *
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
+ * copy_shape = 1
+ * else:
+ */
+ __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
+ if (__pyx_t_1) {
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":209
+ *
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t):
+ * copy_shape = 1 # <<<<<<<<<<<<<<
+ * else:
+ * copy_shape = 0
+ */
+ __pyx_v_copy_shape = 1;
+ goto __pyx_L4;
+ }
+ /*else*/ {
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":211
+ * copy_shape = 1
+ * else:
+ * copy_shape = 0 # <<<<<<<<<<<<<<
+ *
+ * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
+ */
+ __pyx_v_copy_shape = 0;
+ }
+ __pyx_L4:;
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":213
+ * copy_shape = 0
+ *
+ * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
+ * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
+ * raise ValueError(u"ndarray is not C contiguous")
+ */
+ __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
+ if (__pyx_t_2) {
+ goto __pyx_L7_next_and;
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L6_bool_binop_done;
+ }
+ __pyx_L7_next_and:;
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":214
+ *
+ * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
+ * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<<
+ * raise ValueError(u"ndarray is not C contiguous")
+ *
+ */
+ __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
+ __pyx_t_1 = __pyx_t_2;
+ __pyx_L6_bool_binop_done:;
+ if (__pyx_t_1) {
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":215
+ * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
+ * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
+ * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
+ *
+ * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
+ */
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":217
+ * raise ValueError(u"ndarray is not C contiguous")
+ *
+ * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
+ * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
+ * raise ValueError(u"ndarray is not Fortran contiguous")
+ */
+ __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
+ if (__pyx_t_2) {
+ goto __pyx_L10_next_and;
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L9_bool_binop_done;
+ }
+ __pyx_L10_next_and:;
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":218
+ *
+ * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
+ * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<<
+ * raise ValueError(u"ndarray is not Fortran contiguous")
+ *
+ */
+ __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
+ __pyx_t_1 = __pyx_t_2;
+ __pyx_L9_bool_binop_done:;
+ if (__pyx_t_1) {
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":219
+ * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
+ * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
+ * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
+ *
+ * info.buf = PyArray_DATA(self)
+ */
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":221
+ * raise ValueError(u"ndarray is not Fortran contiguous")
+ *
+ * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<<
+ * info.ndim = ndim
+ * if copy_shape:
+ */
+ __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222
+ *
+ * info.buf = PyArray_DATA(self)
+ * info.ndim = ndim # <<<<<<<<<<<<<<
+ * if copy_shape:
+ * # Allocate new buffer for strides and shape info.
+ */
+ __pyx_v_info->ndim = __pyx_v_ndim;
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":223
+ * info.buf = PyArray_DATA(self)
+ * info.ndim = ndim
+ * if copy_shape: # <<<<<<<<<<<<<<
+ * # Allocate new buffer for strides and shape info.
+ * # This is allocated as one block, strides first.
+ */
+ __pyx_t_1 = (__pyx_v_copy_shape != 0);
+ if (__pyx_t_1) {
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":226
+ * # Allocate new buffer for strides and shape info.
+ * # This is allocated as one block, strides first.
+ * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<<
+ * info.shape = info.strides + ndim
+ * for i in range(ndim):
+ */
+ __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2)));
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":227
+ * # This is allocated as one block, strides first.
+ * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2)
+ * info.shape = info.strides + ndim # <<<<<<<<<<<<<<
+ * for i in range(ndim):
+ * info.strides[i] = PyArray_STRIDES(self)[i]
+ */
+ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":228
+ * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2)
+ * info.shape = info.strides + ndim
+ * for i in range(ndim): # <<<<<<<<<<<<<<
+ * info.strides[i] = PyArray_STRIDES(self)[i]
+ * info.shape[i] = PyArray_DIMS(self)[i]
+ */
+ __pyx_t_4 = __pyx_v_ndim;
+ for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
+ __pyx_v_i = __pyx_t_5;
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":229
+ * info.shape = info.strides + ndim
+ * for i in range(ndim):
+ * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<<
+ * info.shape[i] = PyArray_DIMS(self)[i]
+ * else:
+ */
+ (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":230
+ * for i in range(ndim):
+ * info.strides[i] = PyArray_STRIDES(self)[i]
+ * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<<
+ * else:
+ * info.strides = PyArray_STRIDES(self)
+ */
+ (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
+ }
+ goto __pyx_L11;
+ }
+ /*else*/ {
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":232
+ * info.shape[i] = PyArray_DIMS(self)[i]
+ * else:
+ * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<<
+ * info.shape = PyArray_DIMS(self)
+ * info.suboffsets = NULL
+ */
+ __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":233
+ * else:
+ * info.strides = PyArray_STRIDES(self)
+ * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<<
+ * info.suboffsets = NULL
+ * info.itemsize = PyArray_ITEMSIZE(self)
+ */
+ __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
+ }
+ __pyx_L11:;
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":234
+ * info.strides = PyArray_STRIDES(self)
+ * info.shape = PyArray_DIMS(self)
+ * info.suboffsets = NULL # <<<<<<<<<<<<<<
+ * info.itemsize = PyArray_ITEMSIZE(self)
+ * info.readonly = not PyArray_ISWRITEABLE(self)
+ */
+ __pyx_v_info->suboffsets = NULL;
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":235
+ * info.shape = PyArray_DIMS(self)
+ * info.suboffsets = NULL
+ * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<<
+ * info.readonly = not PyArray_ISWRITEABLE(self)
+ *
+ */
+ __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":236
+ * info.suboffsets = NULL
+ * info.itemsize = PyArray_ITEMSIZE(self)
+ * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<<
+ *
+ * cdef int t
+ */
+ __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":239
+ *
+ * cdef int t
+ * cdef char* f = NULL # <<<<<<<<<<<<<<
+ * cdef dtype descr = self.descr
+ * cdef list stack
+ */
+ __pyx_v_f = NULL;
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":240
+ * cdef int t
+ * cdef char* f = NULL
+ * cdef dtype descr = self.descr # <<<<<<<<<<<<<<
+ * cdef list stack
+ * cdef int offset
+ */
+ __pyx_t_3 = ((PyObject *)__pyx_v_self->descr);
+ __Pyx_INCREF(__pyx_t_3);
+ __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":244
+ * cdef int offset
+ *
+ * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<<
+ *
+ * if not hasfields and not copy_shape:
+ */
+ __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":246
+ * cdef bint hasfields = PyDataType_HASFIELDS(descr)
+ *
+ * if not hasfields and not copy_shape: # <<<<<<<<<<<<<<
+ * # do not call releasebuffer
+ * info.obj = None
+ */
+ __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0);
+ if (__pyx_t_2) {
+ goto __pyx_L16_next_and;
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L15_bool_binop_done;
+ }
+ __pyx_L16_next_and:;
+ __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0);
+ __pyx_t_1 = __pyx_t_2;
+ __pyx_L15_bool_binop_done:;
+ if (__pyx_t_1) {
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":248
+ * if not hasfields and not copy_shape:
+ * # do not call releasebuffer
+ * info.obj = None # <<<<<<<<<<<<<<
+ * else:
+ * # need to call releasebuffer
+ */
+ __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(Py_None);
+ __Pyx_GOTREF(__pyx_v_info->obj);
+ __Pyx_DECREF(__pyx_v_info->obj);
+ __pyx_v_info->obj = Py_None;
+ goto __pyx_L14;
+ }
+ /*else*/ {
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":251
+ * else:
+ * # need to call releasebuffer
+ * info.obj = self # <<<<<<<<<<<<<<
+ *
+ * if not hasfields:
+ */
+ __Pyx_INCREF(((PyObject *)__pyx_v_self));
+ __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+ __Pyx_GOTREF(__pyx_v_info->obj);
+ __Pyx_DECREF(__pyx_v_info->obj);
+ __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
+ }
+ __pyx_L14:;
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":253
+ * info.obj = self
+ *
+ * if not hasfields: # <<<<<<<<<<<<<<
+ * t = descr.type_num
+ * if ((descr.byteorder == c'>' and little_endian) or
+ */
+ __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0);
+ if (__pyx_t_1) {
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":254
+ *
+ * if not hasfields:
+ * t = descr.type_num # <<<<<<<<<<<<<<
+ * if ((descr.byteorder == c'>' and little_endian) or
+ * (descr.byteorder == c'<' and not little_endian)):
+ */
+ __pyx_t_4 = __pyx_v_descr->type_num;
+ __pyx_v_t = __pyx_t_4;
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":255
+ * if not hasfields:
+ * t = descr.type_num
+ * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
+ * (descr.byteorder == c'<' and not little_endian)):
+ * raise ValueError(u"Non-native byte order not supported")
+ */
+ __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
+ if (!__pyx_t_2) {
+ goto __pyx_L20_next_or;
+ } else {
+ goto __pyx_L21_next_and;
+ }
+ __pyx_L21_next_and:;
+ __pyx_t_2 = (__pyx_v_little_endian != 0);
+ if (!__pyx_t_2) {
+ goto __pyx_L20_next_or;
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L19_bool_binop_done;
+ }
+ __pyx_L20_next_or:;
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":256
+ * t = descr.type_num
+ * if ((descr.byteorder == c'>' and little_endian) or
+ * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
+ * raise ValueError(u"Non-native byte order not supported")
+ * if t == NPY_BYTE: f = "b"
+ */
+ __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
+ if (__pyx_t_2) {
+ goto __pyx_L22_next_and;
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L19_bool_binop_done;
+ }
+ __pyx_L22_next_and:;
+ __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
+ __pyx_t_1 = __pyx_t_2;
+ __pyx_L19_bool_binop_done:;
+ if (__pyx_t_1) {
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257
+ * if ((descr.byteorder == c'>' and little_endian) or
+ * (descr.byteorder == c'<' and not little_endian)):
+ * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
+ * if t == NPY_BYTE: f = "b"
+ * elif t == NPY_UBYTE: f = "B"
+ */
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
+ * elif t == NPY_CDOUBLE: f = "Zd"
+ * elif t == NPY_CLONGDOUBLE: f = "Zg"
+ * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
+ * else:
+ * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
+ */
+ switch (__pyx_v_t) {
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":258
+ * (descr.byteorder == c'<' and not little_endian)):
+ * raise ValueError(u"Non-native byte order not supported")
+ * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<<
+ * elif t == NPY_UBYTE: f = "B"
+ * elif t == NPY_SHORT: f = "h"
+ */
+ case NPY_BYTE:
+ __pyx_v_f = __pyx_k_b;
+ break;
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":259
+ * raise ValueError(u"Non-native byte order not supported")
+ * if t == NPY_BYTE: f = "b"
+ * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<<
+ * elif t == NPY_SHORT: f = "h"
+ * elif t == NPY_USHORT: f = "H"
+ */
+ case NPY_UBYTE:
+ __pyx_v_f = __pyx_k_B;
+ break;
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":260
+ * if t == NPY_BYTE: f = "b"
+ * elif t == NPY_UBYTE: f = "B"
+ * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<<
+ * elif t == NPY_USHORT: f = "H"
+ * elif t == NPY_INT: f = "i"
+ */
+ case NPY_SHORT:
+ __pyx_v_f = __pyx_k_h;
+ break;
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":261
+ * elif t == NPY_UBYTE: f = "B"
+ * elif t == NPY_SHORT: f = "h"
+ * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<<
+ * elif t == NPY_INT: f = "i"
+ * elif t == NPY_UINT: f = "I"
+ */
+ case NPY_USHORT:
+ __pyx_v_f = __pyx_k_H;
+ break;
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":262
+ * elif t == NPY_SHORT: f = "h"
+ * elif t == NPY_USHORT: f = "H"
+ * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<<
+ * elif t == NPY_UINT: f = "I"
+ * elif t == NPY_LONG: f = "l"
+ */
+ case NPY_INT:
+ __pyx_v_f = __pyx_k_i_2;
+ break;
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":263
+ * elif t == NPY_USHORT: f = "H"
+ * elif t == NPY_INT: f = "i"
+ * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<<
+ * elif t == NPY_LONG: f = "l"
+ * elif t == NPY_ULONG: f = "L"
+ */
+ case NPY_UINT:
+ __pyx_v_f = __pyx_k_I;
+ break;
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":264
+ * elif t == NPY_INT: f = "i"
+ * elif t == NPY_UINT: f = "I"
+ * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<<
+ * elif t == NPY_ULONG: f = "L"
+ * elif t == NPY_LONGLONG: f = "q"
+ */
+ case NPY_LONG:
+ __pyx_v_f = __pyx_k_l;
+ break;
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":265
+ * elif t == NPY_UINT: f = "I"
+ * elif t == NPY_LONG: f = "l"
+ * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<<
+ * elif t == NPY_LONGLONG: f = "q"
+ * elif t == NPY_ULONGLONG: f = "Q"
+ */
+ case NPY_ULONG:
+ __pyx_v_f = __pyx_k_L;
+ break;
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":266
+ * elif t == NPY_LONG: f = "l"
+ * elif t == NPY_ULONG: f = "L"
+ * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<<
+ * elif t == NPY_ULONGLONG: f = "Q"
+ * elif t == NPY_FLOAT: f = "f"
+ */
+ case NPY_LONGLONG:
+ __pyx_v_f = __pyx_k_q;
+ break;
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":267
+ * elif t == NPY_ULONG: f = "L"
+ * elif t == NPY_LONGLONG: f = "q"
+ * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<<
+ * elif t == NPY_FLOAT: f = "f"
+ * elif t == NPY_DOUBLE: f = "d"
+ */
+ case NPY_ULONGLONG:
+ __pyx_v_f = __pyx_k_Q;
+ break;
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":268
+ * elif t == NPY_LONGLONG: f = "q"
+ * elif t == NPY_ULONGLONG: f = "Q"
+ * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<<
+ * elif t == NPY_DOUBLE: f = "d"
+ * elif t == NPY_LONGDOUBLE: f = "g"
+ */
+ case NPY_FLOAT:
+ __pyx_v_f = __pyx_k_f;
+ break;
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":269
+ * elif t == NPY_ULONGLONG: f = "Q"
+ * elif t == NPY_FLOAT: f = "f"
+ * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<<
+ * elif t == NPY_LONGDOUBLE: f = "g"
+ * elif t == NPY_CFLOAT: f = "Zf"
+ */
+ case NPY_DOUBLE:
+ __pyx_v_f = __pyx_k_d;
+ break;
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":270
+ * elif t == NPY_FLOAT: f = "f"
+ * elif t == NPY_DOUBLE: f = "d"
+ * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<<
+ * elif t == NPY_CFLOAT: f = "Zf"
+ * elif t == NPY_CDOUBLE: f = "Zd"
+ */
+ case NPY_LONGDOUBLE:
+ __pyx_v_f = __pyx_k_g;
+ break;
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":271
+ * elif t == NPY_DOUBLE: f = "d"
+ * elif t == NPY_LONGDOUBLE: f = "g"
+ * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<<
+ * elif t == NPY_CDOUBLE: f = "Zd"
+ * elif t == NPY_CLONGDOUBLE: f = "Zg"
+ */
+ case NPY_CFLOAT:
+ __pyx_v_f = __pyx_k_Zf;
+ break;
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":272
+ * elif t == NPY_LONGDOUBLE: f = "g"
+ * elif t == NPY_CFLOAT: f = "Zf"
+ * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<<
+ * elif t == NPY_CLONGDOUBLE: f = "Zg"
+ * elif t == NPY_OBJECT: f = "O"
+ */
+ case NPY_CDOUBLE:
+ __pyx_v_f = __pyx_k_Zd;
+ break;
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":273
+ * elif t == NPY_CFLOAT: f = "Zf"
+ * elif t == NPY_CDOUBLE: f = "Zd"
+ * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<<
+ * elif t == NPY_OBJECT: f = "O"
+ * else:
+ */
+ case NPY_CLONGDOUBLE:
+ __pyx_v_f = __pyx_k_Zg;
+ break;
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
+ * elif t == NPY_CDOUBLE: f = "Zd"
+ * elif t == NPY_CLONGDOUBLE: f = "Zg"
+ * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
+ * else:
+ * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
+ */
+ case NPY_OBJECT:
+ __pyx_v_f = __pyx_k_O;
+ break;
+ default:
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":276
+ * elif t == NPY_OBJECT: f = "O"
+ * else:
+ * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
+ * info.format = f
+ * return
+ */
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_6);
+ __pyx_t_6 = 0;
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_Raise(__pyx_t_6, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ break;
+ }
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":277
+ * else:
+ * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
+ * info.format = f # <<<<<<<<<<<<<<
+ * return
+ * else:
+ */
+ __pyx_v_info->format = __pyx_v_f;
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":278
+ * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
+ * info.format = f
+ * return # <<<<<<<<<<<<<<
+ * else:
+ * info.format = stdlib.malloc(_buffer_format_string_len)
+ */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ }
+ /*else*/ {
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":280
+ * return
+ * else:
+ * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<<
+ * info.format[0] = c'^' # Native data types, manual alignment
+ * offset = 0
+ */
+ __pyx_v_info->format = ((char *)malloc(255));
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":281
+ * else:
+ * info.format = stdlib.malloc(_buffer_format_string_len)
+ * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<<
+ * offset = 0
+ * f = _util_dtypestring(descr, info.format + 1,
+ */
+ (__pyx_v_info->format[0]) = '^';
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":282
+ * info.format = stdlib.malloc(_buffer_format_string_len)
+ * info.format[0] = c'^' # Native data types, manual alignment
+ * offset = 0 # <<<<<<<<<<<<<<
+ * f = _util_dtypestring(descr, info.format + 1,
+ * info.format + _buffer_format_string_len,
+ */
+ __pyx_v_offset = 0;
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":283
+ * info.format[0] = c'^' # Native data types, manual alignment
+ * offset = 0
+ * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<<
+ * info.format + _buffer_format_string_len,
+ * &offset)
+ */
+ __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_f = __pyx_t_7;
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":286
+ * info.format + _buffer_format_string_len,
+ * &offset)
+ * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<<
+ *
+ * def __releasebuffer__(ndarray self, Py_buffer* info):
+ */
+ (__pyx_v_f[0]) = '\x00';
+ }
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":194
+ * # experimental exception made for __getbuffer__ and __releasebuffer__
+ * # -- the details of this may change.
+ * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
+ * # This implementation of getbuffer is geared towards Cython
+ * # requirements, and does not yet fullfill the PEP.
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) {
+ __Pyx_GOTREF(__pyx_v_info->obj);
+ __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL;
+ }
+ goto __pyx_L2;
+ __pyx_L0:;
+ if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) {
+ __Pyx_GOTREF(Py_None);
+ __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL;
+ }
+ __pyx_L2:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_descr);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":288
+ * f[0] = c'\0' # Terminate format string
+ *
+ * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
+ * if PyArray_HASFIELDS(self):
+ * stdlib.free(info.format)
+ */
+
+/* Python wrapper */
+static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
+static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
+ __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ __Pyx_RefNannySetupContext("__releasebuffer__", 0);
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":289
+ *
+ * def __releasebuffer__(ndarray self, Py_buffer* info):
+ * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
+ * stdlib.free(info.format)
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t):
+ */
+ __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
+ if (__pyx_t_1) {
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":290
+ * def __releasebuffer__(ndarray self, Py_buffer* info):
+ * if PyArray_HASFIELDS(self):
+ * stdlib.free(info.format) # <<<<<<<<<<<<<<
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t):
+ * stdlib.free(info.strides)
+ */
+ free(__pyx_v_info->format);
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":291
+ * if PyArray_HASFIELDS(self):
+ * stdlib.free(info.format)
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
+ * stdlib.free(info.strides)
+ * # info.shape was stored after info.strides in the same block
+ */
+ __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
+ if (__pyx_t_1) {
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":292
+ * stdlib.free(info.format)
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t):
+ * stdlib.free(info.strides) # <<<<<<<<<<<<<<
+ * # info.shape was stored after info.strides in the same block
+ *
+ */
+ free(__pyx_v_info->strides);
+ goto __pyx_L4;
+ }
+ __pyx_L4:;
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":288
+ * f[0] = c'\0' # Terminate format string
+ *
+ * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
+ * if PyArray_HASFIELDS(self):
+ * stdlib.free(info.format)
+ */
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+/* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":768
+ * ctypedef npy_cdouble complex_t
+ *
+ * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
+ * return PyArray_MultiIterNew(1, a)
+ *
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":769
+ *
+ * cdef inline object PyArray_MultiIterNew1(a):
+ * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<<
+ *
+ * cdef inline object PyArray_MultiIterNew2(a, b):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":768
+ * ctypedef npy_cdouble complex_t
+ *
+ * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
+ * return PyArray_MultiIterNew(1, a)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771
+ * return PyArray_MultiIterNew(1, a)
+ *
+ * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
+ * return PyArray_MultiIterNew(2, a, b)
+ *
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":772
+ *
+ * cdef inline object PyArray_MultiIterNew2(a, b):
+ * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<<
+ *
+ * cdef inline object PyArray_MultiIterNew3(a, b, c):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771
+ * return PyArray_MultiIterNew(1, a)
+ *
+ * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
+ * return PyArray_MultiIterNew(2, a, b)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774
+ * return PyArray_MultiIterNew(2, a, b)
+ *
+ * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
+ * return PyArray_MultiIterNew(3, a, b, c)
+ *
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":775
+ *
+ * cdef inline object PyArray_MultiIterNew3(a, b, c):
+ * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<<
+ *
+ * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774
+ * return PyArray_MultiIterNew(2, a, b)
+ *
+ * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
+ * return PyArray_MultiIterNew(3, a, b, c)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777
+ * return PyArray_MultiIterNew(3, a, b, c)
+ *
+ * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
+ * return PyArray_MultiIterNew(4, a, b, c, d)
+ *
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":778
+ *
+ * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
+ * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<<
+ *
+ * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777
+ * return PyArray_MultiIterNew(3, a, b, c)
+ *
+ * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
+ * return PyArray_MultiIterNew(4, a, b, c, d)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780
+ * return PyArray_MultiIterNew(4, a, b, c, d)
+ *
+ * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
+ * return PyArray_MultiIterNew(5, a, b, c, d, e)
+ *
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":781
+ *
+ * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
+ * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<<
+ *
+ * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780
+ * return PyArray_MultiIterNew(4, a, b, c, d)
+ *
+ * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
+ * return PyArray_MultiIterNew(5, a, b, c, d, e)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../../anaconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783
+ * return PyArray_MultiIterNew(5, a, b, c, d,