diff --git a/Makefile b/Makefile index 45647eaebc483573a074a8db981845ebc2c2b1e0..edfa8c72f704be98cc15a3ee078c77677ba9ae88 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ inplace: $(PYTHON) setup.py build_ext -i test-code: in - $(NOSETESTS) -s sklearn + $(NOSETESTS) -s scikits/learn test-doc: $(NOSETESTS) -s --with-doctest --doctest-tests --doctest-extension=rst \ --doctest-fixtures=_fixture doc/modules/ diff --git a/doc/install.rst b/doc/install.rst index 0d77ccb352766f8dbc56338f10dd569eb7e68cbd..c599df284dcae83466ab2a5001ef80c6ba31a1c1 100644 --- a/doc/install.rst +++ b/doc/install.rst @@ -55,11 +55,11 @@ This is usually the fastest way to install the latest stable release. If you have pip or easy_install, you can install or update with the command:: - pip install -U sklearn + pip install -U scikits.learn or:: - easy_install -U sklearn + easy_install -U scikits.learn for easy_install. Note that you might need root privileges to run these commands. @@ -145,10 +145,10 @@ version of scikit-learn: Debian and derivatives (Ubuntu) ------------------------------- -The Debian package is named python-sklearn and can be install +The Debian package is named python-scikits-learn and can be install using the following commands with root privileges:: - apt-get install python-sklearn + apt-get install python-scikits-learn Python(x, y) @@ -170,17 +170,17 @@ version. Macports -------- -The macport's package is named py26-sklearn and can be installed +The macport's package is named py26-scikits-learn and can be installed by typing the following command:: - sudo port install py26-sklearn + sudo port install py26-scikits-learn NetBSD ------ scikit-learn is available via `pkgsrc-wip <http://pkgsrc-wip.sourceforge.net/>`_: - http://pkgsrc.se/wip/py-sklearn + http://pkgsrc.se/wip/py-scikits_learn .. _install_bleeding_edge: @@ -200,7 +200,7 @@ Testing requires having the `nose installation, the package can be tested by executing *from outside* the source directory:: - python -c "import sklearn as skl; skl.test()" + python -c "import scikits.learn as skl; skl.test()" This should give you a lot of output (and some warnings) but eventually should finish with the a text similar to:: @@ -220,7 +220,7 @@ source directory:: Test can now be run using nosetest:: - nosetests sklearn/ + nosetests scikits/learn/ If you are running the deveopment version, this is automated in the commands `make in` and `make test`. diff --git a/doc/modules/classes.rst b/doc/modules/classes.rst index 08b5f4957ada4c190dab40b336d5e1c11fe72700..76b856de140af2e7420294440edf1225abb68c2a 100644 --- a/doc/modules/classes.rst +++ b/doc/modules/classes.rst @@ -10,11 +10,11 @@ Support Vector Machines ======================= -.. automodule:: sklearn.svm +.. automodule:: scikits.learn.svm :no-members: :no-inherited-members: -.. currentmodule:: sklearn +.. currentmodule:: scikits.learn .. autosummary:: :toctree: generated/ @@ -37,11 +37,11 @@ Support Vector Machines For sparse data --------------- -.. automodule:: sklearn.svm.sparse +.. automodule:: scikits.learn.svm.sparse :no-members: :no-inherited-members: -.. currentmodule:: sklearn +.. currentmodule:: scikits.learn .. autosummary:: :toctree: generated/ @@ -73,11 +73,11 @@ Low-level methods Generalized Linear Models ========================= -.. automodule:: sklearn.linear_model +.. automodule:: scikits.learn.linear_model :no-members: :no-inherited-members: -.. currentmodule:: sklearn +.. currentmodule:: scikits.learn .. autosummary:: :toctree: generated/ @@ -116,11 +116,11 @@ Generalized Linear Models For sparse data --------------- -.. automodule:: sklearn.linear_model.sparse +.. automodule:: scikits.learn.linear_model.sparse :no-members: :no-inherited-members: -.. currentmodule:: sklearn +.. currentmodule:: scikits.learn .. autosummary:: :toctree: generated/ @@ -136,11 +136,11 @@ For sparse data Naive Bayes =========== -.. automodule:: sklearn.naive_bayes +.. automodule:: scikits.learn.naive_bayes :no-members: :no-inherited-members: -.. currentmodule:: sklearn +.. currentmodule:: scikits.learn .. autosummary:: :toctree: generated/ @@ -154,11 +154,11 @@ Naive Bayes Nearest Neighbors ================= -.. automodule:: sklearn.neighbors +.. automodule:: scikits.learn.neighbors :no-members: :no-inherited-members: -.. currentmodule:: sklearn +.. currentmodule:: scikits.learn .. autosummary:: :toctree: generated/ @@ -179,11 +179,11 @@ Nearest Neighbors Gaussian Mixture Models ======================= -.. automodule:: sklearn.mixture +.. automodule:: scikits.learn.mixture :no-members: :no-inherited-members: -.. currentmodule:: sklearn +.. currentmodule:: scikits.learn .. autosummary:: :toctree: generated/ @@ -197,11 +197,11 @@ Gaussian Mixture Models Hidden Markov Models ==================== -.. automodule:: sklearn.hmm +.. automodule:: scikits.learn.hmm :no-members: :no-inherited-members: -.. currentmodule:: sklearn +.. currentmodule:: scikits.learn .. autosummary:: :toctree: generated/ @@ -215,11 +215,11 @@ Hidden Markov Models Clustering ========== -.. automodule:: sklearn.cluster +.. automodule:: scikits.learn.cluster :no-members: :no-inherited-members: -.. currentmodule:: sklearn +.. currentmodule:: scikits.learn .. autosummary:: :toctree: generated/ @@ -240,11 +240,11 @@ Metrics Classification metrics ---------------------- -.. automodule:: sklearn.metrics +.. automodule:: scikits.learn.metrics :no-members: :no-inherited-members: -.. currentmodule:: sklearn +.. currentmodule:: scikits.learn .. autosummary:: :toctree: generated/ @@ -268,11 +268,11 @@ Classification metrics Regression metrics ------------------ -.. automodule:: sklearn.metrics +.. automodule:: scikits.learn.metrics :no-members: :no-inherited-members: -.. currentmodule:: sklearn +.. currentmodule:: scikits.learn .. autosummary:: :toctree: generated/ @@ -285,11 +285,11 @@ Regression metrics Clustering metrics ------------------ -.. automodule:: sklearn.metrics.cluster +.. automodule:: scikits.learn.metrics.cluster :no-members: :no-inherited-members: -.. currentmodule:: sklearn +.. currentmodule:: scikits.learn .. autosummary:: :toctree: generated/ @@ -303,11 +303,11 @@ Clustering metrics Pairwise metrics ---------------- -.. automodule:: sklearn.metrics.pairwise +.. automodule:: scikits.learn.metrics.pairwise :no-members: :no-inherited-members: -.. currentmodule:: sklearn +.. currentmodule:: scikits.learn .. autosummary:: :toctree: generated/ @@ -323,11 +323,11 @@ Pairwise metrics Covariance Estimators ===================== -.. automodule:: sklearn.covariance +.. automodule:: scikits.learn.covariance :no-members: :no-inherited-members: -.. currentmodule:: sklearn +.. currentmodule:: scikits.learn .. autosummary:: :toctree: generated/ @@ -351,11 +351,11 @@ Covariance Estimators Signal Decomposition ==================== -.. automodule:: sklearn.decomposition +.. automodule:: scikits.learn.decomposition :no-members: :no-inherited-members: -.. currentmodule:: sklearn +.. currentmodule:: scikits.learn .. autosummary:: :toctree: generated/ @@ -393,11 +393,11 @@ Linear Discriminant Analysis Partial Least Squares ===================== -.. automodule:: sklearn.pls +.. automodule:: scikits.learn.pls :no-members: :no-inherited-members: -.. currentmodule:: sklearn +.. currentmodule:: scikits.learn .. autosummary:: :toctree: generated/ @@ -412,11 +412,11 @@ Partial Least Squares Cross Validation ================ -.. automodule:: sklearn.cross_val +.. automodule:: scikits.learn.cross_val :no-members: :no-inherited-members: -.. currentmodule:: sklearn +.. currentmodule:: scikits.learn .. autosummary:: :toctree: generated/ @@ -435,11 +435,11 @@ Cross Validation Grid Search =========== -.. automodule:: sklearn.grid_search +.. automodule:: scikits.learn.grid_search :no-members: :no-inherited-members: -.. currentmodule:: sklearn +.. currentmodule:: scikits.learn .. autosummary:: :toctree: generated/ @@ -454,11 +454,11 @@ Grid Search Feature Selection ================= -.. automodule:: sklearn.feature_selection +.. automodule:: scikits.learn.feature_selection :no-members: :no-inherited-members: -.. currentmodule:: sklearn +.. currentmodule:: scikits.learn .. autosummary:: :toctree: generated/ @@ -474,20 +474,20 @@ Feature Selection Feature Extraction ================== -.. automodule:: sklearn.feature_extraction +.. automodule:: scikits.learn.feature_extraction :no-members: :no-inherited-members: -.. currentmodule:: sklearn +.. currentmodule:: scikits.learn From images ------------- -.. automodule:: sklearn.feature_extraction.image +.. automodule:: scikits.learn.feature_extraction.image :no-members: :no-inherited-members: -.. currentmodule:: sklearn +.. currentmodule:: scikits.learn .. autosummary:: :toctree: generated/ @@ -506,11 +506,11 @@ From images From text --------- -.. automodule:: sklearn.feature_extraction.text +.. automodule:: scikits.learn.feature_extraction.text :no-members: :no-inherited-members: -.. currentmodule:: sklearn +.. currentmodule:: scikits.learn .. autosummary:: :toctree: generated/ @@ -527,11 +527,11 @@ From text Preprocessing and normalization =============================== -.. automodule:: sklearn.preprocessing +.. automodule:: scikits.learn.preprocessing :no-members: :no-inherited-members: -.. currentmodule:: sklearn +.. currentmodule:: scikits.learn .. autosummary:: :toctree: generated/ @@ -577,11 +577,11 @@ Datasets Loaders ------- -.. automodule:: sklearn.datasets +.. automodule:: scikits.learn.datasets :no-members: :no-inherited-members: -.. currentmodule:: sklearn +.. currentmodule:: scikits.learn .. autosummary:: :toctree: generated/ @@ -602,11 +602,11 @@ Loaders Samples generator ----------------- -.. automodule:: sklearn.datasets +.. automodule:: scikits.learn.datasets :no-members: :no-inherited-members: -.. currentmodule:: sklearn +.. currentmodule:: scikits.learn .. autosummary:: :toctree: generated/ @@ -629,11 +629,11 @@ Samples generator Pipeline ======== -.. automodule:: sklearn.pipeline +.. automodule:: scikits.learn.pipeline :no-members: :no-inherited-members: -.. currentmodule:: sklearn +.. currentmodule:: scikits.learn .. autosummary:: :toctree: generated/ @@ -645,11 +645,11 @@ Pipeline Utilities ========= -.. automodule:: sklearn.utils +.. automodule:: scikits.learn.utils :no-members: :no-inherited-members: -.. currentmodule:: sklearn +.. currentmodule:: scikits.learn .. autosummary:: :toctree: generated/ diff --git a/doc/modules/clustering.rst b/doc/modules/clustering.rst index f7a1925bded4bd8ba353fe8e077186a2f027e669..418aaf6771bfa21f6e94b4d7cee37a895b1c9589 100644 --- a/doc/modules/clustering.rst +++ b/doc/modules/clustering.rst @@ -5,7 +5,7 @@ Clustering ========== `Clustering <http://en.wikipedia.org/wiki/Cluster_analysis>`__ of -unlabeled data can be performed with the module :mod:`sklearn.cluster`. +unlabeled data can be performed with the module :mod:`scikits.learn.cluster`. Each clustering algorithm comes in two variants: a class, that implements the `fit` method to learn the clusters on train data, and a function, @@ -13,7 +13,7 @@ that, given train data, returns an array of integer labels corresponding to the different clusters. For the class, the labels over the training data can be found in the `labels_` attribute. -.. currentmodule:: sklearn.cluster +.. currentmodule:: scikits.learn.cluster .. topic:: Input data @@ -21,10 +21,10 @@ data can be found in the `labels_` attribute. this module take different kinds of matrix as input. On one hand, :class:`MeanShift` and :class:`KMeans` take data matrices of shape [n_samples, n_features]. These can be obtained from the classes in - the :mod:`sklearn.feature_extraction` module. On the other hand, + the :mod:`scikits.learn.feature_extraction` module. On the other hand, :class:`AffinityPropagation` and :class:`SpectralClustering` take similarity matrices of shape [n_samples, n_samples]. These can be - obtained from the functions in the :mod:`sklearn.metrics.pairwise` + obtained from the functions in the :mod:`scikits.learn.metrics.pairwise` module. In other words, :class:`MeanShift` and :class:`KMeans` work with points in a vector space, whereas :class:`AffinityPropagation` and :class:`SpectralClustering` can work with arbitrary objects, as @@ -247,10 +247,10 @@ and a column with indices of the dataset that should be connected. This matrix can be constructed from apriori information, for instance if you whish to cluster web pages, but only merging pages with a link pointing from one to another. It can also be learned from the data, for instance -using :func:`sklearn.neighbors.kneighbors_graph` to restrict +using :func:`scikits.learn.neighbors.kneighbors_graph` to restrict merging to nearest neighbors as in the :ref:`swiss roll <example_cluster_plot_ward_structured_vs_unstructured.py>` example, or -using :func:`sklearn.feature_extraction.image.grid_to_graph` to +using :func:`scikits.learn.feature_extraction.image.grid_to_graph` to enable only merging of neighboring pixels on an image, as in the :ref:`Lena <example_cluster_plot_lena_ward_segmentation.py>` example. @@ -311,7 +311,7 @@ truth set of classes or satisfying some assumption such that members belong to the same class are more similar that members of different classes according to some similarity metric. -.. currentmodule:: sklearn.metrics +.. currentmodule:: scikits.learn.metrics Inertia ------- @@ -363,7 +363,7 @@ We can turn those concept as scores :func:`homogeneity_score` and :func:`completeness_score`. Both are bounded below by 0.0 and above by 1.0 (higher is better):: - >>> from sklearn import metrics + >>> from scikits.learn import metrics >>> labels_true = [0, 0, 0, 1, 1, 1] >>> labels_pred = [0, 0, 1, 1, 2, 2] diff --git a/doc/modules/covariance.rst b/doc/modules/covariance.rst index 46027c881c7f188b2820a906073ae3f12a498e5c..b02d4a4082a83ebb8908abadfefb8780a2487032 100644 --- a/doc/modules/covariance.rst +++ b/doc/modules/covariance.rst @@ -4,7 +4,7 @@ Covariance estimation =================================================== -.. currentmodule:: sklearn.covariance +.. currentmodule:: scikits.learn.covariance Many statistical problems require at some point the estimation of a @@ -12,7 +12,7 @@ population's covariance matrix, which can be seen as an estimation of data set scatter plot shape. Most of the time, such an estimation has to be done on a sample whose properties (size, structure, homogeneity) has a large influence on the estimation's quality. The -`sklearn.covariance` package aims at providing tools affording +`scikits.learn.covariance` package aims at providing tools affording an accurate estimation of a population's covariance matrix under various settings. @@ -94,7 +94,7 @@ covariance matrix in terms of Frobenius norm. The Ledoit-Wolf estimator of the covariance matrix can be computed on a sample with the :meth:`ledoit_wolf` function of the -`sklearn.covariance` package, or it can be otherwise obtained by +`scikits.learn.covariance` package, or it can be otherwise obtained by fitting a :class:`LedoitWolf` object to the same sample. [1] O. Ledoit and M. Wolf, "A Well-Conditioned Estimator for Large-Dimensional @@ -126,7 +126,7 @@ Wolf's formula. The resulting estimator is known as the Oracle Shrinkage Approximating estimator of the covariance. The OAS estimator of the covariance matrix can be computed on a sample -with the :meth:`oas` function of the `sklearn.covariance` +with the :meth:`oas` function of the `scikits.learn.covariance` package, or it can be otherwise obtained by fitting an :class:`OAS` object to the same sample. The formula we used to implement the OAS does not correspond to the one given in the article. It has been taken diff --git a/doc/modules/cross_validation.rst b/doc/modules/cross_validation.rst index 96d6167ccf782ab57289236700fd83fa693b24a5..0db1ad213383479abc0ef1cb1ff62a3ff0349998 100644 --- a/doc/modules/cross_validation.rst +++ b/doc/modules/cross_validation.rst @@ -2,7 +2,7 @@ Cross-Validation ================ -.. currentmodule:: sklearn.cross_val +.. currentmodule:: scikits.learn.cross_val Learning the parameters of a prediction function and testing it on the same data yields a methodological bias. To avoid over-fitting, we have to define two @@ -40,12 +40,12 @@ cross-validation procedure does not waste much data as only one sample is removed from the learning set:: >>> import numpy as np - >>> from sklearn.cross_val import LeaveOneOut + >>> from scikits.learn.cross_val import LeaveOneOut >>> X = np.array([[0., 0.], [1., 1.], [-1., -1.], [2., 2.]]) >>> Y = np.array([0, 1, 0, 1]) >>> loo = LeaveOneOut(len(Y)) >>> print loo - sklearn.cross_val.LeaveOneOut(n=4) + scikits.learn.cross_val.LeaveOneOut(n=4) >>> for train, test in loo: print train, test [False True True True] [ True False False False] [ True False True True] [False True False False] @@ -64,12 +64,12 @@ integer indices. It can be obtained by setting the parameter indices to True when creating the cross-validation procedure:: >>> import numpy as np - >>> from sklearn.cross_val import LeaveOneOut + >>> from scikits.learn.cross_val import LeaveOneOut >>> X = np.array([[0., 0.], [1., 1.], [-1., -1.], [2., 2.]]) >>> Y = np.array([0, 1, 0, 1]) >>> loo = LeaveOneOut(len(Y), indices=True) >>> print loo - sklearn.cross_val.LeaveOneOut(n=4) + scikits.learn.cross_val.LeaveOneOut(n=4) >>> for train, test in loo: print train, test [1 2 3] [0] [0 2 3] [1] @@ -86,12 +86,12 @@ possible training/test sets by removing *P* samples from the complete set. Example of Leave-2-Out:: - >>> from sklearn.cross_val import LeavePOut + >>> from scikits.learn.cross_val import LeavePOut >>> X = [[0., 0.], [1., 1.], [-1., -1.], [2., 2.]] >>> Y = [0, 1, 0, 1] >>> loo = LeavePOut(len(Y), 2) >>> print loo - sklearn.cross_val.LeavePOut(n=4, p=2) + scikits.learn.cross_val.LeavePOut(n=4, p=2) >>> for train, test in loo: print train,test [False False True True] [ True True False False] [False True False True] [ True False True False] @@ -121,12 +121,12 @@ and the fold left out is used for test. Example of 2-fold:: - >>> from sklearn.cross_val import KFold + >>> from scikits.learn.cross_val import KFold >>> X = [[0., 0.], [1., 1.], [-1., -1.], [2., 2.]] >>> Y = [0, 1, 0, 1] >>> loo = KFold(len(Y), 2) >>> print loo - sklearn.cross_val.KFold(n=4, k=2) + scikits.learn.cross_val.KFold(n=4, k=2) >>> for train, test in loo: print train,test [False False True True] [ True True False False] [ True True False False] [False False True True] @@ -144,12 +144,12 @@ class as in the complete set. Example of stratified 2-fold:: - >>> from sklearn.cross_val import StratifiedKFold + >>> from scikits.learn.cross_val import StratifiedKFold >>> X = [[0., 0.], [1., 1.], [-1., -1.], [2., 2.], [3., 3.], [4., 4.], [0., 1.]] >>> Y = [0, 0, 0, 1, 1, 1, 0] >>> skf = StratifiedKFold(Y, 2) >>> print skf - sklearn.cross_val.StratifiedKFold(labels=[0 0 0 1 1 1 0], k=2) + scikits.learn.cross_val.StratifiedKFold(labels=[0 0 0 1 1 1 0], k=2) >>> for train, test in skf: print train, test [False True False False True False True] [ True False True True False True False] [ True False True True False True False] [False True False False True False True] @@ -169,13 +169,13 @@ For example, in the cases of multiple experiments, *LOLO* can be used to create a cross-validation based on the different experiments: we create a training set using the samples of all the experiments except one:: - >>> from sklearn.cross_val import LeaveOneLabelOut + >>> from scikits.learn.cross_val import LeaveOneLabelOut >>> X = [[0., 0.], [1., 1.], [-1., -1.], [2., 2.]] >>> Y = [0, 1, 0, 1] >>> labels = [1, 1, 2, 2] >>> loo = LeaveOneLabelOut(labels) >>> print loo - sklearn.cross_val.LeaveOneLabelOut(labels=[1, 1, 2, 2]) + scikits.learn.cross_val.LeaveOneLabelOut(labels=[1, 1, 2, 2]) >>> for train, test in loo: print train,test [False False True True] [ True True False False] [ True True False False] [False False True True] @@ -191,13 +191,13 @@ related to *P* labels for each training/test set. Example of Leave-2-Label Out:: - >>> from sklearn.cross_val import LeavePLabelOut + >>> from scikits.learn.cross_val import LeavePLabelOut >>> X = [[0., 0.], [1., 1.], [-1., -1.], [2., 2.], [3., 3.], [4., 4.]] >>> Y = [0, 1, 0, 1, 0, 1] >>> labels = [1, 1, 2, 2, 3, 3] >>> loo = LeavePLabelOut(labels, 2) >>> print loo - sklearn.cross_val.LeavePLabelOut(labels=[1, 1, 2, 2, 3, 3], p=2) + scikits.learn.cross_val.LeavePLabelOut(labels=[1, 1, 2, 2, 3, 3], p=2) >>> for train, test in loo: print train,test [False False False False True True] [ True True True True False False] [False False True True False False] [ True True False False True True] @@ -225,7 +225,7 @@ smaller than the total dataset if it is very large. .. _Bootstrapping: http://en.wikipedia.org/wiki/Bootstrapping_%28statistics%29 - >>> from sklearn import cross_val + >>> from scikits.learn import cross_val >>> bs = cross_val.Bootstrap(9, random_state=0) >>> len(bs) 3 diff --git a/doc/modules/decomposition.rst b/doc/modules/decomposition.rst index 4b5633003c7ed0743eea25d1fd82f05adcabc97f..0d1e42094e028e470a5c98cc3a8a3fc6d027c4b9 100644 --- a/doc/modules/decomposition.rst +++ b/doc/modules/decomposition.rst @@ -5,7 +5,7 @@ Decomposing signals in components (matrix factorization problems) ================================================================= -.. currentmodule:: sklearn.decomposition +.. currentmodule:: scikits.learn.decomposition .. _PCA: diff --git a/doc/modules/dp-derivation.rst b/doc/modules/dp-derivation.rst index 6c35079c688697d022613449fee93fb843c9e99c..50ac37666e0cd446792754b438a35b8f83b6b598 100644 --- a/doc/modules/dp-derivation.rst +++ b/doc/modules/dp-derivation.rst @@ -1,7 +1,7 @@ .. _dpgmm: -.. currentmodule:: sklearn.mixture +.. currentmodule:: scikits.learn.mixture Variational Gaussian Mixture Models diff --git a/doc/modules/feature_extraction.rst b/doc/modules/feature_extraction.rst index afa09358b4858c7da4ab1b52e88c20aec9283759..7916e698e222dc64f7fb8a43a753e1fb9427e9dc 100644 --- a/doc/modules/feature_extraction.rst +++ b/doc/modules/feature_extraction.rst @@ -5,9 +5,9 @@ Feature extraction ================== -.. currentmodule:: sklearn.feature_extraction +.. currentmodule:: scikits.learn.feature_extraction -The :mod:`sklearn.feature_extraction` module can be used to extract +The :mod:`scikits.learn.feature_extraction` module can be used to extract features in a format supported by machine learning algorithms from datasets consisting of formats such as text and image. @@ -15,7 +15,7 @@ consisting of formats such as text and image. Text feature extraction ======================= -.. currentmodule:: sklearn.feature_extraction.text +.. currentmodule:: scikits.learn.feature_extraction.text XXX: a lot to do here @@ -23,7 +23,7 @@ XXX: a lot to do here Image feature extraction ======================== -.. currentmodule:: sklearn.feature_extraction.image +.. currentmodule:: scikits.learn.feature_extraction.image Patch extraction ---------------- @@ -35,7 +35,7 @@ the third axis. For rebuilding an image from all its patches, use picture with 3 color channels (e.g. in RGB format):: >>> import numpy as np - >>> from sklearn.feature_extraction import image + >>> from scikits.learn.feature_extraction import image >>> one_image = np.arange(4 * 4 * 3).reshape((4, 4, 3)) >>> one_image[:, :, 0] # R channel of a fake RGB picture diff --git a/doc/modules/feature_selection.rst b/doc/modules/feature_selection.rst index 76415528fc427906b42a78a614cb6a3d1235dd63..d9864469575f3d4a9af8d299ab79bb31635c04db 100644 --- a/doc/modules/feature_selection.rst +++ b/doc/modules/feature_selection.rst @@ -5,12 +5,12 @@ Feature selection ================= -The classes in the ``sklearn.feature_selection`` module can be used +The classes in the ``scikits.learn.feature_selection`` module can be used for feature selection/dimensionality reduction on sample sets, either to improve estimators' accuracy scores or to boost their performance on very high-dimensional datasets. -.. currentmodule:: sklearn.feature_selection +.. currentmodule:: scikits.learn.feature_selection Univariate feature selection ============================ diff --git a/doc/modules/gaussian_process.rst b/doc/modules/gaussian_process.rst index 63d615baacaa83acb1e21464ad124b9f5f553d78..07d7396ad52e5227d7d829bb0baeadf87a38bdc3 100644 --- a/doc/modules/gaussian_process.rst +++ b/doc/modules/gaussian_process.rst @@ -6,7 +6,7 @@ Gaussian Processes ================== -.. currentmodule:: sklearn.gaussian_process +.. currentmodule:: scikits.learn.gaussian_process **Gaussian Processes for Machine Learning (GPML)** is a generic supervised learning method primarily designed to solve *regression* problems. It has also @@ -64,7 +64,7 @@ parameters or alternatively it uses the given parameters. :: >>> import numpy as np - >>> from sklearn import gaussian_process + >>> from scikits.learn import gaussian_process >>> def f(x): ... return x * np.sin(x) >>> X = np.atleast_2d([1., 3., 5., 6., 7., 8.]).T diff --git a/doc/modules/grid_search.rst b/doc/modules/grid_search.rst index 40b6e44f917ed72a1a1284dee336bd6df006c16a..811ede07ddbf7fe3eaab67630a5dc67ee1aba793 100644 --- a/doc/modules/grid_search.rst +++ b/doc/modules/grid_search.rst @@ -2,7 +2,7 @@ Grid Search =================================================== -.. currentmodule:: sklearn.grid_search +.. currentmodule:: scikits.learn.grid_search Grid Search is used to optimize the parameters of a model diff --git a/doc/modules/hmm.rst b/doc/modules/hmm.rst index d1ca443f8da4f9e1b2407f4ebebf6ba19bdfb695..629f215537b479af46eca8b0693f00c57b7540f9 100644 --- a/doc/modules/hmm.rst +++ b/doc/modules/hmm.rst @@ -9,7 +9,7 @@ Hidden Markov Models the mailing list. -.. currentmodule:: sklearn.hmm +.. currentmodule:: scikits.learn.hmm Classes in this module include :class:`GaussianHMM`, :class:`MultinomalHMM` and :class:`GMMHMM`. There's currently no narrative documentation for this diff --git a/doc/modules/linear_model.rst b/doc/modules/linear_model.rst index 1d1da635f091502f8d2f5288c0130d5efc6153a8..0dc5c15dd959abf3b515e28d6bc7042b3fb8a387 100644 --- a/doc/modules/linear_model.rst +++ b/doc/modules/linear_model.rst @@ -5,7 +5,7 @@ Generalized Linear Models ========================= -.. currentmodule:: sklearn.linear_model +.. currentmodule:: scikits.learn.linear_model The following are a set of methods intended for regression in which the target value is expected to be a linear combination of the input @@ -40,7 +40,7 @@ responses predicted by the linear approximation. and will store the coefficients :math:`w` of the linear model in its `coef\_` member:: - >>> from sklearn import linear_model + >>> from scikits.learn import linear_model >>> clf = linear_model.LinearRegression() >>> clf.fit ([[0, 0], [1, 1], [2, 2]], [0, 1, 2]) LinearRegression(fit_intercept=True, normalize=False, overwrite_X=False) @@ -97,7 +97,7 @@ As with other linear models, :class:`Ridge` will take in its `fit` method arrays X, y and will store the coefficients :math:`w` of the linear model in its `coef\_` member:: - >>> from sklearn import linear_model + >>> from scikits.learn import linear_model >>> clf = linear_model.Ridge (alpha = .5) >>> clf.fit ([[0, 0], [0, 0], [1, 1]], [0, .1, 1]) Ridge(alpha=0.5, fit_intercept=True, normalize=False, overwrite_X=False, @@ -133,7 +133,7 @@ cross-validation of the alpha parameter. The object works in the same way as GridSearchCV except that it defaults to Generalized Cross-Validation (GCV), an efficient form of leave-one-out cross-validation:: - >>> from sklearn import linear_model + >>> from scikits.learn import linear_model >>> clf = linear_model.RidgeCV(alphas=[0.1, 1.0, 10.0]) >>> clf.fit([[0, 0], [0, 0], [1, 1]], [0, .1, 1]) # doctest: +SKIP RidgeCV(alphas=[0.1, 1.0, 10.0], cv=None, fit_intercept=True, loss_func=None, @@ -321,7 +321,7 @@ function of the norm of its coefficients. :: - >>> from sklearn import linear_model + >>> from scikits.learn import linear_model >>> clf = linear_model.LassoLars(alpha=.1) >>> clf.fit ([[0, 0], [1, 1]], [0, 1]) # doctest: +ELLIPSIS LassoLars(alpha=0.1, eps=..., fit_intercept=True, @@ -461,7 +461,7 @@ By default :math:`\alpha_1 = \alpha_2 = \lambda_1 = \lambda_2 = 1.e^{-6}`, *i.e *Bayesian Ridge Regression* is used for regression:: - >>> from sklearn import linear_model + >>> from scikits.learn import linear_model >>> X = [[0., 0.], [1., 1.], [2., 2.], [3., 3.]] >>> Y = [0., 1., 2., 3.] >>> clf = linear_model.BayesianRidge() @@ -585,7 +585,7 @@ but rather a "hit or miss" cost. The :class:`LogisticRegression` class can be used to do L1 or L2 penalized logistic regression. L1 penalization yields sparse predicting weights. -For L1 penalization :func:`sklearn.svm.l1_min_c` allows to calculate +For L1 penalization :func:`scikits.learn.svm.l1_min_c` allows to calculate the lower bound for C in order to get a non "null" (all feature weights to zero) model. diff --git a/doc/modules/manifold.rst b/doc/modules/manifold.rst index 9fbba304072ea216f02dc02c173b9ce10d1ea8b2..ecf22534a81330ce80def6e0c4c80c6d4ec74b7e 100644 --- a/doc/modules/manifold.rst +++ b/doc/modules/manifold.rst @@ -1,7 +1,7 @@ .. _manifold: -.. currentmodule:: sklearn.manifold +.. currentmodule:: scikits.learn.manifold ================= Manifold learning @@ -91,7 +91,7 @@ from the data itself, without the use of predetermined classifications. * See :ref:`example_manifold_plot_compare_methods.py` for an example of dimensionality reduction on a toy "S-curve" dataset. -The manifold learning implementations available in sklearn are +The manifold learning implementations available in scikits-learn are summarized below Isomap @@ -114,7 +114,7 @@ Complexity The Isomap algorithm comprises three stages: 1. **Nearest neighbor search.** Isomap uses - :class:`sklearn.neighbors.BallTree` for efficient neighbor search. + :class:`scikits.learn.neighbors.BallTree` for efficient neighbor search. The cost is approximately :math:`O[D \log(k) N \log(N)]`, for :math:`k` nearest neighbors of :math:`N` points in :math:`D` dimensions. @@ -257,7 +257,7 @@ Hessian Eigenmapping (also known as Hessian-based LLE: HLLE) is another method of solving the regularization problem of LLE. It revolves around a hessian-based quadratic form at each neighborhood which is used to recover the locally linear structure. Though other implementations note its poor -scaling with data size, ``sklearn`` implements some algorithmic +scaling with data size, ``scikits-learn`` implements some algorithmic improvements which make its cost comparable to that of other LLE variants for small output dimension. HLLE can be performed with function :func:`locally_linear_embedding` or its object-oriented counterpart diff --git a/doc/modules/mixture.rst b/doc/modules/mixture.rst index dbf2db9d5ff7e0cf29f567220bb7a112d5904507..d645a098aa03679599acc8ef7458bc8e0ed910be 100644 --- a/doc/modules/mixture.rst +++ b/doc/modules/mixture.rst @@ -4,9 +4,9 @@ Gaussian mixture models =================================================== -.. currentmodule:: sklearn.mixture +.. currentmodule:: scikits.learn.mixture -`sklearn.mixture` is a package which enables one to learn +`scikits.learn.mixture` is a package which enables one to learn Gaussian Mixture Models (diagonal, spherical, tied and full covariance matrices supported), sample them, and estimate them from data. Facilities to help determine the appropriate number of @@ -35,7 +35,7 @@ these models that, while not guaranteed to return the optimal solution, do converge quickly to a local optimum. To improve the quality it is usual to fit these models many times with different parameters and choose the best result, as measured by the likelihood -or some other external criterion. Here in `sklearn` we implement +or some other external criterion. Here in `scikits.learn` we implement two approximate inference algorithms for mixtures of gaussians: expectation-maximization and variational inference. We also implement a variant of the mixture model, known as the Dirichlet Process prior, @@ -59,7 +59,7 @@ origin) and computes for each point a probability distribution on the components it could have been assigned to. Then, one tweaks the parameters to maximize the likelihood of the data given those assignments. Repeating this process is guaranteed to always converge -to a local optimum. In the `sklearn` this algorithm in +to a local optimum. In the `scikits.learn` this algorithm in implemented in the :class:`GMM` class. Advantages of expectation-maximization: @@ -206,7 +206,7 @@ The main disadvantages of using the dirichlet process are: GMM classifier ============== -.. currentmodule:: sklearn.mixture +.. currentmodule:: scikits.learn.mixture The :class:`GMM` object implements the expectation-maximization (EM) algorithm for fitting mixture-of-gaussian models. It can also draw @@ -238,7 +238,7 @@ the :meth:`GMM.predict` method. Variational Gaussian mixtures: VBGMM classifier ============================================= -.. currentmodule:: sklearn.mixture +.. currentmodule:: scikits.learn.mixture The :class:`VBGMM` object implements a variant of the Gaussian mixture model with variational inference algorithms. The API is identical to diff --git a/doc/modules/multiclass.rst b/doc/modules/multiclass.rst index e657335a064c7e0f10ed02148bf4a3cdc7a06886..767fdf75a50c9386d93860d4b67dafbfb85cd8b4 100644 --- a/doc/modules/multiclass.rst +++ b/doc/modules/multiclass.rst @@ -2,7 +2,7 @@ Multiclass algorithms ===================== -.. currentmodule:: sklearn.multiclass +.. currentmodule:: scikits.learn.multiclass This module implements multiclass learning algorithms: - one-vs-the-rest / one-vs-all @@ -40,9 +40,9 @@ only, it is possible to gain knowledge about the class by inspecting its corresponding classifier. This is the most commonly used strategy and is a fair default choice. Below is an example:: - >>> from sklearn import datasets - >>> from sklearn.multiclass import OneVsRestClassifier - >>> from sklearn.svm import LinearSVC + >>> from scikits.learn import datasets + >>> from scikits.learn.multiclass import OneVsRestClassifier + >>> from scikits.learn.svm import LinearSVC >>> iris = datasets.load_iris() >>> X, y = iris.data, iris.target >>> OneVsRestClassifier(LinearSVC()).fit(X, y).predict(X) @@ -68,9 +68,9 @@ algorithms such as kernel algorithms which don't scale well with a small subset of the data whereas, with one-vs-the-rest, the complete dataset is used `n_classes` times. Below is an example:: - >>> from sklearn import datasets - >>> from sklearn.multiclass import OneVsOneClassifier - >>> from sklearn.svm import LinearSVC + >>> from scikits.learn import datasets + >>> from scikits.learn.multiclass import OneVsOneClassifier + >>> from scikits.learn.svm import LinearSVC >>> iris = datasets.load_iris() >>> X, y = iris.data, iris.target >>> OneVsOneClassifier(LinearSVC()).fit(X, y).predict(X) @@ -120,9 +120,9 @@ effect to bagging. Example:: - >>> from sklearn import datasets - >>> from sklearn.multiclass import OutputCodeClassifier - >>> from sklearn.svm import LinearSVC + >>> from scikits.learn import datasets + >>> from scikits.learn.multiclass import OutputCodeClassifier + >>> from scikits.learn.svm import LinearSVC >>> iris = datasets.load_iris() >>> X, y = iris.data, iris.target >>> OutputCodeClassifier(LinearSVC(), code_size=2, random_state=0).fit(X, y).predict(X) diff --git a/doc/modules/naive_bayes.rst b/doc/modules/naive_bayes.rst index 9bad53492a53709ef8833e98c3460d32f01a07f3..b77c0bedef8562aea4a95ff8c8297bf015d9882b 100644 --- a/doc/modules/naive_bayes.rst +++ b/doc/modules/naive_bayes.rst @@ -2,7 +2,7 @@ Naive Bayes =========== -.. currentmodule:: sklearn.naive_bayes +.. currentmodule:: scikits.learn.naive_bayes **Naive Bayes** algorithms are a set of supervised learning methods diff --git a/doc/modules/neighbors.rst b/doc/modules/neighbors.rst index 4b61ba192a22a98301324a900aa2e25387b766c9..0f5115267ef9e26a9d54052681a61cf318bc62df 100644 --- a/doc/modules/neighbors.rst +++ b/doc/modules/neighbors.rst @@ -2,7 +2,7 @@ Nearest Neighbors ================= -.. currentmodule:: sklearn.neighbors +.. currentmodule:: scikits.learn.neighbors The principle behind nearest neighbor methods (*k*-NN) is to find the *k* training samples closest in Euclidean distance to the sample to be classified, diff --git a/doc/modules/pls.rst b/doc/modules/pls.rst index 668332461c4f5c36a5c25f92cdbd2be45eaa6042..d0a49430609299e95574f2e058e57d2634ee3fca 100644 --- a/doc/modules/pls.rst +++ b/doc/modules/pls.rst @@ -4,7 +4,7 @@ Partial Least Squares ====================== -.. currentmodule:: sklearn.pls +.. currentmodule:: scikits.learn.pls Partial least squares (PLS) models are useful to find linear relations between two multivariate datasets: in PLS the `X` and `Y` arguments of diff --git a/doc/modules/preprocessing.rst b/doc/modules/preprocessing.rst index 4901bd4ee9f5a78f954416f034209d71e0af9fdb..76c7836f74e165b15c835fb324e22a3e8cc97f69 100644 --- a/doc/modules/preprocessing.rst +++ b/doc/modules/preprocessing.rst @@ -4,9 +4,9 @@ Preprocessing data ================== -.. currentmodule:: sklearn.preprocessing +.. currentmodule:: scikits.learn.preprocessing -The ``sklearn.preprocessing`` package provides several common +The ``scikits.learn.preprocessing`` package provides several common utility functions and transformer classes to change raw feature vectors into a representation that is more suitable for the downstream estimators. @@ -36,7 +36,7 @@ estimator unable to learn from other features correctly as expected. The function :func:`scale` provides a quick and easy way to perform this operation on a single array-like dataset:: - >>> from sklearn import preprocessing + >>> from scikits.learn import preprocessing >>> X = [[ 1., -1., 2.], ... [ 2., 0., 0.], ... [ 0., 1., -1.]] @@ -60,7 +60,7 @@ The ``preprocessing`` module further provides a utility class the mean and standard deviation on a training set so as to be able to later reapply the same transformation on the testing set. This class is hence suitable for use in the early steps of a -:class:`sklearn.pipeline.Pipeline`:: +:class:`scikits.learn.pipeline.Pipeline`:: >>> scaler = preprocessing.Scaler().fit(X) >>> scaler @@ -101,8 +101,8 @@ of :class:`Scaler`. since downstream model can further make assumption on the linear independence of the features. - To address this issue you can use :class:`sklearn.decomposition.PCA` - or :class:`sklearn.decomposition.RandomizedPCA` with ``whiten=True`` + To address this issue you can use :class:`scikits.learn.decomposition.PCA` + or :class:`scikits.learn.decomposition.RandomizedPCA` with ``whiten=True`` to further remove the linear correlation across features. Also note that the current implementation of :func:`scale` and @@ -141,7 +141,7 @@ The ``preprocessing`` module further provides a utility class the class is stateless as this operation treats samples independently). This class is hence suitable for use in the early steps of a -:class:`sklearn.pipeline.Pipeline`:: +:class:`scikits.learn.pipeline.Pipeline`:: >>> normalizer = preprocessing.Normalizer().fit(X) # fit does nothing >>> normalizer @@ -192,7 +192,7 @@ often perform slightly better in practice. As for the :class:`Normalizer`, the utility class :class:`Binarizer` is meant to be used in the early stages of -:class:`sklearn.pipeline.Pipeline`. The ``fit`` method does nothing +:class:`scikits.learn.pipeline.Pipeline`. The ``fit`` method does nothing as each sample is treated independently of others:: >>> X = [[ 1., -1., 2.], diff --git a/doc/modules/sgd.rst b/doc/modules/sgd.rst index 1b0b6cedc68f7197489a40c1dae7deef03ceb394..e3f435a58946d26f000565230d1614675f42ef80 100644 --- a/doc/modules/sgd.rst +++ b/doc/modules/sgd.rst @@ -5,7 +5,7 @@ Stochastic Gradient Descent =========================== -.. currentmodule:: sklearn.linear_model +.. currentmodule:: scikits.learn.linear_model **Stochastic Gradient Descent (SGD)** is a simple yet very efficient approach to discriminative learning of linear classifiers under @@ -54,7 +54,7 @@ of size [n_samples, n_features] holding the training samples, and an array Y of size [n_samples] holding the target values (class labels) for the training samples:: - >>> from sklearn.linear_model import SGDClassifier + >>> from scikits.learn.linear_model import SGDClassifier >>> X = [[0., 0.], [1., 1.]] >>> y = [0, 1] >>> clf = SGDClassifier(loss="hinge", penalty="l2") @@ -183,7 +183,7 @@ specified via the parameter `epsilon`. - :ref:`example_linear_model_plot_sgd_ols.py`, -.. currentmodule:: sklearn.linear_model.sparse +.. currentmodule:: scikits.learn.linear_model.sparse Stochastic Gradient Descent for sparse data =========================================== @@ -233,7 +233,7 @@ Tips on Practical Use must be applied to the test vector to obtain meaningful results. This can be easily done using :class:`Scaler`:: - from sklearn.preprocessing import Scaler + from scikits.learn.preprocessing import Scaler scaler = Scaler() scaler.fit(X_train) # Don't cheat - fit only on training data X_train = scaler.transform(X_train) diff --git a/doc/modules/svm.rst b/doc/modules/svm.rst index 8696cdc4b004cc9bf2f1fac1ff79029383561c04..697b0abd1a37f14584928313f0adf41243d196e6 100644 --- a/doc/modules/svm.rst +++ b/doc/modules/svm.rst @@ -5,7 +5,7 @@ Support Vector Machines ======================= -.. currentmodule:: sklearn.svm +.. currentmodule:: scikits.learn.svm **Support vector machines (SVMs)** are a set of supervised learning methods used for :ref:`classification <svm_classification>`, @@ -74,7 +74,7 @@ of integer values, size [n_samples], holding the class labels for the training samples:: - >>> from sklearn import svm + >>> from scikits.learn import svm >>> X = [[0, 0], [1, 1]] >>> Y = [0, 1] >>> clf = svm.SVC() @@ -200,7 +200,7 @@ As with classification classes, the fit method will take as argument vectors X, y, only that in this case y is expected to have floating point values instead of integer values:: - >>> from sklearn import svm + >>> from scikits.learn import svm >>> X = [[0, 0], [2, 2]] >>> y = [0.5, 2.5] >>> clf = svm.SVR() @@ -241,7 +241,7 @@ will only take as input an array X, as there are no class labels. * :ref:`example_svm_plot_oneclass.py` * :ref:`example_applications_plot_species_distribution_modeling.py` -.. currentmodule:: sklearn.svm.sparse +.. currentmodule:: scikits.learn.svm.sparse Support Vector machines for sparse data @@ -373,7 +373,7 @@ The following code defines a linear kernel and creates a classifier instance that will use that kernel:: >>> import numpy as np - >>> from sklearn import svm + >>> from scikits.learn import svm >>> def my_kernel(x, y): ... return np.dot(x, y.T) ... diff --git a/doc/tutorial.rst b/doc/tutorial.rst index a1c64d5cd60777d42be40a484cbf7b6c4714f1a5..cc90d8d9768cbfebf47722b2889973453c0d0289 100644 --- a/doc/tutorial.rst +++ b/doc/tutorial.rst @@ -63,7 +63,7 @@ Loading an example dataset datasets for classification and the `boston house prices dataset <http://archive.ics.uci.edu/ml/datasets/Housing>`_ for regression.:: - >>> from sklearn import datasets + >>> from scikits.learn import datasets >>> iris = datasets.load_iris() >>> digits = datasets.load_digits() @@ -115,7 +115,7 @@ array([0, 1, 2, ..., 8, 9, 8]) data for consumption in the `scikit-learn`. -``sklearn`` also offers the possibility to reuse external datasets coming +``scikits.learn`` also offers the possibility to reuse external datasets coming from the http://mlcomp.org online service that provides a repository of public datasets for various tasks (binary & multi label classification, regression, document classification, ...) along with a runtime environment to compare @@ -135,14 +135,14 @@ the labels corresponding to new data. In `scikit-learn`, an *estimator* is just a plain Python class that implements the methods `fit(X, Y)` and `predict(T)`. -An example of estimator is the class ``sklearn.svm.SVC`` that +An example of estimator is the class ``scikits.learn.svm.SVC`` that implements `Support Vector Classification <http://en.wikipedia.org/wiki/Support_vector_machine>`_. The constructor of an estimator takes as arguments the parameters of the model, but for the time being, we will consider the estimator as a black box and not worry about these: ->>> from sklearn import svm +>>> from scikits.learn import svm >>> clf = svm.SVC() We call our estimator instance `clf` as it is a classifier. It now must @@ -181,8 +181,8 @@ Model persistence It is possible to save a model in the scikit by using Python's built-in persistence model, namely `pickle <http://docs.python.org/library/pickle.html>`_. ->>> from sklearn import svm ->>> from sklearn import datasets +>>> from scikits.learn import svm +>>> from scikits.learn import datasets >>> clf = svm.SVC() >>> iris = datasets.load_iris() >>> X, y = iris.data, iris.target @@ -201,6 +201,6 @@ In the specific case of the scikit, it may be more interesting to use joblib's replacement of pickle, which is more efficient on big data, but can only pickle to the disk and not to a string: ->>> from sklearn.externals import joblib +>>> from scikits.learn.externals import joblib >>> joblib.dump(clf, 'filename.pkl') # doctest: +SKIP diff --git a/doc/whats_new.rst b/doc/whats_new.rst index ee1d060bf4c5e7889a64b45672d2c4a9b623ddfe..098117050eea34793317dd7eeaeffe9e0f06b04b 100644 --- a/doc/whats_new.rst +++ b/doc/whats_new.rst @@ -1,5 +1,5 @@ -.. currentmodule:: sklearn +.. currentmodule:: scikits.learn .. _changes_0_8: @@ -257,7 +257,7 @@ Changelog - Improved sparse matrix support, both in main classes (:class:`grid_search.GridSearchCV`) as in modules - sklearn.svm.sparse and sklearn.linear_model.sparse. + scikits.learn.svm.sparse and scikits.learn.linear_model.sparse. - Lots of cool new examples and a new section that uses real-world datasets was created. These include: @@ -356,7 +356,7 @@ New classes - New module feature_extraction (see :ref:`class reference <feature_extraction_ref>`) - - New FastICA algorithm in module sklearn.fastica + - New FastICA algorithm in module scikits.learn.fastica Documentation @@ -397,7 +397,7 @@ External dependencies ~~~~~~~~~~~~~~~~~~~~~ - Joblib is now a dependencie of this package, although it is - shipped with (sklearn.externals.joblib). + shipped with (scikits.learn.externals.joblib). Removed modules ~~~~~~~~~~~~~~~ diff --git a/examples/applications/face_recognition.py b/examples/applications/face_recognition.py index a9e3efe1fa6d747079b297260b305a1807e8b4af..5251f0cfcdbbdef6751edfd8f27a50b4a1dd4d47 100644 --- a/examples/applications/face_recognition.py +++ b/examples/applications/face_recognition.py @@ -36,13 +36,13 @@ from time import time import logging import pylab as pl -from sklearn.cross_val import StratifiedKFold -from sklearn.datasets import fetch_lfw_people -from sklearn.grid_search import GridSearchCV -from sklearn.metrics import classification_report -from sklearn.metrics import confusion_matrix -from sklearn.decomposition import RandomizedPCA -from sklearn.svm import SVC +from scikits.learn.cross_val import StratifiedKFold +from scikits.learn.datasets import fetch_lfw_people +from scikits.learn.grid_search import GridSearchCV +from scikits.learn.metrics import classification_report +from scikits.learn.metrics import confusion_matrix +from scikits.learn.decomposition import RandomizedPCA +from scikits.learn.svm import SVC # Display progress logs on stdout logging.basicConfig(level=logging.INFO, format='%(asctime)s %(message)s') diff --git a/examples/applications/plot_species_distribution_modeling.py b/examples/applications/plot_species_distribution_modeling.py index c7f1d5dd5ad240ef27585385085fdd979305177e..9d70ec02a11f802ad17323ec57f2593d1930c91d 100644 --- a/examples/applications/plot_species_distribution_modeling.py +++ b/examples/applications/plot_species_distribution_modeling.py @@ -10,7 +10,7 @@ mammals given past observations and 14 environmental variables. Since we have only positive examples (there are no unsuccessful observations), we cast this problem as a density estimation problem and use the `OneClassSVM` provided -by the package `sklearn.svm` as our modeling tool. +by the package `scikits.learn.svm` as our modeling tool. The dataset is provided by Phillips et. al. (2006). If available, the example uses `basemap <http://matplotlib.sourceforge.net/basemap/doc/html/>`_ to plot the coast lines and national boundaries of South America. @@ -54,9 +54,9 @@ try: except ImportError: basemap = False -from sklearn import svm -from sklearn.metrics import roc_curve, auc -from sklearn.datasets.base import Bunch +from scikits.learn import svm +from scikits.learn.metrics import roc_curve, auc +from scikits.learn.datasets.base import Bunch ############################################################################### # Download the data, if not already on disk diff --git a/examples/applications/stock_market.py b/examples/applications/stock_market.py index c45351683c615545abb15b6c2c0a6b5f45aeb4d8..25a1ef61dbc7ed8015c9ddd28fc22d004d6f662a 100644 --- a/examples/applications/stock_market.py +++ b/examples/applications/stock_market.py @@ -15,7 +15,7 @@ import datetime from matplotlib import finance import numpy as np -from sklearn import cluster +from scikits.learn import cluster # Choose a time period reasonnably calm (not too long ago so that we get # high-tech firms, and before the 2008 crash) diff --git a/examples/applications/svm_gui.py b/examples/applications/svm_gui.py index a8b5836e95c1f14e1097b2c2c76e50101a56781b..9667d9d0ff04c3caf34fc9de7a7316b62276fdc4 100644 --- a/examples/applications/svm_gui.py +++ b/examples/applications/svm_gui.py @@ -33,7 +33,7 @@ import Tkinter as Tk import sys import numpy as np -from sklearn import svm +from scikits.learn import svm y_min, y_max = -50, 50 x_min, x_max = -50, 50 diff --git a/examples/applications/topics_extraction_with_nmf.py b/examples/applications/topics_extraction_with_nmf.py index 14246e096778295bd35b8d6447d30f63e8d71450..f446d46466404e0aa306dc6d0b5f31f2dfd2112a 100644 --- a/examples/applications/topics_extraction_with_nmf.py +++ b/examples/applications/topics_extraction_with_nmf.py @@ -36,9 +36,9 @@ edu reply pain health david article medical medicine 16 """ from time import time -from sklearn.feature_extraction import text -from sklearn import decomposition -from sklearn import datasets +from scikits.learn.feature_extraction import text +from scikits.learn import decomposition +from scikits.learn import datasets n_samples = 1000 n_features = 1000 diff --git a/examples/applications/wikipedia_principal_eigenvector.py b/examples/applications/wikipedia_principal_eigenvector.py index 50ec843d35598bdf9b4288dbd4afa59eea3d23b3..12a49c6df9040beb21515e31896245897d5cecd8 100644 --- a/examples/applications/wikipedia_principal_eigenvector.py +++ b/examples/applications/wikipedia_principal_eigenvector.py @@ -43,8 +43,8 @@ import numpy as np from scipy import sparse -from sklearn.utils.extmath import fast_svd -from sklearn.externals.joblib import Memory +from scikits.learn.utils.extmath import fast_svd +from scikits.learn.externals.joblib import Memory ################################################################################ diff --git a/examples/cluster/plot_affinity_propagation.py b/examples/cluster/plot_affinity_propagation.py index 2dc630bc75282ba8439060924b12c30840da5b47..69ff4475a2100d1701bdcbd1770914ceb78ebe83 100644 --- a/examples/cluster/plot_affinity_propagation.py +++ b/examples/cluster/plot_affinity_propagation.py @@ -11,9 +11,9 @@ Between Data Points", Science Feb. 2007 print __doc__ import numpy as np -from sklearn.cluster import AffinityPropagation -from sklearn import metrics -from sklearn.datasets.samples_generator import make_blobs +from scikits.learn.cluster import AffinityPropagation +from scikits.learn import metrics +from scikits.learn.datasets.samples_generator import make_blobs ############################################################################## # Generate sample data diff --git a/examples/cluster/plot_color_quantization.py b/examples/cluster/plot_color_quantization.py index 518376e86b816cef6bfb15d3b7b5ca1a6581ba8c..36afcf1441329dca776076a613d70268922e0ea5 100644 --- a/examples/cluster/plot_color_quantization.py +++ b/examples/cluster/plot_color_quantization.py @@ -27,10 +27,10 @@ randomly) is also shown. print __doc__ import numpy as np import pylab as pl -from sklearn.cluster import KMeans -from sklearn.metrics import euclidean_distances -from sklearn.datasets import load_sample_image -from sklearn.utils import shuffle +from scikits.learn.cluster import KMeans +from scikits.learn.metrics import euclidean_distances +from scikits.learn.datasets import load_sample_image +from scikits.learn.utils import shuffle from time import time n_colors = 64 diff --git a/examples/cluster/plot_dbscan.py b/examples/cluster/plot_dbscan.py index 38a32f53d31e3a1bbe6eb40d9245a0984769a4c9..175f9eb96b4d657a69eb162df99752e2819ba58b 100644 --- a/examples/cluster/plot_dbscan.py +++ b/examples/cluster/plot_dbscan.py @@ -11,9 +11,9 @@ print __doc__ import numpy as np from scipy.spatial import distance -from sklearn.cluster import DBSCAN -from sklearn import metrics -from sklearn.datasets.samples_generator import make_blobs +from scikits.learn.cluster import DBSCAN +from scikits.learn import metrics +from scikits.learn.datasets.samples_generator import make_blobs ############################################################################## diff --git a/examples/cluster/plot_feature_agglomeration_vs_univariate_selection.py b/examples/cluster/plot_feature_agglomeration_vs_univariate_selection.py index c23b944db31ae44f507665490fd8e8f7702439a4..951a4f2c6c71f912c8d817379661400c81d42c6f 100644 --- a/examples/cluster/plot_feature_agglomeration_vs_univariate_selection.py +++ b/examples/cluster/plot_feature_agglomeration_vs_univariate_selection.py @@ -22,14 +22,14 @@ import numpy as np import pylab as pl from scipy import linalg, ndimage -from sklearn.feature_extraction.image import grid_to_graph -from sklearn import feature_selection -from sklearn.cluster import WardAgglomeration -from sklearn.linear_model import BayesianRidge -from sklearn.pipeline import Pipeline -from sklearn.grid_search import GridSearchCV -from sklearn.externals.joblib import Memory -from sklearn.cross_val import KFold +from scikits.learn.feature_extraction.image import grid_to_graph +from scikits.learn import feature_selection +from scikits.learn.cluster import WardAgglomeration +from scikits.learn.linear_model import BayesianRidge +from scikits.learn.pipeline import Pipeline +from scikits.learn.grid_search import GridSearchCV +from scikits.learn.externals.joblib import Memory +from scikits.learn.cross_val import KFold ############################################################################### # Generate data diff --git a/examples/cluster/plot_kmeans_digits.py b/examples/cluster/plot_kmeans_digits.py index 77925a5d133c09654b846eb274ae0a84fa7534e3..76440884a35842225503183434742a47b65f73b5 100644 --- a/examples/cluster/plot_kmeans_digits.py +++ b/examples/cluster/plot_kmeans_digits.py @@ -16,11 +16,11 @@ from time import time import numpy as np import pylab as pl -from sklearn import metrics -from sklearn.cluster import KMeans -from sklearn.datasets import load_digits -from sklearn.decomposition import PCA -from sklearn.preprocessing import scale +from scikits.learn import metrics +from scikits.learn.cluster import KMeans +from scikits.learn.datasets import load_digits +from scikits.learn.decomposition import PCA +from scikits.learn.preprocessing import scale np.random.seed(42) diff --git a/examples/cluster/plot_lena_segmentation.py b/examples/cluster/plot_lena_segmentation.py index bc637fb31b1c5877e75d8ab367995f3bba9f793b..2c11c4bb06f7ee1fe8602deeeb576949d293a204 100644 --- a/examples/cluster/plot_lena_segmentation.py +++ b/examples/cluster/plot_lena_segmentation.py @@ -19,8 +19,8 @@ import numpy as np import scipy as sp import pylab as pl -from sklearn.feature_extraction import image -from sklearn.cluster import spectral_clustering +from scikits.learn.feature_extraction import image +from scikits.learn.cluster import spectral_clustering lena = sp.lena() # Downsample the image by a factor of 4 diff --git a/examples/cluster/plot_lena_ward_segmentation.py b/examples/cluster/plot_lena_ward_segmentation.py index a4e99d998a9d7bb14d0859c49db416f12c18cb2a..03374ba5caec3c1d4e73e5802e2297af422c86b8 100644 --- a/examples/cluster/plot_lena_ward_segmentation.py +++ b/examples/cluster/plot_lena_ward_segmentation.py @@ -18,8 +18,8 @@ import time as time import numpy as np import scipy as sp import pylab as pl -from sklearn.feature_extraction.image import grid_to_graph -from sklearn.cluster import Ward +from scikits.learn.feature_extraction.image import grid_to_graph +from scikits.learn.cluster import Ward ############################################################################### # Generate data diff --git a/examples/cluster/plot_mean_shift.py b/examples/cluster/plot_mean_shift.py index b310378a940d34487a575a5123b75bcb3651ecc6..13fdbdfeb4e7f2580cc588a916141bd840b02794 100644 --- a/examples/cluster/plot_mean_shift.py +++ b/examples/cluster/plot_mean_shift.py @@ -13,8 +13,8 @@ Machine Intelligence. 2002. pp. 603-619. print __doc__ import numpy as np -from sklearn.cluster import MeanShift, estimate_bandwidth -from sklearn.datasets.samples_generator import make_blobs +from scikits.learn.cluster import MeanShift, estimate_bandwidth +from scikits.learn.datasets.samples_generator import make_blobs ############################################################################### # Generate sample data diff --git a/examples/cluster/plot_mini_batch_kmeans.py b/examples/cluster/plot_mini_batch_kmeans.py index 8415c2a1585bb0181d85780c3b5b80e4da39485c..7a876bd056854df38005eba8f2ae5ed0c173cc12 100644 --- a/examples/cluster/plot_mini_batch_kmeans.py +++ b/examples/cluster/plot_mini_batch_kmeans.py @@ -19,9 +19,9 @@ import time import numpy as np import pylab as pl -from sklearn.cluster import MiniBatchKMeans, KMeans -from sklearn.metrics.pairwise import euclidean_distances -from sklearn.datasets.samples_generator import make_blobs +from scikits.learn.cluster import MiniBatchKMeans, KMeans +from scikits.learn.metrics.pairwise import euclidean_distances +from scikits.learn.datasets.samples_generator import make_blobs ############################################################################## # Generate sample data diff --git a/examples/cluster/plot_segmentation_toy.py b/examples/cluster/plot_segmentation_toy.py index 82ba430c1ae102f793cf426878cf0b7c627861a4..e810c25b2bfd40a89c7cff5e6c970bef23bb17b4 100644 --- a/examples/cluster/plot_segmentation_toy.py +++ b/examples/cluster/plot_segmentation_toy.py @@ -33,8 +33,8 @@ print __doc__ import numpy as np import pylab as pl -from sklearn.feature_extraction import image -from sklearn.cluster import spectral_clustering +from scikits.learn.feature_extraction import image +from scikits.learn.cluster import spectral_clustering ################################################################################ l = 100 diff --git a/examples/cluster/plot_ward_structured_vs_unstructured.py b/examples/cluster/plot_ward_structured_vs_unstructured.py index 95c37277b8c7c4ac444614a6497aa68d53b667dd..b5651fded6a68ab3833b51d3d6a45c8688978e26 100644 --- a/examples/cluster/plot_ward_structured_vs_unstructured.py +++ b/examples/cluster/plot_ward_structured_vs_unstructured.py @@ -28,8 +28,8 @@ import time as time import numpy as np import pylab as pl import mpl_toolkits.mplot3d.axes3d as p3 -from sklearn.cluster import Ward -from sklearn.datasets.samples_generator import make_swiss_roll +from scikits.learn.cluster import Ward +from scikits.learn.datasets.samples_generator import make_swiss_roll ############################################################################### # Generate data (swiss roll dataset) @@ -61,7 +61,7 @@ pl.title('Without connectivity constraints') ############################################################################### # Define the structure A of the data. Here a 10 nearest neighbors -from sklearn.neighbors import kneighbors_graph +from scikits.learn.neighbors import kneighbors_graph connectivity = kneighbors_graph(X, n_neighbors=10) ############################################################################### diff --git a/examples/covariance/plot_covariance_estimation.py b/examples/covariance/plot_covariance_estimation.py index 306244c35d882445c746d6734e379d100137e84c..178caceecfe2c6cfd40b0ec2c2cb04d3f1efe31e 100644 --- a/examples/covariance/plot_covariance_estimation.py +++ b/examples/covariance/plot_covariance_estimation.py @@ -42,7 +42,7 @@ X_test = np.dot(base_X_test, coloring_matrix) ############################################################################### # Compute Ledoit-Wolf and Covariances on a grid of shrinkages -from sklearn.covariance import LedoitWolf, OAS, ShrunkCovariance, \ +from scikits.learn.covariance import LedoitWolf, OAS, ShrunkCovariance, \ log_likelihood, empirical_covariance # Ledoit-Wolf optimal shrinkage coefficient estimate diff --git a/examples/covariance/plot_lw_vs_oas.py b/examples/covariance/plot_lw_vs_oas.py index dc2965732c2fd847ee3988a8c12f2f1aa409fffb..1e13c185bbe321dac7555724be56ee38ce458c8a 100644 --- a/examples/covariance/plot_lw_vs_oas.py +++ b/examples/covariance/plot_lw_vs_oas.py @@ -26,7 +26,7 @@ import numpy as np import pylab as pl from scipy.linalg import toeplitz, cholesky -from sklearn.covariance import LedoitWolf, OAS +from scikits.learn.covariance import LedoitWolf, OAS ############################################################################### n_features = 100 diff --git a/examples/decomposition/plot_faces_decomposition.py b/examples/decomposition/plot_faces_decomposition.py index e3aebb64ea29b96feb498786aa8582dccb55b05a..43290b16546859682dda259e2e20536b4ff6fd19 100644 --- a/examples/decomposition/plot_faces_decomposition.py +++ b/examples/decomposition/plot_faces_decomposition.py @@ -5,7 +5,7 @@ Faces dataset decompositions This example applies to :doc:`/datasets/olivetti_faces` different unsupervised matrix decomposition (dimension reduction) methods from the -module :py:mod:`sklearn.decomposition` (see the documentation +module :py:mod:`scikits.learn.decomposition` (see the documentation chapter :ref:`decompositions`) . """ @@ -19,9 +19,9 @@ from time import time import pylab as pl -from sklearn.datasets import fetch_olivetti_faces -from sklearn.cluster import MiniBatchKMeans -from sklearn import decomposition +from scikits.learn.datasets import fetch_olivetti_faces +from scikits.learn.cluster import MiniBatchKMeans +from scikits.learn import decomposition # Display progress logs on stdout logging.basicConfig(level=logging.INFO, diff --git a/examples/decomposition/plot_ica_blind_source_separation.py b/examples/decomposition/plot_ica_blind_source_separation.py index c864f6c180a563b28fb54b5575c49a11b2fd7943..2cb57048e65e0c4fc757ace1d07fd7df4c56aa5d 100644 --- a/examples/decomposition/plot_ica_blind_source_separation.py +++ b/examples/decomposition/plot_ica_blind_source_separation.py @@ -13,7 +13,7 @@ print __doc__ import numpy as np import pylab as pl -from sklearn.decomposition import FastICA +from scikits.learn.decomposition import FastICA ############################################################################### # Generate sample data diff --git a/examples/decomposition/plot_ica_vs_pca.py b/examples/decomposition/plot_ica_vs_pca.py index acbbf5cc42c01c7302ed6835b7be039d5930522a..863eb8c6ebf0932df1b42b5f38ffc64b92aec13e 100644 --- a/examples/decomposition/plot_ica_vs_pca.py +++ b/examples/decomposition/plot_ica_vs_pca.py @@ -33,7 +33,7 @@ print __doc__ import numpy as np import pylab as pl -from sklearn.decomposition import PCA, FastICA +from scikits.learn.decomposition import PCA, FastICA ############################################################################### # Generate sample data diff --git a/examples/decomposition/plot_kernel_pca.py b/examples/decomposition/plot_kernel_pca.py index 385dd61b8064a999b594b5349ccf2e717c442a37..4f53e90361ec24d986bd87f9e89d6b52ccaa929d 100644 --- a/examples/decomposition/plot_kernel_pca.py +++ b/examples/decomposition/plot_kernel_pca.py @@ -14,7 +14,7 @@ print __doc__ import numpy as np import pylab as pl -from sklearn.decomposition import PCA, KernelPCA +from scikits.learn.decomposition import PCA, KernelPCA np.random.seed(0) diff --git a/examples/decomposition/plot_pca_vs_lda.py b/examples/decomposition/plot_pca_vs_lda.py index 963bb47e958b596af9017079aae664300a8cb50f..29d96937057e75b14cff4746b59b37dcf7a4ad33 100644 --- a/examples/decomposition/plot_pca_vs_lda.py +++ b/examples/decomposition/plot_pca_vs_lda.py @@ -20,9 +20,9 @@ print __doc__ import pylab as pl -from sklearn import datasets -from sklearn.decomposition import PCA -from sklearn.lda import LDA +from scikits.learn import datasets +from scikits.learn.decomposition import PCA +from scikits.learn.lda import LDA iris = datasets.load_iris() diff --git a/examples/document_classification_20newsgroups.py b/examples/document_classification_20newsgroups.py index 56843d1501e546deed19dd8e9ce57248e8f8da38..786680f2faf9ecf22cc6507992791c71f09d1639 100644 --- a/examples/document_classification_20newsgroups.py +++ b/examples/document_classification_20newsgroups.py @@ -29,15 +29,15 @@ from optparse import OptionParser import sys from time import time -from sklearn.datasets import fetch_20newsgroups -from sklearn.feature_extraction.text import Vectorizer -from sklearn.feature_selection import SelectKBest, chi2 -from sklearn.linear_model import RidgeClassifier -from sklearn.svm.sparse import LinearSVC -from sklearn.linear_model.sparse import SGDClassifier -from sklearn.naive_bayes import BernoulliNB, MultinomialNB -from sklearn.neighbors import NeighborsClassifier -from sklearn import metrics +from scikits.learn.datasets import fetch_20newsgroups +from scikits.learn.feature_extraction.text import Vectorizer +from scikits.learn.feature_selection import SelectKBest, chi2 +from scikits.learn.linear_model import RidgeClassifier +from scikits.learn.svm.sparse import LinearSVC +from scikits.learn.linear_model.sparse import SGDClassifier +from scikits.learn.naive_bayes import BernoulliNB, MultinomialNB +from scikits.learn.neighbors import NeighborsClassifier +from scikits.learn import metrics # Display progress logs on stdout diff --git a/examples/document_clustering.py b/examples/document_clustering.py index 98eb84968cab2321b7406109102f26b668d25d33..0ed83867289a6d2a2d9c47701dbec12de0d9aa6e 100644 --- a/examples/document_clustering.py +++ b/examples/document_clustering.py @@ -17,14 +17,14 @@ from time import time import logging import numpy as np -from sklearn.datasets import fetch_20newsgroups -from sklearn.feature_extraction.text import Vectorizer -from sklearn import metrics +from scikits.learn.datasets import fetch_20newsgroups +from scikits.learn.feature_extraction.text import Vectorizer +from scikits.learn import metrics -from sklearn.cluster import MiniBatchKMeans -from sklearn.cluster import randindex +from scikits.learn.cluster import MiniBatchKMeans +from scikits.learn.cluster import randindex -from sklearn.preprocessing import Normalizer +from scikits.learn.preprocessing import Normalizer # Display progress logs on stdout diff --git a/examples/feature_selection_pipeline.py b/examples/feature_selection_pipeline.py index 025e2c4d671feeddb392c33f293a1db7254ef3c3..a0343e783cd1dbc1f4d5cf2e6870035dc1da55de 100644 --- a/examples/feature_selection_pipeline.py +++ b/examples/feature_selection_pipeline.py @@ -8,10 +8,10 @@ feature selection with anova and then a C-SVM of the selected features. """ print __doc__ -from sklearn import svm -from sklearn.datasets import samples_generator -from sklearn.feature_selection import SelectKBest, f_regression -from sklearn.pipeline import Pipeline +from scikits.learn import svm +from scikits.learn.datasets import samples_generator +from scikits.learn.feature_selection import SelectKBest, f_regression +from scikits.learn.pipeline import Pipeline # import some data to play with X, y = samples_generator.make_classification( diff --git a/examples/gaussian_naive_bayes.py b/examples/gaussian_naive_bayes.py index 3f23e3d047cd2b02c76cd6a76e1dacfdf38be3bc..7c61ae2c1bb3af2ebb82aef9df5c9e42f6b9efda 100644 --- a/examples/gaussian_naive_bayes.py +++ b/examples/gaussian_naive_bayes.py @@ -11,7 +11,7 @@ A classification example using Gaussian Naive Bayes (GaussianNB). # import some data to play with # The IRIS dataset -from sklearn import datasets +from scikits.learn import datasets iris = datasets.load_iris() X = iris.data @@ -19,7 +19,7 @@ y = iris.target ################################################################################ # GaussianNB -from sklearn.naive_bayes import GaussianNB +from scikits.learn.naive_bayes import GaussianNB gnb = GaussianNB() y_pred = gnb.fit(X, y).predict(X) diff --git a/examples/gaussian_process/gp_diabetes_dataset.py b/examples/gaussian_process/gp_diabetes_dataset.py index f3d1e46cdf04107aefa8e9226fa0490b5b8291d2..c601c9f6998ba5adfce7e6470120f5d1e78309ea 100644 --- a/examples/gaussian_process/gp_diabetes_dataset.py +++ b/examples/gaussian_process/gp_diabetes_dataset.py @@ -23,9 +23,9 @@ print __doc__ # Author: Vincent Dubourg <vincent.dubourg@gmail.com> # License: BSD style -from sklearn import datasets -from sklearn.gaussian_process import GaussianProcess -from sklearn.cross_val import cross_val_score, KFold +from scikits.learn import datasets +from scikits.learn.gaussian_process import GaussianProcess +from scikits.learn.cross_val import cross_val_score, KFold # Load the dataset from scikits' data sets diabetes = datasets.load_diabetes() diff --git a/examples/gaussian_process/plot_gp_probabilistic_classification_after_regression.py b/examples/gaussian_process/plot_gp_probabilistic_classification_after_regression.py index 3ab6cba276ae4e91c02a6fec15c0b6ce5b460299..329f2cf9322464ca16d37451b1d376e684ecf3c2 100644 --- a/examples/gaussian_process/plot_gp_probabilistic_classification_after_regression.py +++ b/examples/gaussian_process/plot_gp_probabilistic_classification_after_regression.py @@ -21,7 +21,7 @@ print __doc__ import numpy as np from scipy import stats -from sklearn.gaussian_process import GaussianProcess +from scikits.learn.gaussian_process import GaussianProcess from matplotlib import pyplot as pl from matplotlib import cm diff --git a/examples/gaussian_process/plot_gp_regression.py b/examples/gaussian_process/plot_gp_regression.py index 06d7801b2b4937a09de983c1668fc7fc085ec480..66c27fe493080be1b48f0e714ebc534fbb6e7019 100644 --- a/examples/gaussian_process/plot_gp_regression.py +++ b/examples/gaussian_process/plot_gp_regression.py @@ -19,7 +19,7 @@ print __doc__ # License: BSD style import numpy as np -from sklearn.gaussian_process import GaussianProcess +from scikits.learn.gaussian_process import GaussianProcess from matplotlib import pyplot as pl diff --git a/examples/grid_search_digits.py b/examples/grid_search_digits.py index 3ebd27d7694885908dd40b5ba30579f609e890e8..4bb1543ae769e65c7654ee87bde57efb11c4729b 100644 --- a/examples/grid_search_digits.py +++ b/examples/grid_search_digits.py @@ -16,13 +16,13 @@ print __doc__ from pprint import pprint import numpy as np -from sklearn import datasets -from sklearn.cross_val import StratifiedKFold -from sklearn.grid_search import GridSearchCV -from sklearn.metrics import classification_report -from sklearn.metrics import precision_score -from sklearn.metrics import recall_score -from sklearn.svm import SVC +from scikits.learn import datasets +from scikits.learn.cross_val import StratifiedKFold +from scikits.learn.grid_search import GridSearchCV +from scikits.learn.metrics import classification_report +from scikits.learn.metrics import precision_score +from scikits.learn.metrics import recall_score +from scikits.learn.svm import SVC ################################################################################ # Loading the Digits dataset diff --git a/examples/grid_search_text_feature_extraction.py b/examples/grid_search_text_feature_extraction.py index c89381afdb5fe3a475e90f7d6f9ab4a826f6f9e8..08dfb2e5172faaa92504ee3ca5842621229904fe 100644 --- a/examples/grid_search_text_feature_extraction.py +++ b/examples/grid_search_text_feature_extraction.py @@ -52,12 +52,12 @@ from time import time import os import logging -from sklearn.datasets import fetch_20newsgroups -from sklearn.feature_extraction.text import CountVectorizer -from sklearn.feature_extraction.text import TfidfTransformer -from sklearn.linear_model.sparse import SGDClassifier -from sklearn.grid_search import GridSearchCV -from sklearn.pipeline import Pipeline +from scikits.learn.datasets import fetch_20newsgroups +from scikits.learn.feature_extraction.text import CountVectorizer +from scikits.learn.feature_extraction.text import TfidfTransformer +from scikits.learn.linear_model.sparse import SGDClassifier +from scikits.learn.grid_search import GridSearchCV +from scikits.learn.pipeline import Pipeline # Display progress logs on stdout logging.basicConfig(level=logging.INFO, diff --git a/examples/linear_model/lasso_and_elasticnet.py b/examples/linear_model/lasso_and_elasticnet.py index a760b141c14f524497e972b1d4d1d7c3732bd0c6..6434f004de4e93f9aa05d2048ff9a0df6288511e 100644 --- a/examples/linear_model/lasso_and_elasticnet.py +++ b/examples/linear_model/lasso_and_elasticnet.py @@ -27,7 +27,7 @@ X_test, y_test = X[n_samples/2:], y[n_samples/2:] ################################################################################ # Lasso -from sklearn.linear_model import Lasso +from scikits.learn.linear_model import Lasso alpha = 0.1 lasso = Lasso(alpha=alpha) @@ -39,7 +39,7 @@ print "r^2 on test data : %f" % (1 - np.linalg.norm(y_test - y_pred_lasso)**2 ################################################################################ # ElasticNet -from sklearn.linear_model import ElasticNet +from scikits.learn.linear_model import ElasticNet enet = ElasticNet(alpha=alpha, rho=0.7) diff --git a/examples/linear_model/lasso_dense_vs_sparse_data.py b/examples/linear_model/lasso_dense_vs_sparse_data.py index c756906eff77b827e882849414764754d8c610df..6f4a96e6f4f1e1fbbf225793c1d4fd77750f9295 100644 --- a/examples/linear_model/lasso_dense_vs_sparse_data.py +++ b/examples/linear_model/lasso_dense_vs_sparse_data.py @@ -15,8 +15,8 @@ import numpy as np from scipy import sparse from scipy import linalg -from sklearn.linear_model.sparse import Lasso as SparseLasso -from sklearn.linear_model import Lasso as DenseLasso +from scikits.learn.linear_model.sparse import Lasso as SparseLasso +from scikits.learn.linear_model import Lasso as DenseLasso ############################################################################### diff --git a/examples/linear_model/logistic_l1_l2_sparsity.py b/examples/linear_model/logistic_l1_l2_sparsity.py index c74ebcf7dd73a80781f533b3dc127d6080ac44bf..f550ecd40f23a07e8b0f8e8fb564916f4fc574a2 100644 --- a/examples/linear_model/logistic_l1_l2_sparsity.py +++ b/examples/linear_model/logistic_l1_l2_sparsity.py @@ -18,8 +18,8 @@ print __doc__ import numpy as np -from sklearn.linear_model import LogisticRegression -from sklearn import datasets +from scikits.learn.linear_model import LogisticRegression +from scikits.learn import datasets # FIXME: the iris dataset has only 4 features! iris = datasets.load_iris() diff --git a/examples/linear_model/plot_ard.py b/examples/linear_model/plot_ard.py index c0610210f88305f0e0797c8f85dd1598d1151dd4..b196732ee4e08d6fdc38d340b94888c9c2033de1 100644 --- a/examples/linear_model/plot_ard.py +++ b/examples/linear_model/plot_ard.py @@ -20,7 +20,7 @@ import numpy as np import pylab as pl from scipy import stats -from sklearn.linear_model import ARDRegression, LinearRegression +from scikits.learn.linear_model import ARDRegression, LinearRegression ################################################################################ # Generating simulated data with Gaussian weigthts diff --git a/examples/linear_model/plot_bayesian_ridge.py b/examples/linear_model/plot_bayesian_ridge.py index 7296bb02a21df8baf9ae34148aad3bf4057a5952..b3fb2d5845e69960546061165b913fda44001825 100644 --- a/examples/linear_model/plot_bayesian_ridge.py +++ b/examples/linear_model/plot_bayesian_ridge.py @@ -20,7 +20,7 @@ import numpy as np import pylab as pl from scipy import stats -from sklearn.linear_model import BayesianRidge, LinearRegression +from scikits.learn.linear_model import BayesianRidge, LinearRegression ################################################################################ # Generating simulated data with Gaussian weigthts diff --git a/examples/linear_model/plot_lasso_coordinate_descent_path.py b/examples/linear_model/plot_lasso_coordinate_descent_path.py index 60e6214e8f6c4294624385e1588e56c8195ddd4a..f107a4d94eb6f7def0a5169a2cd31f9a671c86c3 100644 --- a/examples/linear_model/plot_lasso_coordinate_descent_path.py +++ b/examples/linear_model/plot_lasso_coordinate_descent_path.py @@ -14,8 +14,8 @@ print __doc__ import numpy as np import pylab as pl -from sklearn.linear_model import lasso_path, enet_path -from sklearn import datasets +from scikits.learn.linear_model import lasso_path, enet_path +from scikits.learn import datasets diabetes = datasets.load_diabetes() X = diabetes.data diff --git a/examples/linear_model/plot_lasso_lars.py b/examples/linear_model/plot_lasso_lars.py index dfd2c2406167f3c48a0a63e25a1d521afac3e890..d4557e979b6a1db11b3710140a982514281b4b4e 100644 --- a/examples/linear_model/plot_lasso_lars.py +++ b/examples/linear_model/plot_lasso_lars.py @@ -17,8 +17,8 @@ print __doc__ import numpy as np import pylab as pl -from sklearn import linear_model -from sklearn import datasets +from scikits.learn import linear_model +from scikits.learn import datasets diabetes = datasets.load_diabetes() X = diabetes.data diff --git a/examples/linear_model/plot_lasso_model_selection.py b/examples/linear_model/plot_lasso_model_selection.py index 133cfa67114cb0a24e8530f154c85cbdb062cbd5..8ccca80e3813bb18989bb4568bbae5fd525d9d16 100644 --- a/examples/linear_model/plot_lasso_model_selection.py +++ b/examples/linear_model/plot_lasso_model_selection.py @@ -51,8 +51,8 @@ import time import numpy as np import pylab as pl -from sklearn.linear_model import LassoCV, LassoLarsCV, LassoLarsIC -from sklearn import datasets +from scikits.learn.linear_model import LassoCV, LassoLarsCV, LassoLarsIC +from scikits.learn import datasets diabetes = datasets.load_diabetes() X = diabetes.data diff --git a/examples/linear_model/plot_logistic_path.py b/examples/linear_model/plot_logistic_path.py index 9a26683c54ddbb94077bb9dd8eda4d70529869c5..9bcf0a78c5978492b3d79765b8d80534b13532c7 100644 --- a/examples/linear_model/plot_logistic_path.py +++ b/examples/linear_model/plot_logistic_path.py @@ -16,9 +16,9 @@ from datetime import datetime import numpy as np import pylab as pl -from sklearn import linear_model -from sklearn import datasets -from sklearn.svm import l1_min_c +from scikits.learn import linear_model +from scikits.learn import datasets +from scikits.learn.svm import l1_min_c iris = datasets.load_iris() X = iris.data diff --git a/examples/linear_model/plot_ols.py b/examples/linear_model/plot_ols.py index db05f4e1a76eb632d92eddd9e5823050d2e687a5..96c4e5ae02960c30de98dee53f40f675d32704bb 100644 --- a/examples/linear_model/plot_ols.py +++ b/examples/linear_model/plot_ols.py @@ -11,7 +11,7 @@ print __doc__ import numpy as np import pylab as pl -from sklearn import linear_model +from scikits.learn import linear_model # this is our test set, it's just a straight line with some # gaussian noise diff --git a/examples/linear_model/plot_omp.py b/examples/linear_model/plot_omp.py index 1f6e8073c17c8fbb25ac200f8bd88b92d6ad0c39..7713fd44cc63fad00b1c5aae0c8ce8096132cb85 100644 --- a/examples/linear_model/plot_omp.py +++ b/examples/linear_model/plot_omp.py @@ -10,8 +10,8 @@ print __doc__ import pylab as pl import numpy as np -from sklearn.linear_model import orthogonal_mp -from sklearn.datasets import make_sparse_coded_signal +from scikits.learn.linear_model import orthogonal_mp +from scikits.learn.datasets import make_sparse_coded_signal n_components, n_features = 512, 100 n_atoms = 17 diff --git a/examples/linear_model/plot_polynomial_interpolation.py b/examples/linear_model/plot_polynomial_interpolation.py index e02db52380d2cd3c163c7b56d7cabd01dfa3bf98..efdda3b470a5f1d3bd24f84a75837608a24c1345 100644 --- a/examples/linear_model/plot_polynomial_interpolation.py +++ b/examples/linear_model/plot_polynomial_interpolation.py @@ -29,7 +29,7 @@ print __doc__ import numpy as np import pylab as pl -from sklearn.linear_model import Ridge +from scikits.learn.linear_model import Ridge np.random.seed(0) diff --git a/examples/linear_model/plot_ridge_path.py b/examples/linear_model/plot_ridge_path.py index d3d9bae64ab0e8e30f94f4a71a6ed3564f008fb3..b323e10a7e5a705a8f81a49c5caf9b2d331f0ca3 100644 --- a/examples/linear_model/plot_ridge_path.py +++ b/examples/linear_model/plot_ridge_path.py @@ -3,7 +3,7 @@ Plot Ridge coefficients as a function of the regularization =========================================================== -.. currentmodule:: sklearn.linear_model +.. currentmodule:: scikits.learn.linear_model Shows the effect of collinearity in the coefficients or the :class:`Ridge`. At the end of the path, as alpha tends toward zero @@ -18,7 +18,7 @@ print __doc__ import numpy as np import pylab as pl -from sklearn import linear_model +from scikits.learn import linear_model # X is the 10x10 Hilbert matrix X = 1. / (np.arange(1, 11) + np.arange(0, 10)[:, np.newaxis]) diff --git a/examples/linear_model/plot_sgd_iris.py b/examples/linear_model/plot_sgd_iris.py index d63b44783a10855f27a55c5f857f9067f49c559d..3d77fda2990c0a35ac0084e185e312c91f0e9fa1 100644 --- a/examples/linear_model/plot_sgd_iris.py +++ b/examples/linear_model/plot_sgd_iris.py @@ -12,8 +12,8 @@ print __doc__ import numpy as np import pylab as pl -from sklearn import datasets -from sklearn.linear_model import SGDClassifier +from scikits.learn import datasets +from scikits.learn.linear_model import SGDClassifier # import some data to play with iris = datasets.load_iris() diff --git a/examples/linear_model/plot_sgd_loss_functions.py b/examples/linear_model/plot_sgd_loss_functions.py index c1a1039f151d1e78252b5c65a8f5221bc1dbf011..2b906f369f38a292ac96819216f7141ac16c2122 100644 --- a/examples/linear_model/plot_sgd_loss_functions.py +++ b/examples/linear_model/plot_sgd_loss_functions.py @@ -3,13 +3,13 @@ SGD: Convex Loss Functions ========================== -Plot the convex loss functions supported by `sklearn.linear_model.stochastic_gradient`. +Plot the convex loss functions supported by `scikits.learn.linear_model.stochastic_gradient`. """ print __doc__ import numpy as np import pylab as pl -from sklearn.linear_model.sgd_fast import Hinge, \ +from scikits.learn.linear_model.sgd_fast import Hinge, \ ModifiedHuber, SquaredLoss ############################################################################### diff --git a/examples/linear_model/plot_sgd_ols.py b/examples/linear_model/plot_sgd_ols.py index dde2030ee00e336ac76993dc80528f7a8c543c40..aff62b561b7357055a862ccdcd723c05dada44db 100644 --- a/examples/linear_model/plot_sgd_ols.py +++ b/examples/linear_model/plot_sgd_ols.py @@ -12,7 +12,7 @@ print __doc__ import numpy as np import pylab as pl -from sklearn.linear_model import SGDRegressor +from scikits.learn.linear_model import SGDRegressor # this is our test set, it's just a straight line with some # gaussian noise diff --git a/examples/linear_model/plot_sgd_penalties.py b/examples/linear_model/plot_sgd_penalties.py index 597e0b784b0de68daf73d5ecb0d01c9c99bf2878..552cbb6a9fc4b9d0c276fb70159f1bdb39d6f099 100644 --- a/examples/linear_model/plot_sgd_penalties.py +++ b/examples/linear_model/plot_sgd_penalties.py @@ -3,7 +3,7 @@ SGD: Penalties ============== -Plot the contours of the three penalties supported by `sklearn.linear_model.stochastic_gradient`. +Plot the contours of the three penalties supported by `scikits.learn.linear_model.stochastic_gradient`. """ from __future__ import division diff --git a/examples/linear_model/plot_sgd_separating_hyperplane.py b/examples/linear_model/plot_sgd_separating_hyperplane.py index 9080e255533912d8c295cfac3da5fa8aaff8f253..5ace2030955e0b7a900a1eeba2e2cda539a6c103 100644 --- a/examples/linear_model/plot_sgd_separating_hyperplane.py +++ b/examples/linear_model/plot_sgd_separating_hyperplane.py @@ -11,7 +11,7 @@ print __doc__ import numpy as np import pylab as pl -from sklearn.linear_model import SGDClassifier +from scikits.learn.linear_model import SGDClassifier # we create 40 separable points np.random.seed(0) diff --git a/examples/linear_model/plot_sgd_weighted_classes.py b/examples/linear_model/plot_sgd_weighted_classes.py index aab147d9a297099e923644cfb7a31ce36ede51bd..42e319e1d56fb439d9c3ffb7441d80dd40ff7006 100644 --- a/examples/linear_model/plot_sgd_weighted_classes.py +++ b/examples/linear_model/plot_sgd_weighted_classes.py @@ -11,7 +11,7 @@ print __doc__ import numpy as np import pylab as pl -from sklearn.linear_model import SGDClassifier +from scikits.learn.linear_model import SGDClassifier # we create 40 separable points np.random.seed(0) diff --git a/examples/linear_model/plot_sgd_weighted_samples.py b/examples/linear_model/plot_sgd_weighted_samples.py index c0cdcb3228a86e5213a28bca2ef8bcfe8816d700..680a424978aedae6df647956ddfc8dcdf3f1eefd 100644 --- a/examples/linear_model/plot_sgd_weighted_samples.py +++ b/examples/linear_model/plot_sgd_weighted_samples.py @@ -10,7 +10,7 @@ print __doc__ import numpy as np import pylab as pl -from sklearn import linear_model +from scikits.learn import linear_model # we create 20 points np.random.seed(0) diff --git a/examples/manifold/plot_compare_methods.py b/examples/manifold/plot_compare_methods.py index 8be3de5d40323cf48638e948f0d122e100e50d0c..d6416f51b259dacd3dd4451aac087f035dfda32e 100644 --- a/examples/manifold/plot_compare_methods.py +++ b/examples/manifold/plot_compare_methods.py @@ -20,7 +20,7 @@ import pylab as pl from mpl_toolkits.mplot3d import Axes3D from matplotlib.ticker import NullFormatter -from sklearn import manifold, datasets +from scikits.learn import manifold, datasets n_points = 1000 X, color = datasets.samples_generator.make_s_curve(n_points) diff --git a/examples/manifold/plot_lle_digits.py b/examples/manifold/plot_lle_digits.py index c0e7eb230d2187d6822a37d6e1555468a82ea4b2..03148070d2d7730f216bdc2c57176a76694a94f7 100644 --- a/examples/manifold/plot_lle_digits.py +++ b/examples/manifold/plot_lle_digits.py @@ -17,8 +17,8 @@ from time import time import numpy as np import pylab as pl from matplotlib import offsetbox -from sklearn.utils.fixes import qr_economic -from sklearn import manifold, datasets, decomposition, lda +from scikits.learn.utils.fixes import qr_economic +from scikits.learn import manifold, datasets, decomposition, lda digits = datasets.load_digits(n_class=6) X = digits.data diff --git a/examples/manifold/plot_swissroll.py b/examples/manifold/plot_swissroll.py index 0ce92160d8e6194b9689d4db90e73af205c207aa..e91ed9a0d6063301d2683e206b838adefffacf6f 100644 --- a/examples/manifold/plot_swissroll.py +++ b/examples/manifold/plot_swissroll.py @@ -19,7 +19,7 @@ from mpl_toolkits.mplot3d import Axes3D #---------------------------------------------------------------------- # Locally linear embedding of the swiss roll -from sklearn import manifold, datasets +from scikits.learn import manifold, datasets X, color = datasets.samples_generator.make_swiss_roll(n_samples=1500) print "Computing LLE embedding" diff --git a/examples/mixture/plot_gmm.py b/examples/mixture/plot_gmm.py index 662675c481a7c204700fb0dbebcfad971f429485..a3e6998526f83bb2699974d227193ba9d2a2683b 100644 --- a/examples/mixture/plot_gmm.py +++ b/examples/mixture/plot_gmm.py @@ -28,7 +28,7 @@ from scipy import linalg import pylab as pl import matplotlib as mpl -from sklearn import mixture +from scikits.learn import mixture # Number of samples per component n_samples = 500 diff --git a/examples/mixture/plot_gmm_classifier.py b/examples/mixture/plot_gmm_classifier.py index c71ce06d2f49c624d9594f152536547ef2af9645..a5fa655b02297aeda95d056623fffb2c364b606d 100644 --- a/examples/mixture/plot_gmm_classifier.py +++ b/examples/mixture/plot_gmm_classifier.py @@ -30,9 +30,9 @@ import pylab as pl import matplotlib as mpl import numpy as np -from sklearn import datasets -from sklearn.cross_val import StratifiedKFold -from sklearn.mixture import GMM +from scikits.learn import datasets +from scikits.learn.cross_val import StratifiedKFold +from scikits.learn.mixture import GMM def make_ellipses(gmm, ax): for n, color in enumerate('rgb'): diff --git a/examples/mixture/plot_gmm_pdf.py b/examples/mixture/plot_gmm_pdf.py index 396a550252ab4f517c131a6b3ba601681362674e..10b9a645f5900789b9d6f4c8f095b3c02d179eb8 100644 --- a/examples/mixture/plot_gmm_pdf.py +++ b/examples/mixture/plot_gmm_pdf.py @@ -10,7 +10,7 @@ matrices. import numpy as np import pylab as pl -from sklearn import mixture +from scikits.learn import mixture n_samples = 300 diff --git a/examples/mixture/plot_gmm_sin.py b/examples/mixture/plot_gmm_sin.py index 078f121dd8684424563a12cfb3e215efbba5adfd..302b275c0099e3f0d639e555176a3e72e45c4791 100644 --- a/examples/mixture/plot_gmm_sin.py +++ b/examples/mixture/plot_gmm_sin.py @@ -21,7 +21,7 @@ from scipy import linalg import pylab as pl import matplotlib as mpl -from sklearn import mixture +from scikits.learn import mixture # Number of samples per component n_samples = 100 diff --git a/examples/mlcomp_sparse_document_classification.py b/examples/mlcomp_sparse_document_classification.py index 48b9d6125c6cda858862019865dd9fa08160c20a..c773ab9ed6caa7da326f6dd9aca53b7fa709afc3 100644 --- a/examples/mlcomp_sparse_document_classification.py +++ b/examples/mlcomp_sparse_document_classification.py @@ -45,12 +45,12 @@ import numpy as np import scipy.sparse as sp import pylab as pl -from sklearn.datasets import load_mlcomp -from sklearn.feature_extraction.text import Vectorizer -from sklearn.linear_model.sparse import SGDClassifier -from sklearn.metrics import confusion_matrix -from sklearn.metrics import classification_report -from sklearn.naive_bayes import MultinomialNB +from scikits.learn.datasets import load_mlcomp +from scikits.learn.feature_extraction.text import Vectorizer +from scikits.learn.linear_model.sparse import SGDClassifier +from scikits.learn.metrics import confusion_matrix +from scikits.learn.metrics import classification_report +from scikits.learn.naive_bayes import MultinomialNB if 'MLCOMP_DATASETS_HOME' not in os.environ: diff --git a/examples/plot_classification_probability.py b/examples/plot_classification_probability.py index e03773f66e7b1266e668bea3a14cadc03daffdb4..a6a8cfde238a45a4bb41355dfa6cb6f325a927ca 100644 --- a/examples/plot_classification_probability.py +++ b/examples/plot_classification_probability.py @@ -18,9 +18,9 @@ print __doc__ import pylab as pl import numpy as np -from sklearn.linear_model import LogisticRegression -from sklearn.svm import SVC -from sklearn import datasets +from scikits.learn.linear_model import LogisticRegression +from scikits.learn.svm import SVC +from scikits.learn import datasets iris = datasets.load_iris() X = iris.data[:, :2] # we only take the first two features for visualization diff --git a/examples/plot_confusion_matrix.py b/examples/plot_confusion_matrix.py index 825df7fd20e0a4a32ae11cc8b7d4986226ca499e..6bb69a09f8f6cf0f93306a0e6f7c1248639b9f35 100644 --- a/examples/plot_confusion_matrix.py +++ b/examples/plot_confusion_matrix.py @@ -10,8 +10,8 @@ print __doc__ import random import pylab as pl -from sklearn import svm, datasets -from sklearn.metrics import confusion_matrix +from scikits.learn import svm, datasets +from scikits.learn.metrics import confusion_matrix # import some data to play with iris = datasets.load_iris() diff --git a/examples/plot_digits_classification.py b/examples/plot_digits_classification.py index 67da225d19b4f773d2f1725408f4f516298dc1f5..f6b9736cf8fa7f8ab99261821ed41c34d7d31486 100644 --- a/examples/plot_digits_classification.py +++ b/examples/plot_digits_classification.py @@ -19,7 +19,7 @@ print __doc__ import pylab as pl # Import datasets, classifiers and performance metrics -from sklearn import datasets, svm, metrics +from scikits.learn import datasets, svm, metrics # The digits dataset digits = datasets.load_digits() diff --git a/examples/plot_feature_selection.py b/examples/plot_feature_selection.py index 28bbd05b417078bececbda13f42bdb7a5703e6c9..1d5dfd18b41b74cdfaf57451346bf70ff7f5604a 100644 --- a/examples/plot_feature_selection.py +++ b/examples/plot_feature_selection.py @@ -27,7 +27,7 @@ import pylab as pl # import some data to play with # The IRIS dataset -from sklearn import datasets, svm +from scikits.learn import datasets, svm iris = datasets.load_iris() # Some noisy data not correlated @@ -45,7 +45,7 @@ x_indices = np.arange(x.shape[-1]) ################################################################################ # Univariate feature selection -from sklearn.feature_selection import SelectFpr, f_classif +from scikits.learn.feature_selection import SelectFpr, f_classif # As a scoring function, we use a F test for classification # We use the default selection function: the 10% most significant # features diff --git a/examples/plot_lda_qda.py b/examples/plot_lda_qda.py index e9891c59e8b5daa0857000da2f07eb4b56a52ceb..c5c6872ac8e58595cd71b877ee2fb329e77c9150 100644 --- a/examples/plot_lda_qda.py +++ b/examples/plot_lda_qda.py @@ -13,8 +13,8 @@ import pylab as pl import matplotlib as mpl from matplotlib import colors -from sklearn.lda import LDA -from sklearn.qda import QDA +from scikits.learn.lda import LDA +from scikits.learn.qda import QDA ############################################################################### # colormap diff --git a/examples/plot_lda_vs_qda.py b/examples/plot_lda_vs_qda.py index 2ae60cda1d5b29abfaa5e32c5a18124829914e8f..246684326c8be7f8e02741c552db2322e160337e 100644 --- a/examples/plot_lda_vs_qda.py +++ b/examples/plot_lda_vs_qda.py @@ -12,12 +12,12 @@ import numpy as np import pylab as pl import matplotlib as mpl -from sklearn.lda import LDA -from sklearn.qda import QDA +from scikits.learn.lda import LDA +from scikits.learn.qda import QDA ################################################################################ # load sample dataset -from sklearn.datasets import load_iris +from scikits.learn.datasets import load_iris iris = load_iris() X = iris.data[:,:2] # Take only 2 dimensions diff --git a/examples/plot_neighbors.py b/examples/plot_neighbors.py index 16c0d5a1db2d9a633c0d4ea0dbfb1efbbdc80958..7df3695254f9f5108c79a373adf8dc6f66774ca5 100644 --- a/examples/plot_neighbors.py +++ b/examples/plot_neighbors.py @@ -10,7 +10,7 @@ print __doc__ import numpy as np import pylab as pl -from sklearn import neighbors, datasets +from scikits.learn import neighbors, datasets # import some data to play with iris = datasets.load_iris() diff --git a/examples/plot_neighbors_regression.py b/examples/plot_neighbors_regression.py index ed937a38e47fc284a9bad120bf8646aa4a2285a0..e9bf38e283673752eb44b95c4d1b7330ef9aa650 100644 --- a/examples/plot_neighbors_regression.py +++ b/examples/plot_neighbors_regression.py @@ -20,7 +20,7 @@ print __doc__ # Generate sample data import numpy as np import pylab as pl -from sklearn import neighbors +from scikits.learn import neighbors np.random.seed(0) X = np.sort(5*np.random.rand(40, 1), axis=0) diff --git a/examples/plot_permutation_test_for_classification.py b/examples/plot_permutation_test_for_classification.py index 1ec9205af9761bc91c90df6a384ceb7f925dd437..d41eb0c3c78d24704a14ae59fc7bdfe95f2258eb 100644 --- a/examples/plot_permutation_test_for_classification.py +++ b/examples/plot_permutation_test_for_classification.py @@ -19,10 +19,10 @@ print __doc__ import numpy as np import pylab as pl -from sklearn.svm import SVC -from sklearn.cross_val import StratifiedKFold, permutation_test_score -from sklearn import datasets -from sklearn.metrics import zero_one_score +from scikits.learn.svm import SVC +from scikits.learn.cross_val import StratifiedKFold, permutation_test_score +from scikits.learn import datasets +from scikits.learn.metrics import zero_one_score ############################################################################## diff --git a/examples/plot_pls.py b/examples/plot_pls.py index fe8948daf7b1150d49a818451c26c94e5ae52d30..d585a7a15eb235673e99a5b217cbad48c0f4cfb1 100644 --- a/examples/plot_pls.py +++ b/examples/plot_pls.py @@ -22,7 +22,7 @@ print __doc__ import numpy as np import pylab as pl -from sklearn.pls import PLSCanonical, PLSRegression, CCA +from scikits.learn.pls import PLSCanonical, PLSRegression, CCA ################################################################################ # Dataset based latent variables model diff --git a/examples/plot_precision_recall.py b/examples/plot_precision_recall.py index b0bc8b7c86cd89af134880fe158fa04e17bdf7f7..8d4f1a9a0ea5ec5df597b27a3988993f1ae14907 100644 --- a/examples/plot_precision_recall.py +++ b/examples/plot_precision_recall.py @@ -11,9 +11,9 @@ print __doc__ import random import pylab as pl import numpy as np -from sklearn import svm, datasets -from sklearn.metrics import precision_recall_curve -from sklearn.metrics import auc +from scikits.learn import svm, datasets +from scikits.learn.metrics import precision_recall_curve +from scikits.learn.metrics import auc # import some data to play with iris = datasets.load_iris() diff --git a/examples/plot_rfe_digits.py b/examples/plot_rfe_digits.py index 6f2ed160281156de666a3a9c1c430df817d3efac..69df66122ba844a1f6bb83ba306dd4a6637418e3 100644 --- a/examples/plot_rfe_digits.py +++ b/examples/plot_rfe_digits.py @@ -7,9 +7,9 @@ A recursive feature elimination is performed prior to SVM classification. """ print __doc__ -from sklearn.svm import SVC -from sklearn import datasets -from sklearn.feature_selection import RFE +from scikits.learn.svm import SVC +from scikits.learn import datasets +from scikits.learn.feature_selection import RFE ################################################################################ # Loading the Digits dataset diff --git a/examples/plot_rfe_with_cross_validation.py b/examples/plot_rfe_with_cross_validation.py index c810aa5cc927c89101f46def4854ea6db686ae11..a42ec30edc5f06cb042d8778bb0d0f709b7ae5d1 100644 --- a/examples/plot_rfe_with_cross_validation.py +++ b/examples/plot_rfe_with_cross_validation.py @@ -9,11 +9,11 @@ number of features selected with cross-validation print __doc__ import numpy as np -from sklearn.svm import SVC -from sklearn.cross_val import StratifiedKFold -from sklearn.feature_selection import RFECV -from sklearn.datasets import samples_generator -from sklearn.metrics import zero_one +from scikits.learn.svm import SVC +from scikits.learn.cross_val import StratifiedKFold +from scikits.learn.feature_selection import RFECV +from scikits.learn.datasets import samples_generator +from scikits.learn.metrics import zero_one ################################################################################ # Loading a dataset diff --git a/examples/plot_roc.py b/examples/plot_roc.py index 994c63856847b151bca69ae713cac1599565d3f5..b7c529c041a01c143f12d2a82bd863526a7bbc70 100644 --- a/examples/plot_roc.py +++ b/examples/plot_roc.py @@ -10,9 +10,9 @@ print __doc__ import numpy as np import pylab as pl -from sklearn import svm, datasets -from sklearn.utils import shuffle -from sklearn.metrics import roc_curve, auc +from scikits.learn import svm, datasets +from scikits.learn.utils import shuffle +from scikits.learn.metrics import roc_curve, auc random_state = np.random.RandomState(0) diff --git a/examples/plot_roc_crossval.py b/examples/plot_roc_crossval.py index 46a45fbdb76ddb79fa2f84d9aede2038b3bca091..cd9ea9668b7fd6e84489fb8fba6c509fa0358c83 100644 --- a/examples/plot_roc_crossval.py +++ b/examples/plot_roc_crossval.py @@ -13,9 +13,9 @@ import numpy as np from scipy import interp import pylab as pl -from sklearn import svm, datasets -from sklearn.metrics import roc_curve, auc -from sklearn.cross_val import StratifiedKFold +from scikits.learn import svm, datasets +from scikits.learn.metrics import roc_curve, auc +from scikits.learn.cross_val import StratifiedKFold ################################################################################ # Data IO and generation diff --git a/examples/plot_train_error_vs_test_error.py b/examples/plot_train_error_vs_test_error.py index ab7eb0430c9ca2f2463dbdb706a8bffe4a8e7a35..12da0c8edcd50894f3f4132677c5e8cc0077b81c 100644 --- a/examples/plot_train_error_vs_test_error.py +++ b/examples/plot_train_error_vs_test_error.py @@ -17,7 +17,7 @@ print __doc__ # License: BSD Style. import numpy as np -from sklearn import linear_model +from scikits.learn import linear_model ############################################################################### # Generate sample data diff --git a/examples/svm/plot_custom_kernel.py b/examples/svm/plot_custom_kernel.py index 891e71497848b39657ea23bb2a2661d0929e854b..a33670f58198071b2bc9524e35532df6dfbe7990 100644 --- a/examples/svm/plot_custom_kernel.py +++ b/examples/svm/plot_custom_kernel.py @@ -11,7 +11,7 @@ print __doc__ import numpy as np import pylab as pl -from sklearn import svm, datasets +from scikits.learn import svm, datasets # import some data to play with iris = datasets.load_iris() diff --git a/examples/svm/plot_iris.py b/examples/svm/plot_iris.py index 3b662f7978959c1a159be78afeca4f58e0fa0867..1a7e65ed36da3a683b795fbf0fa8e2b4d7a75789 100644 --- a/examples/svm/plot_iris.py +++ b/examples/svm/plot_iris.py @@ -11,7 +11,7 @@ print __doc__ import numpy as np import pylab as pl -from sklearn import svm, datasets +from scikits.learn import svm, datasets # import some data to play with iris = datasets.load_iris() diff --git a/examples/svm/plot_oneclass.py b/examples/svm/plot_oneclass.py index 43d96dbd83b6c67c6b78065af747925c8f5c475d..89ac5dbd132e3bbe5a8ed3b8666e1d6a64fb954f 100644 --- a/examples/svm/plot_oneclass.py +++ b/examples/svm/plot_oneclass.py @@ -10,7 +10,7 @@ print __doc__ import numpy as np import pylab as pl -from sklearn import svm +from scikits.learn import svm xx, yy = np.meshgrid(np.linspace(-7, 7, 500), np.linspace(-7, 7, 500)) X = 0.3 * np.random.randn(100, 2) diff --git a/examples/svm/plot_separating_hyperplane.py b/examples/svm/plot_separating_hyperplane.py index 8d927dbcc38a45ecbb6e1cb8ab913cb7a8f560ec..fec1d76cab97fe86ac2ce6977261850e4cba1b18 100644 --- a/examples/svm/plot_separating_hyperplane.py +++ b/examples/svm/plot_separating_hyperplane.py @@ -11,7 +11,7 @@ print __doc__ import numpy as np import pylab as pl -from sklearn import svm +from scikits.learn import svm # we create 40 separable points np.random.seed(0) diff --git a/examples/svm/plot_separating_hyperplane_unbalanced.py b/examples/svm/plot_separating_hyperplane_unbalanced.py index 5f3b643a924eeab235b964be509be477607e81f0..19b58967963f1d6d9f4d902b52c1ed64a0b89e1f 100644 --- a/examples/svm/plot_separating_hyperplane_unbalanced.py +++ b/examples/svm/plot_separating_hyperplane_unbalanced.py @@ -14,7 +14,7 @@ print __doc__ import numpy as np import pylab as pl -from sklearn import svm +from scikits.learn import svm # we create 40 separable points np.random.seed(0) diff --git a/examples/svm/plot_svm_anova.py b/examples/svm/plot_svm_anova.py index e1e3ac04b08f06dae04f1b65a9d1e9213664b7d0..100cd0593f67c024cf957690befb2263e8068bb1 100644 --- a/examples/svm/plot_svm_anova.py +++ b/examples/svm/plot_svm_anova.py @@ -10,8 +10,8 @@ print __doc__ import numpy as np import pylab as pl -from sklearn import svm, datasets, feature_selection, cross_val -from sklearn.pipeline import Pipeline +from scikits.learn import svm, datasets, feature_selection, cross_val +from scikits.learn.pipeline import Pipeline ################################################################################ # Import some data to play with diff --git a/examples/svm/plot_svm_nonlinear.py b/examples/svm/plot_svm_nonlinear.py index eba532ad0de79bec926e6113d43a4a197278dc9d..8d21c670ebfbd1a693f39c86e5ba1cc10d0e1737 100644 --- a/examples/svm/plot_svm_nonlinear.py +++ b/examples/svm/plot_svm_nonlinear.py @@ -12,7 +12,7 @@ print __doc__ import numpy as np import pylab as pl -from sklearn import svm +from scikits.learn import svm xx, yy = np.meshgrid(np.linspace(-5, 5, 500), np.linspace(-5, 5, 500)) np.random.seed(0) diff --git a/examples/svm/plot_svm_regression.py b/examples/svm/plot_svm_regression.py index 64e6bfea7e42ca84d0dc5ffe037dc61eaf44f69b..0448f13035152a00887b210d9766b1b368599c98 100644 --- a/examples/svm/plot_svm_regression.py +++ b/examples/svm/plot_svm_regression.py @@ -22,7 +22,7 @@ y[::5] += 3*(0.5 - np.random.rand(8)) ############################################################################### # Fit regression model -from sklearn.svm import SVR +from scikits.learn.svm import SVR svr_rbf = SVR(kernel='rbf', C=1e4, gamma=0.1) svr_lin = SVR(kernel='linear', C=1e4) diff --git a/examples/svm/plot_weighted_samples.py b/examples/svm/plot_weighted_samples.py index 7b8364231b0670a2098e87f7184a5c71cdcbe151..2f95eeb8e9ff2fa0d8e59a8539e1981489988703 100644 --- a/examples/svm/plot_weighted_samples.py +++ b/examples/svm/plot_weighted_samples.py @@ -10,7 +10,7 @@ print __doc__ import numpy as np import pylab as pl -from sklearn import svm +from scikits.learn import svm # we create 20 points np.random.seed(0) diff --git a/sklearn/__init__.py b/scikits/learn/__init__.py similarity index 96% rename from sklearn/__init__.py rename to scikits/learn/__init__.py index 22867642d297fd466787a64b311ca6e890d3ad83..80e4e8d78ea3b2893bb64fb652ae2eae697cfaa2 100644 --- a/sklearn/__init__.py +++ b/scikits/learn/__init__.py @@ -2,7 +2,7 @@ Machine Learning module in python ================================= -sklearn is a Python module integrating classical machine +scikits.learn is a Python module integrating classical machine learning algorithms in the tightly-knit world of scientific Python packages (numpy, scipy, matplotlib). diff --git a/sklearn/ball_tree.c b/scikits/learn/ball_tree.c similarity index 69% rename from sklearn/ball_tree.c rename to scikits/learn/ball_tree.c index 7968b5e49a4cca19ec6bc887a56401907624fb15..771a5f7489c010587a11362181bdb6ec53c38b6a 100644 --- a/sklearn/ball_tree.c +++ b/scikits/learn/ball_tree.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.13 on Fri Sep 2 11:24:58 2011 */ +/* Generated by Cython 0.14.1 on Wed Aug 31 07:48:58 2011 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -126,15 +126,20 @@ #define PyBytes_Repr PyString_Repr #define PyBytes_Concat PyString_Concat #define PyBytes_ConcatAndDel PyString_ConcatAndDel +#endif + +#if PY_VERSION_HEX < 0x02060000 #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) #endif - #ifndef PySet_CheckExact -# define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) + #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) @@ -151,7 +156,7 @@ #endif #if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject + #define PyBoolObject PyLongObject #endif @@ -163,6 +168,25 @@ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif +#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) + #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) + #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) +#else + #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) + #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) +#endif + #if PY_MAJOR_VERSION >= 3 #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #endif @@ -195,12 +219,17 @@ #define _USE_MATH_DEFINES #endif #include <math.h> -#define __PYX_HAVE_API__sklearn__ball_tree +#define __PYX_HAVE_API__scikits__learn__ball_tree #include "stdio.h" #include "stdlib.h" #include "numpy/arrayobject.h" #include "numpy/ufuncobject.h" +#ifdef PYREX_WITHOUT_ASSERTIONS +#define CYTHON_WITHOUT_ASSERTIONS +#endif + + /* inline attribute */ #ifndef CYTHON_INLINE #if defined(__GNUC__) @@ -210,7 +239,7 @@ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else - #define CYTHON_INLINE + #define CYTHON_INLINE #endif #endif @@ -218,14 +247,14 @@ #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || defined(__INTEL_COMPILER) -# define CYTHON_UNUSED __attribute__ ((__unused__)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) # else -# define CYTHON_UNUSED +# define CYTHON_UNUSED # endif #endif @@ -250,7 +279,7 @@ static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); #ifdef __GNUC__ /* Test for GCC > 2.95 */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) +#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* __GNUC__ > 2 ... */ @@ -338,9 +367,9 @@ typedef npy_double __pyx_t_5numpy_double_t; typedef npy_longdouble __pyx_t_5numpy_longdouble_t; -typedef __pyx_t_5numpy_float64_t __pyx_t_7sklearn_9ball_tree_DTYPE_t; +typedef __pyx_t_5numpy_float64_t __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t; -typedef __pyx_t_5numpy_int32_t __pyx_t_7sklearn_9ball_tree_ITYPE_t; +typedef __pyx_t_5numpy_int32_t __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t; #if CYTHON_CCOMPLEX #ifdef __cplusplus @@ -372,7 +401,7 @@ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; typedef npy_cdouble __pyx_t_5numpy_complex_t; -/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":323 +/* "scikits/learn/ball_tree.pyx":323 * # array for efficiency. This is a hybrid of the "Array of Structures" * # and "Structure of Arrays" styles. * cdef struct NodeInfo: # <<<<<<<<<<<<<< @@ -380,14 +409,14 @@ typedef npy_cdouble __pyx_t_5numpy_complex_t; * ITYPE_t idx_end */ -struct __pyx_t_7sklearn_9ball_tree_NodeInfo { - __pyx_t_7sklearn_9ball_tree_ITYPE_t idx_start; - __pyx_t_7sklearn_9ball_tree_ITYPE_t idx_end; - __pyx_t_7sklearn_9ball_tree_ITYPE_t is_leaf; - __pyx_t_7sklearn_9ball_tree_DTYPE_t radius; +struct __pyx_t_7scikits_5learn_9ball_tree_NodeInfo { + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t idx_start; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t idx_end; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t is_leaf; + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t radius; }; -/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":333 +/* "scikits/learn/ball_tree.pyx":333 * # stack struct * # This is used to keep track of the recursion stack in Node_query * cdef struct stack_item: # <<<<<<<<<<<<<< @@ -395,12 +424,12 @@ struct __pyx_t_7sklearn_9ball_tree_NodeInfo { * DTYPE_t dist_p_LB */ -struct __pyx_t_7sklearn_9ball_tree_stack_item { - __pyx_t_7sklearn_9ball_tree_ITYPE_t i_node; - __pyx_t_7sklearn_9ball_tree_DTYPE_t dist_p_LB; +struct __pyx_t_7scikits_5learn_9ball_tree_stack_item { + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t i_node; + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t dist_p_LB; }; -/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":338 +/* "scikits/learn/ball_tree.pyx":338 * * * cdef struct stack: # <<<<<<<<<<<<<< @@ -408,13 +437,13 @@ struct __pyx_t_7sklearn_9ball_tree_stack_item { * stack_item* heap */ -struct __pyx_t_7sklearn_9ball_tree_stack { +struct __pyx_t_7scikits_5learn_9ball_tree_stack { int n; - struct __pyx_t_7sklearn_9ball_tree_stack_item *heap; + struct __pyx_t_7scikits_5learn_9ball_tree_stack_item *heap; int size; }; -/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":395 +/* "scikits/learn/ball_tree.pyx":395 * # BallTree class * # * cdef class BallTree(object): # <<<<<<<<<<<<<< @@ -422,28 +451,28 @@ struct __pyx_t_7sklearn_9ball_tree_stack { * Ball Tree for fast nearest-neighbor searches : */ -struct __pyx_obj_7sklearn_9ball_tree_BallTree { +struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree { PyObject_HEAD - struct __pyx_vtabstruct_7sklearn_9ball_tree_BallTree *__pyx_vtab; + struct __pyx_vtabstruct_7scikits_5learn_9ball_tree_BallTree *__pyx_vtab; PyArrayObject *data; PyArrayObject *idx_array; PyArrayObject *node_centroid_arr; PyArrayObject *node_info_arr; - __pyx_t_7sklearn_9ball_tree_DTYPE_t p; - __pyx_t_7sklearn_9ball_tree_ITYPE_t leaf_size; - __pyx_t_7sklearn_9ball_tree_ITYPE_t n_levels; - __pyx_t_7sklearn_9ball_tree_ITYPE_t n_nodes; + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t p; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t leaf_size; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t n_levels; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t n_nodes; }; -struct __pyx_vtabstruct_7sklearn_9ball_tree_BallTree { - void (*build_tree_)(struct __pyx_obj_7sklearn_9ball_tree_BallTree *); - void (*query_one_)(struct __pyx_obj_7sklearn_9ball_tree_BallTree *, __pyx_t_7sklearn_9ball_tree_DTYPE_t *, __pyx_t_7sklearn_9ball_tree_ITYPE_t, __pyx_t_7sklearn_9ball_tree_DTYPE_t *, __pyx_t_7sklearn_9ball_tree_ITYPE_t *, struct __pyx_t_7sklearn_9ball_tree_stack *, __pyx_t_7sklearn_9ball_tree_ITYPE_t); - __pyx_t_7sklearn_9ball_tree_ITYPE_t (*query_radius_count_)(struct __pyx_obj_7sklearn_9ball_tree_BallTree *, __pyx_t_7sklearn_9ball_tree_DTYPE_t *, __pyx_t_7sklearn_9ball_tree_DTYPE_t, struct __pyx_t_7sklearn_9ball_tree_stack *); - __pyx_t_7sklearn_9ball_tree_ITYPE_t (*query_radius_idx_only_)(struct __pyx_obj_7sklearn_9ball_tree_BallTree *, __pyx_t_7sklearn_9ball_tree_DTYPE_t *, __pyx_t_7sklearn_9ball_tree_DTYPE_t, __pyx_t_7sklearn_9ball_tree_ITYPE_t *, struct __pyx_t_7sklearn_9ball_tree_stack *); - __pyx_t_7sklearn_9ball_tree_ITYPE_t (*query_radius_distances_)(struct __pyx_obj_7sklearn_9ball_tree_BallTree *, __pyx_t_7sklearn_9ball_tree_DTYPE_t *, __pyx_t_7sklearn_9ball_tree_DTYPE_t, __pyx_t_7sklearn_9ball_tree_ITYPE_t *, __pyx_t_7sklearn_9ball_tree_DTYPE_t *, struct __pyx_t_7sklearn_9ball_tree_stack *); +struct __pyx_vtabstruct_7scikits_5learn_9ball_tree_BallTree { + void (*build_tree_)(struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *); + void (*query_one_)(struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *, struct __pyx_t_7scikits_5learn_9ball_tree_stack *, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t); + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t (*query_radius_count_)(struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t, struct __pyx_t_7scikits_5learn_9ball_tree_stack *); + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t (*query_radius_idx_only_)(struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *, struct __pyx_t_7scikits_5learn_9ball_tree_stack *); + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t (*query_radius_distances_)(struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *, struct __pyx_t_7scikits_5learn_9ball_tree_stack *); }; -static struct __pyx_vtabstruct_7sklearn_9ball_tree_BallTree *__pyx_vtabptr_7sklearn_9ball_tree_BallTree; +static struct __pyx_vtabstruct_7scikits_5learn_9ball_tree_BallTree *__pyx_vtabptr_7scikits_5learn_9ball_tree_BallTree; #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 @@ -493,6 +522,11 @@ static struct __pyx_vtabstruct_7sklearn_9ball_tree_BallTree *__pyx_vtabptr_7skle static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ + 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); /*proto*/ @@ -594,11 +628,6 @@ static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /*proto*/ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ - static CYTHON_INLINE npy_int32 __Pyx_PyInt_from_py_npy_int32(PyObject *); static CYTHON_INLINE long __Pyx_pow_long(long, long); /* proto */ @@ -640,11 +669,17 @@ static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(floa #ifdef __cplusplus #define __Pyx_c_is_zerof(z) ((z)==(float)0) #define __Pyx_c_conjf(z) (::std::conj(z)) - /*#define __Pyx_c_absf(z) (::std::abs(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)) - /*#define __Pyx_c_absf(z) (cabsf(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); @@ -655,7 +690,10 @@ static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(floa 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); - /*static CYTHON_INLINE float __Pyx_c_absf(__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); @@ -670,11 +708,17 @@ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(do #ifdef __cplusplus #define __Pyx_c_is_zero(z) ((z)==(double)0) #define __Pyx_c_conj(z) (::std::conj(z)) - /*#define __Pyx_c_abs(z) (::std::abs(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)) - /*#define __Pyx_c_abs(z) (cabs(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); @@ -685,7 +729,10 @@ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(do 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); - /*static CYTHON_INLINE double __Pyx_c_abs(__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 CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *); @@ -762,71 +809,71 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *); / /* Module declarations from libc */ -/* Module declarations from sklearn.ball_tree */ - -static PyTypeObject *__pyx_ptype_7sklearn_9ball_tree_BallTree = 0; -static __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_7sklearn_9ball_tree_infinity; -static CYTHON_INLINE __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_dmax(__pyx_t_7sklearn_9ball_tree_DTYPE_t, __pyx_t_7sklearn_9ball_tree_DTYPE_t); /*proto*/ -static CYTHON_INLINE __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_dmin(__pyx_t_7sklearn_9ball_tree_DTYPE_t, __pyx_t_7sklearn_9ball_tree_DTYPE_t); /*proto*/ -static CYTHON_INLINE __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_dabs(__pyx_t_7sklearn_9ball_tree_DTYPE_t); /*proto*/ -static __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_dist(__pyx_t_7sklearn_9ball_tree_DTYPE_t *, __pyx_t_7sklearn_9ball_tree_DTYPE_t *, __pyx_t_7sklearn_9ball_tree_ITYPE_t, __pyx_t_7sklearn_9ball_tree_DTYPE_t); /*proto*/ -static __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_dist_p(__pyx_t_7sklearn_9ball_tree_DTYPE_t *, __pyx_t_7sklearn_9ball_tree_DTYPE_t *, __pyx_t_7sklearn_9ball_tree_ITYPE_t, __pyx_t_7sklearn_9ball_tree_DTYPE_t); /*proto*/ -static __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_dist_from_dist_p(__pyx_t_7sklearn_9ball_tree_DTYPE_t, __pyx_t_7sklearn_9ball_tree_DTYPE_t); /*proto*/ -static __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_dist_p_from_dist(__pyx_t_7sklearn_9ball_tree_DTYPE_t, __pyx_t_7sklearn_9ball_tree_DTYPE_t); /*proto*/ -static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_stack_create(struct __pyx_t_7sklearn_9ball_tree_stack *, int); /*proto*/ -static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_stack_destroy(struct __pyx_t_7sklearn_9ball_tree_stack *); /*proto*/ -static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_stack_resize(struct __pyx_t_7sklearn_9ball_tree_stack *, int); /*proto*/ -static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_stack_push(struct __pyx_t_7sklearn_9ball_tree_stack *, struct __pyx_t_7sklearn_9ball_tree_stack_item); /*proto*/ -static CYTHON_INLINE struct __pyx_t_7sklearn_9ball_tree_stack_item __pyx_f_7sklearn_9ball_tree_stack_pop(struct __pyx_t_7sklearn_9ball_tree_stack *); /*proto*/ -static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_copy_array(__pyx_t_7sklearn_9ball_tree_DTYPE_t *, __pyx_t_7sklearn_9ball_tree_DTYPE_t *, __pyx_t_7sklearn_9ball_tree_ITYPE_t); /*proto*/ -static void __pyx_f_7sklearn_9ball_tree_compute_centroid(__pyx_t_7sklearn_9ball_tree_DTYPE_t *, __pyx_t_7sklearn_9ball_tree_DTYPE_t *, __pyx_t_7sklearn_9ball_tree_ITYPE_t *, __pyx_t_7sklearn_9ball_tree_ITYPE_t, __pyx_t_7sklearn_9ball_tree_ITYPE_t); /*proto*/ -static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_find_split_dim(__pyx_t_7sklearn_9ball_tree_DTYPE_t *, __pyx_t_7sklearn_9ball_tree_ITYPE_t *, __pyx_t_7sklearn_9ball_tree_ITYPE_t, __pyx_t_7sklearn_9ball_tree_ITYPE_t); /*proto*/ -static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_iswap(__pyx_t_7sklearn_9ball_tree_ITYPE_t *, __pyx_t_7sklearn_9ball_tree_ITYPE_t, __pyx_t_7sklearn_9ball_tree_ITYPE_t); /*proto*/ -static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_dswap(__pyx_t_7sklearn_9ball_tree_DTYPE_t *, __pyx_t_7sklearn_9ball_tree_ITYPE_t, __pyx_t_7sklearn_9ball_tree_ITYPE_t); /*proto*/ -static void __pyx_f_7sklearn_9ball_tree_partition_indices(__pyx_t_7sklearn_9ball_tree_DTYPE_t *, __pyx_t_7sklearn_9ball_tree_ITYPE_t *, __pyx_t_7sklearn_9ball_tree_ITYPE_t, __pyx_t_7sklearn_9ball_tree_ITYPE_t, __pyx_t_7sklearn_9ball_tree_ITYPE_t, __pyx_t_7sklearn_9ball_tree_ITYPE_t); /*proto*/ -static CYTHON_INLINE __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_calc_dist_LB(__pyx_t_7sklearn_9ball_tree_DTYPE_t *, __pyx_t_7sklearn_9ball_tree_DTYPE_t *, __pyx_t_7sklearn_9ball_tree_DTYPE_t, __pyx_t_7sklearn_9ball_tree_ITYPE_t, __pyx_t_7sklearn_9ball_tree_DTYPE_t); /*proto*/ -static CYTHON_INLINE __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_calc_dist_p_LB(__pyx_t_7sklearn_9ball_tree_DTYPE_t *, __pyx_t_7sklearn_9ball_tree_DTYPE_t *, __pyx_t_7sklearn_9ball_tree_DTYPE_t, __pyx_t_7sklearn_9ball_tree_ITYPE_t, __pyx_t_7sklearn_9ball_tree_DTYPE_t); /*proto*/ -static CYTHON_INLINE __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_pqueue_largest(__pyx_t_7sklearn_9ball_tree_DTYPE_t *, __pyx_t_7sklearn_9ball_tree_ITYPE_t); /*proto*/ -static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_pqueue_insert(__pyx_t_7sklearn_9ball_tree_DTYPE_t, __pyx_t_7sklearn_9ball_tree_ITYPE_t, __pyx_t_7sklearn_9ball_tree_DTYPE_t *, __pyx_t_7sklearn_9ball_tree_ITYPE_t *, __pyx_t_7sklearn_9ball_tree_ITYPE_t); /*proto*/ -static CYTHON_INLINE __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_max_heap_largest(__pyx_t_7sklearn_9ball_tree_DTYPE_t *, __pyx_t_7sklearn_9ball_tree_ITYPE_t); /*proto*/ -static void __pyx_f_7sklearn_9ball_tree_max_heap_insert(__pyx_t_7sklearn_9ball_tree_DTYPE_t, __pyx_t_7sklearn_9ball_tree_ITYPE_t, __pyx_t_7sklearn_9ball_tree_DTYPE_t *, __pyx_t_7sklearn_9ball_tree_ITYPE_t *, __pyx_t_7sklearn_9ball_tree_ITYPE_t); /*proto*/ -static void __pyx_f_7sklearn_9ball_tree_sort_dist_idx(__pyx_t_7sklearn_9ball_tree_DTYPE_t *, __pyx_t_7sklearn_9ball_tree_ITYPE_t *, __pyx_t_7sklearn_9ball_tree_ITYPE_t); /*proto*/ -static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_partition_dist_idx(__pyx_t_7sklearn_9ball_tree_DTYPE_t *, __pyx_t_7sklearn_9ball_tree_ITYPE_t *, __pyx_t_7sklearn_9ball_tree_ITYPE_t); /*proto*/ -#define __Pyx_MODULE_NAME "sklearn.ball_tree" -int __pyx_module_is_main_sklearn__ball_tree = 0; - -/* Implementation of sklearn.ball_tree */ +/* Module declarations from scikits.learn.ball_tree */ + +static PyTypeObject *__pyx_ptype_7scikits_5learn_9ball_tree_BallTree = 0; +static __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_7scikits_5learn_9ball_tree_infinity; +static CYTHON_INLINE __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball_tree_dmax(__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t); /*proto*/ +static CYTHON_INLINE __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball_tree_dmin(__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t); /*proto*/ +static CYTHON_INLINE __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball_tree_dabs(__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t); /*proto*/ +static __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball_tree_dist(__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t); /*proto*/ +static __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball_tree_dist_p(__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t); /*proto*/ +static __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball_tree_dist_from_dist_p(__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t); /*proto*/ +static __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball_tree_dist_p_from_dist(__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t); /*proto*/ +static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_stack_create(struct __pyx_t_7scikits_5learn_9ball_tree_stack *, int); /*proto*/ +static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_stack_destroy(struct __pyx_t_7scikits_5learn_9ball_tree_stack *); /*proto*/ +static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_stack_resize(struct __pyx_t_7scikits_5learn_9ball_tree_stack *, int); /*proto*/ +static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_stack_push(struct __pyx_t_7scikits_5learn_9ball_tree_stack *, struct __pyx_t_7scikits_5learn_9ball_tree_stack_item); /*proto*/ +static CYTHON_INLINE struct __pyx_t_7scikits_5learn_9ball_tree_stack_item __pyx_f_7scikits_5learn_9ball_tree_stack_pop(struct __pyx_t_7scikits_5learn_9ball_tree_stack *); /*proto*/ +static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_copy_array(__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t); /*proto*/ +static void __pyx_f_7scikits_5learn_9ball_tree_compute_centroid(__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t); /*proto*/ +static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball_tree_find_split_dim(__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t); /*proto*/ +static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_iswap(__pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t); /*proto*/ +static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_dswap(__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t); /*proto*/ +static void __pyx_f_7scikits_5learn_9ball_tree_partition_indices(__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t); /*proto*/ +static CYTHON_INLINE __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball_tree_calc_dist_LB(__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t); /*proto*/ +static CYTHON_INLINE __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball_tree_calc_dist_p_LB(__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t); /*proto*/ +static CYTHON_INLINE __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball_tree_pqueue_largest(__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t); /*proto*/ +static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_pqueue_insert(__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t); /*proto*/ +static CYTHON_INLINE __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball_tree_max_heap_largest(__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t); /*proto*/ +static void __pyx_f_7scikits_5learn_9ball_tree_max_heap_insert(__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t); /*proto*/ +static void __pyx_f_7scikits_5learn_9ball_tree_sort_dist_idx(__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t); /*proto*/ +static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball_tree_partition_dist_idx(__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t); /*proto*/ +#define __Pyx_MODULE_NAME "scikits.learn.ball_tree" +static int __pyx_module_is_main_scikits__learn__ball_tree = 0; + +/* Implementation of scikits.learn.ball_tree */ static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_enumerate; static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_RuntimeError; static char __pyx_k_1[] = "new_size smaller than current"; -static char __pyx_k_2[] = "popping empty stack"; -static char __pyx_k_3[] = "X is an empty array"; -static char __pyx_k_4[] = "X should have two dimensions"; -static char __pyx_k_5[] = "p must be greater than or equal to 1"; -static char __pyx_k_6[] = "leaf_size must be greater than or equal to 1"; -static char __pyx_k_8[] = "query data dimension must match BallTree data dimension"; -static char __pyx_k_9[] = "k must be less than or equal to the number of training points"; -static char __pyx_k_13[] = "count_only and return_distance cannot both be true"; -static char __pyx_k_14[] = "return_distance must be True if sort_distances is True"; -static char __pyx_k_15[] = "r must be broadcastable to X.shape"; -static char __pyx_k_16[] = "query_radius_idx_only_"; -static char __pyx_k_17[] = "query_radius_distances_"; -static char __pyx_k_18[] = "Fatal: parent is a leaf. Memory allocation is flawed"; -static char __pyx_k_19[] = "zero-sized node"; -static char __pyx_k_20[] = "ndarray is not C contiguous"; -static char __pyx_k_21[] = "ndarray is not Fortran contiguous"; -static char __pyx_k_22[] = "Non-native byte order not supported"; -static char __pyx_k_23[] = "unknown dtype code in numpy.pxd (%d)"; -static char __pyx_k_24[] = "Format string allocated too short, see comment in numpy.pxd"; -static char __pyx_k_25[] = "Format string allocated too short."; -static char __pyx_k_26[] = "\n=========\nBall Tree\n=========\nA ball tree is a data object which speeds up nearest neighbor\nsearches in high dimensions (see scikit-learn neighbors module\ndocumentation for an overview of neighbor trees). There are many\ntypes of ball trees. This package provides a basic implementation\nin cython.\n\nImplementation Notes\n--------------------\n\nA ball tree can be thought of as a collection of nodes. Each node\nstores a centroid, a radius, and the pointers to two child nodes.\n\n* centroid : the centroid of a node is the mean of all the locations\n of points within the node\n* radius : the radius of a node is the distance from the centroid\n to the furthest point in the node.\n* subnodes : each node has a maximum of 2 child nodes. The data within\n the parent node is divided between the two child nodes.\n\nIn a typical tree implementation, nodes may be classes or structures which\nare dynamically allocated as needed. This offers flexibility in the number\nof nodes, and leads to very straightforward and readable code. It also means\nthat the tree can be dynamically augmented or pruned with new data, in an\nin-line fashion. This approach generally leads to recursive code: upon\nconstruction, the head node constructs its child nodes, the child nodes\nconstruct their child nodes, and so-on.\n\nThe current package uses a different approach: all node data is stored in\na set of numpy arrays which are pre-allocated. The main advantage of this\napproach is that the whole object can be quickly and easily saved to disk\nand reconstructed from disk. This also allows for an iterative interface\nwhich gives more control over the heap, and leads to speed. There are a\nfew disadvantages, however: once the tree is built, augmenting or pruning it\nis not as straightforward. Also, the size of the tree must be known from the\nstart, so there is not as much flexibility in building it.\n\nBallTree Pseudo-code\n~~~~~~~~~~~~~~~~~~~~\nBecause understanding a ball ""tree is simpler with recursive code, here is some\npseudo-code to show the structure of the main functionality\n\n # Ball Tree pseudo code\n\n class Node:\n #class data:\n centroid\n radius\n child1, child2\n\n #class methods:\n def construct(data):\n centroid = compute_centroid(data)\n radius = compute_radius(centroid, data)\n\n # Divide the data into two approximately equal sets.\n # This is often done by splitting along a single dimension.\n data1, data2 = divide(data)\n\n if number_of_points(data1) > 0:\n child1.construct(data1)\n\n if number_of_points(data2) > 0:\n child2.construct(data2)\n\n def query(pt, neighbors_heap):\n # compute the minimum distance from pt to any point in this node\n d = distance(point, centroid)\n if d < radius:\n min_distance = 0\n else:\n min_distance = d - radius\n\n if min_distance > max_distance_in(neighbors_heap):\n # all these points are too far away. cut off the search here\n return\n elif node_size > 1:\n child1.query(pt, neighbors_heap)\n child2.query(pt, neighbors_heap)\n\n\n object BallTree:\n #class data:\n data\n root_node\n\n #class methods\n def construct(data, num_leaves):\n root_node.construct(data)\n\n def query(point, num_neighbors):\n neighbors_heap = empty_heap_of_size(num_neighbors)\n root_node.query(point, neighbors_heap)\n\nThis certainly is not a complete description, but should give the basic idea\nof the form of the algorithm. The implementation below is much faster than\nanything mirroring the pseudo-code above, but for that reason is much more\nopaque. Here's the basic idea:\n\nBallTree Storage\n~~~~~~~~~~~~~~~~\nTh""e BallTree information is stored using a combination of\n\"Array of Structures\" and \"Structure of Arrays\" to maximize speed.\nGiven input data of size ``(n_samples, n_features)``, BallTree computes the\nexpected number of nodes ``n_nodes`` (see below), and allocates the\nfollowing arrays:\n\n* ``data`` : a float array of shape ``(n_samples, n_features)``\n This is simply the input data. If the input matrix is well-formed\n (contiguous, c-ordered, correct data type) then no copy is needed\n* ``idx_array`` : an integer array of size ``n_samples``\n This can be thought of as an array of pointers to the data in ``data``.\n Rather than shuffling around the data itself, we shuffle around pointers\n to the rows in data.\n* ``node_centroid_arr`` : a float array of shape ``(n_nodes, n_features)``\n This stores the centroid of the data in each node.\n* ``node_info_arr`` : a size-``n_nodes`` array of ``NodeInfo`` structures.\n This stores information associated with each node. Each ``NodeInfo``\n instance has the following attributes:\n - ``idx_start``\n - ``idx_end`` : ``idx_start`` and ``idx_end`` reference the part of\n ``idx_array`` which point to the data associated with the node.\n The data in node with index ``i_node`` is given by\n ``data[idx_array[idx_start:idx_end]]``\n - ``is_leaf`` : a boolean value which tells whether this node is a leaf:\n that is, whether or not it has children.\n - ``radius`` : a floating-point value which gives the distance from\n the node centroid to the furthest point in the node.\n\nOne feature here is that there are no stored pointers from parent nodes to\nchild nodes and vice-versa. These pointers are implemented implicitly:\nFor a node with index ``i``, the two children are found at indices\n``2 * i + 1`` and ``2 * i + 2``, while the parent is found at index\n``floor((i - 1) / 2)``. The root node has no parent.\n\nWith this data structure in place, the functionality of t""he above BallTree\npseudo-code can be implemented in a much more efficient manner.\nMost of the data passing done in this code uses raw data pointers.\nUsing numpy arrays would be preferable for safety, but the\noverhead of array slicing and sub-array construction leads to execution\ntime which is several orders of magnitude slower than the current\nimplementation.\n\nPriority Queue vs Max-heap\n~~~~~~~~~~~~~~~~~~~~~~~~~~\nWhen querying for more than one neighbor, the code must maintain a list of\nthe current k nearest points. The BallTree code implements this in two ways.\n\n- A priority queue: this is just a sorted list. When an item is added,\n it is inserted in the appropriate location. The cost of the search plus\n insert averages O[k].\n- A max-heap: this is a binary tree structure arranged such that each node is\n greater than its children. The cost of adding an item is O[log(k)].\n At the end of the iterations, the results must be sorted: a quicksort is\n used, which averages O[k log(k)]. Quicksort has worst-case O[k^2]\n performance, but because the input is already structured in a max-heap,\n the worst case will not be realized. Thus the sort is a one-time operation\n with cost O[k log(k)].\n\nEach insert is performed an average of log(N) times per query, where N is\nthe number of training points. Because of this, for a single query, the\npriority-queue approach costs O[k log(N)], and the max-heap approach costs\nO[log(k)log(N)] + O[k log(k)]. Tests show that for sufficiently large k,\nthe max-heap approach out-performs the priority queue approach by a factor\nof a few. In light of these tests, the code uses a priority queue for\nk < 5, and a max-heap otherwise.\n\nMemory Allocation\n~~~~~~~~~~~~~~~~~\nIt is desirable to construct a tree in as balanced a way as possible.\nGiven a training set with n_samples and a user-supplied leaf_size, if\nthe points in each node are divided as evenly as possible between the\ntwo children, the maximum de""pth needed so that leaf nodes satisfy\n``leaf_size <= n_points <= 2 * leaf_size`` is given by\n``n_levels = 1 + max(0, floor(log2((n_samples - 1) / leaf_size)))``\n(with the exception of the special case where ``n_samples < leaf_size``)\nFor a given number of levels, the number of points in a tree is given by\n``n_nodes = 2 ** n_levels - 1``. Both of these results can be shown\nby induction. Using them, the correct amount of memory can be pre-allocated\nfor a given ``n_samples`` and ``leaf_size``.\n"; -static char __pyx_k_27[] = "BallTree.__reduce__ (line 512)"; -static char __pyx_k_28[] = "BallTree.__getstate__ (line 518)"; -static char __pyx_k_29[] = "BallTree.__setstate__ (line 531)"; -static char __pyx_k_30[] = "BallTree.query (line 544)"; -static char __pyx_k_31[] = "BallTree.query_radius (line 644)"; +static char __pyx_k_3[] = "popping empty stack"; +static char __pyx_k_11[] = "X is an empty array"; +static char __pyx_k_13[] = "X should have two dimensions"; +static char __pyx_k_15[] = "p must be greater than or equal to 1"; +static char __pyx_k_17[] = "leaf_size must be greater than or equal to 1"; +static char __pyx_k_20[] = "query data dimension must match BallTree data dimension"; +static char __pyx_k_22[] = "k must be less than or equal to the number of training points"; +static char __pyx_k_27[] = "count_only and return_distance cannot both be true"; +static char __pyx_k_29[] = "return_distance must be True if sort_distances is True"; +static char __pyx_k_33[] = "r must be broadcastable to X.shape"; +static char __pyx_k_36[] = "query_radius_idx_only_"; +static char __pyx_k_37[] = "query_radius_distances_"; +static char __pyx_k_38[] = "Fatal: parent is a leaf. Memory allocation is flawed"; +static char __pyx_k_40[] = "zero-sized node"; +static char __pyx_k_42[] = "ndarray is not C contiguous"; +static char __pyx_k_44[] = "ndarray is not Fortran contiguous"; +static char __pyx_k_46[] = "Non-native byte order not supported"; +static char __pyx_k_48[] = "unknown dtype code in numpy.pxd (%d)"; +static char __pyx_k_49[] = "Format string allocated too short, see comment in numpy.pxd"; +static char __pyx_k_52[] = "Format string allocated too short."; +static char __pyx_k_54[] = "\n=========\nBall Tree\n=========\nA ball tree is a data object which speeds up nearest neighbor\nsearches in high dimensions (see scikit-learn neighbors module\ndocumentation for an overview of neighbor trees). There are many\ntypes of ball trees. This package provides a basic implementation\nin cython.\n\nImplementation Notes\n--------------------\n\nA ball tree can be thought of as a collection of nodes. Each node\nstores a centroid, a radius, and the pointers to two child nodes.\n\n* centroid : the centroid of a node is the mean of all the locations\n of points within the node\n* radius : the radius of a node is the distance from the centroid\n to the furthest point in the node.\n* subnodes : each node has a maximum of 2 child nodes. The data within\n the parent node is divided between the two child nodes.\n\nIn a typical tree implementation, nodes may be classes or structures which\nare dynamically allocated as needed. This offers flexibility in the number\nof nodes, and leads to very straightforward and readable code. It also means\nthat the tree can be dynamically augmented or pruned with new data, in an\nin-line fashion. This approach generally leads to recursive code: upon\nconstruction, the head node constructs its child nodes, the child nodes\nconstruct their child nodes, and so-on.\n\nThe current package uses a different approach: all node data is stored in\na set of numpy arrays which are pre-allocated. The main advantage of this\napproach is that the whole object can be quickly and easily saved to disk\nand reconstructed from disk. This also allows for an iterative interface\nwhich gives more control over the heap, and leads to speed. There are a\nfew disadvantages, however: once the tree is built, augmenting or pruning it\nis not as straightforward. Also, the size of the tree must be known from the\nstart, so there is not as much flexibility in building it.\n\nBallTree Pseudo-code\n~~~~~~~~~~~~~~~~~~~~\nBecause understanding a ball ""tree is simpler with recursive code, here is some\npseudo-code to show the structure of the main functionality\n\n # Ball Tree pseudo code\n\n class Node:\n #class data:\n centroid\n radius\n child1, child2\n\n #class methods:\n def construct(data):\n centroid = compute_centroid(data)\n radius = compute_radius(centroid, data)\n\n # Divide the data into two approximately equal sets.\n # This is often done by splitting along a single dimension.\n data1, data2 = divide(data)\n\n if number_of_points(data1) > 0:\n child1.construct(data1)\n\n if number_of_points(data2) > 0:\n child2.construct(data2)\n\n def query(pt, neighbors_heap):\n # compute the minimum distance from pt to any point in this node\n d = distance(point, centroid)\n if d < radius:\n min_distance = 0\n else:\n min_distance = d - radius\n\n if min_distance > max_distance_in(neighbors_heap):\n # all these points are too far away. cut off the search here\n return\n elif node_size > 1:\n child1.query(pt, neighbors_heap)\n child2.query(pt, neighbors_heap)\n\n\n object BallTree:\n #class data:\n data\n root_node\n\n #class methods\n def construct(data, num_leaves):\n root_node.construct(data)\n\n def query(point, num_neighbors):\n neighbors_heap = empty_heap_of_size(num_neighbors)\n root_node.query(point, neighbors_heap)\n\nThis certainly is not a complete description, but should give the basic idea\nof the form of the algorithm. The implementation below is much faster than\nanything mirroring the pseudo-code above, but for that reason is much more\nopaque. Here's the basic idea:\n\nBallTree Storage\n~~~~~~~~~~~~~~~~""\nThe BallTree information is stored using a combination of\n\"Array of Structures\" and \"Structure of Arrays\" to maximize speed.\nGiven input data of size ``(n_samples, n_features)``, BallTree computes the\nexpected number of nodes ``n_nodes`` (see below), and allocates the\nfollowing arrays:\n\n* ``data`` : a float array of shape ``(n_samples, n_features)``\n This is simply the input data. If the input matrix is well-formed\n (contiguous, c-ordered, correct data type) then no copy is needed\n* ``idx_array`` : an integer array of size ``n_samples``\n This can be thought of as an array of pointers to the data in ``data``.\n Rather than shuffling around the data itself, we shuffle around pointers\n to the rows in data.\n* ``node_centroid_arr`` : a float array of shape ``(n_nodes, n_features)``\n This stores the centroid of the data in each node.\n* ``node_info_arr`` : a size-``n_nodes`` array of ``NodeInfo`` structures.\n This stores information associated with each node. Each ``NodeInfo``\n instance has the following attributes:\n - ``idx_start``\n - ``idx_end`` : ``idx_start`` and ``idx_end`` reference the part of\n ``idx_array`` which point to the data associated with the node.\n The data in node with index ``i_node`` is given by\n ``data[idx_array[idx_start:idx_end]]``\n - ``is_leaf`` : a boolean value which tells whether this node is a leaf:\n that is, whether or not it has children.\n - ``radius`` : a floating-point value which gives the distance from\n the node centroid to the furthest point in the node.\n\nOne feature here is that there are no stored pointers from parent nodes to\nchild nodes and vice-versa. These pointers are implemented implicitly:\nFor a node with index ``i``, the two children are found at indices\n``2 * i + 1`` and ``2 * i + 2``, while the parent is found at index\n``floor((i - 1) / 2)``. The root node has no parent.\n\nWith this data structure in place, the functionality ""of the above BallTree\npseudo-code can be implemented in a much more efficient manner.\nMost of the data passing done in this code uses raw data pointers.\nUsing numpy arrays would be preferable for safety, but the\noverhead of array slicing and sub-array construction leads to execution\ntime which is several orders of magnitude slower than the current\nimplementation.\n\nPriority Queue vs Max-heap\n~~~~~~~~~~~~~~~~~~~~~~~~~~\nWhen querying for more than one neighbor, the code must maintain a list of\nthe current k nearest points. The BallTree code implements this in two ways.\n\n- A priority queue: this is just a sorted list. When an item is added,\n it is inserted in the appropriate location. The cost of the search plus\n insert averages O[k].\n- A max-heap: this is a binary tree structure arranged such that each node is\n greater than its children. The cost of adding an item is O[log(k)].\n At the end of the iterations, the results must be sorted: a quicksort is\n used, which averages O[k log(k)]. Quicksort has worst-case O[k^2]\n performance, but because the input is already structured in a max-heap,\n the worst case will not be realized. Thus the sort is a one-time operation\n with cost O[k log(k)].\n\nEach insert is performed an average of log(N) times per query, where N is\nthe number of training points. Because of this, for a single query, the\npriority-queue approach costs O[k log(N)], and the max-heap approach costs\nO[log(k)log(N)] + O[k log(k)]. Tests show that for sufficiently large k,\nthe max-heap approach out-performs the priority queue approach by a factor\nof a few. In light of these tests, the code uses a priority queue for\nk < 5, and a max-heap otherwise.\n\nMemory Allocation\n~~~~~~~~~~~~~~~~~\nIt is desirable to construct a tree in as balanced a way as possible.\nGiven a training set with n_samples and a user-supplied leaf_size, if\nthe points in each node are divided as evenly as possible between the\ntwo children, the maximu""m depth needed so that leaf nodes satisfy\n``leaf_size <= n_points <= 2 * leaf_size`` is given by\n``n_levels = 1 + max(0, floor(log2((n_samples - 1) / leaf_size)))``\n(with the exception of the special case where ``n_samples < leaf_size``)\nFor a given number of levels, the number of points in a tree is given by\n``n_nodes = 2 ** n_levels - 1``. Both of these results can be shown\nby induction. Using them, the correct amount of memory can be pre-allocated\nfor a given ``n_samples`` and ``leaf_size``.\n"; +static char __pyx_k_55[] = "scikits.learn.ball_tree"; +static char __pyx_k_56[] = "BallTree.query (line 544)"; +static char __pyx_k_57[] = "\n query(X, k=1, return_distance=True)\n\n query the Ball Tree for the k nearest neighbors\n\n Parameters\n ----------\n X : array-like, last dimension self.dim\n An array of points to query\n k : integer (default = 1)\n The number of nearest neighbors to return\n return_distance : boolean (default = True)\n if True, return a tuple (d,i)\n if False, return array i\n\n Returns\n -------\n i : if return_distance == False\n (d,i) : if return_distance == True\n\n d : array of doubles - shape: x.shape[:-1] + (k,)\n each entry gives the list of distances to the\n neighbors of the corresponding point\n (note that distances are not sorted)\n\n i : array of integers - shape: x.shape[:-1] + (k,)\n each entry gives the list of indices of\n neighbors of the corresponding point\n (note that neighbors are not sorted)\n\n Examples\n --------\n Query for k-nearest neighbors\n\n >>> import numpy as np\n >>> np.random.seed(0)\n >>> X = np.random.random((10,3)) # 10 points in 3 dimensions\n >>> ball_tree = BallTree(X, leaf_size=2)\n >>> dist, ind = ball_tree.query(X[0], k=3)\n >>> print ind # indices of 3 closest neighbors\n [0 3 1]\n >>> print dist # distances to 3 closest neighbors\n [ 0. 0.19662693 0.29473397]\n "; +static char __pyx_k_58[] = "BallTree.query_radius (line 644)"; +static char __pyx_k_59[] = "\n query_radius(self, X, r, count_only = False):\n\n query the Ball Tree for neighbors within a ball of size r\n\n Parameters\n ----------\n X : array-like, last dimension self.dim\n An array of points to query\n r : distance within which neighbors are returned\n r can be a single value, or an array of values of shape\n x.shape[:-1] if different radii are desired for each point.\n return_distance : boolean (default = False)\n if True, return distances to neighbors of each point\n if False, return only neighbors\n Note that unlike BallTree.query(), setting return_distance=True\n adds to the computation time. Not all distances need to be\n calculated explicitly for return_distance=False. Results are\n not sorted by default: see ``sort_results`` keyword.\n count_only : boolean (default = False)\n if True, return only the count of points within distance r\n if False, return the indices of all points within distance r\n If return_distance==True, setting count_only=True will\n result in an error.\n sort_results : boolean (default = False)\n if True, the distances and indices will be sorted before being\n returned. If False, the results will not be sorted. If\n return_distance == False, settinng sort_results = True will\n result in an error.\n\n Returns\n -------\n count : if count_only == True\n ind : if count_only == False and return_distance == False\n (ind, dist) : if count_only == False and return_distance == True\n\n count : array of integers, shape = X.shape[:-1]\n each entry gives the number of neighbors within\n a distance r of the corresponding point.\n\n ind : array of objects, shape = X.shape[:-1]\n each element is ""a numpy integer array listing the indices of\n neighbors of the corresponding point. Note that unlike\n the results of BallTree.query(), the returned neighbors\n are not sorted by distance\n\n dist : array of objects, shape = X.shape[:-1]\n each element is a numpy double array\n listing the distances corresponding to indices in i.\n\n Examples\n --------\n Query for neighbors in a given radius\n\n >>> import numpy as np\n >>> np.random.seed(0)\n >>> X = np.random.random((10,3)) # 10 points in 3 dimensions\n >>> ball_tree = BallTree(X, leaf_size=2)\n >>> print ball_tree.query_radius(X[0], r=0.3, count_only=True)\n 3\n >>> ind = ball_tree.query_radius(X[0], r=0.3)\n >>> print ind # indices of neighbors within distance 0.3\n [3 0 1]\n "; static char __pyx_k__B[] = "B"; static char __pyx_k__C[] = "C"; static char __pyx_k__H[] = "H"; @@ -872,7 +919,6 @@ static char __pyx_k__int32[] = "int32"; static char __pyx_k__names[] = "names"; static char __pyx_k__numpy[] = "numpy"; static char __pyx_k__order[] = "order"; -static char __pyx_k__query[] = "query"; static char __pyx_k__range[] = "range"; static char __pyx_k__shape[] = "shape"; static char __pyx_k__zeros[] = "zeros"; @@ -892,7 +938,6 @@ static char __pyx_k__is_leaf[] = "is_leaf"; static char __pyx_k__n_nodes[] = "n_nodes"; static char __pyx_k__reshape[] = "reshape"; static char __pyx_k__strides[] = "strides"; -static char __pyx_k__BallTree[] = "BallTree"; static char __pyx_k____main__[] = "__main__"; static char __pyx_k____test__[] = "__test__"; static char __pyx_k__itemsize[] = "itemsize"; @@ -906,7 +951,6 @@ static char __pyx_k__idx_array[] = "idx_array"; static char __pyx_k__idx_start[] = "idx_start"; static char __pyx_k__leaf_size[] = "leaf_size"; static char __pyx_k__ValueError[] = "ValueError"; -static char __pyx_k____reduce__[] = "__reduce__"; static char __pyx_k__atleast_1d[] = "atleast_1d"; static char __pyx_k__atleast_2d[] = "atleast_2d"; static char __pyx_k__count_only[] = "count_only"; @@ -915,40 +959,37 @@ static char __pyx_k__suboffsets[] = "suboffsets"; static char __pyx_k__build_tree_[] = "build_tree_"; static char __pyx_k__RuntimeError[] = "RuntimeError"; static char __pyx_k____getstate__[] = "__getstate__"; -static char __pyx_k____setstate__[] = "__setstate__"; -static char __pyx_k__query_radius[] = "query_radius"; static char __pyx_k__sort_results[] = "sort_results"; static char __pyx_k__node_info_arr[] = "node_info_arr"; static char __pyx_k__return_distance[] = "return_distance"; static char __pyx_k__node_centroid_arr[] = "node_centroid_arr"; static char __pyx_k__query_radius_count_[] = "query_radius_count_"; static PyObject *__pyx_kp_s_1; +static PyObject *__pyx_kp_s_11; static PyObject *__pyx_kp_s_13; -static PyObject *__pyx_kp_s_14; static PyObject *__pyx_kp_s_15; -static PyObject *__pyx_n_s_16; -static PyObject *__pyx_n_s_17; -static PyObject *__pyx_kp_s_18; -static PyObject *__pyx_kp_s_19; -static PyObject *__pyx_kp_s_2; -static PyObject *__pyx_kp_u_20; -static PyObject *__pyx_kp_u_21; -static PyObject *__pyx_kp_u_22; -static PyObject *__pyx_kp_u_23; -static PyObject *__pyx_kp_u_24; -static PyObject *__pyx_kp_u_25; -static PyObject *__pyx_kp_u_27; -static PyObject *__pyx_kp_u_28; -static PyObject *__pyx_kp_u_29; +static PyObject *__pyx_kp_s_17; +static PyObject *__pyx_kp_s_20; +static PyObject *__pyx_kp_s_22; +static PyObject *__pyx_kp_s_27; +static PyObject *__pyx_kp_s_29; static PyObject *__pyx_kp_s_3; -static PyObject *__pyx_kp_u_30; -static PyObject *__pyx_kp_u_31; -static PyObject *__pyx_kp_s_4; -static PyObject *__pyx_kp_s_5; -static PyObject *__pyx_kp_s_6; -static PyObject *__pyx_kp_s_8; -static PyObject *__pyx_kp_s_9; -static PyObject *__pyx_n_s__BallTree; +static PyObject *__pyx_kp_s_33; +static PyObject *__pyx_n_s_36; +static PyObject *__pyx_n_s_37; +static PyObject *__pyx_kp_s_38; +static PyObject *__pyx_kp_s_40; +static PyObject *__pyx_kp_u_42; +static PyObject *__pyx_kp_u_44; +static PyObject *__pyx_kp_u_46; +static PyObject *__pyx_kp_u_48; +static PyObject *__pyx_kp_u_49; +static PyObject *__pyx_kp_u_52; +static PyObject *__pyx_n_s_55; +static PyObject *__pyx_kp_u_56; +static PyObject *__pyx_kp_u_57; +static PyObject *__pyx_kp_u_58; +static PyObject *__pyx_kp_u_59; static PyObject *__pyx_n_s__C; static PyObject *__pyx_n_s__DTYPE; static PyObject *__pyx_n_s__ITYPE; @@ -958,8 +999,6 @@ static PyObject *__pyx_n_s__X; static PyObject *__pyx_n_s____getstate__; static PyObject *__pyx_n_s____main__; static PyObject *__pyx_n_s____new__; -static PyObject *__pyx_n_s____reduce__; -static PyObject *__pyx_n_s____setstate__; static PyObject *__pyx_n_s____test__; static PyObject *__pyx_n_s__arange; static PyObject *__pyx_n_s__asarray; @@ -1009,9 +1048,7 @@ static PyObject *__pyx_n_s__object; static PyObject *__pyx_n_s__ones; static PyObject *__pyx_n_s__order; static PyObject *__pyx_n_s__p; -static PyObject *__pyx_n_s__query; static PyObject *__pyx_n_s__query_one_; -static PyObject *__pyx_n_s__query_radius; static PyObject *__pyx_n_s__query_radius_count_; static PyObject *__pyx_n_s__r; static PyObject *__pyx_n_s__radius; @@ -1031,12 +1068,40 @@ static PyObject *__pyx_int_1; static PyObject *__pyx_int_5; static PyObject *__pyx_int_neg_1; static PyObject *__pyx_int_15; -static PyObject *__pyx_k_7; -static PyObject *__pyx_k_10; -static PyObject *__pyx_k_11; -static PyObject *__pyx_k_12; - -/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":215 +static PyObject *__pyx_k_19; +static PyObject *__pyx_k_24; +static PyObject *__pyx_k_25; +static PyObject *__pyx_k_26; +static PyObject *__pyx_k_tuple_2; +static PyObject *__pyx_k_tuple_4; +static PyObject *__pyx_k_tuple_5; +static PyObject *__pyx_k_tuple_6; +static PyObject *__pyx_k_tuple_7; +static PyObject *__pyx_k_tuple_8; +static PyObject *__pyx_k_tuple_9; +static PyObject *__pyx_k_tuple_10; +static PyObject *__pyx_k_tuple_12; +static PyObject *__pyx_k_tuple_14; +static PyObject *__pyx_k_tuple_16; +static PyObject *__pyx_k_tuple_18; +static PyObject *__pyx_k_tuple_21; +static PyObject *__pyx_k_tuple_23; +static PyObject *__pyx_k_tuple_28; +static PyObject *__pyx_k_tuple_30; +static PyObject *__pyx_k_tuple_31; +static PyObject *__pyx_k_tuple_32; +static PyObject *__pyx_k_tuple_34; +static PyObject *__pyx_k_tuple_35; +static PyObject *__pyx_k_tuple_39; +static PyObject *__pyx_k_tuple_41; +static PyObject *__pyx_k_tuple_43; +static PyObject *__pyx_k_tuple_45; +static PyObject *__pyx_k_tuple_47; +static PyObject *__pyx_k_tuple_50; +static PyObject *__pyx_k_tuple_51; +static PyObject *__pyx_k_tuple_53; + +/* "scikits/learn/ball_tree.pyx":215 * # * @cython.profile(False) * cdef inline DTYPE_t dmax(DTYPE_t x, DTYPE_t y): # <<<<<<<<<<<<<< @@ -1044,12 +1109,12 @@ static PyObject *__pyx_k_12; * return x */ -static CYTHON_INLINE __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_dmax(__pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_x, __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_y) { - __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_r; +static CYTHON_INLINE __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball_tree_dmax(__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_x, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_y) { + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_r; int __pyx_t_1; __Pyx_RefNannySetupContext("dmax"); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":216 + /* "scikits/learn/ball_tree.pyx":216 * @cython.profile(False) * cdef inline DTYPE_t dmax(DTYPE_t x, DTYPE_t y): * if x >= y: # <<<<<<<<<<<<<< @@ -1059,7 +1124,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_ __pyx_t_1 = (__pyx_v_x >= __pyx_v_y); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":217 + /* "scikits/learn/ball_tree.pyx":217 * cdef inline DTYPE_t dmax(DTYPE_t x, DTYPE_t y): * if x >= y: * return x # <<<<<<<<<<<<<< @@ -1072,7 +1137,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_ } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":219 + /* "scikits/learn/ball_tree.pyx":219 * return x * else: * return y # <<<<<<<<<<<<<< @@ -1090,7 +1155,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_ return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":223 +/* "scikits/learn/ball_tree.pyx":223 * * @cython.profile(False) * cdef inline DTYPE_t dmin(DTYPE_t x, DTYPE_t y): # <<<<<<<<<<<<<< @@ -1098,12 +1163,12 @@ static CYTHON_INLINE __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_ * return x */ -static CYTHON_INLINE __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_dmin(__pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_x, __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_y) { - __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_r; +static CYTHON_INLINE __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball_tree_dmin(__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_x, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_y) { + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_r; int __pyx_t_1; __Pyx_RefNannySetupContext("dmin"); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":224 + /* "scikits/learn/ball_tree.pyx":224 * @cython.profile(False) * cdef inline DTYPE_t dmin(DTYPE_t x, DTYPE_t y): * if x <= y: # <<<<<<<<<<<<<< @@ -1113,7 +1178,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_ __pyx_t_1 = (__pyx_v_x <= __pyx_v_y); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":225 + /* "scikits/learn/ball_tree.pyx":225 * cdef inline DTYPE_t dmin(DTYPE_t x, DTYPE_t y): * if x <= y: * return x # <<<<<<<<<<<<<< @@ -1126,7 +1191,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_ } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":227 + /* "scikits/learn/ball_tree.pyx":227 * return x * else: * return y # <<<<<<<<<<<<<< @@ -1144,7 +1209,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_ return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":231 +/* "scikits/learn/ball_tree.pyx":231 * * @cython.profile(False) * cdef inline DTYPE_t dabs(DTYPE_t x): # <<<<<<<<<<<<<< @@ -1152,12 +1217,12 @@ static CYTHON_INLINE __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_ * return x */ -static CYTHON_INLINE __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_dabs(__pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_x) { - __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_r; +static CYTHON_INLINE __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball_tree_dabs(__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_x) { + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_r; int __pyx_t_1; __Pyx_RefNannySetupContext("dabs"); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":232 + /* "scikits/learn/ball_tree.pyx":232 * @cython.profile(False) * cdef inline DTYPE_t dabs(DTYPE_t x): * if x >= 0: # <<<<<<<<<<<<<< @@ -1167,7 +1232,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_ __pyx_t_1 = (__pyx_v_x >= 0.0); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":233 + /* "scikits/learn/ball_tree.pyx":233 * cdef inline DTYPE_t dabs(DTYPE_t x): * if x >= 0: * return x # <<<<<<<<<<<<<< @@ -1180,7 +1245,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_ } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":235 + /* "scikits/learn/ball_tree.pyx":235 * return x * else: * return -x # <<<<<<<<<<<<<< @@ -1198,7 +1263,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_ return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":248 +/* "scikits/learn/ball_tree.pyx":248 * # which convert between these forms. * @cython.cdivision(True) * cdef DTYPE_t dist(DTYPE_t *x1, DTYPE_t *x2, ITYPE_t n, DTYPE_t p): # <<<<<<<<<<<<<< @@ -1206,16 +1271,16 @@ static CYTHON_INLINE __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_ * cdef DTYPE_t r, d */ -static __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_dist(__pyx_t_7sklearn_9ball_tree_DTYPE_t *__pyx_v_x1, __pyx_t_7sklearn_9ball_tree_DTYPE_t *__pyx_v_x2, __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_n, __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_p) { - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_i; - __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_r; - __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_d; - __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_r; +static __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball_tree_dist(__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *__pyx_v_x1, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *__pyx_v_x2, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_n, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_p) { + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_i; + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_r; + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_d; + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_r; int __pyx_t_1; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_t_2; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_t_2; __Pyx_RefNannySetupContext("dist"); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":251 + /* "scikits/learn/ball_tree.pyx":251 * cdef ITYPE_t i * cdef DTYPE_t r, d * r = 0 # <<<<<<<<<<<<<< @@ -1224,7 +1289,7 @@ static __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_dist(__p */ __pyx_v_r = 0.0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":252 + /* "scikits/learn/ball_tree.pyx":252 * cdef DTYPE_t r, d * r = 0 * if p == 2: # <<<<<<<<<<<<<< @@ -1234,7 +1299,7 @@ static __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_dist(__p __pyx_t_1 = (__pyx_v_p == 2.0); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":253 + /* "scikits/learn/ball_tree.pyx":253 * r = 0 * if p == 2: * for i from 0 <= i < n: # <<<<<<<<<<<<<< @@ -1244,7 +1309,7 @@ static __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_dist(__p __pyx_t_2 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":254 + /* "scikits/learn/ball_tree.pyx":254 * if p == 2: * for i from 0 <= i < n: * d = x1[i] - x2[i] # <<<<<<<<<<<<<< @@ -1253,38 +1318,38 @@ static __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_dist(__p */ __pyx_v_d = ((__pyx_v_x1[__pyx_v_i]) - (__pyx_v_x2[__pyx_v_i])); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":255 + /* "scikits/learn/ball_tree.pyx":255 * for i from 0 <= i < n: * d = x1[i] - x2[i] * r += d * d # <<<<<<<<<<<<<< * r = r ** 0.5 * elif p == infinity: */ - __pyx_v_r += (__pyx_v_d * __pyx_v_d); + __pyx_v_r = (__pyx_v_r + (__pyx_v_d * __pyx_v_d)); } - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":256 + /* "scikits/learn/ball_tree.pyx":256 * d = x1[i] - x2[i] * r += d * d * r = r ** 0.5 # <<<<<<<<<<<<<< * elif p == infinity: * for i from 0 <= i < n: */ - __pyx_v_r = pow(__pyx_v_r, 0.5); + __pyx_v_r = pow(((double)__pyx_v_r), 0.5); goto __pyx_L3; } - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":257 + /* "scikits/learn/ball_tree.pyx":257 * r += d * d * r = r ** 0.5 * elif p == infinity: # <<<<<<<<<<<<<< * for i from 0 <= i < n: * r = dmax(r, dabs(x1[i] - x2[i])) */ - __pyx_t_1 = (__pyx_v_p == __pyx_v_7sklearn_9ball_tree_infinity); + __pyx_t_1 = (__pyx_v_p == __pyx_v_7scikits_5learn_9ball_tree_infinity); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":258 + /* "scikits/learn/ball_tree.pyx":258 * r = r ** 0.5 * elif p == infinity: * for i from 0 <= i < n: # <<<<<<<<<<<<<< @@ -1294,19 +1359,19 @@ static __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_dist(__p __pyx_t_2 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":259 + /* "scikits/learn/ball_tree.pyx":259 * elif p == infinity: * for i from 0 <= i < n: * r = dmax(r, dabs(x1[i] - x2[i])) # <<<<<<<<<<<<<< * elif p == 1: * for i from 0 <= i < n: */ - __pyx_v_r = __pyx_f_7sklearn_9ball_tree_dmax(__pyx_v_r, __pyx_f_7sklearn_9ball_tree_dabs(((__pyx_v_x1[__pyx_v_i]) - (__pyx_v_x2[__pyx_v_i])))); + __pyx_v_r = __pyx_f_7scikits_5learn_9ball_tree_dmax(__pyx_v_r, __pyx_f_7scikits_5learn_9ball_tree_dabs(((__pyx_v_x1[__pyx_v_i]) - (__pyx_v_x2[__pyx_v_i])))); } goto __pyx_L3; } - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":260 + /* "scikits/learn/ball_tree.pyx":260 * for i from 0 <= i < n: * r = dmax(r, dabs(x1[i] - x2[i])) * elif p == 1: # <<<<<<<<<<<<<< @@ -1316,7 +1381,7 @@ static __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_dist(__p __pyx_t_1 = (__pyx_v_p == 1.0); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":261 + /* "scikits/learn/ball_tree.pyx":261 * r = dmax(r, dabs(x1[i] - x2[i])) * elif p == 1: * for i from 0 <= i < n: # <<<<<<<<<<<<<< @@ -1326,20 +1391,20 @@ static __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_dist(__p __pyx_t_2 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":262 + /* "scikits/learn/ball_tree.pyx":262 * elif p == 1: * for i from 0 <= i < n: * r += dabs(x1[i] - x2[i]) # <<<<<<<<<<<<<< * else: * for i from 0 <= i < n: */ - __pyx_v_r += __pyx_f_7sklearn_9ball_tree_dabs(((__pyx_v_x1[__pyx_v_i]) - (__pyx_v_x2[__pyx_v_i]))); + __pyx_v_r = (__pyx_v_r + __pyx_f_7scikits_5learn_9ball_tree_dabs(((__pyx_v_x1[__pyx_v_i]) - (__pyx_v_x2[__pyx_v_i])))); } goto __pyx_L3; } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":264 + /* "scikits/learn/ball_tree.pyx":264 * r += dabs(x1[i] - x2[i]) * else: * for i from 0 <= i < n: # <<<<<<<<<<<<<< @@ -1349,26 +1414,26 @@ static __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_dist(__p __pyx_t_2 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":265 + /* "scikits/learn/ball_tree.pyx":265 * else: * for i from 0 <= i < n: * d = dabs(x1[i] - x2[i]) # <<<<<<<<<<<<<< * r += d ** p * r = r ** (1. / p) */ - __pyx_v_d = __pyx_f_7sklearn_9ball_tree_dabs(((__pyx_v_x1[__pyx_v_i]) - (__pyx_v_x2[__pyx_v_i]))); + __pyx_v_d = __pyx_f_7scikits_5learn_9ball_tree_dabs(((__pyx_v_x1[__pyx_v_i]) - (__pyx_v_x2[__pyx_v_i]))); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":266 + /* "scikits/learn/ball_tree.pyx":266 * for i from 0 <= i < n: * d = dabs(x1[i] - x2[i]) * r += d ** p # <<<<<<<<<<<<<< * r = r ** (1. / p) * return r */ - __pyx_v_r += pow(__pyx_v_d, __pyx_v_p); + __pyx_v_r = (__pyx_v_r + pow(__pyx_v_d, __pyx_v_p)); } - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":267 + /* "scikits/learn/ball_tree.pyx":267 * d = dabs(x1[i] - x2[i]) * r += d ** p * r = r ** (1. / p) # <<<<<<<<<<<<<< @@ -1379,7 +1444,7 @@ static __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_dist(__p } __pyx_L3:; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":268 + /* "scikits/learn/ball_tree.pyx":268 * r += d ** p * r = r ** (1. / p) * return r # <<<<<<<<<<<<<< @@ -1395,7 +1460,7 @@ static __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_dist(__p return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":272 +/* "scikits/learn/ball_tree.pyx":272 * * @cython.cdivision(True) * cdef DTYPE_t dist_p(DTYPE_t *x1, DTYPE_t *x2, ITYPE_t n, DTYPE_t p): # <<<<<<<<<<<<<< @@ -1403,16 +1468,16 @@ static __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_dist(__p * cdef DTYPE_t r, d */ -static __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_dist_p(__pyx_t_7sklearn_9ball_tree_DTYPE_t *__pyx_v_x1, __pyx_t_7sklearn_9ball_tree_DTYPE_t *__pyx_v_x2, __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_n, __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_p) { - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_i; - __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_r; - __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_d; - __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_r; +static __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball_tree_dist_p(__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *__pyx_v_x1, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *__pyx_v_x2, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_n, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_p) { + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_i; + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_r; + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_d; + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_r; int __pyx_t_1; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_t_2; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_t_2; __Pyx_RefNannySetupContext("dist_p"); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":275 + /* "scikits/learn/ball_tree.pyx":275 * cdef ITYPE_t i * cdef DTYPE_t r, d * r = 0 # <<<<<<<<<<<<<< @@ -1421,7 +1486,7 @@ static __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_dist_p(_ */ __pyx_v_r = 0.0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":276 + /* "scikits/learn/ball_tree.pyx":276 * cdef DTYPE_t r, d * r = 0 * if p == 2: # <<<<<<<<<<<<<< @@ -1431,7 +1496,7 @@ static __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_dist_p(_ __pyx_t_1 = (__pyx_v_p == 2.0); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":277 + /* "scikits/learn/ball_tree.pyx":277 * r = 0 * if p == 2: * for i from 0 <= i < n: # <<<<<<<<<<<<<< @@ -1441,7 +1506,7 @@ static __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_dist_p(_ __pyx_t_2 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":278 + /* "scikits/learn/ball_tree.pyx":278 * if p == 2: * for i from 0 <= i < n: * d = x1[i] - x2[i] # <<<<<<<<<<<<<< @@ -1450,29 +1515,29 @@ static __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_dist_p(_ */ __pyx_v_d = ((__pyx_v_x1[__pyx_v_i]) - (__pyx_v_x2[__pyx_v_i])); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":279 + /* "scikits/learn/ball_tree.pyx":279 * for i from 0 <= i < n: * d = x1[i] - x2[i] * r += d * d # <<<<<<<<<<<<<< * elif p == infinity: * for i from 0 <= i < n: */ - __pyx_v_r += (__pyx_v_d * __pyx_v_d); + __pyx_v_r = (__pyx_v_r + (__pyx_v_d * __pyx_v_d)); } goto __pyx_L3; } - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":280 + /* "scikits/learn/ball_tree.pyx":280 * d = x1[i] - x2[i] * r += d * d * elif p == infinity: # <<<<<<<<<<<<<< * for i from 0 <= i < n: * r = dmax(r, dabs(x1[i] - x2[i])) */ - __pyx_t_1 = (__pyx_v_p == __pyx_v_7sklearn_9ball_tree_infinity); + __pyx_t_1 = (__pyx_v_p == __pyx_v_7scikits_5learn_9ball_tree_infinity); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":281 + /* "scikits/learn/ball_tree.pyx":281 * r += d * d * elif p == infinity: * for i from 0 <= i < n: # <<<<<<<<<<<<<< @@ -1482,19 +1547,19 @@ static __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_dist_p(_ __pyx_t_2 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":282 + /* "scikits/learn/ball_tree.pyx":282 * elif p == infinity: * for i from 0 <= i < n: * r = dmax(r, dabs(x1[i] - x2[i])) # <<<<<<<<<<<<<< * elif p == 1: * for i from 0 <= i < n: */ - __pyx_v_r = __pyx_f_7sklearn_9ball_tree_dmax(__pyx_v_r, __pyx_f_7sklearn_9ball_tree_dabs(((__pyx_v_x1[__pyx_v_i]) - (__pyx_v_x2[__pyx_v_i])))); + __pyx_v_r = __pyx_f_7scikits_5learn_9ball_tree_dmax(__pyx_v_r, __pyx_f_7scikits_5learn_9ball_tree_dabs(((__pyx_v_x1[__pyx_v_i]) - (__pyx_v_x2[__pyx_v_i])))); } goto __pyx_L3; } - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":283 + /* "scikits/learn/ball_tree.pyx":283 * for i from 0 <= i < n: * r = dmax(r, dabs(x1[i] - x2[i])) * elif p == 1: # <<<<<<<<<<<<<< @@ -1504,7 +1569,7 @@ static __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_dist_p(_ __pyx_t_1 = (__pyx_v_p == 1.0); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":284 + /* "scikits/learn/ball_tree.pyx":284 * r = dmax(r, dabs(x1[i] - x2[i])) * elif p == 1: * for i from 0 <= i < n: # <<<<<<<<<<<<<< @@ -1514,20 +1579,20 @@ static __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_dist_p(_ __pyx_t_2 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":285 + /* "scikits/learn/ball_tree.pyx":285 * elif p == 1: * for i from 0 <= i < n: * r += dabs(x1[i] - x2[i]) # <<<<<<<<<<<<<< * else: * for i from 0 <= i < n: */ - __pyx_v_r += __pyx_f_7sklearn_9ball_tree_dabs(((__pyx_v_x1[__pyx_v_i]) - (__pyx_v_x2[__pyx_v_i]))); + __pyx_v_r = (__pyx_v_r + __pyx_f_7scikits_5learn_9ball_tree_dabs(((__pyx_v_x1[__pyx_v_i]) - (__pyx_v_x2[__pyx_v_i])))); } goto __pyx_L3; } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":287 + /* "scikits/learn/ball_tree.pyx":287 * r += dabs(x1[i] - x2[i]) * else: * for i from 0 <= i < n: # <<<<<<<<<<<<<< @@ -1537,28 +1602,28 @@ static __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_dist_p(_ __pyx_t_2 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":288 + /* "scikits/learn/ball_tree.pyx":288 * else: * for i from 0 <= i < n: * d = dabs(x1[i] - x2[i]) # <<<<<<<<<<<<<< * r += d ** p * return r */ - __pyx_v_d = __pyx_f_7sklearn_9ball_tree_dabs(((__pyx_v_x1[__pyx_v_i]) - (__pyx_v_x2[__pyx_v_i]))); + __pyx_v_d = __pyx_f_7scikits_5learn_9ball_tree_dabs(((__pyx_v_x1[__pyx_v_i]) - (__pyx_v_x2[__pyx_v_i]))); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":289 + /* "scikits/learn/ball_tree.pyx":289 * for i from 0 <= i < n: * d = dabs(x1[i] - x2[i]) * r += d ** p # <<<<<<<<<<<<<< * return r * */ - __pyx_v_r += pow(__pyx_v_d, __pyx_v_p); + __pyx_v_r = (__pyx_v_r + pow(__pyx_v_d, __pyx_v_p)); } } __pyx_L3:; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":290 + /* "scikits/learn/ball_tree.pyx":290 * d = dabs(x1[i] - x2[i]) * r += d ** p * return r # <<<<<<<<<<<<<< @@ -1574,7 +1639,7 @@ static __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_dist_p(_ return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":294 +/* "scikits/learn/ball_tree.pyx":294 * * @cython.cdivision(True) * cdef DTYPE_t dist_from_dist_p(DTYPE_t r, DTYPE_t p): # <<<<<<<<<<<<<< @@ -1582,12 +1647,12 @@ static __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_dist_p(_ * return r ** 0.5 */ -static __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_dist_from_dist_p(__pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_r, __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_p) { - __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_r; +static __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball_tree_dist_from_dist_p(__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_r, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_p) { + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_r; int __pyx_t_1; __Pyx_RefNannySetupContext("dist_from_dist_p"); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":295 + /* "scikits/learn/ball_tree.pyx":295 * @cython.cdivision(True) * cdef DTYPE_t dist_from_dist_p(DTYPE_t r, DTYPE_t p): * if p == 2: # <<<<<<<<<<<<<< @@ -1597,29 +1662,29 @@ static __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_dist_fro __pyx_t_1 = (__pyx_v_p == 2.0); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":296 + /* "scikits/learn/ball_tree.pyx":296 * cdef DTYPE_t dist_from_dist_p(DTYPE_t r, DTYPE_t p): * if p == 2: * return r ** 0.5 # <<<<<<<<<<<<<< * elif p == infinity: * return r */ - __pyx_r = pow(__pyx_v_r, 0.5); + __pyx_r = pow(((double)__pyx_v_r), 0.5); goto __pyx_L0; goto __pyx_L3; } - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":297 + /* "scikits/learn/ball_tree.pyx":297 * if p == 2: * return r ** 0.5 * elif p == infinity: # <<<<<<<<<<<<<< * return r * elif p == 1: */ - __pyx_t_1 = (__pyx_v_p == __pyx_v_7sklearn_9ball_tree_infinity); + __pyx_t_1 = (__pyx_v_p == __pyx_v_7scikits_5learn_9ball_tree_infinity); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":298 + /* "scikits/learn/ball_tree.pyx":298 * return r ** 0.5 * elif p == infinity: * return r # <<<<<<<<<<<<<< @@ -1631,7 +1696,7 @@ static __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_dist_fro goto __pyx_L3; } - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":299 + /* "scikits/learn/ball_tree.pyx":299 * elif p == infinity: * return r * elif p == 1: # <<<<<<<<<<<<<< @@ -1641,7 +1706,7 @@ static __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_dist_fro __pyx_t_1 = (__pyx_v_p == 1.0); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":300 + /* "scikits/learn/ball_tree.pyx":300 * return r * elif p == 1: * return r # <<<<<<<<<<<<<< @@ -1654,7 +1719,7 @@ static __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_dist_fro } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":302 + /* "scikits/learn/ball_tree.pyx":302 * return r * else: * return r ** (1. / p) # <<<<<<<<<<<<<< @@ -1672,7 +1737,7 @@ static __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_dist_fro return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":306 +/* "scikits/learn/ball_tree.pyx":306 * * @cython.cdivision(True) * cdef DTYPE_t dist_p_from_dist(DTYPE_t r, DTYPE_t p): # <<<<<<<<<<<<<< @@ -1680,12 +1745,12 @@ static __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_dist_fro * return r ** 2 */ -static __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_dist_p_from_dist(__pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_r, __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_p) { - __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_r; +static __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball_tree_dist_p_from_dist(__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_r, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_p) { + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_r; int __pyx_t_1; __Pyx_RefNannySetupContext("dist_p_from_dist"); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":307 + /* "scikits/learn/ball_tree.pyx":307 * @cython.cdivision(True) * cdef DTYPE_t dist_p_from_dist(DTYPE_t r, DTYPE_t p): * if p == 2: # <<<<<<<<<<<<<< @@ -1695,7 +1760,7 @@ static __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_dist_p_f __pyx_t_1 = (__pyx_v_p == 2.0); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":308 + /* "scikits/learn/ball_tree.pyx":308 * cdef DTYPE_t dist_p_from_dist(DTYPE_t r, DTYPE_t p): * if p == 2: * return r ** 2 # <<<<<<<<<<<<<< @@ -1707,17 +1772,17 @@ static __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_dist_p_f goto __pyx_L3; } - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":309 + /* "scikits/learn/ball_tree.pyx":309 * if p == 2: * return r ** 2 * elif p == infinity: # <<<<<<<<<<<<<< * return r * elif p == 1: */ - __pyx_t_1 = (__pyx_v_p == __pyx_v_7sklearn_9ball_tree_infinity); + __pyx_t_1 = (__pyx_v_p == __pyx_v_7scikits_5learn_9ball_tree_infinity); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":310 + /* "scikits/learn/ball_tree.pyx":310 * return r ** 2 * elif p == infinity: * return r # <<<<<<<<<<<<<< @@ -1729,7 +1794,7 @@ static __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_dist_p_f goto __pyx_L3; } - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":311 + /* "scikits/learn/ball_tree.pyx":311 * elif p == infinity: * return r * elif p == 1: # <<<<<<<<<<<<<< @@ -1739,7 +1804,7 @@ static __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_dist_p_f __pyx_t_1 = (__pyx_v_p == 1.0); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":312 + /* "scikits/learn/ball_tree.pyx":312 * return r * elif p == 1: * return r # <<<<<<<<<<<<<< @@ -1752,7 +1817,7 @@ static __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_dist_p_f } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":314 + /* "scikits/learn/ball_tree.pyx":314 * return r * else: * return r ** p # <<<<<<<<<<<<<< @@ -1770,7 +1835,7 @@ static __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_dist_p_f return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":345 +/* "scikits/learn/ball_tree.pyx":345 * * @cython.profile(False) * cdef inline void stack_create(stack* self, int size): # <<<<<<<<<<<<<< @@ -1778,10 +1843,10 @@ static __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_dist_p_f * self.heap = <stack_item*> stdlib.malloc(sizeof(stack_item) * size) */ -static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_stack_create(struct __pyx_t_7sklearn_9ball_tree_stack *__pyx_v_self, int __pyx_v_size) { +static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_stack_create(struct __pyx_t_7scikits_5learn_9ball_tree_stack *__pyx_v_self, int __pyx_v_size) { __Pyx_RefNannySetupContext("stack_create"); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":346 + /* "scikits/learn/ball_tree.pyx":346 * @cython.profile(False) * cdef inline void stack_create(stack* self, int size): * self.size = size # <<<<<<<<<<<<<< @@ -1790,16 +1855,16 @@ static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_stack_create(struct __pyx_ */ __pyx_v_self->size = __pyx_v_size; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":347 + /* "scikits/learn/ball_tree.pyx":347 * cdef inline void stack_create(stack* self, int size): * self.size = size * self.heap = <stack_item*> stdlib.malloc(sizeof(stack_item) * size) # <<<<<<<<<<<<<< * self.n = 0 * */ - __pyx_v_self->heap = ((struct __pyx_t_7sklearn_9ball_tree_stack_item *)malloc(((sizeof(struct __pyx_t_7sklearn_9ball_tree_stack_item)) * __pyx_v_size))); + __pyx_v_self->heap = ((struct __pyx_t_7scikits_5learn_9ball_tree_stack_item *)malloc(((sizeof(struct __pyx_t_7scikits_5learn_9ball_tree_stack_item)) * __pyx_v_size))); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":348 + /* "scikits/learn/ball_tree.pyx":348 * self.size = size * self.heap = <stack_item*> stdlib.malloc(sizeof(stack_item) * size) * self.n = 0 # <<<<<<<<<<<<<< @@ -1811,7 +1876,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_stack_create(struct __pyx_ __Pyx_RefNannyFinishContext(); } -/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":352 +/* "scikits/learn/ball_tree.pyx":352 * * @cython.profile(False) * cdef inline void stack_destroy(stack* self): # <<<<<<<<<<<<<< @@ -1819,10 +1884,10 @@ static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_stack_create(struct __pyx_ * */ -static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_stack_destroy(struct __pyx_t_7sklearn_9ball_tree_stack *__pyx_v_self) { +static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_stack_destroy(struct __pyx_t_7scikits_5learn_9ball_tree_stack *__pyx_v_self) { __Pyx_RefNannySetupContext("stack_destroy"); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":353 + /* "scikits/learn/ball_tree.pyx":353 * @cython.profile(False) * cdef inline void stack_destroy(stack* self): * stdlib.free(self.heap) # <<<<<<<<<<<<<< @@ -1834,7 +1899,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_stack_destroy(struct __pyx __Pyx_RefNannyFinishContext(); } -/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":357 +/* "scikits/learn/ball_tree.pyx":357 * * @cython.profile(False) * cdef inline void stack_resize(stack* self, int new_size): # <<<<<<<<<<<<<< @@ -1842,13 +1907,12 @@ static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_stack_destroy(struct __pyx * if new_size < self.n: */ -static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_stack_resize(struct __pyx_t_7sklearn_9ball_tree_stack *__pyx_v_self, int __pyx_v_new_size) { +static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_stack_resize(struct __pyx_t_7scikits_5learn_9ball_tree_stack *__pyx_v_self, int __pyx_v_new_size) { int __pyx_t_1; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("stack_resize"); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":359 + /* "scikits/learn/ball_tree.pyx":359 * cdef inline void stack_resize(stack* self, int new_size): * #print "resize", self.n, new_size * if new_size < self.n: # <<<<<<<<<<<<<< @@ -1858,29 +1922,23 @@ static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_stack_resize(struct __pyx_ __pyx_t_1 = (__pyx_v_new_size < __pyx_v_self->n); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":360 + /* "scikits/learn/ball_tree.pyx":360 * #print "resize", self.n, new_size * if new_size < self.n: * raise ValueError("new_size smaller than current") # <<<<<<<<<<<<<< * * self.size = new_size */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_2), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_1)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1)); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_2, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L3; } __pyx_L3:; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":362 + /* "scikits/learn/ball_tree.pyx":362 * raise ValueError("new_size smaller than current") * * self.size = new_size # <<<<<<<<<<<<<< @@ -1889,25 +1947,24 @@ static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_stack_resize(struct __pyx_ */ __pyx_v_self->size = __pyx_v_new_size; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":363 + /* "scikits/learn/ball_tree.pyx":363 * * self.size = new_size * self.heap = <stack_item*>stdlib.realloc(<void*> self.heap, # <<<<<<<<<<<<<< * new_size * sizeof(stack_item)) * */ - __pyx_v_self->heap = ((struct __pyx_t_7sklearn_9ball_tree_stack_item *)realloc(((void *)__pyx_v_self->heap), (__pyx_v_new_size * (sizeof(struct __pyx_t_7sklearn_9ball_tree_stack_item))))); + __pyx_v_self->heap = ((struct __pyx_t_7scikits_5learn_9ball_tree_stack_item *)realloc(((void *)__pyx_v_self->heap), (__pyx_v_new_size * (sizeof(struct __pyx_t_7scikits_5learn_9ball_tree_stack_item))))); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("sklearn.ball_tree.stack_resize"); + __Pyx_WriteUnraisable("scikits.learn.ball_tree.stack_resize"); __pyx_L0:; __Pyx_RefNannyFinishContext(); } -/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":368 +/* "scikits/learn/ball_tree.pyx":368 * * @cython.profile(False) * cdef inline void stack_push(stack* self, stack_item item): # <<<<<<<<<<<<<< @@ -1915,11 +1972,11 @@ static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_stack_resize(struct __pyx_ * stack_resize(self, 2 * self.size + 1) */ -static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_stack_push(struct __pyx_t_7sklearn_9ball_tree_stack *__pyx_v_self, struct __pyx_t_7sklearn_9ball_tree_stack_item __pyx_v_item) { +static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_stack_push(struct __pyx_t_7scikits_5learn_9ball_tree_stack *__pyx_v_self, struct __pyx_t_7scikits_5learn_9ball_tree_stack_item __pyx_v_item) { int __pyx_t_1; __Pyx_RefNannySetupContext("stack_push"); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":369 + /* "scikits/learn/ball_tree.pyx":369 * @cython.profile(False) * cdef inline void stack_push(stack* self, stack_item item): * if self.n >= self.size: # <<<<<<<<<<<<<< @@ -1929,19 +1986,19 @@ static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_stack_push(struct __pyx_t_ __pyx_t_1 = (__pyx_v_self->n >= __pyx_v_self->size); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":370 + /* "scikits/learn/ball_tree.pyx":370 * cdef inline void stack_push(stack* self, stack_item item): * if self.n >= self.size: * stack_resize(self, 2 * self.size + 1) # <<<<<<<<<<<<<< * * self.heap[self.n] = item */ - __pyx_f_7sklearn_9ball_tree_stack_resize(__pyx_v_self, ((2 * __pyx_v_self->size) + 1)); + __pyx_f_7scikits_5learn_9ball_tree_stack_resize(__pyx_v_self, ((2 * __pyx_v_self->size) + 1)); goto __pyx_L3; } __pyx_L3:; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":372 + /* "scikits/learn/ball_tree.pyx":372 * stack_resize(self, 2 * self.size + 1) * * self.heap[self.n] = item # <<<<<<<<<<<<<< @@ -1950,19 +2007,19 @@ static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_stack_push(struct __pyx_t_ */ (__pyx_v_self->heap[__pyx_v_self->n]) = __pyx_v_item; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":373 + /* "scikits/learn/ball_tree.pyx":373 * * self.heap[self.n] = item * self.n += 1 # <<<<<<<<<<<<<< * * */ - __pyx_v_self->n += 1; + __pyx_v_self->n = (__pyx_v_self->n + 1); __Pyx_RefNannyFinishContext(); } -/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":377 +/* "scikits/learn/ball_tree.pyx":377 * * @cython.profile(False) * cdef inline stack_item stack_pop(stack* self): # <<<<<<<<<<<<<< @@ -1970,14 +2027,13 @@ static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_stack_push(struct __pyx_t_ * raise ValueError("popping empty stack") */ -static CYTHON_INLINE struct __pyx_t_7sklearn_9ball_tree_stack_item __pyx_f_7sklearn_9ball_tree_stack_pop(struct __pyx_t_7sklearn_9ball_tree_stack *__pyx_v_self) { - struct __pyx_t_7sklearn_9ball_tree_stack_item __pyx_r; +static CYTHON_INLINE struct __pyx_t_7scikits_5learn_9ball_tree_stack_item __pyx_f_7scikits_5learn_9ball_tree_stack_pop(struct __pyx_t_7scikits_5learn_9ball_tree_stack *__pyx_v_self) { + struct __pyx_t_7scikits_5learn_9ball_tree_stack_item __pyx_r; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("stack_pop"); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":378 + /* "scikits/learn/ball_tree.pyx":378 * @cython.profile(False) * cdef inline stack_item stack_pop(stack* self): * if self.n == 0: # <<<<<<<<<<<<<< @@ -1987,38 +2043,32 @@ static CYTHON_INLINE struct __pyx_t_7sklearn_9ball_tree_stack_item __pyx_f_7skle __pyx_t_1 = (__pyx_v_self->n == 0); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":379 + /* "scikits/learn/ball_tree.pyx":379 * cdef inline stack_item stack_pop(stack* self): * if self.n == 0: * raise ValueError("popping empty stack") # <<<<<<<<<<<<<< * * self.n -= 1 */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_2)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_2)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_2)); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_2, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L3; } __pyx_L3:; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":381 + /* "scikits/learn/ball_tree.pyx":381 * raise ValueError("popping empty stack") * * self.n -= 1 # <<<<<<<<<<<<<< * return self.heap[self.n] * */ - __pyx_v_self->n -= 1; + __pyx_v_self->n = (__pyx_v_self->n - 1); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":382 + /* "scikits/learn/ball_tree.pyx":382 * * self.n -= 1 * return self.heap[self.n] # <<<<<<<<<<<<<< @@ -2031,14 +2081,13 @@ static CYTHON_INLINE struct __pyx_t_7sklearn_9ball_tree_stack_item __pyx_f_7skle goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("sklearn.ball_tree.stack_pop"); + __Pyx_WriteUnraisable("scikits.learn.ball_tree.stack_pop"); __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":388 +/* "scikits/learn/ball_tree.pyx":388 * # newObj function * # this is a helper function for pickling * def newObj(obj): # <<<<<<<<<<<<<< @@ -2046,8 +2095,9 @@ static CYTHON_INLINE struct __pyx_t_7sklearn_9ball_tree_stack_item __pyx_f_7skle * */ -static PyObject *__pyx_pf_7sklearn_9ball_tree_newObj(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/ -static PyObject *__pyx_pf_7sklearn_9ball_tree_newObj(PyObject *__pyx_self, PyObject *__pyx_v_obj) { +static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_newObj(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/ +static PyMethodDef __pyx_mdef_7scikits_5learn_9ball_tree_newObj = {__Pyx_NAMESTR("newObj"), (PyCFunction)__pyx_pf_7scikits_5learn_9ball_tree_newObj, METH_O, __Pyx_DOCSTR(0)}; +static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_newObj(PyObject *__pyx_self, PyObject *__pyx_v_obj) { PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -2055,7 +2105,7 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_newObj(PyObject *__pyx_self, PyObj __Pyx_RefNannySetupContext("newObj"); __pyx_self = __pyx_self; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":389 + /* "scikits/learn/ball_tree.pyx":389 * # this is a helper function for pickling * def newObj(obj): * return obj.__new__(obj) # <<<<<<<<<<<<<< @@ -2066,14 +2116,14 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_newObj(PyObject *__pyx_self, PyObj __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s____new__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __Pyx_INCREF(__pyx_v_obj); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj); __Pyx_GIVEREF(__pyx_v_obj); - __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; @@ -2084,7 +2134,7 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_newObj(PyObject *__pyx_self, PyObj __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("sklearn.ball_tree.newObj"); + __Pyx_AddTraceback("scikits.learn.ball_tree.newObj"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -2092,31 +2142,7 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_newObj(PyObject *__pyx_self, PyObj return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":459 - * [ 0. 0.19662693 0.29473397] - * """ - * cdef readonly np.ndarray data # <<<<<<<<<<<<<< - * cdef np.ndarray idx_array - * cdef np.ndarray node_centroid_arr - */ - -static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_4data___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_4data___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannySetupContext("__get__"); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->data)); - __pyx_r = ((PyObject *)((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->data); - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":468 +/* "scikits/learn/ball_tree.pyx":468 * cdef ITYPE_t n_nodes * * def __cinit__(self): # <<<<<<<<<<<<<< @@ -2124,19 +2150,18 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_4data___get__(PyObject * * initialize all arrays to empty. This will prevent memory errors */ -static int __pyx_pf_7sklearn_9ball_tree_8BallTree___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pf_7sklearn_9ball_tree_8BallTree___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static int __pyx_pf_7scikits_5learn_9ball_tree_8BallTree___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pf_7scikits_5learn_9ball_tree_8BallTree___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("__cinit__"); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":473 + /* "scikits/learn/ball_tree.pyx":473 * in rare cases where __init__ is not called * """ * self.data = np.empty((0,0), dtype=DTYPE) # <<<<<<<<<<<<<< @@ -2148,73 +2173,53 @@ static int __pyx_pf_7sklearn_9ball_tree_8BallTree___cinit__(PyObject *__pyx_v_se __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __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(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __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_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_k_tuple_6), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GIVEREF(__pyx_t_4); - __Pyx_GOTREF(((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->data); - __Pyx_DECREF(((PyObject *)((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->data)); - ((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->data = ((PyArrayObject *)__pyx_t_4); - __pyx_t_4 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->data); + __Pyx_DECREF(((PyObject *)((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->data)); + ((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->data = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":474 + /* "scikits/learn/ball_tree.pyx":474 * """ * self.data = np.empty((0,0), dtype=DTYPE) * self.idx_array = np.empty(0, dtype=ITYPE) # <<<<<<<<<<<<<< * self.node_centroid_arr = np.empty((0,0), dtype=DTYPE) * self.node_info_arr = np.empty(0, dtype='c') */ - __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __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 = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__ITYPE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyEval_CallObjectWithKeywords(__pyx_t_1, __pyx_t_4, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_k_tuple_7), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GIVEREF(__pyx_t_2); - __Pyx_GOTREF(((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->idx_array); - __Pyx_DECREF(((PyObject *)((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->idx_array)); - ((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->idx_array = ((PyArrayObject *)__pyx_t_2); + __Pyx_GOTREF(((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->idx_array); + __Pyx_DECREF(((PyObject *)((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->idx_array)); + ((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->idx_array = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":475 + /* "scikits/learn/ball_tree.pyx":475 * self.data = np.empty((0,0), dtype=DTYPE) * self.idx_array = np.empty(0, dtype=ITYPE) * self.node_centroid_arr = np.empty((0,0), dtype=DTYPE) # <<<<<<<<<<<<<< @@ -2226,38 +2231,24 @@ static int __pyx_pf_7sklearn_9ball_tree_8BallTree___cinit__(PyObject *__pyx_v_se __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_k_tuple_9), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __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_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GIVEREF(__pyx_t_1); - __Pyx_GOTREF(((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->node_centroid_arr); - __Pyx_DECREF(((PyObject *)((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->node_centroid_arr)); - ((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->node_centroid_arr = ((PyArrayObject *)__pyx_t_1); + __Pyx_GOTREF(((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->node_centroid_arr); + __Pyx_DECREF(((PyObject *)((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->node_centroid_arr)); + ((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->node_centroid_arr = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":476 + /* "scikits/learn/ball_tree.pyx":476 * self.idx_array = np.empty(0, dtype=ITYPE) * self.node_centroid_arr = np.empty((0,0), dtype=DTYPE) * self.node_info_arr = np.empty(0, dtype='c') # <<<<<<<<<<<<<< @@ -2269,24 +2260,18 @@ static int __pyx_pf_7sklearn_9ball_tree_8BallTree___cinit__(PyObject *__pyx_v_se __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __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 = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__c)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = PyEval_CallObjectWithKeywords(__pyx_t_2, __pyx_t_1, ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__c)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_k_tuple_10), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GIVEREF(__pyx_t_3); - __Pyx_GOTREF(((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->node_info_arr); - __Pyx_DECREF(((PyObject *)((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->node_info_arr)); - ((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->node_info_arr = ((PyArrayObject *)__pyx_t_3); + __Pyx_GOTREF(((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->node_info_arr); + __Pyx_DECREF(((PyObject *)((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->node_info_arr)); + ((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->node_info_arr = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; __pyx_r = 0; @@ -2295,15 +2280,14 @@ static int __pyx_pf_7sklearn_9ball_tree_8BallTree___cinit__(PyObject *__pyx_v_se __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("sklearn.ball_tree.BallTree.__cinit__"); + __Pyx_AddTraceback("scikits.learn.ball_tree.BallTree.__cinit__"); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":478 +/* "scikits/learn/ball_tree.pyx":478 * self.node_info_arr = np.empty(0, dtype='c') * * def __init__(self, X, ITYPE_t leaf_size=20, DTYPE_t p=2): # <<<<<<<<<<<<<< @@ -2311,13 +2295,13 @@ static int __pyx_pf_7sklearn_9ball_tree_8BallTree___cinit__(PyObject *__pyx_v_se * */ -static int __pyx_pf_7sklearn_9ball_tree_8BallTree___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pf_7sklearn_9ball_tree_8BallTree___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static int __pyx_pf_7scikits_5learn_9ball_tree_8BallTree_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pf_7scikits_5learn_9ball_tree_8BallTree_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_X = 0; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_leaf_size; - __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_p; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_n_samples; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_n_features; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_leaf_size; + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_p; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_n_samples; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_n_features; int __pyx_r; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -2327,7 +2311,7 @@ static int __pyx_pf_7sklearn_9ball_tree_8BallTree___init__(PyObject *__pyx_v_sel long __pyx_t_6; long __pyx_t_7; long __pyx_t_8; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_t_9; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_t_9; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__X,&__pyx_n_s__leaf_size,&__pyx_n_s__p,0}; __Pyx_RefNannySetupContext("__init__"); if (unlikely(__pyx_kwds)) { @@ -2363,16 +2347,16 @@ static int __pyx_pf_7sklearn_9ball_tree_8BallTree___init__(PyObject *__pyx_v_sel if (values[1]) { __pyx_v_leaf_size = __Pyx_PyInt_from_py_npy_int32(values[1]); if (unlikely((__pyx_v_leaf_size == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { - __pyx_v_leaf_size = ((__pyx_t_7sklearn_9ball_tree_ITYPE_t)20); + __pyx_v_leaf_size = ((__pyx_t_7scikits_5learn_9ball_tree_ITYPE_t)20); } if (values[2]) { __pyx_v_p = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_p == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { - __pyx_v_p = ((__pyx_t_7sklearn_9ball_tree_DTYPE_t)2.0); + __pyx_v_p = ((__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t)2.0); } } else { - __pyx_v_leaf_size = ((__pyx_t_7sklearn_9ball_tree_ITYPE_t)20); - __pyx_v_p = ((__pyx_t_7sklearn_9ball_tree_DTYPE_t)2.0); + __pyx_v_leaf_size = ((__pyx_t_7scikits_5learn_9ball_tree_ITYPE_t)20); + __pyx_v_p = ((__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t)2.0); switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: __pyx_v_p = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_p == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L3_error;} case 2: __pyx_v_leaf_size = __Pyx_PyInt_from_py_npy_int32(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_leaf_size == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L3_error;} @@ -2385,12 +2369,12 @@ static int __pyx_pf_7sklearn_9ball_tree_8BallTree___init__(PyObject *__pyx_v_sel __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("sklearn.ball_tree.BallTree.__init__"); + __Pyx_AddTraceback("scikits.learn.ball_tree.BallTree.__init__"); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":479 + /* "scikits/learn/ball_tree.pyx":479 * * def __init__(self, X, ITYPE_t leaf_size=20, DTYPE_t p=2): * self.data = np.asarray(X, dtype=DTYPE, order='C') # <<<<<<<<<<<<<< @@ -2403,7 +2387,7 @@ static int __pyx_pf_7sklearn_9ball_tree_8BallTree___init__(PyObject *__pyx_v_sel __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 = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_INCREF(__pyx_v_X); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_X); __Pyx_GIVEREF(__pyx_v_X); @@ -2414,19 +2398,19 @@ static int __pyx_pf_7sklearn_9ball_tree_8BallTree___init__(PyObject *__pyx_v_sel if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__order), ((PyObject *)__pyx_n_s__C)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_2, __pyx_t_1, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __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(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GIVEREF(__pyx_t_4); - __Pyx_GOTREF(((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->data); - __Pyx_DECREF(((PyObject *)((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->data)); - ((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->data = ((PyArrayObject *)__pyx_t_4); + __Pyx_GOTREF(((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->data); + __Pyx_DECREF(((PyObject *)((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->data)); + ((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->data = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":481 + /* "scikits/learn/ball_tree.pyx":481 * self.data = np.asarray(X, dtype=DTYPE, order='C') * * if X.size == 0: # <<<<<<<<<<<<<< @@ -2442,53 +2426,41 @@ static int __pyx_pf_7sklearn_9ball_tree_8BallTree___init__(PyObject *__pyx_v_sel __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_5) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":482 + /* "scikits/learn/ball_tree.pyx":482 * * if X.size == 0: * raise ValueError("X is an empty array") # <<<<<<<<<<<<<< * * if self.data.ndim != 2: */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_12), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_3)); - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":484 + /* "scikits/learn/ball_tree.pyx":484 * raise ValueError("X is an empty array") * * if self.data.ndim != 2: # <<<<<<<<<<<<<< * raise ValueError("X should have two dimensions") * */ - __pyx_t_5 = (((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->data->nd != 2); + __pyx_t_5 = (((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->data->nd != 2); if (__pyx_t_5) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":485 + /* "scikits/learn/ball_tree.pyx":485 * * if self.data.ndim != 2: * raise ValueError("X should have two dimensions") # <<<<<<<<<<<<<< * * if p < 1: */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_4)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_4)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_4)); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_14), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -2496,7 +2468,7 @@ static int __pyx_pf_7sklearn_9ball_tree_8BallTree___init__(PyObject *__pyx_v_sel } __pyx_L7:; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":487 + /* "scikits/learn/ball_tree.pyx":487 * raise ValueError("X should have two dimensions") * * if p < 1: # <<<<<<<<<<<<<< @@ -2506,38 +2478,32 @@ static int __pyx_pf_7sklearn_9ball_tree_8BallTree___init__(PyObject *__pyx_v_sel __pyx_t_5 = (__pyx_v_p < 1.0); if (__pyx_t_5) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":488 + /* "scikits/learn/ball_tree.pyx":488 * * if p < 1: * raise ValueError("p must be greater than or equal to 1") # <<<<<<<<<<<<<< * self.p = p * */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_16), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_5)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_5)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5)); - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L8; } __pyx_L8:; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":489 + /* "scikits/learn/ball_tree.pyx":489 * if p < 1: * raise ValueError("p must be greater than or equal to 1") * self.p = p # <<<<<<<<<<<<<< * * if leaf_size < 1: */ - ((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->p = __pyx_v_p; + ((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->p = __pyx_v_p; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":491 + /* "scikits/learn/ball_tree.pyx":491 * self.p = p * * if leaf_size < 1: # <<<<<<<<<<<<<< @@ -2547,21 +2513,15 @@ static int __pyx_pf_7sklearn_9ball_tree_8BallTree___init__(PyObject *__pyx_v_sel __pyx_t_5 = (__pyx_v_leaf_size < 1); if (__pyx_t_5) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":492 + /* "scikits/learn/ball_tree.pyx":492 * * if leaf_size < 1: * raise ValueError("leaf_size must be greater than or equal to 1") # <<<<<<<<<<<<<< * self.leaf_size = leaf_size * */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_6)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_6)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_6)); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_18), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -2569,34 +2529,34 @@ static int __pyx_pf_7sklearn_9ball_tree_8BallTree___init__(PyObject *__pyx_v_sel } __pyx_L9:; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":493 + /* "scikits/learn/ball_tree.pyx":493 * if leaf_size < 1: * raise ValueError("leaf_size must be greater than or equal to 1") * self.leaf_size = leaf_size # <<<<<<<<<<<<<< * * cdef ITYPE_t n_samples = self.data.shape[0] */ - ((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->leaf_size = __pyx_v_leaf_size; + ((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->leaf_size = __pyx_v_leaf_size; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":495 + /* "scikits/learn/ball_tree.pyx":495 * self.leaf_size = leaf_size * * cdef ITYPE_t n_samples = self.data.shape[0] # <<<<<<<<<<<<<< * cdef ITYPE_t n_features = self.data.shape[1] * */ - __pyx_v_n_samples = (((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->data->dimensions[0]); + __pyx_v_n_samples = (((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->data->dimensions[0]); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":496 + /* "scikits/learn/ball_tree.pyx":496 * * cdef ITYPE_t n_samples = self.data.shape[0] * cdef ITYPE_t n_features = self.data.shape[1] # <<<<<<<<<<<<<< * * # determine number of levels in the ball tree, and from this */ - __pyx_v_n_features = (((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->data->dimensions[1]); + __pyx_v_n_features = (((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->data->dimensions[1]); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":500 + /* "scikits/learn/ball_tree.pyx":500 * # determine number of levels in the ball tree, and from this * # the number of nodes in the ball tree * self.n_levels = np.log2(max(1, (n_samples - 1)/self.leaf_size)) + 1 # <<<<<<<<<<<<<< @@ -2609,15 +2569,15 @@ static int __pyx_pf_7sklearn_9ball_tree_8BallTree___init__(PyObject *__pyx_v_sel __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = (__pyx_v_n_samples - 1); - if (unlikely(((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->leaf_size == 0)) { + if (unlikely(((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->leaf_size == 0)) { PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - else if (sizeof(long) == sizeof(long) && unlikely(((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->leaf_size == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_t_6))) { + else if (sizeof(long) == sizeof(long) && unlikely(((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->leaf_size == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_t_6))) { PyErr_Format(PyExc_OverflowError, "value too large to perform division"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_7 = __Pyx_div_long(__pyx_t_6, ((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->leaf_size); + __pyx_t_7 = __Pyx_div_long(__pyx_t_6, ((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->leaf_size); __pyx_t_6 = 1; if ((__pyx_t_7 > __pyx_t_6)) { __pyx_t_8 = __pyx_t_7; @@ -2627,31 +2587,31 @@ static int __pyx_pf_7sklearn_9ball_tree_8BallTree___init__(PyObject *__pyx_v_sel __pyx_t_3 = PyInt_FromLong(__pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_9 = __Pyx_PyInt_from_py_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_9 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - ((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->n_levels = __pyx_t_9; + ((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->n_levels = __pyx_t_9; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":501 + /* "scikits/learn/ball_tree.pyx":501 * # the number of nodes in the ball tree * self.n_levels = np.log2(max(1, (n_samples - 1)/self.leaf_size)) + 1 * self.n_nodes = (2 ** self.n_levels) - 1 # <<<<<<<<<<<<<< * * self.idx_array = np.arange(n_samples, dtype=ITYPE) */ - ((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->n_nodes = (__Pyx_pow_long(2, ((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->n_levels) - 1); + ((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->n_nodes = (__Pyx_pow_long(2, ((long)((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->n_levels)) - 1); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":503 + /* "scikits/learn/ball_tree.pyx":503 * self.n_nodes = (2 ** self.n_levels) - 1 * * self.idx_array = np.arange(n_samples, dtype=ITYPE) # <<<<<<<<<<<<<< @@ -2666,7 +2626,7 @@ static int __pyx_pf_7sklearn_9ball_tree_8BallTree___init__(PyObject *__pyx_v_sel __pyx_t_1 = __Pyx_PyInt_to_py_npy_int32(__pyx_v_n_samples); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; @@ -2676,19 +2636,19 @@ static int __pyx_pf_7sklearn_9ball_tree_8BallTree___init__(PyObject *__pyx_v_sel __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyEval_CallObjectWithKeywords(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __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(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GIVEREF(__pyx_t_2); - __Pyx_GOTREF(((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->idx_array); - __Pyx_DECREF(((PyObject *)((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->idx_array)); - ((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->idx_array = ((PyArrayObject *)__pyx_t_2); + __Pyx_GOTREF(((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->idx_array); + __Pyx_DECREF(((PyObject *)((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->idx_array)); + ((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->idx_array = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":505 + /* "scikits/learn/ball_tree.pyx":505 * self.idx_array = np.arange(n_samples, dtype=ITYPE) * * self.node_centroid_arr = np.empty((self.n_nodes, n_features), # <<<<<<<<<<<<<< @@ -2700,12 +2660,12 @@ static int __pyx_pf_7sklearn_9ball_tree_8BallTree___init__(PyObject *__pyx_v_sel __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_to_py_npy_int32(((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->n_nodes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_to_py_npy_int32(((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->n_nodes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_to_py_npy_int32(__pyx_v_n_features); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4); @@ -2713,14 +2673,14 @@ static int __pyx_pf_7sklearn_9ball_tree_8BallTree___init__(PyObject *__pyx_v_sel __pyx_t_2 = 0; __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":506 + /* "scikits/learn/ball_tree.pyx":506 * * self.node_centroid_arr = np.empty((self.n_nodes, n_features), * dtype=DTYPE, order='C') # <<<<<<<<<<<<<< @@ -2732,14 +2692,14 @@ static int __pyx_pf_7sklearn_9ball_tree_8BallTree___init__(PyObject *__pyx_v_sel if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__order), ((PyObject *)__pyx_n_s__C)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyEval_CallObjectWithKeywords(__pyx_t_1, __pyx_t_4, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":505 + /* "scikits/learn/ball_tree.pyx":505 * self.idx_array = np.arange(n_samples, dtype=ITYPE) * * self.node_centroid_arr = np.empty((self.n_nodes, n_features), # <<<<<<<<<<<<<< @@ -2747,12 +2707,12 @@ static int __pyx_pf_7sklearn_9ball_tree_8BallTree___init__(PyObject *__pyx_v_sel * */ __Pyx_GIVEREF(__pyx_t_2); - __Pyx_GOTREF(((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->node_centroid_arr); - __Pyx_DECREF(((PyObject *)((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->node_centroid_arr)); - ((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->node_centroid_arr = ((PyArrayObject *)__pyx_t_2); + __Pyx_GOTREF(((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->node_centroid_arr); + __Pyx_DECREF(((PyObject *)((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->node_centroid_arr)); + ((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->node_centroid_arr = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":508 + /* "scikits/learn/ball_tree.pyx":508 * dtype=DTYPE, order='C') * * self.node_info_arr = np.empty(self.n_nodes * sizeof(NodeInfo), # <<<<<<<<<<<<<< @@ -2764,10 +2724,10 @@ static int __pyx_pf_7sklearn_9ball_tree_8BallTree___init__(PyObject *__pyx_v_sel __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_FromSize_t((((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->n_nodes * (sizeof(struct __pyx_t_7sklearn_9ball_tree_NodeInfo)))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_FromSize_t((((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->n_nodes * (sizeof(struct __pyx_t_7scikits_5learn_9ball_tree_NodeInfo)))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; @@ -2775,26 +2735,26 @@ static int __pyx_pf_7sklearn_9ball_tree_8BallTree___init__(PyObject *__pyx_v_sel __Pyx_GOTREF(((PyObject *)__pyx_t_2)); if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__c)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__order), ((PyObject *)__pyx_n_s__C)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __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_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GIVEREF(__pyx_t_1); - __Pyx_GOTREF(((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->node_info_arr); - __Pyx_DECREF(((PyObject *)((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->node_info_arr)); - ((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->node_info_arr = ((PyArrayObject *)__pyx_t_1); + __Pyx_GOTREF(((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->node_info_arr); + __Pyx_DECREF(((PyObject *)((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->node_info_arr)); + ((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->node_info_arr = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":510 + /* "scikits/learn/ball_tree.pyx":510 * self.node_info_arr = np.empty(self.n_nodes * sizeof(NodeInfo), * dtype='c', order='C') * self.build_tree_() # <<<<<<<<<<<<<< * * def __reduce__(self): */ - ((struct __pyx_vtabstruct_7sklearn_9ball_tree_BallTree *)((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->__pyx_vtab)->build_tree_(((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)); + ((struct __pyx_vtabstruct_7scikits_5learn_9ball_tree_BallTree *)((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->__pyx_vtab)->build_tree_(((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)); __pyx_r = 0; goto __pyx_L0; @@ -2803,14 +2763,14 @@ static int __pyx_pf_7sklearn_9ball_tree_8BallTree___init__(PyObject *__pyx_v_sel __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("sklearn.ball_tree.BallTree.__init__"); + __Pyx_AddTraceback("scikits.learn.ball_tree.BallTree.__init__"); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":512 +/* "scikits/learn/ball_tree.pyx":512 * self.build_tree_() * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -2818,9 +2778,9 @@ static int __pyx_pf_7sklearn_9ball_tree_8BallTree___init__(PyObject *__pyx_v_sel * reduce method used for pickling */ -static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree___reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_7sklearn_9ball_tree_8BallTree___reduce__[] = "\n reduce method used for pickling\n "; -static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree___reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_2__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_7scikits_5learn_9ball_tree_8BallTree_2__reduce__[] = "\n reduce method used for pickling\n "; +static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_2__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -2828,7 +2788,7 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree___reduce__(PyObject *__p PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("__reduce__"); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":516 + /* "scikits/learn/ball_tree.pyx":516 * reduce method used for pickling * """ * return (newObj, (BallTree,), self.__getstate__()) # <<<<<<<<<<<<<< @@ -2839,27 +2799,27 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree___reduce__(PyObject *__p __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__newObj); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_9ball_tree_BallTree))); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)__pyx_ptype_7sklearn_9ball_tree_BallTree))); - __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_9ball_tree_BallTree))); + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_7scikits_5learn_9ball_tree_BallTree))); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)__pyx_ptype_7scikits_5learn_9ball_tree_BallTree))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_7scikits_5learn_9ball_tree_BallTree))); __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s____getstate__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_t_2)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_4 = 0; - __pyx_r = __pyx_t_3; + __pyx_r = ((PyObject *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; @@ -2870,7 +2830,7 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree___reduce__(PyObject *__p __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("sklearn.ball_tree.BallTree.__reduce__"); + __Pyx_AddTraceback("scikits.learn.ball_tree.BallTree.__reduce__"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -2878,7 +2838,7 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree___reduce__(PyObject *__p return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":518 +/* "scikits/learn/ball_tree.pyx":518 * return (newObj, (BallTree,), self.__getstate__()) * * def __getstate__(self): # <<<<<<<<<<<<<< @@ -2886,9 +2846,9 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree___reduce__(PyObject *__p * get state for pickling */ -static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree___getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_7sklearn_9ball_tree_8BallTree___getstate__[] = "\n get state for pickling\n "; -static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree___getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_3__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_7scikits_5learn_9ball_tree_8BallTree_3__getstate__[] = "\n get state for pickling\n "; +static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_3__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -2897,7 +2857,7 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree___getstate__(PyObject *_ PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("__getstate__"); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":522 + /* "scikits/learn/ball_tree.pyx":522 * get state for pickling * """ * return (self.data, # <<<<<<<<<<<<<< @@ -2906,59 +2866,59 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree___getstate__(PyObject *_ */ __Pyx_XDECREF(__pyx_r); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":526 + /* "scikits/learn/ball_tree.pyx":526 * self.node_centroid_arr, * self.node_info_arr, * self.p, # <<<<<<<<<<<<<< * self.leaf_size, * self.n_levels, */ - __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->p); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->p); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":527 + /* "scikits/learn/ball_tree.pyx":527 * self.node_info_arr, * self.p, * self.leaf_size, # <<<<<<<<<<<<<< * self.n_levels, * self.n_nodes) */ - __pyx_t_2 = __Pyx_PyInt_to_py_npy_int32(((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->leaf_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_to_py_npy_int32(((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->leaf_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":528 + /* "scikits/learn/ball_tree.pyx":528 * self.p, * self.leaf_size, * self.n_levels, # <<<<<<<<<<<<<< * self.n_nodes) * */ - __pyx_t_3 = __Pyx_PyInt_to_py_npy_int32(((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->n_levels); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_to_py_npy_int32(((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->n_levels); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":529 + /* "scikits/learn/ball_tree.pyx":529 * self.leaf_size, * self.n_levels, * self.n_nodes) # <<<<<<<<<<<<<< * * def __setstate__(self, state): */ - __pyx_t_4 = __Pyx_PyInt_to_py_npy_int32(((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->n_nodes); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_to_py_npy_int32(((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->n_nodes); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(8); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_INCREF(((PyObject *)((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->data)); - PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->data)); - __Pyx_GIVEREF(((PyObject *)((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->data)); - __Pyx_INCREF(((PyObject *)((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->idx_array)); - PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->idx_array)); - __Pyx_GIVEREF(((PyObject *)((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->idx_array)); - __Pyx_INCREF(((PyObject *)((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->node_centroid_arr)); - PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->node_centroid_arr)); - __Pyx_GIVEREF(((PyObject *)((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->node_centroid_arr)); - __Pyx_INCREF(((PyObject *)((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->node_info_arr)); - PyTuple_SET_ITEM(__pyx_t_5, 3, ((PyObject *)((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->node_info_arr)); - __Pyx_GIVEREF(((PyObject *)((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->node_info_arr)); + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_INCREF(((PyObject *)((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->data)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->data)); + __Pyx_GIVEREF(((PyObject *)((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->data)); + __Pyx_INCREF(((PyObject *)((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->idx_array)); + PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->idx_array)); + __Pyx_GIVEREF(((PyObject *)((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->idx_array)); + __Pyx_INCREF(((PyObject *)((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->node_centroid_arr)); + PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->node_centroid_arr)); + __Pyx_GIVEREF(((PyObject *)((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->node_centroid_arr)); + __Pyx_INCREF(((PyObject *)((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->node_info_arr)); + PyTuple_SET_ITEM(__pyx_t_5, 3, ((PyObject *)((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->node_info_arr)); + __Pyx_GIVEREF(((PyObject *)((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->node_info_arr)); PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_t_2); @@ -2971,7 +2931,7 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree___getstate__(PyObject *_ __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; - __pyx_r = __pyx_t_5; + __pyx_r = ((PyObject *)__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L0; @@ -2983,7 +2943,7 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree___getstate__(PyObject *_ __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("sklearn.ball_tree.BallTree.__getstate__"); + __Pyx_AddTraceback("scikits.learn.ball_tree.BallTree.__getstate__"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -2991,7 +2951,7 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree___getstate__(PyObject *_ return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":531 +/* "scikits/learn/ball_tree.pyx":531 * self.n_nodes) * * def __setstate__(self, state): # <<<<<<<<<<<<<< @@ -2999,16 +2959,16 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree___getstate__(PyObject *_ * set state for pickling */ -static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree___setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_state); /*proto*/ -static char __pyx_doc_7sklearn_9ball_tree_8BallTree___setstate__[] = "\n set state for pickling\n "; -static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree___setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_state) { +static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_4__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_state); /*proto*/ +static char __pyx_doc_7scikits_5learn_9ball_tree_8BallTree_4__setstate__[] = "\n set state for pickling\n "; +static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_4__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_state) { PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; - __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_t_2; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_t_3; + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_t_2; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_t_3; __Pyx_RefNannySetupContext("__setstate__"); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":535 + /* "scikits/learn/ball_tree.pyx":535 * set state for pickling * """ * self.data = state[0] # <<<<<<<<<<<<<< @@ -3019,12 +2979,12 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree___setstate__(PyObject *_ __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GIVEREF(__pyx_t_1); - __Pyx_GOTREF(((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->data); - __Pyx_DECREF(((PyObject *)((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->data)); - ((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->data = ((PyArrayObject *)__pyx_t_1); + __Pyx_GOTREF(((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->data); + __Pyx_DECREF(((PyObject *)((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->data)); + ((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->data = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":536 + /* "scikits/learn/ball_tree.pyx":536 * """ * self.data = state[0] * self.idx_array = state[1] # <<<<<<<<<<<<<< @@ -3035,12 +2995,12 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree___setstate__(PyObject *_ __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GIVEREF(__pyx_t_1); - __Pyx_GOTREF(((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->idx_array); - __Pyx_DECREF(((PyObject *)((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->idx_array)); - ((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->idx_array = ((PyArrayObject *)__pyx_t_1); + __Pyx_GOTREF(((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->idx_array); + __Pyx_DECREF(((PyObject *)((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->idx_array)); + ((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->idx_array = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":537 + /* "scikits/learn/ball_tree.pyx":537 * self.data = state[0] * self.idx_array = state[1] * self.node_centroid_arr = state[2] # <<<<<<<<<<<<<< @@ -3051,12 +3011,12 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree___setstate__(PyObject *_ __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GIVEREF(__pyx_t_1); - __Pyx_GOTREF(((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->node_centroid_arr); - __Pyx_DECREF(((PyObject *)((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->node_centroid_arr)); - ((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->node_centroid_arr = ((PyArrayObject *)__pyx_t_1); + __Pyx_GOTREF(((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->node_centroid_arr); + __Pyx_DECREF(((PyObject *)((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->node_centroid_arr)); + ((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->node_centroid_arr = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":538 + /* "scikits/learn/ball_tree.pyx":538 * self.idx_array = state[1] * self.node_centroid_arr = state[2] * self.node_info_arr = state[3] # <<<<<<<<<<<<<< @@ -3067,12 +3027,12 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree___setstate__(PyObject *_ __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GIVEREF(__pyx_t_1); - __Pyx_GOTREF(((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->node_info_arr); - __Pyx_DECREF(((PyObject *)((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->node_info_arr)); - ((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->node_info_arr = ((PyArrayObject *)__pyx_t_1); + __Pyx_GOTREF(((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->node_info_arr); + __Pyx_DECREF(((PyObject *)((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->node_info_arr)); + ((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->node_info_arr = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":539 + /* "scikits/learn/ball_tree.pyx":539 * self.node_centroid_arr = state[2] * self.node_info_arr = state[3] * self.p = state[4] # <<<<<<<<<<<<<< @@ -3083,9 +3043,9 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree___setstate__(PyObject *_ __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - ((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->p = __pyx_t_2; + ((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->p = __pyx_t_2; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":540 + /* "scikits/learn/ball_tree.pyx":540 * self.node_info_arr = state[3] * self.p = state[4] * self.leaf_size = state[5] # <<<<<<<<<<<<<< @@ -3096,9 +3056,9 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree___setstate__(PyObject *_ __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyInt_from_py_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - ((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->leaf_size = __pyx_t_3; + ((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->leaf_size = __pyx_t_3; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":541 + /* "scikits/learn/ball_tree.pyx":541 * self.p = state[4] * self.leaf_size = state[5] * self.n_levels = state[6] # <<<<<<<<<<<<<< @@ -3109,9 +3069,9 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree___setstate__(PyObject *_ __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyInt_from_py_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - ((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->n_levels = __pyx_t_3; + ((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->n_levels = __pyx_t_3; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":542 + /* "scikits/learn/ball_tree.pyx":542 * self.leaf_size = state[5] * self.n_levels = state[6] * self.n_nodes = state[7] # <<<<<<<<<<<<<< @@ -3122,13 +3082,13 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree___setstate__(PyObject *_ __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyInt_from_py_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - ((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->n_nodes = __pyx_t_3; + ((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->n_nodes = __pyx_t_3; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("sklearn.ball_tree.BallTree.__setstate__"); + __Pyx_AddTraceback("scikits.learn.ball_tree.BallTree.__setstate__"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -3136,7 +3096,7 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree___setstate__(PyObject *_ return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":544 +/* "scikits/learn/ball_tree.pyx":544 * self.n_nodes = state[7] * * def query(self, X, k=1, return_distance=True): # <<<<<<<<<<<<<< @@ -3144,29 +3104,29 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree___setstate__(PyObject *_ * query(X, k=1, return_distance=True) */ -static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_7sklearn_9ball_tree_8BallTree_query[] = "\n query(X, k=1, return_distance=True)\n\n query the Ball Tree for the k nearest neighbors\n\n Parameters\n ----------\n X : array-like, last dimension self.dim\n An array of points to query\n k : integer (default = 1)\n The number of nearest neighbors to return\n return_distance : boolean (default = True)\n if True, return a tuple (d,i)\n if False, return array i\n\n Returns\n -------\n i : if return_distance == False\n (d,i) : if return_distance == True\n\n d : array of doubles - shape: x.shape[:-1] + (k,)\n each entry gives the list of distances to the\n neighbors of the corresponding point\n (note that distances are not sorted)\n\n i : array of integers - shape: x.shape[:-1] + (k,)\n each entry gives the list of indices of\n neighbors of the corresponding point\n (note that neighbors are not sorted)\n\n Examples\n --------\n Query for k-nearest neighbors\n\n >>> import numpy as np\n >>> np.random.seed(0)\n >>> X = np.random.random((10,3)) # 10 points in 3 dimensions\n >>> ball_tree = BallTree(X, leaf_size=2)\n >>> dist, ind = ball_tree.query(X[0], k=3)\n >>> print ind # indices of 3 closest neighbors\n [0 3 1]\n >>> print dist # distances to 3 closest neighbors\n [ 0. 0.19662693 0.29473397]\n "; -static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_5query(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_7scikits_5learn_9ball_tree_8BallTree_5query[] = "\n query(X, k=1, return_distance=True)\n\n query the Ball Tree for the k nearest neighbors\n\n Parameters\n ----------\n X : array-like, last dimension self.dim\n An array of points to query\n k : integer (default = 1)\n The number of nearest neighbors to return\n return_distance : boolean (default = True)\n if True, return a tuple (d,i)\n if False, return array i\n\n Returns\n -------\n i : if return_distance == False\n (d,i) : if return_distance == True\n\n d : array of doubles - shape: x.shape[:-1] + (k,)\n each entry gives the list of distances to the\n neighbors of the corresponding point\n (note that distances are not sorted)\n\n i : array of integers - shape: x.shape[:-1] + (k,)\n each entry gives the list of indices of\n neighbors of the corresponding point\n (note that neighbors are not sorted)\n\n Examples\n --------\n Query for k-nearest neighbors\n\n >>> import numpy as np\n >>> np.random.seed(0)\n >>> X = np.random.random((10,3)) # 10 points in 3 dimensions\n >>> ball_tree = BallTree(X, leaf_size=2)\n >>> dist, ind = ball_tree.query(X[0], k=3)\n >>> print ind # indices of 3 closest neighbors\n [0 3 1]\n >>> print dist # distances to 3 closest neighbors\n [ 0. 0.19662693 0.29473397]\n "; +static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_5query(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_X = 0; PyObject *__pyx_v_k = 0; PyObject *__pyx_v_return_distance = 0; PyObject *__pyx_v_orig_shape; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_use_max_heap; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_i; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_n_neighbors; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_use_max_heap; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_i; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_n_neighbors; PyArrayObject *__pyx_v_distances = 0; PyArrayObject *__pyx_v_idx_array = 0; PyArrayObject *__pyx_v_Xi; - __pyx_t_7sklearn_9ball_tree_DTYPE_t *__pyx_v_dist_ptr; - __pyx_t_7sklearn_9ball_tree_ITYPE_t *__pyx_v_idx_ptr; - struct __pyx_t_7sklearn_9ball_tree_stack __pyx_v_node_stack; + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *__pyx_v_dist_ptr; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *__pyx_v_idx_ptr; + struct __pyx_t_7scikits_5learn_9ball_tree_stack __pyx_v_node_stack; PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_t_6; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_t_6; Py_ssize_t __pyx_t_7; PyObject *__pyx_t_8 = NULL; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__X,&__pyx_n_s__k,&__pyx_n_s__return_distance,0}; @@ -3175,7 +3135,7 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query(PyObject *__pyx_v_ Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)__pyx_int_1); - values[2] = __pyx_k_7; + values[2] = __pyx_k_19; switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); @@ -3207,7 +3167,7 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query(PyObject *__pyx_v_ __pyx_v_return_distance = values[2]; } else { __pyx_v_k = ((PyObject *)__pyx_int_1); - __pyx_v_return_distance = __pyx_k_7; + __pyx_v_return_distance = __pyx_k_19; switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: __pyx_v_return_distance = PyTuple_GET_ITEM(__pyx_args, 2); case 2: __pyx_v_k = PyTuple_GET_ITEM(__pyx_args, 1); @@ -3220,7 +3180,7 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query(PyObject *__pyx_v_ __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("query", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("sklearn.ball_tree.BallTree.query"); + __Pyx_AddTraceback("scikits.learn.ball_tree.BallTree.query"); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; @@ -3228,7 +3188,7 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query(PyObject *__pyx_v_ __pyx_v_orig_shape = Py_None; __Pyx_INCREF(Py_None); __pyx_v_Xi = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":589 + /* "scikits/learn/ball_tree.pyx":589 * [ 0. 0.19662693 0.29473397] * """ * X = np.asarray(X, dtype=DTYPE, order='C') # <<<<<<<<<<<<<< @@ -3241,7 +3201,7 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query(PyObject *__pyx_v_ __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 = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_INCREF(__pyx_v_X); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_X); __Pyx_GIVEREF(__pyx_v_X); @@ -3252,16 +3212,16 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query(PyObject *__pyx_v_ if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__order), ((PyObject *)__pyx_n_s__C)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_2, __pyx_t_1, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __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(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_v_X); __pyx_v_X = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":590 + /* "scikits/learn/ball_tree.pyx":590 * """ * X = np.asarray(X, dtype=DTYPE, order='C') * X = np.atleast_2d(X) # <<<<<<<<<<<<<< @@ -3274,19 +3234,19 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query(PyObject *__pyx_v_ __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 = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); __Pyx_INCREF(__pyx_v_X); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_X); __Pyx_GIVEREF(__pyx_v_X); - __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __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_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_v_X); __pyx_v_X = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":592 + /* "scikits/learn/ball_tree.pyx":592 * X = np.atleast_2d(X) * * if X.shape[-1] != self.data.shape[1]: # <<<<<<<<<<<<<< @@ -3298,7 +3258,7 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query(PyObject *__pyx_v_ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_to_py_Py_intptr_t((((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->data->dimensions[1])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_to_py_Py_intptr_t((((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->data->dimensions[1])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_NE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); @@ -3308,59 +3268,47 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query(PyObject *__pyx_v_ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_5) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":593 + /* "scikits/learn/ball_tree.pyx":593 * * if X.shape[-1] != self.data.shape[1]: * raise ValueError("query data dimension must match BallTree " # <<<<<<<<<<<<<< * "data dimension") * */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_21), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_8)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_8)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_8)); - __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_1, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":596 + /* "scikits/learn/ball_tree.pyx":596 * "data dimension") * * if k > self.data.shape[0]: # <<<<<<<<<<<<<< * raise ValueError("k must be less than or equal " * "to the number of training points") */ - __pyx_t_1 = __Pyx_PyInt_to_py_Py_intptr_t((((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->data->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_k, __pyx_t_1, Py_GT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_to_py_Py_intptr_t((((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->data->dimensions[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_k, __pyx_t_3, Py_GT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":597 + /* "scikits/learn/ball_tree.pyx":597 * * if k > self.data.shape[0]: * raise ValueError("k must be less than or equal " # <<<<<<<<<<<<<< * "to the number of training points") * */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_9)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_9)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9)); - __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_23), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_1, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -3368,7 +3316,7 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query(PyObject *__pyx_v_ } __pyx_L7:; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":601 + /* "scikits/learn/ball_tree.pyx":601 * * # flatten X for iteration * orig_shape = X.shape # <<<<<<<<<<<<<< @@ -3381,7 +3329,7 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query(PyObject *__pyx_v_ __pyx_v_orig_shape = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":602 + /* "scikits/learn/ball_tree.pyx":602 * # flatten X for iteration * orig_shape = X.shape * X = X.reshape((-1, X.shape[-1])) # <<<<<<<<<<<<<< @@ -3396,7 +3344,7 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query(PyObject *__pyx_v_ __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __Pyx_INCREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); @@ -3404,19 +3352,19 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query(PyObject *__pyx_v_ __Pyx_GIVEREF(__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 = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_v_X); __pyx_v_X = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":606 + /* "scikits/learn/ball_tree.pyx":606 * # for k less than 5, a priority queue is slightly faster * # for more neighbors, a max-heap implementation is faster * cdef ITYPE_t use_max_heap = (k >= 5) # <<<<<<<<<<<<<< @@ -3429,7 +3377,7 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query(PyObject *__pyx_v_ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_use_max_heap = __pyx_t_6; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":609 + /* "scikits/learn/ball_tree.pyx":609 * * cdef ITYPE_t i * cdef ITYPE_t n_neighbors = k # <<<<<<<<<<<<<< @@ -3439,7 +3387,7 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query(PyObject *__pyx_v_ __pyx_t_6 = __Pyx_PyInt_from_py_npy_int32(__pyx_v_k); if (unlikely((__pyx_t_6 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_n_neighbors = __pyx_t_6; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":610 + /* "scikits/learn/ball_tree.pyx":610 * cdef ITYPE_t i * cdef ITYPE_t n_neighbors = k * cdef np.ndarray distances = np.empty((X.shape[0], n_neighbors), # <<<<<<<<<<<<<< @@ -3459,7 +3407,7 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query(PyObject *__pyx_v_ __pyx_t_3 = __Pyx_PyInt_to_py_npy_int32(__pyx_v_n_neighbors); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); @@ -3467,14 +3415,14 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query(PyObject *__pyx_v_ __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":611 + /* "scikits/learn/ball_tree.pyx":611 * cdef ITYPE_t n_neighbors = k * cdef np.ndarray distances = np.empty((X.shape[0], n_neighbors), * dtype=DTYPE) # <<<<<<<<<<<<<< @@ -3485,16 +3433,16 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query(PyObject *__pyx_v_ __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_t_4, __pyx_t_3, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_t_4, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __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_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_distances = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":612 + /* "scikits/learn/ball_tree.pyx":612 * cdef np.ndarray distances = np.empty((X.shape[0], n_neighbors), * dtype=DTYPE) * cdef np.ndarray idx_array = np.empty((X.shape[0], n_neighbors), # <<<<<<<<<<<<<< @@ -3514,7 +3462,7 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query(PyObject *__pyx_v_ __pyx_t_1 = __Pyx_PyInt_to_py_npy_int32(__pyx_v_n_neighbors); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); @@ -3522,14 +3470,14 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query(PyObject *__pyx_v_ __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_4)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":613 + /* "scikits/learn/ball_tree.pyx":613 * dtype=DTYPE) * cdef np.ndarray idx_array = np.empty((X.shape[0], n_neighbors), * dtype=ITYPE) # <<<<<<<<<<<<<< @@ -3540,16 +3488,16 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query(PyObject *__pyx_v_ __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyEval_CallObjectWithKeywords(__pyx_t_2, __pyx_t_1, ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_idx_array = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":616 + /* "scikits/learn/ball_tree.pyx":616 * cdef np.ndarray Xi * * distances[:] = np.inf # <<<<<<<<<<<<<< @@ -3561,37 +3509,37 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query(PyObject *__pyx_v_ __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__inf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PySequence_SetSlice(((PyObject *)__pyx_v_distances), 0, PY_SSIZE_T_MAX, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_PySequence_SetSlice(((PyObject *)__pyx_v_distances), 0, PY_SSIZE_T_MAX, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":618 + /* "scikits/learn/ball_tree.pyx":618 * distances[:] = np.inf * * cdef DTYPE_t* dist_ptr = <DTYPE_t*> distances.data # <<<<<<<<<<<<<< * cdef ITYPE_t* idx_ptr = <ITYPE_t*> idx_array.data * */ - __pyx_v_dist_ptr = ((__pyx_t_7sklearn_9ball_tree_DTYPE_t *)__pyx_v_distances->data); + __pyx_v_dist_ptr = ((__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *)__pyx_v_distances->data); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":619 + /* "scikits/learn/ball_tree.pyx":619 * * cdef DTYPE_t* dist_ptr = <DTYPE_t*> distances.data * cdef ITYPE_t* idx_ptr = <ITYPE_t*> idx_array.data # <<<<<<<<<<<<<< * * cdef stack node_stack */ - __pyx_v_idx_ptr = ((__pyx_t_7sklearn_9ball_tree_ITYPE_t *)__pyx_v_idx_array->data); + __pyx_v_idx_ptr = ((__pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *)__pyx_v_idx_array->data); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":622 + /* "scikits/learn/ball_tree.pyx":622 * * cdef stack node_stack * stack_create(&node_stack, self.n_levels + 1) # <<<<<<<<<<<<<< * * for i, Xi in enumerate(X): */ - __pyx_f_7sklearn_9ball_tree_stack_create((&__pyx_v_node_stack), (((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->n_levels + 1)); + __pyx_f_7scikits_5learn_9ball_tree_stack_create((&__pyx_v_node_stack), (((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->n_levels + 1)); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":624 + /* "scikits/learn/ball_tree.pyx":624 * stack_create(&node_stack, self.n_levels + 1) * * for i, Xi in enumerate(X): # <<<<<<<<<<<<<< @@ -3627,16 +3575,16 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query(PyObject *__pyx_v_ __pyx_v_i = __pyx_t_6; __pyx_t_6 = (__pyx_t_6 + 1); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":626 + /* "scikits/learn/ball_tree.pyx":626 * for i, Xi in enumerate(X): * self.query_one_(<DTYPE_t*>Xi.data, n_neighbors, * dist_ptr, idx_ptr, &node_stack, use_max_heap) # <<<<<<<<<<<<<< * * # if max-heap is used, results must be sorted */ - ((struct __pyx_vtabstruct_7sklearn_9ball_tree_BallTree *)((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->__pyx_vtab)->query_one_(((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self), ((__pyx_t_7sklearn_9ball_tree_DTYPE_t *)__pyx_v_Xi->data), __pyx_v_n_neighbors, __pyx_v_dist_ptr, __pyx_v_idx_ptr, (&__pyx_v_node_stack), __pyx_v_use_max_heap); + ((struct __pyx_vtabstruct_7scikits_5learn_9ball_tree_BallTree *)((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->__pyx_vtab)->query_one_(((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self), ((__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *)__pyx_v_Xi->data), __pyx_v_n_neighbors, __pyx_v_dist_ptr, __pyx_v_idx_ptr, (&__pyx_v_node_stack), __pyx_v_use_max_heap); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":629 + /* "scikits/learn/ball_tree.pyx":629 * * # if max-heap is used, results must be sorted * if use_max_heap: # <<<<<<<<<<<<<< @@ -3645,48 +3593,48 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query(PyObject *__pyx_v_ */ if (__pyx_v_use_max_heap) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":630 + /* "scikits/learn/ball_tree.pyx":630 * # if max-heap is used, results must be sorted * if use_max_heap: * sort_dist_idx(dist_ptr, idx_ptr, n_neighbors) # <<<<<<<<<<<<<< * * dist_ptr += n_neighbors */ - __pyx_f_7sklearn_9ball_tree_sort_dist_idx(__pyx_v_dist_ptr, __pyx_v_idx_ptr, __pyx_v_n_neighbors); + __pyx_f_7scikits_5learn_9ball_tree_sort_dist_idx(__pyx_v_dist_ptr, __pyx_v_idx_ptr, __pyx_v_n_neighbors); goto __pyx_L10; } __pyx_L10:; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":632 + /* "scikits/learn/ball_tree.pyx":632 * sort_dist_idx(dist_ptr, idx_ptr, n_neighbors) * * dist_ptr += n_neighbors # <<<<<<<<<<<<<< * idx_ptr += n_neighbors * */ - __pyx_v_dist_ptr += __pyx_v_n_neighbors; + __pyx_v_dist_ptr = (__pyx_v_dist_ptr + __pyx_v_n_neighbors); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":633 + /* "scikits/learn/ball_tree.pyx":633 * * dist_ptr += n_neighbors * idx_ptr += n_neighbors # <<<<<<<<<<<<<< * * stack_destroy(&node_stack) */ - __pyx_v_idx_ptr += __pyx_v_n_neighbors; + __pyx_v_idx_ptr = (__pyx_v_idx_ptr + __pyx_v_n_neighbors); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":635 + /* "scikits/learn/ball_tree.pyx":635 * idx_ptr += n_neighbors * * stack_destroy(&node_stack) # <<<<<<<<<<<<<< * * # deflatten results */ - __pyx_f_7sklearn_9ball_tree_stack_destroy((&__pyx_v_node_stack)); + __pyx_f_7scikits_5learn_9ball_tree_stack_destroy((&__pyx_v_node_stack)); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":638 + /* "scikits/learn/ball_tree.pyx":638 * * # deflatten results * if return_distance: # <<<<<<<<<<<<<< @@ -3696,7 +3644,7 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query(PyObject *__pyx_v_ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_return_distance); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_5) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":639 + /* "scikits/learn/ball_tree.pyx":639 * # deflatten results * if return_distance: * return (distances.reshape((orig_shape[:-1]) + (k,)), # <<<<<<<<<<<<<< @@ -3706,28 +3654,28 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query(PyObject *__pyx_v_ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_distances), __pyx_n_s__reshape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PySequence_GetSlice(__pyx_v_orig_shape, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PySequence_GetSlice(__pyx_v_orig_shape, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_INCREF(__pyx_v_k); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_k); __Pyx_GIVEREF(__pyx_v_k); - __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Add(__pyx_t_3, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __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_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__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 = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":640 + /* "scikits/learn/ball_tree.pyx":640 * if return_distance: * return (distances.reshape((orig_shape[:-1]) + (k,)), * idx_array.reshape((orig_shape[:-1]) + (k,))) # <<<<<<<<<<<<<< @@ -3736,42 +3684,42 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query(PyObject *__pyx_v_ */ __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_idx_array), __pyx_n_s__reshape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PySequence_GetSlice(__pyx_v_orig_shape, 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PySequence_GetSlice(__pyx_v_orig_shape, 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __Pyx_INCREF(__pyx_v_k); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_k); __Pyx_GIVEREF(__pyx_v_k); - __pyx_t_8 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyNumber_Add(__pyx_t_4, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_2 = 0; __pyx_t_8 = 0; - __pyx_r = __pyx_t_3; + __pyx_r = ((PyObject *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; goto __pyx_L11; } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":642 + /* "scikits/learn/ball_tree.pyx":642 * idx_array.reshape((orig_shape[:-1]) + (k,))) * else: * return idx_array.reshape((orig_shape[:-1]) + (k,)) # <<<<<<<<<<<<<< @@ -3781,26 +3729,26 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query(PyObject *__pyx_v_ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_idx_array), __pyx_n_s__reshape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = PySequence_GetSlice(__pyx_v_orig_shape, 0, -1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PySequence_GetSlice(__pyx_v_orig_shape, 0, -1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __Pyx_INCREF(__pyx_v_k); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_k); __Pyx_GIVEREF(__pyx_v_k); - __pyx_t_1 = PyNumber_Add(__pyx_t_8, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Add(__pyx_t_8, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __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_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; @@ -3815,7 +3763,7 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query(PyObject *__pyx_v_ __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("sklearn.ball_tree.BallTree.query"); + __Pyx_AddTraceback("scikits.learn.ball_tree.BallTree.query"); __pyx_r = NULL; __pyx_L0:; __Pyx_DECREF(__pyx_v_orig_shape); @@ -3828,7 +3776,7 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query(PyObject *__pyx_v_ return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":644 +/* "scikits/learn/ball_tree.pyx":644 * return idx_array.reshape((orig_shape[:-1]) + (k,)) * * def query_radius(self, X, r, return_distance=False, # <<<<<<<<<<<<<< @@ -3836,9 +3784,9 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query(PyObject *__pyx_v_ * """ */ -static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query_radius(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_7sklearn_9ball_tree_8BallTree_query_radius[] = "\n query_radius(self, X, r, count_only = False):\n\n query the Ball Tree for neighbors within a ball of size r\n\n Parameters\n ----------\n X : array-like, last dimension self.dim\n An array of points to query\n r : distance within which neighbors are returned\n r can be a single value, or an array of values of shape\n x.shape[:-1] if different radii are desired for each point.\n return_distance : boolean (default = False)\n if True, return distances to neighbors of each point\n if False, return only neighbors\n Note that unlike BallTree.query(), setting return_distance=True\n adds to the computation time. Not all distances need to be\n calculated explicitly for return_distance=False. Results are\n not sorted by default: see ``sort_results`` keyword.\n count_only : boolean (default = False)\n if True, return only the count of points within distance r\n if False, return the indices of all points within distance r\n If return_distance==True, setting count_only=True will\n result in an error.\n sort_results : boolean (default = False)\n if True, the distances and indices will be sorted before being\n returned. If False, the results will not be sorted. If\n return_distance == False, settinng sort_results = True will\n result in an error.\n\n Returns\n -------\n count : if count_only == True\n ind : if count_only == False and return_distance == False\n (ind, dist) : if count_only == False and return_distance == True\n\n count : array of integers, shape = X.shape[:-1]\n each entry gives the number of neighbors within\n a distance r of the corresponding point.\n\n ind : array of objects, shape = X.shape[:-1]\n each element is ""a numpy integer array listing the indices of\n neighbors of the corresponding point. Note that unlike\n the results of BallTree.query(), the returned neighbors\n are not sorted by distance\n\n dist : array of objects, shape = X.shape[:-1]\n each element is a numpy double array\n listing the distances corresponding to indices in i.\n\n Examples\n --------\n Query for neighbors in a given radius\n\n >>> import numpy as np\n >>> np.random.seed(0)\n >>> X = np.random.random((10,3)) # 10 points in 3 dimensions\n >>> ball_tree = BallTree(X, leaf_size=2)\n >>> print ball_tree.query_radius(X[0], r=0.3, count_only=True)\n 3\n >>> ind = ball_tree.query_radius(X[0], r=0.3)\n >>> print ind # indices of neighbors within distance 0.3\n [3 0 1]\n "; -static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query_radius(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_6query_radius(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_7scikits_5learn_9ball_tree_8BallTree_6query_radius[] = "\n query_radius(self, X, r, count_only = False):\n\n query the Ball Tree for neighbors within a ball of size r\n\n Parameters\n ----------\n X : array-like, last dimension self.dim\n An array of points to query\n r : distance within which neighbors are returned\n r can be a single value, or an array of values of shape\n x.shape[:-1] if different radii are desired for each point.\n return_distance : boolean (default = False)\n if True, return distances to neighbors of each point\n if False, return only neighbors\n Note that unlike BallTree.query(), setting return_distance=True\n adds to the computation time. Not all distances need to be\n calculated explicitly for return_distance=False. Results are\n not sorted by default: see ``sort_results`` keyword.\n count_only : boolean (default = False)\n if True, return only the count of points within distance r\n if False, return the indices of all points within distance r\n If return_distance==True, setting count_only=True will\n result in an error.\n sort_results : boolean (default = False)\n if True, the distances and indices will be sorted before being\n returned. If False, the results will not be sorted. If\n return_distance == False, settinng sort_results = True will\n result in an error.\n\n Returns\n -------\n count : if count_only == True\n ind : if count_only == False and return_distance == False\n (ind, dist) : if count_only == False and return_distance == True\n\n count : array of integers, shape = X.shape[:-1]\n each entry gives the number of neighbors within\n a distance r of the corresponding point.\n\n ind : array of objects, shape = X.shape[:-1]\n each element is ""a numpy integer array listing the indices of\n neighbors of the corresponding point. Note that unlike\n the results of BallTree.query(), the returned neighbors\n are not sorted by distance\n\n dist : array of objects, shape = X.shape[:-1]\n each element is a numpy double array\n listing the distances corresponding to indices in i.\n\n Examples\n --------\n Query for neighbors in a given radius\n\n >>> import numpy as np\n >>> np.random.seed(0)\n >>> X = np.random.random((10,3)) # 10 points in 3 dimensions\n >>> ball_tree = BallTree(X, leaf_size=2)\n >>> print ball_tree.query_radius(X[0], r=0.3, count_only=True)\n 3\n >>> ind = ball_tree.query_radius(X[0], r=0.3)\n >>> print ind # indices of neighbors within distance 0.3\n [3 0 1]\n "; +static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_6query_radius(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_X = 0; PyObject *__pyx_v_r = 0; PyObject *__pyx_v_return_distance = 0; @@ -3850,9 +3798,9 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query_radius(PyObject *_ PyArrayObject *__pyx_v_distances_i; PyArrayObject *__pyx_v_pt; PyArrayObject *__pyx_v_count; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_count_i; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_count_i; PyObject *__pyx_v_orig_shape; - struct __pyx_t_7sklearn_9ball_tree_stack __pyx_v_node_stack; + struct __pyx_t_7scikits_5learn_9ball_tree_stack __pyx_v_node_stack; PyObject *__pyx_v_pt_idx; PyObject *__pyx_r = NULL; int __pyx_t_1; @@ -3865,15 +3813,21 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query_radius(PyObject *_ PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; Py_ssize_t __pyx_t_10; - __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_t_11; + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *__pyx_t_11; + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_t_12; + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *__pyx_t_13; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *__pyx_t_14; + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *__pyx_t_15; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *__pyx_t_16; + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *__pyx_t_17; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__X,&__pyx_n_s__r,&__pyx_n_s__return_distance,&__pyx_n_s__count_only,&__pyx_n_s__sort_results,0}; __Pyx_RefNannySetupContext("query_radius"); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[5] = {0,0,0,0,0}; - values[2] = __pyx_k_10; - values[3] = __pyx_k_11; - values[4] = __pyx_k_12; + values[2] = __pyx_k_24; + values[3] = __pyx_k_25; + values[4] = __pyx_k_26; switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); @@ -3919,9 +3873,9 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query_radius(PyObject *_ __pyx_v_count_only = values[3]; __pyx_v_sort_results = values[4]; } else { - __pyx_v_return_distance = __pyx_k_10; - __pyx_v_count_only = __pyx_k_11; - __pyx_v_sort_results = __pyx_k_12; + __pyx_v_return_distance = __pyx_k_24; + __pyx_v_count_only = __pyx_k_25; + __pyx_v_sort_results = __pyx_k_26; switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: __pyx_v_sort_results = PyTuple_GET_ITEM(__pyx_args, 4); @@ -3940,7 +3894,7 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query_radius(PyObject *_ __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("query_radius", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("sklearn.ball_tree.BallTree.query_radius"); + __Pyx_AddTraceback("scikits.learn.ball_tree.BallTree.query_radius"); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; @@ -3955,7 +3909,7 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query_radius(PyObject *_ __pyx_v_orig_shape = Py_None; __Pyx_INCREF(Py_None); __pyx_v_pt_idx = Py_None; __Pyx_INCREF(Py_None); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":710 + /* "scikits/learn/ball_tree.pyx":710 * [3 0 1] * """ * if count_only and return_distance: # <<<<<<<<<<<<<< @@ -3971,29 +3925,23 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query_radius(PyObject *_ } if (__pyx_t_3) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":711 + /* "scikits/learn/ball_tree.pyx":711 * """ * if count_only and return_distance: * raise ValueError("count_only and return_distance " # <<<<<<<<<<<<<< * "cannot both be true") * */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_28), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_13)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_13)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_13)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_4, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":714 + /* "scikits/learn/ball_tree.pyx":714 * "cannot both be true") * * if sort_results and not return_distance: # <<<<<<<<<<<<<< @@ -4010,21 +3958,15 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query_radius(PyObject *_ } if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":715 + /* "scikits/learn/ball_tree.pyx":715 * * if sort_results and not return_distance: * raise ValueError("return_distance must be True if sort_distances " # <<<<<<<<<<<<<< * "is True") * */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_14)); - PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_14)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14)); - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_30), NULL); 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_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -4032,7 +3974,7 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query_radius(PyObject *_ } __pyx_L7:; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":723 + /* "scikits/learn/ball_tree.pyx":723 * * # prepare X for query * X = np.asarray(X, dtype=DTYPE, order='C') # <<<<<<<<<<<<<< @@ -4045,7 +3987,7 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query_radius(PyObject *_ __Pyx_GOTREF(__pyx_t_5); __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 = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); __Pyx_INCREF(__pyx_v_X); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_X); __Pyx_GIVEREF(__pyx_v_X); @@ -4056,16 +3998,16 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query_radius(PyObject *_ if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__order), ((PyObject *)__pyx_n_s__C)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_7 = PyEval_CallObjectWithKeywords(__pyx_t_5, __pyx_t_4, ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyEval_CallObjectWithKeywords(__pyx_t_5, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_v_X); __pyx_v_X = __pyx_t_7; __pyx_t_7 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":724 + /* "scikits/learn/ball_tree.pyx":724 * # prepare X for query * X = np.asarray(X, dtype=DTYPE, order='C') * X = np.atleast_2d(X) # <<<<<<<<<<<<<< @@ -4078,19 +4020,19 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query_radius(PyObject *_ __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(((PyObject *)__pyx_t_7)); __Pyx_INCREF(__pyx_v_X); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_X); __Pyx_GIVEREF(__pyx_v_X); - __pyx_t_4 = PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_v_X); __pyx_v_X = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":725 + /* "scikits/learn/ball_tree.pyx":725 * X = np.asarray(X, dtype=DTYPE, order='C') * X = np.atleast_2d(X) * if X.shape[-1] != self.data.shape[1]: # <<<<<<<<<<<<<< @@ -4102,7 +4044,7 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query_radius(PyObject *_ __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_4, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyInt_to_py_Py_intptr_t((((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->data->dimensions[1])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_to_py_Py_intptr_t((((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->data->dimensions[1])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = PyObject_RichCompare(__pyx_t_7, __pyx_t_4, Py_NE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); @@ -4112,44 +4054,38 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query_radius(PyObject *_ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":726 + /* "scikits/learn/ball_tree.pyx":726 * X = np.atleast_2d(X) * if X.shape[-1] != self.data.shape[1]: * raise ValueError("query data dimension must match BallTree " # <<<<<<<<<<<<<< * "data dimension") * */ - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_31), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_8)); - PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_kp_s_8)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_8)); - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_6, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L8; } __pyx_L8:; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":730 + /* "scikits/learn/ball_tree.pyx":730 * * # prepare r for query * r = np.asarray(r, dtype=DTYPE, order='C') # <<<<<<<<<<<<<< * r = np.atleast_1d(r) * if r.shape == (1,): */ - __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__asarray); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __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 = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__asarray); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_6)); __Pyx_INCREF(__pyx_v_r); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_r); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_r); __Pyx_GIVEREF(__pyx_v_r); __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_7)); @@ -4158,16 +4094,16 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query_radius(PyObject *_ if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__order), ((PyObject *)__pyx_n_s__C)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_6, __pyx_t_4, ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_4, ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_v_r); __pyx_v_r = __pyx_t_5; __pyx_t_5 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":731 + /* "scikits/learn/ball_tree.pyx":731 * # prepare r for query * r = np.asarray(r, dtype=DTYPE, order='C') * r = np.atleast_1d(r) # <<<<<<<<<<<<<< @@ -4180,128 +4116,116 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query_radius(PyObject *_ __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyTuple_New(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_GOTREF(((PyObject *)__pyx_t_5)); __Pyx_INCREF(__pyx_v_r); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_r); __Pyx_GIVEREF(__pyx_v_r); - __pyx_t_4 = PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); 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_t_6 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_v_r); - __pyx_v_r = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_v_r = __pyx_t_6; + __pyx_t_6 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":732 + /* "scikits/learn/ball_tree.pyx":732 * r = np.asarray(r, dtype=DTYPE, order='C') * r = np.atleast_1d(r) * if r.shape == (1,): # <<<<<<<<<<<<<< * r = r[0] * np.ones(X.shape[:-1], dtype=np.double) * else: */ - __pyx_t_4 = PyObject_GetAttr(__pyx_v_r, __pyx_n_s__shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_GetAttr(__pyx_v_r, __pyx_n_s__shape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, ((PyObject *)__pyx_k_tuple_32), Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_INCREF(__pyx_int_1); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - __pyx_t_7 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":733 + /* "scikits/learn/ball_tree.pyx":733 * r = np.atleast_1d(r) * if r.shape == (1,): * r = r[0] * np.ones(X.shape[:-1], dtype=np.double) # <<<<<<<<<<<<<< * else: * if r.shape != X.shape[:-1]: */ - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_r, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_r, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__ones); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_GetAttr(__pyx_v_X, __pyx_n_s__shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PySequence_GetSlice(__pyx_t_5, 0, -1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); - __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__double); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__ones); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyObject_GetAttr(__pyx_v_X, __pyx_n_s__shape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PySequence_GetSlice(__pyx_t_6, 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_6)); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__double); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyEval_CallObjectWithKeywords(__pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyEval_CallObjectWithKeywords(__pyx_t_7, ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Multiply(__pyx_t_7, __pyx_t_9); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Multiply(__pyx_t_5, __pyx_t_9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_v_r); - __pyx_v_r = __pyx_t_6; - __pyx_t_6 = 0; + __pyx_v_r = __pyx_t_4; + __pyx_t_4 = 0; goto __pyx_L9; } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":735 + /* "scikits/learn/ball_tree.pyx":735 * r = r[0] * np.ones(X.shape[:-1], dtype=np.double) * else: * if r.shape != X.shape[:-1]: # <<<<<<<<<<<<<< * raise ValueError("r must be broadcastable to X.shape") * */ - __pyx_t_6 = PyObject_GetAttr(__pyx_v_r, __pyx_n_s__shape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PyObject_GetAttr(__pyx_v_r, __pyx_n_s__shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = PyObject_GetAttr(__pyx_v_X, __pyx_n_s__shape); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_7 = PySequence_GetSlice(__pyx_t_9, 0, -1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = __Pyx_PySequence_GetSlice(__pyx_t_9, 0, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyObject_RichCompare(__pyx_t_6, __pyx_t_7, Py_NE); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_NE); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":736 + /* "scikits/learn/ball_tree.pyx":736 * else: * if r.shape != X.shape[:-1]: * raise ValueError("r must be broadcastable to X.shape") # <<<<<<<<<<<<<< * * # flatten X and r for iteration */ - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_34), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_15)); - PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_kp_s_15)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_15)); - __pyx_t_7 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); + __Pyx_Raise(__pyx_t_9, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_Raise(__pyx_t_7, 0, 0); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L10; } @@ -4309,86 +4233,80 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query_radius(PyObject *_ } __pyx_L9:; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":739 + /* "scikits/learn/ball_tree.pyx":739 * * # flatten X and r for iteration * orig_shape = X.shape # <<<<<<<<<<<<<< * X = X.reshape((-1, X.shape[-1])) * r = r.reshape(-1) */ - __pyx_t_7 = PyObject_GetAttr(__pyx_v_X, __pyx_n_s__shape); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = PyObject_GetAttr(__pyx_v_X, __pyx_n_s__shape); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_v_orig_shape); - __pyx_v_orig_shape = __pyx_t_7; - __pyx_t_7 = 0; + __pyx_v_orig_shape = __pyx_t_9; + __pyx_t_9 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":740 + /* "scikits/learn/ball_tree.pyx":740 * # flatten X and r for iteration * orig_shape = X.shape * X = X.reshape((-1, X.shape[-1])) # <<<<<<<<<<<<<< * r = r.reshape(-1) * */ - __pyx_t_7 = PyObject_GetAttr(__pyx_v_X, __pyx_n_s__reshape); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = PyObject_GetAttr(__pyx_v_X, __pyx_n_s__shape); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_9, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_GetAttr(__pyx_v_X, __pyx_n_s__reshape); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); + __pyx_t_5 = PyObject_GetAttr(__pyx_v_X, __pyx_n_s__shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_5, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); __Pyx_INCREF(__pyx_int_neg_1); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_int_neg_1); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); - PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9); - __Pyx_GIVEREF(__pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_9 = PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_GIVEREF(__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 = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_5)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_5)); + __pyx_t_5 = 0; + __pyx_t_5 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_v_X); - __pyx_v_X = __pyx_t_9; - __pyx_t_9 = 0; + __pyx_v_X = __pyx_t_5; + __pyx_t_5 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":741 + /* "scikits/learn/ball_tree.pyx":741 * orig_shape = X.shape * X = X.reshape((-1, X.shape[-1])) * r = r.reshape(-1) # <<<<<<<<<<<<<< * * cdef stack node_stack */ - __pyx_t_9 = PyObject_GetAttr(__pyx_v_r, __pyx_n_s__reshape); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF(__pyx_int_neg_1); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_int_neg_1); - __Pyx_GIVEREF(__pyx_int_neg_1); - __pyx_t_7 = PyObject_Call(__pyx_t_9, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_5 = PyObject_GetAttr(__pyx_v_r, __pyx_n_s__reshape); 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); + __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_35), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_v_r); - __pyx_v_r = __pyx_t_7; - __pyx_t_7 = 0; + __pyx_v_r = __pyx_t_4; + __pyx_t_4 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":744 + /* "scikits/learn/ball_tree.pyx":744 * * cdef stack node_stack * stack_create(&node_stack, self.n_levels + 1) # <<<<<<<<<<<<<< * * if count_only: */ - __pyx_f_7sklearn_9ball_tree_stack_create((&__pyx_v_node_stack), (((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->n_levels + 1)); + __pyx_f_7scikits_5learn_9ball_tree_stack_create((&__pyx_v_node_stack), (((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->n_levels + 1)); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":746 + /* "scikits/learn/ball_tree.pyx":746 * stack_create(&node_stack, self.n_levels + 1) * * if count_only: # <<<<<<<<<<<<<< @@ -4398,43 +4316,43 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query_radius(PyObject *_ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_count_only); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":747 + /* "scikits/learn/ball_tree.pyx":747 * * if count_only: * count = np.zeros(X.shape[0], ITYPE) # <<<<<<<<<<<<<< * for pt_idx, pt in enumerate(X): * count[pt_idx] = self.query_radius_count_(<DTYPE_t*>pt.data, */ - __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__zeros); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyObject_GetAttr(__pyx_v_X, __pyx_n_s__shape); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_7, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__ITYPE); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_GetAttr(__pyx_v_X, __pyx_n_s__shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_4, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__ITYPE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_6)); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); __pyx_t_9 = 0; - __pyx_t_7 = 0; - __pyx_t_7 = PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_count)); - __pyx_v_count = ((PyArrayObject *)__pyx_t_7); - __pyx_t_7 = 0; + __pyx_v_count = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":748 + /* "scikits/learn/ball_tree.pyx":748 * if count_only: * count = np.zeros(X.shape[0], ITYPE) * for pt_idx, pt in enumerate(X): # <<<<<<<<<<<<<< @@ -4442,79 +4360,88 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query_radius(PyObject *_ * r[pt_idx], */ __Pyx_INCREF(__pyx_int_0); - __pyx_t_7 = __pyx_int_0; + __pyx_t_4 = __pyx_int_0; if (PyList_CheckExact(__pyx_v_X) || PyTuple_CheckExact(__pyx_v_X)) { - __pyx_t_10 = 0; __pyx_t_5 = __pyx_v_X; __Pyx_INCREF(__pyx_t_5); + __pyx_t_10 = 0; __pyx_t_6 = __pyx_v_X; __Pyx_INCREF(__pyx_t_6); } else { - __pyx_t_10 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_X); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_10 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_X); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); } for (;;) { - if (likely(PyList_CheckExact(__pyx_t_5))) { - if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_5)) break; - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_t_10++; - } else if (likely(PyTuple_CheckExact(__pyx_t_5))) { - if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_5)) break; - __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_t_10++; + if (likely(PyList_CheckExact(__pyx_t_6))) { + if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_6)) break; + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_5); __pyx_t_10++; + } else if (likely(PyTuple_CheckExact(__pyx_t_6))) { + if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_6)) break; + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_5); __pyx_t_10++; } else { - __pyx_t_6 = PyIter_Next(__pyx_t_5); - if (!__pyx_t_6) { + __pyx_t_5 = PyIter_Next(__pyx_t_6); + if (!__pyx_t_5) { if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} break; } - __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); } - if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_pt)); - __pyx_v_pt = ((PyArrayObject *)__pyx_t_6); - __pyx_t_6 = 0; - __Pyx_INCREF(__pyx_t_7); + __pyx_v_pt = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + __Pyx_INCREF(__pyx_t_4); __Pyx_DECREF(__pyx_v_pt_idx); - __pyx_v_pt_idx = __pyx_t_7; - __pyx_t_6 = PyNumber_Add(__pyx_t_7, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_7); - __pyx_t_7 = __pyx_t_6; - __pyx_t_6 = 0; + __pyx_v_pt_idx = __pyx_t_4; + __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); + __pyx_t_4 = __pyx_t_5; + __pyx_t_5 = 0; + + /* "scikits/learn/ball_tree.pyx":749 + * count = np.zeros(X.shape[0], ITYPE) + * for pt_idx, pt in enumerate(X): + * count[pt_idx] = self.query_radius_count_(<DTYPE_t*>pt.data, # <<<<<<<<<<<<<< + * r[pt_idx], + * &node_stack) + */ + __pyx_t_11 = ((__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *)__pyx_v_pt->data); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":750 + /* "scikits/learn/ball_tree.pyx":750 * for pt_idx, pt in enumerate(X): * count[pt_idx] = self.query_radius_count_(<DTYPE_t*>pt.data, * r[pt_idx], # <<<<<<<<<<<<<< * &node_stack) * elif not return_distance: */ - __pyx_t_6 = PyObject_GetItem(__pyx_v_r, __pyx_v_pt_idx); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_11 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_5 = PyObject_GetItem(__pyx_v_r, __pyx_v_pt_idx); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_12 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":751 + /* "scikits/learn/ball_tree.pyx":751 * count[pt_idx] = self.query_radius_count_(<DTYPE_t*>pt.data, * r[pt_idx], * &node_stack) # <<<<<<<<<<<<<< * elif not return_distance: * idx_array = np.empty(X.shape[0], dtype='object') */ - __pyx_t_6 = __Pyx_PyInt_to_py_npy_int32(((struct __pyx_vtabstruct_7sklearn_9ball_tree_BallTree *)((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->__pyx_vtab)->query_radius_count_(((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self), ((__pyx_t_7sklearn_9ball_tree_DTYPE_t *)__pyx_v_pt->data), __pyx_t_11, (&__pyx_v_node_stack))); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyInt_to_py_npy_int32(((struct __pyx_vtabstruct_7scikits_5learn_9ball_tree_BallTree *)((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->__pyx_vtab)->query_radius_count_(((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self), __pyx_t_11, __pyx_t_12, (&__pyx_v_node_stack))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":749 + /* "scikits/learn/ball_tree.pyx":749 * count = np.zeros(X.shape[0], ITYPE) * for pt_idx, pt in enumerate(X): * count[pt_idx] = self.query_radius_count_(<DTYPE_t*>pt.data, # <<<<<<<<<<<<<< * r[pt_idx], * &node_stack) */ - if (PyObject_SetItem(((PyObject *)__pyx_v_count), __pyx_v_pt_idx, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyObject_SetItem(((PyObject *)__pyx_v_count), __pyx_v_pt_idx, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L11; } - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":752 + /* "scikits/learn/ball_tree.pyx":752 * r[pt_idx], * &node_stack) * elif not return_distance: # <<<<<<<<<<<<<< @@ -4525,42 +4452,42 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query_radius(PyObject *_ __pyx_t_3 = (!__pyx_t_1); if (__pyx_t_3) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":753 + /* "scikits/learn/ball_tree.pyx":753 * &node_stack) * elif not return_distance: * idx_array = np.empty(X.shape[0], dtype='object') # <<<<<<<<<<<<<< * idx_array_i = np.empty(self.data.shape[0], dtype=ITYPE) * for pt_idx, pt in enumerate(X): */ - __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyObject_GetAttr(__pyx_v_X, __pyx_n_s__shape); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_7, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); - if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__object)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_9 = PyEval_CallObjectWithKeywords(__pyx_t_5, __pyx_t_7, ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_GetAttr(__pyx_v_X, __pyx_n_s__shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __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 = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__object)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyEval_CallObjectWithKeywords(__pyx_t_6, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_idx_array)); __pyx_v_idx_array = ((PyArrayObject *)__pyx_t_9); __pyx_t_9 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":754 + /* "scikits/learn/ball_tree.pyx":754 * elif not return_distance: * idx_array = np.empty(X.shape[0], dtype='object') * idx_array_i = np.empty(self.data.shape[0], dtype=ITYPE) # <<<<<<<<<<<<<< @@ -4569,33 +4496,33 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query_radius(PyObject *_ */ __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_6 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyInt_to_py_Py_intptr_t((((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->data->dimensions[0])); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyInt_to_py_Py_intptr_t((((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->data->dimensions[0])); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_9)); - __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__ITYPE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_6, __pyx_t_7, ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__ITYPE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_5, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_idx_array_i)); - __pyx_v_idx_array_i = ((PyArrayObject *)__pyx_t_5); - __pyx_t_5 = 0; + __pyx_v_idx_array_i = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":755 + /* "scikits/learn/ball_tree.pyx":755 * idx_array = np.empty(X.shape[0], dtype='object') * idx_array_i = np.empty(self.data.shape[0], dtype=ITYPE) * for pt_idx, pt in enumerate(X): # <<<<<<<<<<<<<< @@ -4603,7 +4530,7 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query_radius(PyObject *_ * <DTYPE_t*>pt.data, */ __Pyx_INCREF(__pyx_int_0); - __pyx_t_5 = __pyx_int_0; + __pyx_t_6 = __pyx_int_0; if (PyList_CheckExact(__pyx_v_X) || PyTuple_CheckExact(__pyx_v_X)) { __pyx_t_10 = 0; __pyx_t_9 = __pyx_v_X; __Pyx_INCREF(__pyx_t_9); } else { @@ -4613,147 +4540,165 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query_radius(PyObject *_ for (;;) { if (likely(PyList_CheckExact(__pyx_t_9))) { if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_9)) break; - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_4); __pyx_t_10++; } else if (likely(PyTuple_CheckExact(__pyx_t_9))) { if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_9)) break; - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_4); __pyx_t_10++; } else { - __pyx_t_7 = PyIter_Next(__pyx_t_9); - if (!__pyx_t_7) { + __pyx_t_4 = PyIter_Next(__pyx_t_9); + if (!__pyx_t_4) { if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} break; } - __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_4); } - if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_pt)); - __pyx_v_pt = ((PyArrayObject *)__pyx_t_7); - __pyx_t_7 = 0; - __Pyx_INCREF(__pyx_t_5); + __pyx_v_pt = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; + __Pyx_INCREF(__pyx_t_6); __Pyx_DECREF(__pyx_v_pt_idx); - __pyx_v_pt_idx = __pyx_t_5; - __pyx_t_7 = PyNumber_Add(__pyx_t_5, __pyx_int_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_5); - __pyx_t_5 = __pyx_t_7; - __pyx_t_7 = 0; - - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":758 + __pyx_v_pt_idx = __pyx_t_6; + __pyx_t_4 = PyNumber_Add(__pyx_t_6, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); + __pyx_t_6 = __pyx_t_4; + __pyx_t_4 = 0; + + /* "scikits/learn/ball_tree.pyx":757 + * for pt_idx, pt in enumerate(X): + * count_i = self.query_radius_idx_only_( + * <DTYPE_t*>pt.data, # <<<<<<<<<<<<<< + * r[pt_idx], + * <ITYPE_t*>idx_array_i.data, + */ + __pyx_t_13 = ((__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *)__pyx_v_pt->data); + + /* "scikits/learn/ball_tree.pyx":758 * count_i = self.query_radius_idx_only_( * <DTYPE_t*>pt.data, * r[pt_idx], # <<<<<<<<<<<<<< * <ITYPE_t*>idx_array_i.data, * &node_stack) */ - __pyx_t_7 = PyObject_GetItem(__pyx_v_r, __pyx_v_pt_idx); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_11 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_4 = PyObject_GetItem(__pyx_v_r, __pyx_v_pt_idx); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_12 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "scikits/learn/ball_tree.pyx":759 + * <DTYPE_t*>pt.data, + * r[pt_idx], + * <ITYPE_t*>idx_array_i.data, # <<<<<<<<<<<<<< + * &node_stack) + * idx_array[pt_idx] = idx_array_i[:count_i].copy() + */ + __pyx_t_14 = ((__pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *)__pyx_v_idx_array_i->data); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":760 + /* "scikits/learn/ball_tree.pyx":760 * r[pt_idx], * <ITYPE_t*>idx_array_i.data, * &node_stack) # <<<<<<<<<<<<<< * idx_array[pt_idx] = idx_array_i[:count_i].copy() * */ - __pyx_v_count_i = ((struct __pyx_vtabstruct_7sklearn_9ball_tree_BallTree *)((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->__pyx_vtab)->query_radius_idx_only_(((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self), ((__pyx_t_7sklearn_9ball_tree_DTYPE_t *)__pyx_v_pt->data), __pyx_t_11, ((__pyx_t_7sklearn_9ball_tree_ITYPE_t *)__pyx_v_idx_array_i->data), (&__pyx_v_node_stack)); + __pyx_v_count_i = ((struct __pyx_vtabstruct_7scikits_5learn_9ball_tree_BallTree *)((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->__pyx_vtab)->query_radius_idx_only_(((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self), __pyx_t_13, __pyx_t_12, __pyx_t_14, (&__pyx_v_node_stack)); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":761 + /* "scikits/learn/ball_tree.pyx":761 * <ITYPE_t*>idx_array_i.data, * &node_stack) * idx_array[pt_idx] = idx_array_i[:count_i].copy() # <<<<<<<<<<<<<< * * else: */ - __pyx_t_7 = PySequence_GetSlice(((PyObject *)__pyx_v_idx_array_i), 0, __pyx_v_count_i); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__copy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyObject_SetItem(((PyObject *)__pyx_v_idx_array), __pyx_v_pt_idx, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_4 = __Pyx_PySequence_GetSlice(((PyObject *)__pyx_v_idx_array_i), 0, __pyx_v_count_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__copy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyObject_SetItem(((PyObject *)__pyx_v_idx_array), __pyx_v_pt_idx, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L11; } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":764 + /* "scikits/learn/ball_tree.pyx":764 * * else: * idx_array = np.empty(X.shape[0], dtype='object') # <<<<<<<<<<<<<< * distances = np.empty(X.shape[0], dtype='object') * idx_array_i = np.empty(self.data.shape[0], dtype=ITYPE) */ - __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_9 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_GetAttr(__pyx_v_X, __pyx_n_s__shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_5, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_7); - __pyx_t_7 = 0; - __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_7)); - if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__object)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_9, __pyx_t_5, ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyObject_GetAttr(__pyx_v_X, __pyx_n_s__shape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_6)); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__object)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_9, ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; - if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_idx_array)); - __pyx_v_idx_array = ((PyArrayObject *)__pyx_t_6); - __pyx_t_6 = 0; + __pyx_v_idx_array = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":765 + /* "scikits/learn/ball_tree.pyx":765 * else: * idx_array = np.empty(X.shape[0], dtype='object') * distances = np.empty(X.shape[0], dtype='object') # <<<<<<<<<<<<<< * idx_array_i = np.empty(self.data.shape[0], dtype=ITYPE) * distances_i = np.empty(self.data.shape[0], dtype=DTYPE) */ - __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__empty); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_GetAttr(__pyx_v_X, __pyx_n_s__shape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyObject_GetAttr(__pyx_v_X, __pyx_n_s__shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__object)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_9 = PyEval_CallObjectWithKeywords(__pyx_t_7, __pyx_t_6, ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_6)); + if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__object)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyEval_CallObjectWithKeywords(__pyx_t_4, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_distances)); __pyx_v_distances = ((PyArrayObject *)__pyx_t_9); __pyx_t_9 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":766 + /* "scikits/learn/ball_tree.pyx":766 * idx_array = np.empty(X.shape[0], dtype='object') * distances = np.empty(X.shape[0], dtype='object') * idx_array_i = np.empty(self.data.shape[0], dtype=ITYPE) # <<<<<<<<<<<<<< @@ -4762,68 +4707,68 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query_radius(PyObject *_ */ __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyInt_to_py_Py_intptr_t((((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->data->dimensions[0])); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyInt_to_py_Py_intptr_t((((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->data->dimensions[0])); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_9)); - __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__ITYPE); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__dtype), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyEval_CallObjectWithKeywords(__pyx_t_5, __pyx_t_6, ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__ITYPE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_6, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; - if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_idx_array_i)); - __pyx_v_idx_array_i = ((PyArrayObject *)__pyx_t_7); - __pyx_t_7 = 0; + __pyx_v_idx_array_i = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":767 + /* "scikits/learn/ball_tree.pyx":767 * distances = np.empty(X.shape[0], dtype='object') * idx_array_i = np.empty(self.data.shape[0], dtype=ITYPE) * distances_i = np.empty(self.data.shape[0], dtype=DTYPE) # <<<<<<<<<<<<<< * for pt_idx, pt in enumerate(X): * count_i = self.query_radius_distances_( */ - __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_9 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyInt_to_py_Py_intptr_t((((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->data->dimensions[0])); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyInt_to_py_Py_intptr_t((((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->data->dimensions[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_7); - __pyx_t_7 = 0; - __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_7)); - __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__DTYPE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_9, __pyx_t_6, ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_9, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_distances_i)); - __pyx_v_distances_i = ((PyArrayObject *)__pyx_t_5); - __pyx_t_5 = 0; + __pyx_v_distances_i = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":768 + /* "scikits/learn/ball_tree.pyx":768 * idx_array_i = np.empty(self.data.shape[0], dtype=ITYPE) * distances_i = np.empty(self.data.shape[0], dtype=DTYPE) * for pt_idx, pt in enumerate(X): # <<<<<<<<<<<<<< @@ -4831,135 +4776,162 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query_radius(PyObject *_ * <DTYPE_t*>pt.data, */ __Pyx_INCREF(__pyx_int_0); - __pyx_t_5 = __pyx_int_0; + __pyx_t_6 = __pyx_int_0; if (PyList_CheckExact(__pyx_v_X) || PyTuple_CheckExact(__pyx_v_X)) { - __pyx_t_10 = 0; __pyx_t_7 = __pyx_v_X; __Pyx_INCREF(__pyx_t_7); + __pyx_t_10 = 0; __pyx_t_4 = __pyx_v_X; __Pyx_INCREF(__pyx_t_4); } else { - __pyx_t_10 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_X); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_10 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_X); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); } for (;;) { - if (likely(PyList_CheckExact(__pyx_t_7))) { - if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_7)) break; - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_t_10++; - } else if (likely(PyTuple_CheckExact(__pyx_t_7))) { - if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_7)) break; - __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_t_10++; + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_4)) break; + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_5); __pyx_t_10++; + } else if (likely(PyTuple_CheckExact(__pyx_t_4))) { + if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_5); __pyx_t_10++; } else { - __pyx_t_6 = PyIter_Next(__pyx_t_7); - if (!__pyx_t_6) { + __pyx_t_5 = PyIter_Next(__pyx_t_4); + if (!__pyx_t_5) { if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} break; } - __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_5); } - if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_pt)); - __pyx_v_pt = ((PyArrayObject *)__pyx_t_6); - __pyx_t_6 = 0; - __Pyx_INCREF(__pyx_t_5); + __pyx_v_pt = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; + __Pyx_INCREF(__pyx_t_6); __Pyx_DECREF(__pyx_v_pt_idx); - __pyx_v_pt_idx = __pyx_t_5; - __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); - __pyx_t_5 = __pyx_t_6; - __pyx_t_6 = 0; + __pyx_v_pt_idx = __pyx_t_6; + __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); + __pyx_t_6 = __pyx_t_5; + __pyx_t_5 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":771 + /* "scikits/learn/ball_tree.pyx":770 + * for pt_idx, pt in enumerate(X): * count_i = self.query_radius_distances_( - * <DTYPE_t*>pt.data, - * r[pt_idx], # <<<<<<<<<<<<<< + * <DTYPE_t*>pt.data, # <<<<<<<<<<<<<< + * r[pt_idx], * <ITYPE_t*>idx_array_i.data, - * <DTYPE_t*>distances_i.data, */ - __pyx_t_6 = PyObject_GetItem(__pyx_v_r, __pyx_v_pt_idx); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_11 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_15 = ((__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *)__pyx_v_pt->data); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":774 + /* "scikits/learn/ball_tree.pyx":771 + * count_i = self.query_radius_distances_( + * <DTYPE_t*>pt.data, + * r[pt_idx], # <<<<<<<<<<<<<< * <ITYPE_t*>idx_array_i.data, * <DTYPE_t*>distances_i.data, - * &node_stack) # <<<<<<<<<<<<<< - * if sort_results: - * sort_dist_idx(<DTYPE_t*>distances_i.data, */ - __pyx_v_count_i = ((struct __pyx_vtabstruct_7sklearn_9ball_tree_BallTree *)((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->__pyx_vtab)->query_radius_distances_(((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self), ((__pyx_t_7sklearn_9ball_tree_DTYPE_t *)__pyx_v_pt->data), __pyx_t_11, ((__pyx_t_7sklearn_9ball_tree_ITYPE_t *)__pyx_v_idx_array_i->data), ((__pyx_t_7sklearn_9ball_tree_DTYPE_t *)__pyx_v_distances_i->data), (&__pyx_v_node_stack)); + __pyx_t_5 = PyObject_GetItem(__pyx_v_r, __pyx_v_pt_idx); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_12 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":775 + /* "scikits/learn/ball_tree.pyx":772 + * <DTYPE_t*>pt.data, + * r[pt_idx], + * <ITYPE_t*>idx_array_i.data, # <<<<<<<<<<<<<< * <DTYPE_t*>distances_i.data, * &node_stack) - * if sort_results: # <<<<<<<<<<<<<< - * sort_dist_idx(<DTYPE_t*>distances_i.data, + */ + __pyx_t_16 = ((__pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *)__pyx_v_idx_array_i->data); + + /* "scikits/learn/ball_tree.pyx":773 + * r[pt_idx], + * <ITYPE_t*>idx_array_i.data, + * <DTYPE_t*>distances_i.data, # <<<<<<<<<<<<<< + * &node_stack) + * if sort_results: + */ + __pyx_t_17 = ((__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *)__pyx_v_distances_i->data); + + /* "scikits/learn/ball_tree.pyx":774 + * <ITYPE_t*>idx_array_i.data, + * <DTYPE_t*>distances_i.data, + * &node_stack) # <<<<<<<<<<<<<< + * if sort_results: + * sort_dist_idx(<DTYPE_t*>distances_i.data, + */ + __pyx_v_count_i = ((struct __pyx_vtabstruct_7scikits_5learn_9ball_tree_BallTree *)((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->__pyx_vtab)->query_radius_distances_(((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self), __pyx_t_15, __pyx_t_12, __pyx_t_16, __pyx_t_17, (&__pyx_v_node_stack)); + + /* "scikits/learn/ball_tree.pyx":775 + * <DTYPE_t*>distances_i.data, + * &node_stack) + * if sort_results: # <<<<<<<<<<<<<< + * sort_dist_idx(<DTYPE_t*>distances_i.data, * <ITYPE_t*>idx_array_i.data, */ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_sort_results); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_3) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":778 + /* "scikits/learn/ball_tree.pyx":778 * sort_dist_idx(<DTYPE_t*>distances_i.data, * <ITYPE_t*>idx_array_i.data, * count_i) # <<<<<<<<<<<<<< * * idx_array[pt_idx] = idx_array_i[:count_i].copy() */ - __pyx_f_7sklearn_9ball_tree_sort_dist_idx(((__pyx_t_7sklearn_9ball_tree_DTYPE_t *)__pyx_v_distances_i->data), ((__pyx_t_7sklearn_9ball_tree_ITYPE_t *)__pyx_v_idx_array_i->data), __pyx_v_count_i); + __pyx_f_7scikits_5learn_9ball_tree_sort_dist_idx(((__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *)__pyx_v_distances_i->data), ((__pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *)__pyx_v_idx_array_i->data), __pyx_v_count_i); goto __pyx_L18; } __pyx_L18:; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":780 + /* "scikits/learn/ball_tree.pyx":780 * count_i) * * idx_array[pt_idx] = idx_array_i[:count_i].copy() # <<<<<<<<<<<<<< * distances[pt_idx] = distances_i[:count_i].copy() * */ - __pyx_t_6 = PySequence_GetSlice(((PyObject *)__pyx_v_idx_array_i), 0, __pyx_v_count_i); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__copy); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PySequence_GetSlice(((PyObject *)__pyx_v_idx_array_i), 0, __pyx_v_count_i); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__copy); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PyObject_SetItem(((PyObject *)__pyx_v_idx_array), __pyx_v_pt_idx, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyObject_SetItem(((PyObject *)__pyx_v_idx_array), __pyx_v_pt_idx, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":781 + /* "scikits/learn/ball_tree.pyx":781 * * idx_array[pt_idx] = idx_array_i[:count_i].copy() * distances[pt_idx] = distances_i[:count_i].copy() # <<<<<<<<<<<<<< * * stack_destroy(&node_stack) */ - __pyx_t_6 = PySequence_GetSlice(((PyObject *)__pyx_v_distances_i), 0, __pyx_v_count_i); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__copy); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PySequence_GetSlice(((PyObject *)__pyx_v_distances_i), 0, __pyx_v_count_i); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__copy); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PyObject_SetItem(((PyObject *)__pyx_v_distances), __pyx_v_pt_idx, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyObject_SetItem(((PyObject *)__pyx_v_distances), __pyx_v_pt_idx, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_L11:; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":783 + /* "scikits/learn/ball_tree.pyx":783 * distances[pt_idx] = distances_i[:count_i].copy() * * stack_destroy(&node_stack) # <<<<<<<<<<<<<< * * # deflatten results */ - __pyx_f_7sklearn_9ball_tree_stack_destroy((&__pyx_v_node_stack)); + __pyx_f_7scikits_5learn_9ball_tree_stack_destroy((&__pyx_v_node_stack)); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":786 + /* "scikits/learn/ball_tree.pyx":786 * * # deflatten results * if count_only: # <<<<<<<<<<<<<< @@ -4969,7 +4941,7 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query_radius(PyObject *_ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_count_only); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_3) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":787 + /* "scikits/learn/ball_tree.pyx":787 * # deflatten results * if count_only: * return count.reshape(orig_shape[:-1]) # <<<<<<<<<<<<<< @@ -4977,26 +4949,26 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query_radius(PyObject *_ * return (idx_array.reshape(orig_shape[:-1]), */ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_count), __pyx_n_s__reshape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = PySequence_GetSlice(__pyx_v_orig_shape, 0, -1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_v_count), __pyx_n_s__reshape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_7); - __pyx_t_7 = 0; - __pyx_t_7 = PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_4 = __Pyx_PySequence_GetSlice(__pyx_v_orig_shape, 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_r = __pyx_t_7; - __pyx_t_7 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; goto __pyx_L0; goto __pyx_L19; } - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":788 + /* "scikits/learn/ball_tree.pyx":788 * if count_only: * return count.reshape(orig_shape[:-1]) * elif return_distance: # <<<<<<<<<<<<<< @@ -5006,7 +4978,7 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query_radius(PyObject *_ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_return_distance); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_3) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":789 + /* "scikits/learn/ball_tree.pyx":789 * return count.reshape(orig_shape[:-1]) * elif return_distance: * return (idx_array.reshape(orig_shape[:-1]), # <<<<<<<<<<<<<< @@ -5014,56 +4986,56 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query_radius(PyObject *_ * else: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_7 = PyObject_GetAttr(((PyObject *)__pyx_v_idx_array), __pyx_n_s__reshape); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = PySequence_GetSlice(__pyx_v_orig_shape, 0, -1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_idx_array), __pyx_n_s__reshape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PySequence_GetSlice(__pyx_v_orig_shape, 0, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_6)); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":790 + /* "scikits/learn/ball_tree.pyx":790 * elif return_distance: * return (idx_array.reshape(orig_shape[:-1]), * distances.reshape(orig_shape[:-1])) # <<<<<<<<<<<<<< * else: * return idx_array.reshape(orig_shape[:-1]) */ - __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_distances), __pyx_n_s__reshape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = PySequence_GetSlice(__pyx_v_orig_shape, 0, -1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_v_distances), __pyx_n_s__reshape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PySequence_GetSlice(__pyx_v_orig_shape, 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_7); - __pyx_t_7 = 0; - __pyx_t_7 = PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_GOTREF(((PyObject *)__pyx_t_9)); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_7); - __pyx_t_6 = 0; - __pyx_t_7 = 0; - __pyx_r = __pyx_t_9; + __Pyx_GOTREF(((PyObject *)__pyx_t_9)); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_5 = 0; + __pyx_t_4 = 0; + __pyx_r = ((PyObject *)__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L0; goto __pyx_L19; } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":792 + /* "scikits/learn/ball_tree.pyx":792 * distances.reshape(orig_shape[:-1])) * else: * return idx_array.reshape(orig_shape[:-1]) # <<<<<<<<<<<<<< @@ -5073,19 +5045,19 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query_radius(PyObject *_ __Pyx_XDECREF(__pyx_r); __pyx_t_9 = PyObject_GetAttr(((PyObject *)__pyx_v_idx_array), __pyx_n_s__reshape); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_7 = PySequence_GetSlice(__pyx_v_orig_shape, 0, -1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_7); - __pyx_t_7 = 0; - __pyx_t_7 = PyObject_Call(__pyx_t_9, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = __Pyx_PySequence_GetSlice(__pyx_v_orig_shape, 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_r = __pyx_t_7; - __pyx_t_7 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; goto __pyx_L0; } __pyx_L19:; @@ -5099,7 +5071,7 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query_radius(PyObject *_ __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); - __Pyx_AddTraceback("sklearn.ball_tree.BallTree.query_radius"); + __Pyx_AddTraceback("scikits.learn.ball_tree.BallTree.query_radius"); __pyx_r = NULL; __pyx_L0:; __Pyx_DECREF((PyObject *)__pyx_v_idx_array); @@ -5117,7 +5089,7 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query_radius(PyObject *_ return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":795 +/* "scikits/learn/ball_tree.pyx":795 * * @cython.cdivision(True) * cdef void build_tree_(BallTree self): # <<<<<<<<<<<<<< @@ -5125,69 +5097,68 @@ static PyObject *__pyx_pf_7sklearn_9ball_tree_8BallTree_query_radius(PyObject *_ * cdef ITYPE_t* idx_array = <ITYPE_t*> self.idx_array.data */ -static void __pyx_f_7sklearn_9ball_tree_8BallTree_build_tree_(struct __pyx_obj_7sklearn_9ball_tree_BallTree *__pyx_v_self) { - __pyx_t_7sklearn_9ball_tree_DTYPE_t *__pyx_v_data; - __pyx_t_7sklearn_9ball_tree_ITYPE_t *__pyx_v_idx_array; - __pyx_t_7sklearn_9ball_tree_DTYPE_t *__pyx_v_node_centroid_arr; - struct __pyx_t_7sklearn_9ball_tree_NodeInfo *__pyx_v_node_info_arr; - __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_p; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_n_samples; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_n_features; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_idx_start; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_idx_end; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_n_points; - __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_radius; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_i; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_i_node; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_i_parent; - __pyx_t_7sklearn_9ball_tree_DTYPE_t *__pyx_v_centroid; - struct __pyx_t_7sklearn_9ball_tree_NodeInfo *__pyx_v_node_info; - struct __pyx_t_7sklearn_9ball_tree_NodeInfo *__pyx_v_parent_info; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_i_max; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_t_1; +static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_build_tree_(struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *__pyx_v_self) { + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *__pyx_v_data; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *__pyx_v_idx_array; + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *__pyx_v_node_centroid_arr; + struct __pyx_t_7scikits_5learn_9ball_tree_NodeInfo *__pyx_v_node_info_arr; + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_p; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_n_samples; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_n_features; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_idx_start; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_idx_end; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_n_points; + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_radius; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_i; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_i_node; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_i_parent; + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *__pyx_v_centroid; + struct __pyx_t_7scikits_5learn_9ball_tree_NodeInfo *__pyx_v_node_info; + struct __pyx_t_7scikits_5learn_9ball_tree_NodeInfo *__pyx_v_parent_info; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_i_max; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_t_5; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_t_4; __Pyx_RefNannySetupContext("build_tree_"); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":796 + /* "scikits/learn/ball_tree.pyx":796 * @cython.cdivision(True) * cdef void build_tree_(BallTree self): * cdef DTYPE_t* data = <DTYPE_t*> self.data.data # <<<<<<<<<<<<<< * cdef ITYPE_t* idx_array = <ITYPE_t*> self.idx_array.data * cdef DTYPE_t* node_centroid_arr = <DTYPE_t*>self.node_centroid_arr.data */ - __pyx_v_data = ((__pyx_t_7sklearn_9ball_tree_DTYPE_t *)__pyx_v_self->data->data); + __pyx_v_data = ((__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *)__pyx_v_self->data->data); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":797 + /* "scikits/learn/ball_tree.pyx":797 * cdef void build_tree_(BallTree self): * cdef DTYPE_t* data = <DTYPE_t*> self.data.data * cdef ITYPE_t* idx_array = <ITYPE_t*> self.idx_array.data # <<<<<<<<<<<<<< * cdef DTYPE_t* node_centroid_arr = <DTYPE_t*>self.node_centroid_arr.data * cdef NodeInfo* node_info_arr = <NodeInfo*> self.node_info_arr.data */ - __pyx_v_idx_array = ((__pyx_t_7sklearn_9ball_tree_ITYPE_t *)__pyx_v_self->idx_array->data); + __pyx_v_idx_array = ((__pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *)__pyx_v_self->idx_array->data); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":798 + /* "scikits/learn/ball_tree.pyx":798 * cdef DTYPE_t* data = <DTYPE_t*> self.data.data * cdef ITYPE_t* idx_array = <ITYPE_t*> self.idx_array.data * cdef DTYPE_t* node_centroid_arr = <DTYPE_t*>self.node_centroid_arr.data # <<<<<<<<<<<<<< * cdef NodeInfo* node_info_arr = <NodeInfo*> self.node_info_arr.data * */ - __pyx_v_node_centroid_arr = ((__pyx_t_7sklearn_9ball_tree_DTYPE_t *)__pyx_v_self->node_centroid_arr->data); + __pyx_v_node_centroid_arr = ((__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *)__pyx_v_self->node_centroid_arr->data); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":799 + /* "scikits/learn/ball_tree.pyx":799 * cdef ITYPE_t* idx_array = <ITYPE_t*> self.idx_array.data * cdef DTYPE_t* node_centroid_arr = <DTYPE_t*>self.node_centroid_arr.data * cdef NodeInfo* node_info_arr = <NodeInfo*> self.node_info_arr.data # <<<<<<<<<<<<<< * * cdef DTYPE_t p = self.p */ - __pyx_v_node_info_arr = ((struct __pyx_t_7sklearn_9ball_tree_NodeInfo *)__pyx_v_self->node_info_arr->data); + __pyx_v_node_info_arr = ((struct __pyx_t_7scikits_5learn_9ball_tree_NodeInfo *)__pyx_v_self->node_info_arr->data); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":801 + /* "scikits/learn/ball_tree.pyx":801 * cdef NodeInfo* node_info_arr = <NodeInfo*> self.node_info_arr.data * * cdef DTYPE_t p = self.p # <<<<<<<<<<<<<< @@ -5196,7 +5167,7 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_build_tree_(struct __pyx_obj_ */ __pyx_v_p = __pyx_v_self->p; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":802 + /* "scikits/learn/ball_tree.pyx":802 * * cdef DTYPE_t p = self.p * cdef ITYPE_t n_samples = self.data.shape[0] # <<<<<<<<<<<<<< @@ -5205,7 +5176,7 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_build_tree_(struct __pyx_obj_ */ __pyx_v_n_samples = (__pyx_v_self->data->dimensions[0]); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":803 + /* "scikits/learn/ball_tree.pyx":803 * cdef DTYPE_t p = self.p * cdef ITYPE_t n_samples = self.data.shape[0] * cdef ITYPE_t n_features = self.data.shape[1] # <<<<<<<<<<<<<< @@ -5214,7 +5185,7 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_build_tree_(struct __pyx_obj_ */ __pyx_v_n_features = (__pyx_v_self->data->dimensions[1]); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":809 + /* "scikits/learn/ball_tree.pyx":809 * cdef ITYPE_t i, i_node, i_parent * * cdef DTYPE_t* centroid = node_centroid_arr # <<<<<<<<<<<<<< @@ -5223,7 +5194,7 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_build_tree_(struct __pyx_obj_ */ __pyx_v_centroid = __pyx_v_node_centroid_arr; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":810 + /* "scikits/learn/ball_tree.pyx":810 * * cdef DTYPE_t* centroid = node_centroid_arr * cdef NodeInfo* node_info = node_info_arr # <<<<<<<<<<<<<< @@ -5232,7 +5203,7 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_build_tree_(struct __pyx_obj_ */ __pyx_v_node_info = __pyx_v_node_info_arr; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":816 + /* "scikits/learn/ball_tree.pyx":816 * #------------------------------------------------------------ * # take care of the root node * node_info.idx_start = 0 # <<<<<<<<<<<<<< @@ -5241,7 +5212,7 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_build_tree_(struct __pyx_obj_ */ __pyx_v_node_info->idx_start = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":817 + /* "scikits/learn/ball_tree.pyx":817 * # take care of the root node * node_info.idx_start = 0 * node_info.idx_end = n_samples # <<<<<<<<<<<<<< @@ -5250,7 +5221,7 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_build_tree_(struct __pyx_obj_ */ __pyx_v_node_info->idx_end = __pyx_v_n_samples; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":818 + /* "scikits/learn/ball_tree.pyx":818 * node_info.idx_start = 0 * node_info.idx_end = n_samples * n_points = n_samples # <<<<<<<<<<<<<< @@ -5259,16 +5230,16 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_build_tree_(struct __pyx_obj_ */ __pyx_v_n_points = __pyx_v_n_samples; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":822 + /* "scikits/learn/ball_tree.pyx":822 * # determine Node centroid * compute_centroid(centroid, data, idx_array, * n_features, n_samples) # <<<<<<<<<<<<<< * * # determine Node radius */ - __pyx_f_7sklearn_9ball_tree_compute_centroid(__pyx_v_centroid, __pyx_v_data, __pyx_v_idx_array, __pyx_v_n_features, __pyx_v_n_samples); + __pyx_f_7scikits_5learn_9ball_tree_compute_centroid(__pyx_v_centroid, __pyx_v_data, __pyx_v_idx_array, __pyx_v_n_features, __pyx_v_n_samples); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":825 + /* "scikits/learn/ball_tree.pyx":825 * * # determine Node radius * radius = 0 # <<<<<<<<<<<<<< @@ -5277,7 +5248,7 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_build_tree_(struct __pyx_obj_ */ __pyx_v_radius = 0.0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":826 + /* "scikits/learn/ball_tree.pyx":826 * # determine Node radius * radius = 0 * for i from node_info.idx_start <= i < node_info.idx_end: # <<<<<<<<<<<<<< @@ -5287,26 +5258,26 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_build_tree_(struct __pyx_obj_ __pyx_t_1 = __pyx_v_node_info->idx_end; for (__pyx_v_i = __pyx_v_node_info->idx_start; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":829 + /* "scikits/learn/ball_tree.pyx":829 * radius = dmax(radius, * dist_p(centroid, data + n_features * idx_array[i], * n_features, p)) # <<<<<<<<<<<<<< * node_info.radius = dist_from_dist_p(radius, p) * */ - __pyx_v_radius = __pyx_f_7sklearn_9ball_tree_dmax(__pyx_v_radius, __pyx_f_7sklearn_9ball_tree_dist_p(__pyx_v_centroid, (__pyx_v_data + (__pyx_v_n_features * (__pyx_v_idx_array[__pyx_v_i]))), __pyx_v_n_features, __pyx_v_p)); + __pyx_v_radius = __pyx_f_7scikits_5learn_9ball_tree_dmax(__pyx_v_radius, __pyx_f_7scikits_5learn_9ball_tree_dist_p(__pyx_v_centroid, (__pyx_v_data + (__pyx_v_n_features * (__pyx_v_idx_array[__pyx_v_i]))), __pyx_v_n_features, __pyx_v_p)); } - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":830 + /* "scikits/learn/ball_tree.pyx":830 * dist_p(centroid, data + n_features * idx_array[i], * n_features, p)) * node_info.radius = dist_from_dist_p(radius, p) # <<<<<<<<<<<<<< * * # check if this is a leaf */ - __pyx_v_node_info->radius = __pyx_f_7sklearn_9ball_tree_dist_from_dist_p(__pyx_v_radius, __pyx_v_p); + __pyx_v_node_info->radius = __pyx_f_7scikits_5learn_9ball_tree_dist_from_dist_p(__pyx_v_radius, __pyx_v_p); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":833 + /* "scikits/learn/ball_tree.pyx":833 * * # check if this is a leaf * if self.n_nodes == 1: # <<<<<<<<<<<<<< @@ -5316,7 +5287,7 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_build_tree_(struct __pyx_obj_ __pyx_t_2 = (__pyx_v_self->n_nodes == 1); if (__pyx_t_2) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":834 + /* "scikits/learn/ball_tree.pyx":834 * # check if this is a leaf * if self.n_nodes == 1: * node_info.is_leaf = 1 # <<<<<<<<<<<<<< @@ -5328,7 +5299,7 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_build_tree_(struct __pyx_obj_ } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":837 + /* "scikits/learn/ball_tree.pyx":837 * * else: * node_info.is_leaf = 0 # <<<<<<<<<<<<<< @@ -5337,27 +5308,27 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_build_tree_(struct __pyx_obj_ */ __pyx_v_node_info->is_leaf = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":841 + /* "scikits/learn/ball_tree.pyx":841 * # find dimension with largest spread * i_max = find_split_dim(data, idx_array + node_info.idx_start, * n_features, n_points) # <<<<<<<<<<<<<< * * # sort idx_array along this dimension */ - __pyx_v_i_max = __pyx_f_7sklearn_9ball_tree_find_split_dim(__pyx_v_data, (__pyx_v_idx_array + __pyx_v_node_info->idx_start), __pyx_v_n_features, __pyx_v_n_points); + __pyx_v_i_max = __pyx_f_7scikits_5learn_9ball_tree_find_split_dim(__pyx_v_data, (__pyx_v_idx_array + __pyx_v_node_info->idx_start), __pyx_v_n_features, __pyx_v_n_points); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":849 + /* "scikits/learn/ball_tree.pyx":849 * n_points / 2, * n_features, * n_points) # <<<<<<<<<<<<<< * * #------------------------------------------------------------ */ - __pyx_f_7sklearn_9ball_tree_partition_indices(__pyx_v_data, (__pyx_v_idx_array + __pyx_v_node_info->idx_start), __pyx_v_i_max, (__pyx_v_n_points / 2), __pyx_v_n_features, __pyx_v_n_points); + __pyx_f_7scikits_5learn_9ball_tree_partition_indices(__pyx_v_data, (__pyx_v_idx_array + __pyx_v_node_info->idx_start), __pyx_v_i_max, (__pyx_v_n_points / 2), __pyx_v_n_features, __pyx_v_n_points); } __pyx_L5:; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":853 + /* "scikits/learn/ball_tree.pyx":853 * #------------------------------------------------------------ * # cycle through all child nodes * for i_node from 1 <= i_node < self.n_nodes: # <<<<<<<<<<<<<< @@ -5367,7 +5338,7 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_build_tree_(struct __pyx_obj_ __pyx_t_1 = __pyx_v_self->n_nodes; for (__pyx_v_i_node = 1; __pyx_v_i_node < __pyx_t_1; __pyx_v_i_node++) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":854 + /* "scikits/learn/ball_tree.pyx":854 * # cycle through all child nodes * for i_node from 1 <= i_node < self.n_nodes: * i_parent = (i_node - 1) / 2 # <<<<<<<<<<<<<< @@ -5376,7 +5347,7 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_build_tree_(struct __pyx_obj_ */ __pyx_v_i_parent = ((__pyx_v_i_node - 1) / 2); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":855 + /* "scikits/learn/ball_tree.pyx":855 * for i_node from 1 <= i_node < self.n_nodes: * i_parent = (i_node - 1) / 2 * parent_info = node_info_arr + i_parent # <<<<<<<<<<<<<< @@ -5385,7 +5356,7 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_build_tree_(struct __pyx_obj_ */ __pyx_v_parent_info = (__pyx_v_node_info_arr + __pyx_v_i_parent); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":857 + /* "scikits/learn/ball_tree.pyx":857 * parent_info = node_info_arr + i_parent * * node_info = node_info_arr + i_node # <<<<<<<<<<<<<< @@ -5394,7 +5365,7 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_build_tree_(struct __pyx_obj_ */ __pyx_v_node_info = (__pyx_v_node_info_arr + __pyx_v_i_node); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":859 + /* "scikits/learn/ball_tree.pyx":859 * node_info = node_info_arr + i_node * * if parent_info.is_leaf: # <<<<<<<<<<<<<< @@ -5403,29 +5374,23 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_build_tree_(struct __pyx_obj_ */ if (__pyx_v_parent_info->is_leaf) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":860 + /* "scikits/learn/ball_tree.pyx":860 * * if parent_info.is_leaf: * raise ValueError("Fatal: parent is a leaf. Memory " # <<<<<<<<<<<<<< * "allocation is flawed") * */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_39), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_18)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_18)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_18)); - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L8; } __pyx_L8:; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":863 + /* "scikits/learn/ball_tree.pyx":863 * "allocation is flawed") * * if i_node < self.n_nodes / 2: # <<<<<<<<<<<<<< @@ -5435,7 +5400,7 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_build_tree_(struct __pyx_obj_ __pyx_t_2 = (__pyx_v_i_node < (__pyx_v_self->n_nodes / 2)); if (__pyx_t_2) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":864 + /* "scikits/learn/ball_tree.pyx":864 * * if i_node < self.n_nodes / 2: * node_info.is_leaf = 0 # <<<<<<<<<<<<<< @@ -5447,7 +5412,7 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_build_tree_(struct __pyx_obj_ } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":866 + /* "scikits/learn/ball_tree.pyx":866 * node_info.is_leaf = 0 * else: * node_info.is_leaf = 1 # <<<<<<<<<<<<<< @@ -5458,7 +5423,7 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_build_tree_(struct __pyx_obj_ } __pyx_L9:; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":868 + /* "scikits/learn/ball_tree.pyx":868 * node_info.is_leaf = 1 * * centroid = node_centroid_arr + i_node * n_features # <<<<<<<<<<<<<< @@ -5467,7 +5432,7 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_build_tree_(struct __pyx_obj_ */ __pyx_v_centroid = (__pyx_v_node_centroid_arr + (__pyx_v_i_node * __pyx_v_n_features)); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":871 + /* "scikits/learn/ball_tree.pyx":871 * * # find indices for this node * idx_start = parent_info.idx_start # <<<<<<<<<<<<<< @@ -5476,7 +5441,7 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_build_tree_(struct __pyx_obj_ */ __pyx_v_idx_start = __pyx_v_parent_info->idx_start; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":872 + /* "scikits/learn/ball_tree.pyx":872 * # find indices for this node * idx_start = parent_info.idx_start * idx_end = parent_info.idx_end # <<<<<<<<<<<<<< @@ -5485,7 +5450,7 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_build_tree_(struct __pyx_obj_ */ __pyx_v_idx_end = __pyx_v_parent_info->idx_end; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":874 + /* "scikits/learn/ball_tree.pyx":874 * idx_end = parent_info.idx_end * * if i_node % 2 == 1: # <<<<<<<<<<<<<< @@ -5495,7 +5460,7 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_build_tree_(struct __pyx_obj_ __pyx_t_2 = ((__pyx_v_i_node % 2) == 1); if (__pyx_t_2) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":875 + /* "scikits/learn/ball_tree.pyx":875 * * if i_node % 2 == 1: * idx_start = (idx_start + idx_end) / 2 # <<<<<<<<<<<<<< @@ -5507,7 +5472,7 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_build_tree_(struct __pyx_obj_ } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":877 + /* "scikits/learn/ball_tree.pyx":877 * idx_start = (idx_start + idx_end) / 2 * else: * idx_end = (idx_start + idx_end) / 2 # <<<<<<<<<<<<<< @@ -5518,7 +5483,7 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_build_tree_(struct __pyx_obj_ } __pyx_L10:; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":879 + /* "scikits/learn/ball_tree.pyx":879 * idx_end = (idx_start + idx_end) / 2 * * node_info.idx_start = idx_start # <<<<<<<<<<<<<< @@ -5527,7 +5492,7 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_build_tree_(struct __pyx_obj_ */ __pyx_v_node_info->idx_start = __pyx_v_idx_start; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":880 + /* "scikits/learn/ball_tree.pyx":880 * * node_info.idx_start = idx_start * node_info.idx_end = idx_end # <<<<<<<<<<<<<< @@ -5536,7 +5501,7 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_build_tree_(struct __pyx_obj_ */ __pyx_v_node_info->idx_end = __pyx_v_idx_end; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":882 + /* "scikits/learn/ball_tree.pyx":882 * node_info.idx_end = idx_end * * n_points = idx_end - idx_start # <<<<<<<<<<<<<< @@ -5545,37 +5510,39 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_build_tree_(struct __pyx_obj_ */ __pyx_v_n_points = (__pyx_v_idx_end - __pyx_v_idx_start); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":884 + /* "scikits/learn/ball_tree.pyx":887 + * raise ValueError("zero-sized node") + * + * elif n_points == 1: # <<<<<<<<<<<<<< + * #copy this point to centroid + * copy_array(centroid, + */ + switch (__pyx_v_n_points) { + + /* "scikits/learn/ball_tree.pyx":884 * n_points = idx_end - idx_start * * if n_points == 0: # <<<<<<<<<<<<<< * raise ValueError("zero-sized node") * */ - switch (__pyx_v_n_points) { case 0: - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":885 + /* "scikits/learn/ball_tree.pyx":885 * * if n_points == 0: * raise ValueError("zero-sized node") # <<<<<<<<<<<<<< * * elif n_points == 1: */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_19)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_19)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_19)); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_41), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} break; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":887 + /* "scikits/learn/ball_tree.pyx":887 * raise ValueError("zero-sized node") * * elif n_points == 1: # <<<<<<<<<<<<<< @@ -5584,16 +5551,16 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_build_tree_(struct __pyx_obj_ */ case 1: - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":891 + /* "scikits/learn/ball_tree.pyx":891 * copy_array(centroid, * data + idx_array[idx_start] * n_features, * n_features) # <<<<<<<<<<<<<< * * #store radius in array */ - __pyx_f_7sklearn_9ball_tree_copy_array(__pyx_v_centroid, (__pyx_v_data + ((__pyx_v_idx_array[__pyx_v_idx_start]) * __pyx_v_n_features)), __pyx_v_n_features); + __pyx_f_7scikits_5learn_9ball_tree_copy_array(__pyx_v_centroid, (__pyx_v_data + ((__pyx_v_idx_array[__pyx_v_idx_start]) * __pyx_v_n_features)), __pyx_v_n_features); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":894 + /* "scikits/learn/ball_tree.pyx":894 * * #store radius in array * node_info.radius = 0 # <<<<<<<<<<<<<< @@ -5602,7 +5569,7 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_build_tree_(struct __pyx_obj_ */ __pyx_v_node_info->radius = 0.0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":897 + /* "scikits/learn/ball_tree.pyx":897 * * #is a leaf * node_info.is_leaf = 1 # <<<<<<<<<<<<<< @@ -5613,16 +5580,16 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_build_tree_(struct __pyx_obj_ break; default: - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":902 + /* "scikits/learn/ball_tree.pyx":902 * # determine Node centroid * compute_centroid(centroid, data, idx_array + idx_start, * n_features, n_points) # <<<<<<<<<<<<<< * * # determine Node radius */ - __pyx_f_7sklearn_9ball_tree_compute_centroid(__pyx_v_centroid, __pyx_v_data, (__pyx_v_idx_array + __pyx_v_idx_start), __pyx_v_n_features, __pyx_v_n_points); + __pyx_f_7scikits_5learn_9ball_tree_compute_centroid(__pyx_v_centroid, __pyx_v_data, (__pyx_v_idx_array + __pyx_v_idx_start), __pyx_v_n_features, __pyx_v_n_points); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":905 + /* "scikits/learn/ball_tree.pyx":905 * * # determine Node radius * radius = 0 # <<<<<<<<<<<<<< @@ -5631,36 +5598,36 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_build_tree_(struct __pyx_obj_ */ __pyx_v_radius = 0.0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":906 + /* "scikits/learn/ball_tree.pyx":906 * # determine Node radius * radius = 0 * for i from idx_start <= i < idx_end: # <<<<<<<<<<<<<< * radius = dmax(radius, * dist_p(centroid, */ - __pyx_t_5 = __pyx_v_idx_end; - for (__pyx_v_i = __pyx_v_idx_start; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { + __pyx_t_4 = __pyx_v_idx_end; + for (__pyx_v_i = __pyx_v_idx_start; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":910 + /* "scikits/learn/ball_tree.pyx":910 * dist_p(centroid, * data + n_features * idx_array[i], * n_features, p)) # <<<<<<<<<<<<<< * node_info.radius = dist_from_dist_p(radius, p) * */ - __pyx_v_radius = __pyx_f_7sklearn_9ball_tree_dmax(__pyx_v_radius, __pyx_f_7sklearn_9ball_tree_dist_p(__pyx_v_centroid, (__pyx_v_data + (__pyx_v_n_features * (__pyx_v_idx_array[__pyx_v_i]))), __pyx_v_n_features, __pyx_v_p)); + __pyx_v_radius = __pyx_f_7scikits_5learn_9ball_tree_dmax(__pyx_v_radius, __pyx_f_7scikits_5learn_9ball_tree_dist_p(__pyx_v_centroid, (__pyx_v_data + (__pyx_v_n_features * (__pyx_v_idx_array[__pyx_v_i]))), __pyx_v_n_features, __pyx_v_p)); } - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":911 + /* "scikits/learn/ball_tree.pyx":911 * data + n_features * idx_array[i], * n_features, p)) * node_info.radius = dist_from_dist_p(radius, p) # <<<<<<<<<<<<<< * * if not node_info.is_leaf: */ - __pyx_v_node_info->radius = __pyx_f_7sklearn_9ball_tree_dist_from_dist_p(__pyx_v_radius, __pyx_v_p); + __pyx_v_node_info->radius = __pyx_f_7scikits_5learn_9ball_tree_dist_from_dist_p(__pyx_v_radius, __pyx_v_p); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":913 + /* "scikits/learn/ball_tree.pyx":913 * node_info.radius = dist_from_dist_p(radius, p) * * if not node_info.is_leaf: # <<<<<<<<<<<<<< @@ -5670,23 +5637,23 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_build_tree_(struct __pyx_obj_ __pyx_t_2 = (!__pyx_v_node_info->is_leaf); if (__pyx_t_2) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":916 + /* "scikits/learn/ball_tree.pyx":916 * # find dimension with largest spread * i_max = find_split_dim(data, idx_array + idx_start, * n_features, n_points) # <<<<<<<<<<<<<< * * # sort indices along this dimension */ - __pyx_v_i_max = __pyx_f_7sklearn_9ball_tree_find_split_dim(__pyx_v_data, (__pyx_v_idx_array + __pyx_v_idx_start), __pyx_v_n_features, __pyx_v_n_points); + __pyx_v_i_max = __pyx_f_7scikits_5learn_9ball_tree_find_split_dim(__pyx_v_data, (__pyx_v_idx_array + __pyx_v_idx_start), __pyx_v_n_features, __pyx_v_n_points); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":924 + /* "scikits/learn/ball_tree.pyx":924 * n_points / 2, * n_features, * n_points) # <<<<<<<<<<<<<< * * cdef void query_one_(BallTree self, */ - __pyx_f_7sklearn_9ball_tree_partition_indices(__pyx_v_data, (__pyx_v_idx_array + __pyx_v_idx_start), __pyx_v_i_max, (__pyx_v_n_points / 2), __pyx_v_n_features, __pyx_v_n_points); + __pyx_f_7scikits_5learn_9ball_tree_partition_indices(__pyx_v_data, (__pyx_v_idx_array + __pyx_v_idx_start), __pyx_v_i_max, (__pyx_v_n_points / 2), __pyx_v_n_features, __pyx_v_n_points); goto __pyx_L13; } __pyx_L13:; @@ -5697,13 +5664,12 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_build_tree_(struct __pyx_obj_ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_WriteUnraisable("sklearn.ball_tree.BallTree.build_tree_"); + __Pyx_WriteUnraisable("scikits.learn.ball_tree.BallTree.build_tree_"); __pyx_L0:; __Pyx_RefNannyFinishContext(); } -/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":926 +/* "scikits/learn/ball_tree.pyx":926 * n_points) * * cdef void query_one_(BallTree self, # <<<<<<<<<<<<<< @@ -5711,66 +5677,66 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_build_tree_(struct __pyx_obj_ * ITYPE_t k, */ -static void __pyx_f_7sklearn_9ball_tree_8BallTree_query_one_(struct __pyx_obj_7sklearn_9ball_tree_BallTree *__pyx_v_self, __pyx_t_7sklearn_9ball_tree_DTYPE_t *__pyx_v_pt, __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_k, __pyx_t_7sklearn_9ball_tree_DTYPE_t *__pyx_v_near_set_dist, __pyx_t_7sklearn_9ball_tree_ITYPE_t *__pyx_v_near_set_indx, struct __pyx_t_7sklearn_9ball_tree_stack *__pyx_v_node_stack, __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_use_max_heap) { - __pyx_t_7sklearn_9ball_tree_DTYPE_t *__pyx_v_data; - __pyx_t_7sklearn_9ball_tree_ITYPE_t *__pyx_v_idx_array; - __pyx_t_7sklearn_9ball_tree_DTYPE_t *__pyx_v_node_centroid_arr; - struct __pyx_t_7sklearn_9ball_tree_NodeInfo *__pyx_v_node_info_arr; - struct __pyx_t_7sklearn_9ball_tree_NodeInfo *__pyx_v_node_info; - __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_p; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_n_features; - __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_dist_pt; - __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_dist_p_LB; - __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_dist_p_LB_1; - __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_dist_p_LB_2; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_i; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_i1; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_i2; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_i_node; - struct __pyx_t_7sklearn_9ball_tree_stack_item __pyx_v_item; - __pyx_t_7sklearn_9ball_tree_DTYPE_t (*__pyx_v_heapqueue_largest)(__pyx_t_7sklearn_9ball_tree_DTYPE_t *, __pyx_t_7sklearn_9ball_tree_ITYPE_t); - void (*__pyx_v_heapqueue_insert)(__pyx_t_7sklearn_9ball_tree_DTYPE_t, __pyx_t_7sklearn_9ball_tree_ITYPE_t, __pyx_t_7sklearn_9ball_tree_DTYPE_t *, __pyx_t_7sklearn_9ball_tree_ITYPE_t *, __pyx_t_7sklearn_9ball_tree_ITYPE_t); +static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_query_one_(struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *__pyx_v_self, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *__pyx_v_pt, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_k, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *__pyx_v_near_set_dist, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *__pyx_v_near_set_indx, struct __pyx_t_7scikits_5learn_9ball_tree_stack *__pyx_v_node_stack, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_use_max_heap) { + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *__pyx_v_data; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *__pyx_v_idx_array; + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *__pyx_v_node_centroid_arr; + struct __pyx_t_7scikits_5learn_9ball_tree_NodeInfo *__pyx_v_node_info_arr; + struct __pyx_t_7scikits_5learn_9ball_tree_NodeInfo *__pyx_v_node_info; + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_p; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_n_features; + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_dist_pt; + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_dist_p_LB; + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_dist_p_LB_1; + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_dist_p_LB_2; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_i; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_i1; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_i2; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_i_node; + struct __pyx_t_7scikits_5learn_9ball_tree_stack_item __pyx_v_item; + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t (*__pyx_v_heapqueue_largest)(__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t); + void (*__pyx_v_heapqueue_insert)(__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t); int __pyx_t_1; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_t_2; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_t_2; __Pyx_RefNannySetupContext("query_one_"); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":933 + /* "scikits/learn/ball_tree.pyx":933 * stack* node_stack, * ITYPE_t use_max_heap): * cdef DTYPE_t* data = <DTYPE_t*> self.data.data # <<<<<<<<<<<<<< * cdef ITYPE_t* idx_array = <ITYPE_t*> self.idx_array.data * cdef DTYPE_t* node_centroid_arr = <DTYPE_t*>self.node_centroid_arr.data */ - __pyx_v_data = ((__pyx_t_7sklearn_9ball_tree_DTYPE_t *)__pyx_v_self->data->data); + __pyx_v_data = ((__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *)__pyx_v_self->data->data); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":934 + /* "scikits/learn/ball_tree.pyx":934 * ITYPE_t use_max_heap): * cdef DTYPE_t* data = <DTYPE_t*> self.data.data * cdef ITYPE_t* idx_array = <ITYPE_t*> self.idx_array.data # <<<<<<<<<<<<<< * cdef DTYPE_t* node_centroid_arr = <DTYPE_t*>self.node_centroid_arr.data * cdef NodeInfo* node_info_arr = <NodeInfo*> self.node_info_arr.data */ - __pyx_v_idx_array = ((__pyx_t_7sklearn_9ball_tree_ITYPE_t *)__pyx_v_self->idx_array->data); + __pyx_v_idx_array = ((__pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *)__pyx_v_self->idx_array->data); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":935 + /* "scikits/learn/ball_tree.pyx":935 * cdef DTYPE_t* data = <DTYPE_t*> self.data.data * cdef ITYPE_t* idx_array = <ITYPE_t*> self.idx_array.data * cdef DTYPE_t* node_centroid_arr = <DTYPE_t*>self.node_centroid_arr.data # <<<<<<<<<<<<<< * cdef NodeInfo* node_info_arr = <NodeInfo*> self.node_info_arr.data * cdef NodeInfo* node_info = node_info_arr */ - __pyx_v_node_centroid_arr = ((__pyx_t_7sklearn_9ball_tree_DTYPE_t *)__pyx_v_self->node_centroid_arr->data); + __pyx_v_node_centroid_arr = ((__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *)__pyx_v_self->node_centroid_arr->data); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":936 + /* "scikits/learn/ball_tree.pyx":936 * cdef ITYPE_t* idx_array = <ITYPE_t*> self.idx_array.data * cdef DTYPE_t* node_centroid_arr = <DTYPE_t*>self.node_centroid_arr.data * cdef NodeInfo* node_info_arr = <NodeInfo*> self.node_info_arr.data # <<<<<<<<<<<<<< * cdef NodeInfo* node_info = node_info_arr * */ - __pyx_v_node_info_arr = ((struct __pyx_t_7sklearn_9ball_tree_NodeInfo *)__pyx_v_self->node_info_arr->data); + __pyx_v_node_info_arr = ((struct __pyx_t_7scikits_5learn_9ball_tree_NodeInfo *)__pyx_v_self->node_info_arr->data); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":937 + /* "scikits/learn/ball_tree.pyx":937 * cdef DTYPE_t* node_centroid_arr = <DTYPE_t*>self.node_centroid_arr.data * cdef NodeInfo* node_info_arr = <NodeInfo*> self.node_info_arr.data * cdef NodeInfo* node_info = node_info_arr # <<<<<<<<<<<<<< @@ -5779,7 +5745,7 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_query_one_(struct __pyx_obj_7 */ __pyx_v_node_info = __pyx_v_node_info_arr; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":939 + /* "scikits/learn/ball_tree.pyx":939 * cdef NodeInfo* node_info = node_info_arr * * cdef DTYPE_t p = self.p # <<<<<<<<<<<<<< @@ -5788,7 +5754,7 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_query_one_(struct __pyx_obj_7 */ __pyx_v_p = __pyx_v_self->p; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":940 + /* "scikits/learn/ball_tree.pyx":940 * * cdef DTYPE_t p = self.p * cdef ITYPE_t n_features = self.data.shape[1] # <<<<<<<<<<<<<< @@ -5797,7 +5763,7 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_query_one_(struct __pyx_obj_7 */ __pyx_v_n_features = (__pyx_v_self->data->dimensions[1]); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":947 + /* "scikits/learn/ball_tree.pyx":947 * cdef stack_item item * * item.i_node = 0 # <<<<<<<<<<<<<< @@ -5806,25 +5772,25 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_query_one_(struct __pyx_obj_7 */ __pyx_v_item.i_node = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":948 + /* "scikits/learn/ball_tree.pyx":948 * * item.i_node = 0 * item.dist_p_LB = calc_dist_p_LB(pt, node_centroid_arr, # <<<<<<<<<<<<<< * node_info.radius, * n_features, p) */ - __pyx_v_item.dist_p_LB = __pyx_f_7sklearn_9ball_tree_calc_dist_p_LB(__pyx_v_pt, __pyx_v_node_centroid_arr, __pyx_v_node_info->radius, __pyx_v_n_features, __pyx_v_p); + __pyx_v_item.dist_p_LB = __pyx_f_7scikits_5learn_9ball_tree_calc_dist_p_LB(__pyx_v_pt, __pyx_v_node_centroid_arr, __pyx_v_node_info->radius, __pyx_v_n_features, __pyx_v_p); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":951 + /* "scikits/learn/ball_tree.pyx":951 * node_info.radius, * n_features, p) * stack_push(node_stack, item) # <<<<<<<<<<<<<< * * # create pointers to the priority-queue/max-heap functions. */ - __pyx_f_7sklearn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); + __pyx_f_7scikits_5learn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":959 + /* "scikits/learn/ball_tree.pyx":959 * ITYPE_t*, ITYPE_t) * * if use_max_heap: # <<<<<<<<<<<<<< @@ -5833,48 +5799,48 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_query_one_(struct __pyx_obj_7 */ if (__pyx_v_use_max_heap) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":960 + /* "scikits/learn/ball_tree.pyx":960 * * if use_max_heap: * heapqueue_largest = &max_heap_largest # <<<<<<<<<<<<<< * heapqueue_insert = &max_heap_insert * else: */ - __pyx_v_heapqueue_largest = (&__pyx_f_7sklearn_9ball_tree_max_heap_largest); + __pyx_v_heapqueue_largest = (&__pyx_f_7scikits_5learn_9ball_tree_max_heap_largest); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":961 + /* "scikits/learn/ball_tree.pyx":961 * if use_max_heap: * heapqueue_largest = &max_heap_largest * heapqueue_insert = &max_heap_insert # <<<<<<<<<<<<<< * else: * heapqueue_largest = &pqueue_largest */ - __pyx_v_heapqueue_insert = (&__pyx_f_7sklearn_9ball_tree_max_heap_insert); + __pyx_v_heapqueue_insert = (&__pyx_f_7scikits_5learn_9ball_tree_max_heap_insert); goto __pyx_L3; } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":963 + /* "scikits/learn/ball_tree.pyx":963 * heapqueue_insert = &max_heap_insert * else: * heapqueue_largest = &pqueue_largest # <<<<<<<<<<<<<< * heapqueue_insert = &pqueue_insert * */ - __pyx_v_heapqueue_largest = (&__pyx_f_7sklearn_9ball_tree_pqueue_largest); + __pyx_v_heapqueue_largest = (&__pyx_f_7scikits_5learn_9ball_tree_pqueue_largest); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":964 + /* "scikits/learn/ball_tree.pyx":964 * else: * heapqueue_largest = &pqueue_largest * heapqueue_insert = &pqueue_insert # <<<<<<<<<<<<<< * * while(node_stack.n > 0): */ - __pyx_v_heapqueue_insert = (&__pyx_f_7sklearn_9ball_tree_pqueue_insert); + __pyx_v_heapqueue_insert = (&__pyx_f_7scikits_5learn_9ball_tree_pqueue_insert); } __pyx_L3:; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":966 + /* "scikits/learn/ball_tree.pyx":966 * heapqueue_insert = &pqueue_insert * * while(node_stack.n > 0): # <<<<<<<<<<<<<< @@ -5885,16 +5851,16 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_query_one_(struct __pyx_obj_7 __pyx_t_1 = (__pyx_v_node_stack->n > 0); if (!__pyx_t_1) break; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":967 + /* "scikits/learn/ball_tree.pyx":967 * * while(node_stack.n > 0): * item = stack_pop(node_stack) # <<<<<<<<<<<<<< * i_node = item.i_node * dist_p_LB = item.dist_p_LB */ - __pyx_v_item = __pyx_f_7sklearn_9ball_tree_stack_pop(__pyx_v_node_stack); + __pyx_v_item = __pyx_f_7scikits_5learn_9ball_tree_stack_pop(__pyx_v_node_stack); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":968 + /* "scikits/learn/ball_tree.pyx":968 * while(node_stack.n > 0): * item = stack_pop(node_stack) * i_node = item.i_node # <<<<<<<<<<<<<< @@ -5903,7 +5869,7 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_query_one_(struct __pyx_obj_7 */ __pyx_v_i_node = __pyx_v_item.i_node; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":969 + /* "scikits/learn/ball_tree.pyx":969 * item = stack_pop(node_stack) * i_node = item.i_node * dist_p_LB = item.dist_p_LB # <<<<<<<<<<<<<< @@ -5912,7 +5878,7 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_query_one_(struct __pyx_obj_7 */ __pyx_v_dist_p_LB = __pyx_v_item.dist_p_LB; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":971 + /* "scikits/learn/ball_tree.pyx":971 * dist_p_LB = item.dist_p_LB * * node_info = node_info_arr + i_node # <<<<<<<<<<<<<< @@ -5921,7 +5887,7 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_query_one_(struct __pyx_obj_7 */ __pyx_v_node_info = (__pyx_v_node_info_arr + __pyx_v_i_node); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":975 + /* "scikits/learn/ball_tree.pyx":975 * #------------------------------------------------------------ * # Case 1: query point is outside node radius * if dist_p_LB >= heapqueue_largest(near_set_dist, k): # <<<<<<<<<<<<<< @@ -5931,7 +5897,7 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_query_one_(struct __pyx_obj_7 __pyx_t_1 = (__pyx_v_dist_p_LB >= __pyx_v_heapqueue_largest(__pyx_v_near_set_dist, __pyx_v_k)); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":976 + /* "scikits/learn/ball_tree.pyx":976 * # Case 1: query point is outside node radius * if dist_p_LB >= heapqueue_largest(near_set_dist, k): * continue # <<<<<<<<<<<<<< @@ -5942,7 +5908,7 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_query_one_(struct __pyx_obj_7 goto __pyx_L6; } - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":980 + /* "scikits/learn/ball_tree.pyx":980 * #------------------------------------------------------------ * # Case 2: this is a leaf node. Update set of nearby points * elif node_info.is_leaf: # <<<<<<<<<<<<<< @@ -5951,7 +5917,7 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_query_one_(struct __pyx_obj_7 */ if (__pyx_v_node_info->is_leaf) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":981 + /* "scikits/learn/ball_tree.pyx":981 * # Case 2: this is a leaf node. Update set of nearby points * elif node_info.is_leaf: * for i from node_info.idx_start <= i < node_info.idx_end: # <<<<<<<<<<<<<< @@ -5961,16 +5927,16 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_query_one_(struct __pyx_obj_7 __pyx_t_2 = __pyx_v_node_info->idx_end; for (__pyx_v_i = __pyx_v_node_info->idx_start; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":984 + /* "scikits/learn/ball_tree.pyx":984 * dist_pt = dist_p(pt, * data + n_features * idx_array[i], * n_features, p) # <<<<<<<<<<<<<< * * if dist_pt < heapqueue_largest(near_set_dist, k): */ - __pyx_v_dist_pt = __pyx_f_7sklearn_9ball_tree_dist_p(__pyx_v_pt, (__pyx_v_data + (__pyx_v_n_features * (__pyx_v_idx_array[__pyx_v_i]))), __pyx_v_n_features, __pyx_v_p); + __pyx_v_dist_pt = __pyx_f_7scikits_5learn_9ball_tree_dist_p(__pyx_v_pt, (__pyx_v_data + (__pyx_v_n_features * (__pyx_v_idx_array[__pyx_v_i]))), __pyx_v_n_features, __pyx_v_p); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":986 + /* "scikits/learn/ball_tree.pyx":986 * n_features, p) * * if dist_pt < heapqueue_largest(near_set_dist, k): # <<<<<<<<<<<<<< @@ -5980,7 +5946,7 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_query_one_(struct __pyx_obj_7 __pyx_t_1 = (__pyx_v_dist_pt < __pyx_v_heapqueue_largest(__pyx_v_near_set_dist, __pyx_v_k)); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":988 + /* "scikits/learn/ball_tree.pyx":988 * if dist_pt < heapqueue_largest(near_set_dist, k): * heapqueue_insert(dist_pt, idx_array[i], * near_set_dist, near_set_indx, k) # <<<<<<<<<<<<<< @@ -5996,7 +5962,7 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_query_one_(struct __pyx_obj_7 } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":994 + /* "scikits/learn/ball_tree.pyx":994 * # starting with the one whose centroid is closest * else: * i1 = 2 * i_node + 1 # <<<<<<<<<<<<<< @@ -6005,7 +5971,7 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_query_one_(struct __pyx_obj_7 */ __pyx_v_i1 = ((2 * __pyx_v_i_node) + 1); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":995 + /* "scikits/learn/ball_tree.pyx":995 * else: * i1 = 2 * i_node + 1 * i2 = i1 + 1 # <<<<<<<<<<<<<< @@ -6014,25 +5980,25 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_query_one_(struct __pyx_obj_7 */ __pyx_v_i2 = (__pyx_v_i1 + 1); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":999 + /* "scikits/learn/ball_tree.pyx":999 * + i1 * n_features), * node_info_arr[i1].radius, * n_features, p) # <<<<<<<<<<<<<< * dist_p_LB_2 = calc_dist_p_LB(pt, (node_centroid_arr * + i2 * n_features), */ - __pyx_v_dist_p_LB_1 = __pyx_f_7sklearn_9ball_tree_calc_dist_p_LB(__pyx_v_pt, (__pyx_v_node_centroid_arr + (__pyx_v_i1 * __pyx_v_n_features)), (__pyx_v_node_info_arr[__pyx_v_i1]).radius, __pyx_v_n_features, __pyx_v_p); + __pyx_v_dist_p_LB_1 = __pyx_f_7scikits_5learn_9ball_tree_calc_dist_p_LB(__pyx_v_pt, (__pyx_v_node_centroid_arr + (__pyx_v_i1 * __pyx_v_n_features)), (__pyx_v_node_info_arr[__pyx_v_i1]).radius, __pyx_v_n_features, __pyx_v_p); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1003 + /* "scikits/learn/ball_tree.pyx":1003 * + i2 * n_features), * node_info_arr[i2].radius, * n_features, p) # <<<<<<<<<<<<<< * * # append children to stack: last-in-first-out */ - __pyx_v_dist_p_LB_2 = __pyx_f_7sklearn_9ball_tree_calc_dist_p_LB(__pyx_v_pt, (__pyx_v_node_centroid_arr + (__pyx_v_i2 * __pyx_v_n_features)), (__pyx_v_node_info_arr[__pyx_v_i2]).radius, __pyx_v_n_features, __pyx_v_p); + __pyx_v_dist_p_LB_2 = __pyx_f_7scikits_5learn_9ball_tree_calc_dist_p_LB(__pyx_v_pt, (__pyx_v_node_centroid_arr + (__pyx_v_i2 * __pyx_v_n_features)), (__pyx_v_node_info_arr[__pyx_v_i2]).radius, __pyx_v_n_features, __pyx_v_p); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1006 + /* "scikits/learn/ball_tree.pyx":1006 * * # append children to stack: last-in-first-out * if dist_p_LB_2 <= dist_p_LB_1: # <<<<<<<<<<<<<< @@ -6042,7 +6008,7 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_query_one_(struct __pyx_obj_7 __pyx_t_1 = (__pyx_v_dist_p_LB_2 <= __pyx_v_dist_p_LB_1); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1007 + /* "scikits/learn/ball_tree.pyx":1007 * # append children to stack: last-in-first-out * if dist_p_LB_2 <= dist_p_LB_1: * item.i_node = i1 # <<<<<<<<<<<<<< @@ -6051,7 +6017,7 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_query_one_(struct __pyx_obj_7 */ __pyx_v_item.i_node = __pyx_v_i1; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1008 + /* "scikits/learn/ball_tree.pyx":1008 * if dist_p_LB_2 <= dist_p_LB_1: * item.i_node = i1 * item.dist_p_LB = dist_p_LB_1 # <<<<<<<<<<<<<< @@ -6060,16 +6026,16 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_query_one_(struct __pyx_obj_7 */ __pyx_v_item.dist_p_LB = __pyx_v_dist_p_LB_1; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1009 + /* "scikits/learn/ball_tree.pyx":1009 * item.i_node = i1 * item.dist_p_LB = dist_p_LB_1 * stack_push(node_stack, item) # <<<<<<<<<<<<<< * * item.i_node = i2 */ - __pyx_f_7sklearn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); + __pyx_f_7scikits_5learn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1011 + /* "scikits/learn/ball_tree.pyx":1011 * stack_push(node_stack, item) * * item.i_node = i2 # <<<<<<<<<<<<<< @@ -6078,7 +6044,7 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_query_one_(struct __pyx_obj_7 */ __pyx_v_item.i_node = __pyx_v_i2; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1012 + /* "scikits/learn/ball_tree.pyx":1012 * * item.i_node = i2 * item.dist_p_LB = dist_p_LB_2 # <<<<<<<<<<<<<< @@ -6087,19 +6053,19 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_query_one_(struct __pyx_obj_7 */ __pyx_v_item.dist_p_LB = __pyx_v_dist_p_LB_2; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1013 + /* "scikits/learn/ball_tree.pyx":1013 * item.i_node = i2 * item.dist_p_LB = dist_p_LB_2 * stack_push(node_stack, item) # <<<<<<<<<<<<<< * * else: */ - __pyx_f_7sklearn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); + __pyx_f_7scikits_5learn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); goto __pyx_L10; } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1016 + /* "scikits/learn/ball_tree.pyx":1016 * * else: * item.i_node = i2 # <<<<<<<<<<<<<< @@ -6108,7 +6074,7 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_query_one_(struct __pyx_obj_7 */ __pyx_v_item.i_node = __pyx_v_i2; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1017 + /* "scikits/learn/ball_tree.pyx":1017 * else: * item.i_node = i2 * item.dist_p_LB = dist_p_LB_2 # <<<<<<<<<<<<<< @@ -6117,16 +6083,16 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_query_one_(struct __pyx_obj_7 */ __pyx_v_item.dist_p_LB = __pyx_v_dist_p_LB_2; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1018 + /* "scikits/learn/ball_tree.pyx":1018 * item.i_node = i2 * item.dist_p_LB = dist_p_LB_2 * stack_push(node_stack, item) # <<<<<<<<<<<<<< * * item.i_node = i1 */ - __pyx_f_7sklearn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); + __pyx_f_7scikits_5learn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1020 + /* "scikits/learn/ball_tree.pyx":1020 * stack_push(node_stack, item) * * item.i_node = i1 # <<<<<<<<<<<<<< @@ -6135,7 +6101,7 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_query_one_(struct __pyx_obj_7 */ __pyx_v_item.i_node = __pyx_v_i1; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1021 + /* "scikits/learn/ball_tree.pyx":1021 * * item.i_node = i1 * item.dist_p_LB = dist_p_LB_1 # <<<<<<<<<<<<<< @@ -6144,14 +6110,14 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_query_one_(struct __pyx_obj_7 */ __pyx_v_item.dist_p_LB = __pyx_v_dist_p_LB_1; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1022 + /* "scikits/learn/ball_tree.pyx":1022 * item.i_node = i1 * item.dist_p_LB = dist_p_LB_1 * stack_push(node_stack, item) # <<<<<<<<<<<<<< * * for i from 0 <= i < k: */ - __pyx_f_7sklearn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); + __pyx_f_7scikits_5learn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); } __pyx_L10:; } @@ -6159,7 +6125,7 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_query_one_(struct __pyx_obj_7 __pyx_L4_continue:; } - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1024 + /* "scikits/learn/ball_tree.pyx":1024 * stack_push(node_stack, item) * * for i from 0 <= i < k: # <<<<<<<<<<<<<< @@ -6169,20 +6135,20 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_query_one_(struct __pyx_obj_7 __pyx_t_2 = __pyx_v_k; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1025 + /* "scikits/learn/ball_tree.pyx":1025 * * for i from 0 <= i < k: * near_set_dist[i] = dist_from_dist_p(near_set_dist[i], p) # <<<<<<<<<<<<<< * * cdef ITYPE_t query_radius_count_(BallTree self, */ - (__pyx_v_near_set_dist[__pyx_v_i]) = __pyx_f_7sklearn_9ball_tree_dist_from_dist_p((__pyx_v_near_set_dist[__pyx_v_i]), __pyx_v_p); + (__pyx_v_near_set_dist[__pyx_v_i]) = __pyx_f_7scikits_5learn_9ball_tree_dist_from_dist_p((__pyx_v_near_set_dist[__pyx_v_i]), __pyx_v_p); } __Pyx_RefNannyFinishContext(); } -/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1027 +/* "scikits/learn/ball_tree.pyx":1027 * near_set_dist[i] = dist_from_dist_p(near_set_dist[i], p) * * cdef ITYPE_t query_radius_count_(BallTree self, # <<<<<<<<<<<<<< @@ -6190,63 +6156,63 @@ static void __pyx_f_7sklearn_9ball_tree_8BallTree_query_one_(struct __pyx_obj_7 * stack* node_stack): */ -static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTree_query_radius_count_(struct __pyx_obj_7sklearn_9ball_tree_BallTree *__pyx_v_self, __pyx_t_7sklearn_9ball_tree_DTYPE_t *__pyx_v_pt, __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_r, struct __pyx_t_7sklearn_9ball_tree_stack *__pyx_v_node_stack) { - __pyx_t_7sklearn_9ball_tree_DTYPE_t *__pyx_v_data; - __pyx_t_7sklearn_9ball_tree_ITYPE_t *__pyx_v_idx_array; - __pyx_t_7sklearn_9ball_tree_DTYPE_t *__pyx_v_node_centroid_arr; - struct __pyx_t_7sklearn_9ball_tree_NodeInfo *__pyx_v_node_info_arr; - struct __pyx_t_7sklearn_9ball_tree_NodeInfo *__pyx_v_node_info; - __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_p; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_n_features; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_i; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_i_node; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_count; - __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_r_p; - __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_dist_pt; - struct __pyx_t_7sklearn_9ball_tree_stack_item __pyx_v_item; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_r; +static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball_tree_8BallTree_query_radius_count_(struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *__pyx_v_self, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *__pyx_v_pt, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_r, struct __pyx_t_7scikits_5learn_9ball_tree_stack *__pyx_v_node_stack) { + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *__pyx_v_data; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *__pyx_v_idx_array; + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *__pyx_v_node_centroid_arr; + struct __pyx_t_7scikits_5learn_9ball_tree_NodeInfo *__pyx_v_node_info_arr; + struct __pyx_t_7scikits_5learn_9ball_tree_NodeInfo *__pyx_v_node_info; + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_p; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_n_features; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_i; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_i_node; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_count; + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_r_p; + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_dist_pt; + struct __pyx_t_7scikits_5learn_9ball_tree_stack_item __pyx_v_item; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_r; int __pyx_t_1; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_t_2; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_t_2; long __pyx_t_3; __Pyx_RefNannySetupContext("query_radius_count_"); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1030 + /* "scikits/learn/ball_tree.pyx":1030 * DTYPE_t* pt, DTYPE_t r, * stack* node_stack): * cdef DTYPE_t* data = <DTYPE_t*> self.data.data # <<<<<<<<<<<<<< * cdef ITYPE_t* idx_array = <ITYPE_t*> self.idx_array.data * cdef DTYPE_t* node_centroid_arr = <DTYPE_t*>self.node_centroid_arr.data */ - __pyx_v_data = ((__pyx_t_7sklearn_9ball_tree_DTYPE_t *)__pyx_v_self->data->data); + __pyx_v_data = ((__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *)__pyx_v_self->data->data); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1031 + /* "scikits/learn/ball_tree.pyx":1031 * stack* node_stack): * cdef DTYPE_t* data = <DTYPE_t*> self.data.data * cdef ITYPE_t* idx_array = <ITYPE_t*> self.idx_array.data # <<<<<<<<<<<<<< * cdef DTYPE_t* node_centroid_arr = <DTYPE_t*>self.node_centroid_arr.data * cdef NodeInfo* node_info_arr = <NodeInfo*> self.node_info_arr.data */ - __pyx_v_idx_array = ((__pyx_t_7sklearn_9ball_tree_ITYPE_t *)__pyx_v_self->idx_array->data); + __pyx_v_idx_array = ((__pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *)__pyx_v_self->idx_array->data); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1032 + /* "scikits/learn/ball_tree.pyx":1032 * cdef DTYPE_t* data = <DTYPE_t*> self.data.data * cdef ITYPE_t* idx_array = <ITYPE_t*> self.idx_array.data * cdef DTYPE_t* node_centroid_arr = <DTYPE_t*>self.node_centroid_arr.data # <<<<<<<<<<<<<< * cdef NodeInfo* node_info_arr = <NodeInfo*> self.node_info_arr.data * cdef NodeInfo* node_info = node_info_arr */ - __pyx_v_node_centroid_arr = ((__pyx_t_7sklearn_9ball_tree_DTYPE_t *)__pyx_v_self->node_centroid_arr->data); + __pyx_v_node_centroid_arr = ((__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *)__pyx_v_self->node_centroid_arr->data); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1033 + /* "scikits/learn/ball_tree.pyx":1033 * cdef ITYPE_t* idx_array = <ITYPE_t*> self.idx_array.data * cdef DTYPE_t* node_centroid_arr = <DTYPE_t*>self.node_centroid_arr.data * cdef NodeInfo* node_info_arr = <NodeInfo*> self.node_info_arr.data # <<<<<<<<<<<<<< * cdef NodeInfo* node_info = node_info_arr * */ - __pyx_v_node_info_arr = ((struct __pyx_t_7sklearn_9ball_tree_NodeInfo *)__pyx_v_self->node_info_arr->data); + __pyx_v_node_info_arr = ((struct __pyx_t_7scikits_5learn_9ball_tree_NodeInfo *)__pyx_v_self->node_info_arr->data); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1034 + /* "scikits/learn/ball_tree.pyx":1034 * cdef DTYPE_t* node_centroid_arr = <DTYPE_t*>self.node_centroid_arr.data * cdef NodeInfo* node_info_arr = <NodeInfo*> self.node_info_arr.data * cdef NodeInfo* node_info = node_info_arr # <<<<<<<<<<<<<< @@ -6255,7 +6221,7 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre */ __pyx_v_node_info = __pyx_v_node_info_arr; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1036 + /* "scikits/learn/ball_tree.pyx":1036 * cdef NodeInfo* node_info = node_info_arr * * cdef DTYPE_t p = self.p # <<<<<<<<<<<<<< @@ -6264,7 +6230,7 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre */ __pyx_v_p = __pyx_v_self->p; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1037 + /* "scikits/learn/ball_tree.pyx":1037 * * cdef DTYPE_t p = self.p * cdef ITYPE_t n_features = self.data.shape[1] # <<<<<<<<<<<<<< @@ -6273,7 +6239,7 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre */ __pyx_v_n_features = (__pyx_v_self->data->dimensions[1]); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1039 + /* "scikits/learn/ball_tree.pyx":1039 * cdef ITYPE_t n_features = self.data.shape[1] * cdef ITYPE_t i, i_node * cdef ITYPE_t count = 0 # <<<<<<<<<<<<<< @@ -6282,16 +6248,16 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre */ __pyx_v_count = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1040 + /* "scikits/learn/ball_tree.pyx":1040 * cdef ITYPE_t i, i_node * cdef ITYPE_t count = 0 * cdef DTYPE_t r_p = dist_p_from_dist(r, p) # <<<<<<<<<<<<<< * cdef DTYPE_t dist_pt * */ - __pyx_v_r_p = __pyx_f_7sklearn_9ball_tree_dist_p_from_dist(__pyx_v_r, __pyx_v_p); + __pyx_v_r_p = __pyx_f_7scikits_5learn_9ball_tree_dist_p_from_dist(__pyx_v_r, __pyx_v_p); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1045 + /* "scikits/learn/ball_tree.pyx":1045 * cdef stack_item item * * item.i_node = 0 # <<<<<<<<<<<<<< @@ -6300,16 +6266,16 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre */ __pyx_v_item.i_node = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1046 + /* "scikits/learn/ball_tree.pyx":1046 * * item.i_node = 0 * stack_push(node_stack, item) # <<<<<<<<<<<<<< * * while(node_stack.n > 0): */ - __pyx_f_7sklearn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); + __pyx_f_7scikits_5learn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1048 + /* "scikits/learn/ball_tree.pyx":1048 * stack_push(node_stack, item) * * while(node_stack.n > 0): # <<<<<<<<<<<<<< @@ -6320,16 +6286,16 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre __pyx_t_1 = (__pyx_v_node_stack->n > 0); if (!__pyx_t_1) break; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1049 + /* "scikits/learn/ball_tree.pyx":1049 * * while(node_stack.n > 0): * item = stack_pop(node_stack) # <<<<<<<<<<<<<< * i_node = item.i_node * node_info = node_info_arr + i_node */ - __pyx_v_item = __pyx_f_7sklearn_9ball_tree_stack_pop(__pyx_v_node_stack); + __pyx_v_item = __pyx_f_7scikits_5learn_9ball_tree_stack_pop(__pyx_v_node_stack); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1050 + /* "scikits/learn/ball_tree.pyx":1050 * while(node_stack.n > 0): * item = stack_pop(node_stack) * i_node = item.i_node # <<<<<<<<<<<<<< @@ -6338,7 +6304,7 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre */ __pyx_v_i_node = __pyx_v_item.i_node; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1051 + /* "scikits/learn/ball_tree.pyx":1051 * item = stack_pop(node_stack) * i_node = item.i_node * node_info = node_info_arr + i_node # <<<<<<<<<<<<<< @@ -6347,16 +6313,16 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre */ __pyx_v_node_info = (__pyx_v_node_info_arr + __pyx_v_i_node); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1054 + /* "scikits/learn/ball_tree.pyx":1054 * * dist_pt = dist(pt, node_centroid_arr + n_features * i_node, * n_features, p) # <<<<<<<<<<<<<< * * #------------------------------------------------------------ */ - __pyx_v_dist_pt = __pyx_f_7sklearn_9ball_tree_dist(__pyx_v_pt, (__pyx_v_node_centroid_arr + (__pyx_v_n_features * __pyx_v_i_node)), __pyx_v_n_features, __pyx_v_p); + __pyx_v_dist_pt = __pyx_f_7scikits_5learn_9ball_tree_dist(__pyx_v_pt, (__pyx_v_node_centroid_arr + (__pyx_v_n_features * __pyx_v_i_node)), __pyx_v_n_features, __pyx_v_p); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1059 + /* "scikits/learn/ball_tree.pyx":1059 * # Case 1: all node points are outside distance r. * # prune this branch. * if dist_pt - node_info.radius > r: # <<<<<<<<<<<<<< @@ -6366,7 +6332,7 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre __pyx_t_1 = ((__pyx_v_dist_pt - __pyx_v_node_info->radius) > __pyx_v_r); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1060 + /* "scikits/learn/ball_tree.pyx":1060 * # prune this branch. * if dist_pt - node_info.radius > r: * continue # <<<<<<<<<<<<<< @@ -6377,7 +6343,7 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre goto __pyx_L5; } - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1065 + /* "scikits/learn/ball_tree.pyx":1065 * # Case 2: all node points are within distance r * # add all points * elif dist_pt + node_info.radius < r: # <<<<<<<<<<<<<< @@ -6387,18 +6353,18 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre __pyx_t_1 = ((__pyx_v_dist_pt + __pyx_v_node_info->radius) < __pyx_v_r); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1066 + /* "scikits/learn/ball_tree.pyx":1066 * # add all points * elif dist_pt + node_info.radius < r: * count += (node_info.idx_end - node_info.idx_start) # <<<<<<<<<<<<<< * * #------------------------------------------------------------ */ - __pyx_v_count += (__pyx_v_node_info->idx_end - __pyx_v_node_info->idx_start); + __pyx_v_count = (__pyx_v_count + (__pyx_v_node_info->idx_end - __pyx_v_node_info->idx_start)); goto __pyx_L5; } - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1071 + /* "scikits/learn/ball_tree.pyx":1071 * # Case 3: this is a leaf node. Go through all points to * # determine if they fall within radius * elif node_info.is_leaf: # <<<<<<<<<<<<<< @@ -6407,7 +6373,7 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre */ if (__pyx_v_node_info->is_leaf) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1072 + /* "scikits/learn/ball_tree.pyx":1072 * # determine if they fall within radius * elif node_info.is_leaf: * for i from node_info.idx_start <= i < node_info.idx_end: # <<<<<<<<<<<<<< @@ -6417,16 +6383,16 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre __pyx_t_2 = __pyx_v_node_info->idx_end; for (__pyx_v_i = __pyx_v_node_info->idx_start; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1075 + /* "scikits/learn/ball_tree.pyx":1075 * dist_pt = dist_p(pt, * data + idx_array[i] * n_features, * n_features, p) # <<<<<<<<<<<<<< * if dist_pt <= r_p: * count += 1 */ - __pyx_v_dist_pt = __pyx_f_7sklearn_9ball_tree_dist_p(__pyx_v_pt, (__pyx_v_data + ((__pyx_v_idx_array[__pyx_v_i]) * __pyx_v_n_features)), __pyx_v_n_features, __pyx_v_p); + __pyx_v_dist_pt = __pyx_f_7scikits_5learn_9ball_tree_dist_p(__pyx_v_pt, (__pyx_v_data + ((__pyx_v_idx_array[__pyx_v_i]) * __pyx_v_n_features)), __pyx_v_n_features, __pyx_v_p); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1076 + /* "scikits/learn/ball_tree.pyx":1076 * data + idx_array[i] * n_features, * n_features, p) * if dist_pt <= r_p: # <<<<<<<<<<<<<< @@ -6436,14 +6402,14 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre __pyx_t_1 = (__pyx_v_dist_pt <= __pyx_v_r_p); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1077 + /* "scikits/learn/ball_tree.pyx":1077 * n_features, p) * if dist_pt <= r_p: * count += 1 # <<<<<<<<<<<<<< * * #------------------------------------------------------------ */ - __pyx_v_count += 1; + __pyx_v_count = (__pyx_v_count + 1); goto __pyx_L8; } __pyx_L8:; @@ -6452,7 +6418,7 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1082 + /* "scikits/learn/ball_tree.pyx":1082 * # Case 4: Node is not a leaf. Recursively query subnodes * else: * item.i_node = 2 * i_node + 1 # <<<<<<<<<<<<<< @@ -6461,16 +6427,16 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre */ __pyx_v_item.i_node = ((2 * __pyx_v_i_node) + 1); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1083 + /* "scikits/learn/ball_tree.pyx":1083 * else: * item.i_node = 2 * i_node + 1 * stack_push(node_stack, item) # <<<<<<<<<<<<<< * * item.i_node = i = 2 * i_node + 2 */ - __pyx_f_7sklearn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); + __pyx_f_7scikits_5learn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1085 + /* "scikits/learn/ball_tree.pyx":1085 * stack_push(node_stack, item) * * item.i_node = i = 2 * i_node + 2 # <<<<<<<<<<<<<< @@ -6481,20 +6447,20 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre __pyx_v_item.i_node = __pyx_t_3; __pyx_v_i = __pyx_t_3; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1086 + /* "scikits/learn/ball_tree.pyx":1086 * * item.i_node = i = 2 * i_node + 2 * stack_push(node_stack, item) # <<<<<<<<<<<<<< * * return count */ - __pyx_f_7sklearn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); + __pyx_f_7scikits_5learn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); } __pyx_L5:; __pyx_L3_continue:; } - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1088 + /* "scikits/learn/ball_tree.pyx":1088 * stack_push(node_stack, item) * * return count # <<<<<<<<<<<<<< @@ -6510,7 +6476,7 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1090 +/* "scikits/learn/ball_tree.pyx":1090 * return count * * cdef ITYPE_t query_radius_idx_only_(BallTree self, # <<<<<<<<<<<<<< @@ -6518,63 +6484,63 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre * ITYPE_t* indices, */ -static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTree_query_radius_idx_only_(struct __pyx_obj_7sklearn_9ball_tree_BallTree *__pyx_v_self, __pyx_t_7sklearn_9ball_tree_DTYPE_t *__pyx_v_pt, __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_r, __pyx_t_7sklearn_9ball_tree_ITYPE_t *__pyx_v_indices, struct __pyx_t_7sklearn_9ball_tree_stack *__pyx_v_node_stack) { - __pyx_t_7sklearn_9ball_tree_DTYPE_t *__pyx_v_data; - __pyx_t_7sklearn_9ball_tree_ITYPE_t *__pyx_v_idx_array; - __pyx_t_7sklearn_9ball_tree_DTYPE_t *__pyx_v_node_centroid_arr; - struct __pyx_t_7sklearn_9ball_tree_NodeInfo *__pyx_v_node_info_arr; - struct __pyx_t_7sklearn_9ball_tree_NodeInfo *__pyx_v_node_info; - __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_p; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_n_features; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_i; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_i_node; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_idx_i; - __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_r_p; - __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_dist_pt; - struct __pyx_t_7sklearn_9ball_tree_stack_item __pyx_v_item; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_r; +static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball_tree_8BallTree_query_radius_idx_only_(struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *__pyx_v_self, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *__pyx_v_pt, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_r, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *__pyx_v_indices, struct __pyx_t_7scikits_5learn_9ball_tree_stack *__pyx_v_node_stack) { + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *__pyx_v_data; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *__pyx_v_idx_array; + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *__pyx_v_node_centroid_arr; + struct __pyx_t_7scikits_5learn_9ball_tree_NodeInfo *__pyx_v_node_info_arr; + struct __pyx_t_7scikits_5learn_9ball_tree_NodeInfo *__pyx_v_node_info; + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_p; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_n_features; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_i; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_i_node; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_idx_i; + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_r_p; + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_dist_pt; + struct __pyx_t_7scikits_5learn_9ball_tree_stack_item __pyx_v_item; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_r; int __pyx_t_1; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_t_2; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_t_2; long __pyx_t_3; __Pyx_RefNannySetupContext("query_radius_idx_only_"); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1094 + /* "scikits/learn/ball_tree.pyx":1094 * ITYPE_t* indices, * stack* node_stack): * cdef DTYPE_t* data = <DTYPE_t*> self.data.data # <<<<<<<<<<<<<< * cdef ITYPE_t* idx_array = <ITYPE_t*> self.idx_array.data * cdef DTYPE_t* node_centroid_arr = <DTYPE_t*>self.node_centroid_arr.data */ - __pyx_v_data = ((__pyx_t_7sklearn_9ball_tree_DTYPE_t *)__pyx_v_self->data->data); + __pyx_v_data = ((__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *)__pyx_v_self->data->data); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1095 + /* "scikits/learn/ball_tree.pyx":1095 * stack* node_stack): * cdef DTYPE_t* data = <DTYPE_t*> self.data.data * cdef ITYPE_t* idx_array = <ITYPE_t*> self.idx_array.data # <<<<<<<<<<<<<< * cdef DTYPE_t* node_centroid_arr = <DTYPE_t*>self.node_centroid_arr.data * cdef NodeInfo* node_info_arr = <NodeInfo*> self.node_info_arr.data */ - __pyx_v_idx_array = ((__pyx_t_7sklearn_9ball_tree_ITYPE_t *)__pyx_v_self->idx_array->data); + __pyx_v_idx_array = ((__pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *)__pyx_v_self->idx_array->data); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1096 + /* "scikits/learn/ball_tree.pyx":1096 * cdef DTYPE_t* data = <DTYPE_t*> self.data.data * cdef ITYPE_t* idx_array = <ITYPE_t*> self.idx_array.data * cdef DTYPE_t* node_centroid_arr = <DTYPE_t*>self.node_centroid_arr.data # <<<<<<<<<<<<<< * cdef NodeInfo* node_info_arr = <NodeInfo*> self.node_info_arr.data * cdef NodeInfo* node_info = node_info_arr */ - __pyx_v_node_centroid_arr = ((__pyx_t_7sklearn_9ball_tree_DTYPE_t *)__pyx_v_self->node_centroid_arr->data); + __pyx_v_node_centroid_arr = ((__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *)__pyx_v_self->node_centroid_arr->data); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1097 + /* "scikits/learn/ball_tree.pyx":1097 * cdef ITYPE_t* idx_array = <ITYPE_t*> self.idx_array.data * cdef DTYPE_t* node_centroid_arr = <DTYPE_t*>self.node_centroid_arr.data * cdef NodeInfo* node_info_arr = <NodeInfo*> self.node_info_arr.data # <<<<<<<<<<<<<< * cdef NodeInfo* node_info = node_info_arr * */ - __pyx_v_node_info_arr = ((struct __pyx_t_7sklearn_9ball_tree_NodeInfo *)__pyx_v_self->node_info_arr->data); + __pyx_v_node_info_arr = ((struct __pyx_t_7scikits_5learn_9ball_tree_NodeInfo *)__pyx_v_self->node_info_arr->data); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1098 + /* "scikits/learn/ball_tree.pyx":1098 * cdef DTYPE_t* node_centroid_arr = <DTYPE_t*>self.node_centroid_arr.data * cdef NodeInfo* node_info_arr = <NodeInfo*> self.node_info_arr.data * cdef NodeInfo* node_info = node_info_arr # <<<<<<<<<<<<<< @@ -6583,7 +6549,7 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre */ __pyx_v_node_info = __pyx_v_node_info_arr; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1100 + /* "scikits/learn/ball_tree.pyx":1100 * cdef NodeInfo* node_info = node_info_arr * * cdef DTYPE_t p = self.p # <<<<<<<<<<<<<< @@ -6592,7 +6558,7 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre */ __pyx_v_p = __pyx_v_self->p; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1101 + /* "scikits/learn/ball_tree.pyx":1101 * * cdef DTYPE_t p = self.p * cdef ITYPE_t n_features = self.data.shape[1] # <<<<<<<<<<<<<< @@ -6601,7 +6567,7 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre */ __pyx_v_n_features = (__pyx_v_self->data->dimensions[1]); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1103 + /* "scikits/learn/ball_tree.pyx":1103 * cdef ITYPE_t n_features = self.data.shape[1] * cdef ITYPE_t i, i_node * cdef ITYPE_t idx_i = 0 # <<<<<<<<<<<<<< @@ -6610,16 +6576,16 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre */ __pyx_v_idx_i = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1104 + /* "scikits/learn/ball_tree.pyx":1104 * cdef ITYPE_t i, i_node * cdef ITYPE_t idx_i = 0 * cdef DTYPE_t r_p = dist_p_from_dist(r, p) # <<<<<<<<<<<<<< * cdef DTYPE_t dist_pt * */ - __pyx_v_r_p = __pyx_f_7sklearn_9ball_tree_dist_p_from_dist(__pyx_v_r, __pyx_v_p); + __pyx_v_r_p = __pyx_f_7scikits_5learn_9ball_tree_dist_p_from_dist(__pyx_v_r, __pyx_v_p); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1109 + /* "scikits/learn/ball_tree.pyx":1109 * cdef stack_item item * * item.i_node = 0 # <<<<<<<<<<<<<< @@ -6628,16 +6594,16 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre */ __pyx_v_item.i_node = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1110 + /* "scikits/learn/ball_tree.pyx":1110 * * item.i_node = 0 * stack_push(node_stack, item) # <<<<<<<<<<<<<< * * while(node_stack.n > 0): */ - __pyx_f_7sklearn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); + __pyx_f_7scikits_5learn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1112 + /* "scikits/learn/ball_tree.pyx":1112 * stack_push(node_stack, item) * * while(node_stack.n > 0): # <<<<<<<<<<<<<< @@ -6648,16 +6614,16 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre __pyx_t_1 = (__pyx_v_node_stack->n > 0); if (!__pyx_t_1) break; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1113 + /* "scikits/learn/ball_tree.pyx":1113 * * while(node_stack.n > 0): * item = stack_pop(node_stack) # <<<<<<<<<<<<<< * i_node = item.i_node * node_info = node_info_arr + i_node */ - __pyx_v_item = __pyx_f_7sklearn_9ball_tree_stack_pop(__pyx_v_node_stack); + __pyx_v_item = __pyx_f_7scikits_5learn_9ball_tree_stack_pop(__pyx_v_node_stack); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1114 + /* "scikits/learn/ball_tree.pyx":1114 * while(node_stack.n > 0): * item = stack_pop(node_stack) * i_node = item.i_node # <<<<<<<<<<<<<< @@ -6666,7 +6632,7 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre */ __pyx_v_i_node = __pyx_v_item.i_node; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1115 + /* "scikits/learn/ball_tree.pyx":1115 * item = stack_pop(node_stack) * i_node = item.i_node * node_info = node_info_arr + i_node # <<<<<<<<<<<<<< @@ -6675,16 +6641,16 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre */ __pyx_v_node_info = (__pyx_v_node_info_arr + __pyx_v_i_node); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1118 + /* "scikits/learn/ball_tree.pyx":1118 * * dist_pt = dist(pt, node_centroid_arr + n_features * i_node, * n_features, p) # <<<<<<<<<<<<<< * * #------------------------------------------------------------ */ - __pyx_v_dist_pt = __pyx_f_7sklearn_9ball_tree_dist(__pyx_v_pt, (__pyx_v_node_centroid_arr + (__pyx_v_n_features * __pyx_v_i_node)), __pyx_v_n_features, __pyx_v_p); + __pyx_v_dist_pt = __pyx_f_7scikits_5learn_9ball_tree_dist(__pyx_v_pt, (__pyx_v_node_centroid_arr + (__pyx_v_n_features * __pyx_v_i_node)), __pyx_v_n_features, __pyx_v_p); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1123 + /* "scikits/learn/ball_tree.pyx":1123 * # Case 1: all node points are outside distance r. * # prune this branch. * if dist_pt - node_info.radius > r: # <<<<<<<<<<<<<< @@ -6694,7 +6660,7 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre __pyx_t_1 = ((__pyx_v_dist_pt - __pyx_v_node_info->radius) > __pyx_v_r); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1124 + /* "scikits/learn/ball_tree.pyx":1124 * # prune this branch. * if dist_pt - node_info.radius > r: * continue # <<<<<<<<<<<<<< @@ -6705,7 +6671,7 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre goto __pyx_L5; } - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1129 + /* "scikits/learn/ball_tree.pyx":1129 * # Case 2: all node points are within distance r * # add all points * elif dist_pt + node_info.radius < r: # <<<<<<<<<<<<<< @@ -6715,7 +6681,7 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre __pyx_t_1 = ((__pyx_v_dist_pt + __pyx_v_node_info->radius) < __pyx_v_r); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1130 + /* "scikits/learn/ball_tree.pyx":1130 * # add all points * elif dist_pt + node_info.radius < r: * for i from node_info.idx_start <= i < node_info.idx_end: # <<<<<<<<<<<<<< @@ -6725,7 +6691,7 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre __pyx_t_2 = __pyx_v_node_info->idx_end; for (__pyx_v_i = __pyx_v_node_info->idx_start; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1131 + /* "scikits/learn/ball_tree.pyx":1131 * elif dist_pt + node_info.radius < r: * for i from node_info.idx_start <= i < node_info.idx_end: * indices[idx_i] = idx_array[i] # <<<<<<<<<<<<<< @@ -6734,19 +6700,19 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre */ (__pyx_v_indices[__pyx_v_idx_i]) = (__pyx_v_idx_array[__pyx_v_i]); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1132 + /* "scikits/learn/ball_tree.pyx":1132 * for i from node_info.idx_start <= i < node_info.idx_end: * indices[idx_i] = idx_array[i] * idx_i += 1 # <<<<<<<<<<<<<< * * #------------------------------------------------------------ */ - __pyx_v_idx_i += 1; + __pyx_v_idx_i = (__pyx_v_idx_i + 1); } goto __pyx_L5; } - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1137 + /* "scikits/learn/ball_tree.pyx":1137 * # Case 3: this is a leaf node. Go through all points to * # determine if they fall within radius * elif node_info.is_leaf: # <<<<<<<<<<<<<< @@ -6755,7 +6721,7 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre */ if (__pyx_v_node_info->is_leaf) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1138 + /* "scikits/learn/ball_tree.pyx":1138 * # determine if they fall within radius * elif node_info.is_leaf: * for i from node_info.idx_start <= i < node_info.idx_end: # <<<<<<<<<<<<<< @@ -6765,16 +6731,16 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre __pyx_t_2 = __pyx_v_node_info->idx_end; for (__pyx_v_i = __pyx_v_node_info->idx_start; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1141 + /* "scikits/learn/ball_tree.pyx":1141 * dist_pt = dist_p(pt, * data + idx_array[i] * n_features, * n_features, p) # <<<<<<<<<<<<<< * if dist_pt <= r_p: * indices[idx_i] = idx_array[i] */ - __pyx_v_dist_pt = __pyx_f_7sklearn_9ball_tree_dist_p(__pyx_v_pt, (__pyx_v_data + ((__pyx_v_idx_array[__pyx_v_i]) * __pyx_v_n_features)), __pyx_v_n_features, __pyx_v_p); + __pyx_v_dist_pt = __pyx_f_7scikits_5learn_9ball_tree_dist_p(__pyx_v_pt, (__pyx_v_data + ((__pyx_v_idx_array[__pyx_v_i]) * __pyx_v_n_features)), __pyx_v_n_features, __pyx_v_p); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1142 + /* "scikits/learn/ball_tree.pyx":1142 * data + idx_array[i] * n_features, * n_features, p) * if dist_pt <= r_p: # <<<<<<<<<<<<<< @@ -6784,7 +6750,7 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre __pyx_t_1 = (__pyx_v_dist_pt <= __pyx_v_r_p); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1143 + /* "scikits/learn/ball_tree.pyx":1143 * n_features, p) * if dist_pt <= r_p: * indices[idx_i] = idx_array[i] # <<<<<<<<<<<<<< @@ -6793,14 +6759,14 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre */ (__pyx_v_indices[__pyx_v_idx_i]) = (__pyx_v_idx_array[__pyx_v_i]); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1144 + /* "scikits/learn/ball_tree.pyx":1144 * if dist_pt <= r_p: * indices[idx_i] = idx_array[i] * idx_i += 1 # <<<<<<<<<<<<<< * * #------------------------------------------------------------ */ - __pyx_v_idx_i += 1; + __pyx_v_idx_i = (__pyx_v_idx_i + 1); goto __pyx_L10; } __pyx_L10:; @@ -6809,7 +6775,7 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1149 + /* "scikits/learn/ball_tree.pyx":1149 * # Case 4: Node is not a leaf. Recursively query subnodes * else: * item.i_node = 2 * i_node + 1 # <<<<<<<<<<<<<< @@ -6818,16 +6784,16 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre */ __pyx_v_item.i_node = ((2 * __pyx_v_i_node) + 1); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1150 + /* "scikits/learn/ball_tree.pyx":1150 * else: * item.i_node = 2 * i_node + 1 * stack_push(node_stack, item) # <<<<<<<<<<<<<< * * item.i_node = i = 2 * i_node + 2 */ - __pyx_f_7sklearn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); + __pyx_f_7scikits_5learn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1152 + /* "scikits/learn/ball_tree.pyx":1152 * stack_push(node_stack, item) * * item.i_node = i = 2 * i_node + 2 # <<<<<<<<<<<<<< @@ -6838,20 +6804,20 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre __pyx_v_item.i_node = __pyx_t_3; __pyx_v_i = __pyx_t_3; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1153 + /* "scikits/learn/ball_tree.pyx":1153 * * item.i_node = i = 2 * i_node + 2 * stack_push(node_stack, item) # <<<<<<<<<<<<<< * * return idx_i */ - __pyx_f_7sklearn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); + __pyx_f_7scikits_5learn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); } __pyx_L5:; __pyx_L3_continue:; } - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1155 + /* "scikits/learn/ball_tree.pyx":1155 * stack_push(node_stack, item) * * return idx_i # <<<<<<<<<<<<<< @@ -6867,7 +6833,7 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1157 +/* "scikits/learn/ball_tree.pyx":1157 * return idx_i * * cdef ITYPE_t query_radius_distances_(BallTree self, # <<<<<<<<<<<<<< @@ -6875,63 +6841,63 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre * ITYPE_t* indices, */ -static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTree_query_radius_distances_(struct __pyx_obj_7sklearn_9ball_tree_BallTree *__pyx_v_self, __pyx_t_7sklearn_9ball_tree_DTYPE_t *__pyx_v_pt, __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_r, __pyx_t_7sklearn_9ball_tree_ITYPE_t *__pyx_v_indices, __pyx_t_7sklearn_9ball_tree_DTYPE_t *__pyx_v_distances, struct __pyx_t_7sklearn_9ball_tree_stack *__pyx_v_node_stack) { - __pyx_t_7sklearn_9ball_tree_DTYPE_t *__pyx_v_data; - __pyx_t_7sklearn_9ball_tree_ITYPE_t *__pyx_v_idx_array; - __pyx_t_7sklearn_9ball_tree_DTYPE_t *__pyx_v_node_centroid_arr; - struct __pyx_t_7sklearn_9ball_tree_NodeInfo *__pyx_v_node_info_arr; - struct __pyx_t_7sklearn_9ball_tree_NodeInfo *__pyx_v_node_info; - __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_p; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_n_features; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_i; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_i_node; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_idx_i; - __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_r_p; - __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_dist_pt; - struct __pyx_t_7sklearn_9ball_tree_stack_item __pyx_v_item; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_r; +static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball_tree_8BallTree_query_radius_distances_(struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *__pyx_v_self, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *__pyx_v_pt, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_r, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *__pyx_v_indices, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *__pyx_v_distances, struct __pyx_t_7scikits_5learn_9ball_tree_stack *__pyx_v_node_stack) { + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *__pyx_v_data; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *__pyx_v_idx_array; + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *__pyx_v_node_centroid_arr; + struct __pyx_t_7scikits_5learn_9ball_tree_NodeInfo *__pyx_v_node_info_arr; + struct __pyx_t_7scikits_5learn_9ball_tree_NodeInfo *__pyx_v_node_info; + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_p; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_n_features; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_i; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_i_node; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_idx_i; + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_r_p; + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_dist_pt; + struct __pyx_t_7scikits_5learn_9ball_tree_stack_item __pyx_v_item; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_r; int __pyx_t_1; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_t_2; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_t_2; long __pyx_t_3; __Pyx_RefNannySetupContext("query_radius_distances_"); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1162 + /* "scikits/learn/ball_tree.pyx":1162 * DTYPE_t* distances, * stack* node_stack): * cdef DTYPE_t* data = <DTYPE_t*> self.data.data # <<<<<<<<<<<<<< * cdef ITYPE_t* idx_array = <ITYPE_t*> self.idx_array.data * cdef DTYPE_t* node_centroid_arr = <DTYPE_t*>self.node_centroid_arr.data */ - __pyx_v_data = ((__pyx_t_7sklearn_9ball_tree_DTYPE_t *)__pyx_v_self->data->data); + __pyx_v_data = ((__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *)__pyx_v_self->data->data); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1163 + /* "scikits/learn/ball_tree.pyx":1163 * stack* node_stack): * cdef DTYPE_t* data = <DTYPE_t*> self.data.data * cdef ITYPE_t* idx_array = <ITYPE_t*> self.idx_array.data # <<<<<<<<<<<<<< * cdef DTYPE_t* node_centroid_arr = <DTYPE_t*>self.node_centroid_arr.data * cdef NodeInfo* node_info_arr = <NodeInfo*> self.node_info_arr.data */ - __pyx_v_idx_array = ((__pyx_t_7sklearn_9ball_tree_ITYPE_t *)__pyx_v_self->idx_array->data); + __pyx_v_idx_array = ((__pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *)__pyx_v_self->idx_array->data); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1164 + /* "scikits/learn/ball_tree.pyx":1164 * cdef DTYPE_t* data = <DTYPE_t*> self.data.data * cdef ITYPE_t* idx_array = <ITYPE_t*> self.idx_array.data * cdef DTYPE_t* node_centroid_arr = <DTYPE_t*>self.node_centroid_arr.data # <<<<<<<<<<<<<< * cdef NodeInfo* node_info_arr = <NodeInfo*> self.node_info_arr.data * cdef NodeInfo* node_info = node_info_arr */ - __pyx_v_node_centroid_arr = ((__pyx_t_7sklearn_9ball_tree_DTYPE_t *)__pyx_v_self->node_centroid_arr->data); + __pyx_v_node_centroid_arr = ((__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *)__pyx_v_self->node_centroid_arr->data); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1165 + /* "scikits/learn/ball_tree.pyx":1165 * cdef ITYPE_t* idx_array = <ITYPE_t*> self.idx_array.data * cdef DTYPE_t* node_centroid_arr = <DTYPE_t*>self.node_centroid_arr.data * cdef NodeInfo* node_info_arr = <NodeInfo*> self.node_info_arr.data # <<<<<<<<<<<<<< * cdef NodeInfo* node_info = node_info_arr * */ - __pyx_v_node_info_arr = ((struct __pyx_t_7sklearn_9ball_tree_NodeInfo *)__pyx_v_self->node_info_arr->data); + __pyx_v_node_info_arr = ((struct __pyx_t_7scikits_5learn_9ball_tree_NodeInfo *)__pyx_v_self->node_info_arr->data); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1166 + /* "scikits/learn/ball_tree.pyx":1166 * cdef DTYPE_t* node_centroid_arr = <DTYPE_t*>self.node_centroid_arr.data * cdef NodeInfo* node_info_arr = <NodeInfo*> self.node_info_arr.data * cdef NodeInfo* node_info = node_info_arr # <<<<<<<<<<<<<< @@ -6940,7 +6906,7 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre */ __pyx_v_node_info = __pyx_v_node_info_arr; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1168 + /* "scikits/learn/ball_tree.pyx":1168 * cdef NodeInfo* node_info = node_info_arr * * cdef DTYPE_t p = self.p # <<<<<<<<<<<<<< @@ -6949,7 +6915,7 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre */ __pyx_v_p = __pyx_v_self->p; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1169 + /* "scikits/learn/ball_tree.pyx":1169 * * cdef DTYPE_t p = self.p * cdef ITYPE_t n_features = self.data.shape[1] # <<<<<<<<<<<<<< @@ -6958,7 +6924,7 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre */ __pyx_v_n_features = (__pyx_v_self->data->dimensions[1]); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1171 + /* "scikits/learn/ball_tree.pyx":1171 * cdef ITYPE_t n_features = self.data.shape[1] * cdef ITYPE_t i, i_node * cdef ITYPE_t idx_i = 0 # <<<<<<<<<<<<<< @@ -6967,16 +6933,16 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre */ __pyx_v_idx_i = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1172 + /* "scikits/learn/ball_tree.pyx":1172 * cdef ITYPE_t i, i_node * cdef ITYPE_t idx_i = 0 * cdef DTYPE_t r_p = dist_p_from_dist(r, p) # <<<<<<<<<<<<<< * cdef DTYPE_t dist_pt * */ - __pyx_v_r_p = __pyx_f_7sklearn_9ball_tree_dist_p_from_dist(__pyx_v_r, __pyx_v_p); + __pyx_v_r_p = __pyx_f_7scikits_5learn_9ball_tree_dist_p_from_dist(__pyx_v_r, __pyx_v_p); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1177 + /* "scikits/learn/ball_tree.pyx":1177 * cdef stack_item item * * item.i_node = 0 # <<<<<<<<<<<<<< @@ -6985,16 +6951,16 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre */ __pyx_v_item.i_node = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1178 + /* "scikits/learn/ball_tree.pyx":1178 * * item.i_node = 0 * stack_push(node_stack, item) # <<<<<<<<<<<<<< * * while(node_stack.n > 0): */ - __pyx_f_7sklearn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); + __pyx_f_7scikits_5learn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1180 + /* "scikits/learn/ball_tree.pyx":1180 * stack_push(node_stack, item) * * while(node_stack.n > 0): # <<<<<<<<<<<<<< @@ -7005,16 +6971,16 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre __pyx_t_1 = (__pyx_v_node_stack->n > 0); if (!__pyx_t_1) break; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1181 + /* "scikits/learn/ball_tree.pyx":1181 * * while(node_stack.n > 0): * item = stack_pop(node_stack) # <<<<<<<<<<<<<< * i_node = item.i_node * node_info = node_info_arr + i_node */ - __pyx_v_item = __pyx_f_7sklearn_9ball_tree_stack_pop(__pyx_v_node_stack); + __pyx_v_item = __pyx_f_7scikits_5learn_9ball_tree_stack_pop(__pyx_v_node_stack); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1182 + /* "scikits/learn/ball_tree.pyx":1182 * while(node_stack.n > 0): * item = stack_pop(node_stack) * i_node = item.i_node # <<<<<<<<<<<<<< @@ -7023,7 +6989,7 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre */ __pyx_v_i_node = __pyx_v_item.i_node; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1183 + /* "scikits/learn/ball_tree.pyx":1183 * item = stack_pop(node_stack) * i_node = item.i_node * node_info = node_info_arr + i_node # <<<<<<<<<<<<<< @@ -7032,16 +6998,16 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre */ __pyx_v_node_info = (__pyx_v_node_info_arr + __pyx_v_i_node); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1186 + /* "scikits/learn/ball_tree.pyx":1186 * * dist_pt = dist(pt, node_centroid_arr + n_features * i_node, * n_features, p) # <<<<<<<<<<<<<< * * #------------------------------------------------------------ */ - __pyx_v_dist_pt = __pyx_f_7sklearn_9ball_tree_dist(__pyx_v_pt, (__pyx_v_node_centroid_arr + (__pyx_v_n_features * __pyx_v_i_node)), __pyx_v_n_features, __pyx_v_p); + __pyx_v_dist_pt = __pyx_f_7scikits_5learn_9ball_tree_dist(__pyx_v_pt, (__pyx_v_node_centroid_arr + (__pyx_v_n_features * __pyx_v_i_node)), __pyx_v_n_features, __pyx_v_p); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1191 + /* "scikits/learn/ball_tree.pyx":1191 * # Case 1: all node points are outside distance r. * # prune this branch. * if dist_pt - node_info.radius > r: # <<<<<<<<<<<<<< @@ -7051,7 +7017,7 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre __pyx_t_1 = ((__pyx_v_dist_pt - __pyx_v_node_info->radius) > __pyx_v_r); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1192 + /* "scikits/learn/ball_tree.pyx":1192 * # prune this branch. * if dist_pt - node_info.radius > r: * continue # <<<<<<<<<<<<<< @@ -7062,7 +7028,7 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre goto __pyx_L5; } - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1197 + /* "scikits/learn/ball_tree.pyx":1197 * # Case 2: all node points are within distance r * # add all points * elif dist_pt + node_info.radius < r: # <<<<<<<<<<<<<< @@ -7072,7 +7038,7 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre __pyx_t_1 = ((__pyx_v_dist_pt + __pyx_v_node_info->radius) < __pyx_v_r); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1198 + /* "scikits/learn/ball_tree.pyx":1198 * # add all points * elif dist_pt + node_info.radius < r: * for i from node_info.idx_start <= i < node_info.idx_end: # <<<<<<<<<<<<<< @@ -7082,16 +7048,16 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre __pyx_t_2 = __pyx_v_node_info->idx_end; for (__pyx_v_i = __pyx_v_node_info->idx_start; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1201 + /* "scikits/learn/ball_tree.pyx":1201 * dist_pt = dist(pt, * data + idx_array[i] * n_features, * n_features, p) # <<<<<<<<<<<<<< * indices[idx_i] = idx_array[i] * distances[idx_i] = dist_pt */ - __pyx_v_dist_pt = __pyx_f_7sklearn_9ball_tree_dist(__pyx_v_pt, (__pyx_v_data + ((__pyx_v_idx_array[__pyx_v_i]) * __pyx_v_n_features)), __pyx_v_n_features, __pyx_v_p); + __pyx_v_dist_pt = __pyx_f_7scikits_5learn_9ball_tree_dist(__pyx_v_pt, (__pyx_v_data + ((__pyx_v_idx_array[__pyx_v_i]) * __pyx_v_n_features)), __pyx_v_n_features, __pyx_v_p); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1202 + /* "scikits/learn/ball_tree.pyx":1202 * data + idx_array[i] * n_features, * n_features, p) * indices[idx_i] = idx_array[i] # <<<<<<<<<<<<<< @@ -7100,7 +7066,7 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre */ (__pyx_v_indices[__pyx_v_idx_i]) = (__pyx_v_idx_array[__pyx_v_i]); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1203 + /* "scikits/learn/ball_tree.pyx":1203 * n_features, p) * indices[idx_i] = idx_array[i] * distances[idx_i] = dist_pt # <<<<<<<<<<<<<< @@ -7109,19 +7075,19 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre */ (__pyx_v_distances[__pyx_v_idx_i]) = __pyx_v_dist_pt; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1204 + /* "scikits/learn/ball_tree.pyx":1204 * indices[idx_i] = idx_array[i] * distances[idx_i] = dist_pt * idx_i += 1 # <<<<<<<<<<<<<< * * #------------------------------------------------------------ */ - __pyx_v_idx_i += 1; + __pyx_v_idx_i = (__pyx_v_idx_i + 1); } goto __pyx_L5; } - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1209 + /* "scikits/learn/ball_tree.pyx":1209 * # Case 3: this is a leaf node. Go through all points to * # determine if they fall within radius * elif node_info.is_leaf: # <<<<<<<<<<<<<< @@ -7130,7 +7096,7 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre */ if (__pyx_v_node_info->is_leaf) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1210 + /* "scikits/learn/ball_tree.pyx":1210 * # determine if they fall within radius * elif node_info.is_leaf: * for i from node_info.idx_start <= i < node_info.idx_end: # <<<<<<<<<<<<<< @@ -7140,16 +7106,16 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre __pyx_t_2 = __pyx_v_node_info->idx_end; for (__pyx_v_i = __pyx_v_node_info->idx_start; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1213 + /* "scikits/learn/ball_tree.pyx":1213 * dist_pt = dist_p(pt, * data + idx_array[i] * n_features, * n_features, p) # <<<<<<<<<<<<<< * if dist_pt <= r_p: * indices[idx_i] = idx_array[i] */ - __pyx_v_dist_pt = __pyx_f_7sklearn_9ball_tree_dist_p(__pyx_v_pt, (__pyx_v_data + ((__pyx_v_idx_array[__pyx_v_i]) * __pyx_v_n_features)), __pyx_v_n_features, __pyx_v_p); + __pyx_v_dist_pt = __pyx_f_7scikits_5learn_9ball_tree_dist_p(__pyx_v_pt, (__pyx_v_data + ((__pyx_v_idx_array[__pyx_v_i]) * __pyx_v_n_features)), __pyx_v_n_features, __pyx_v_p); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1214 + /* "scikits/learn/ball_tree.pyx":1214 * data + idx_array[i] * n_features, * n_features, p) * if dist_pt <= r_p: # <<<<<<<<<<<<<< @@ -7159,7 +7125,7 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre __pyx_t_1 = (__pyx_v_dist_pt <= __pyx_v_r_p); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1215 + /* "scikits/learn/ball_tree.pyx":1215 * n_features, p) * if dist_pt <= r_p: * indices[idx_i] = idx_array[i] # <<<<<<<<<<<<<< @@ -7168,23 +7134,23 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre */ (__pyx_v_indices[__pyx_v_idx_i]) = (__pyx_v_idx_array[__pyx_v_i]); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1216 + /* "scikits/learn/ball_tree.pyx":1216 * if dist_pt <= r_p: * indices[idx_i] = idx_array[i] * distances[idx_i] = dist_from_dist_p(dist_pt, p) # <<<<<<<<<<<<<< * idx_i += 1 * */ - (__pyx_v_distances[__pyx_v_idx_i]) = __pyx_f_7sklearn_9ball_tree_dist_from_dist_p(__pyx_v_dist_pt, __pyx_v_p); + (__pyx_v_distances[__pyx_v_idx_i]) = __pyx_f_7scikits_5learn_9ball_tree_dist_from_dist_p(__pyx_v_dist_pt, __pyx_v_p); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1217 + /* "scikits/learn/ball_tree.pyx":1217 * indices[idx_i] = idx_array[i] * distances[idx_i] = dist_from_dist_p(dist_pt, p) * idx_i += 1 # <<<<<<<<<<<<<< * * #------------------------------------------------------------ */ - __pyx_v_idx_i += 1; + __pyx_v_idx_i = (__pyx_v_idx_i + 1); goto __pyx_L10; } __pyx_L10:; @@ -7193,7 +7159,7 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1222 + /* "scikits/learn/ball_tree.pyx":1222 * # Case 4: Node is not a leaf. Recursively query subnodes * else: * item.i_node = 2 * i_node + 1 # <<<<<<<<<<<<<< @@ -7202,16 +7168,16 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre */ __pyx_v_item.i_node = ((2 * __pyx_v_i_node) + 1); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1223 + /* "scikits/learn/ball_tree.pyx":1223 * else: * item.i_node = 2 * i_node + 1 * stack_push(node_stack, item) # <<<<<<<<<<<<<< * * item.i_node = i = 2 * i_node + 2 */ - __pyx_f_7sklearn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); + __pyx_f_7scikits_5learn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1225 + /* "scikits/learn/ball_tree.pyx":1225 * stack_push(node_stack, item) * * item.i_node = i = 2 * i_node + 2 # <<<<<<<<<<<<<< @@ -7222,20 +7188,20 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre __pyx_v_item.i_node = __pyx_t_3; __pyx_v_i = __pyx_t_3; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1226 + /* "scikits/learn/ball_tree.pyx":1226 * * item.i_node = i = 2 * i_node + 2 * stack_push(node_stack, item) # <<<<<<<<<<<<<< * * return idx_i */ - __pyx_f_7sklearn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); + __pyx_f_7scikits_5learn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); } __pyx_L5:; __pyx_L3_continue:; } - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1228 + /* "scikits/learn/ball_tree.pyx":1228 * stack_push(node_stack, item) * * return idx_i # <<<<<<<<<<<<<< @@ -7251,7 +7217,31 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1235 +/* "scikits/learn/ball_tree.pyx":459 + * [ 0. 0.19662693 0.29473397] + * """ + * cdef readonly np.ndarray data # <<<<<<<<<<<<<< + * cdef np.ndarray idx_array + * cdef np.ndarray node_centroid_arr + */ + +static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_4data___get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_4data___get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannySetupContext("__get__"); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->data)); + __pyx_r = ((PyObject *)((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->data); + goto __pyx_L0; + + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "scikits/learn/ball_tree.pyx":1235 * # * @cython.profile(False) * cdef inline void copy_array(DTYPE_t* x, DTYPE_t* y, ITYPE_t n): # <<<<<<<<<<<<<< @@ -7259,12 +7249,12 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_8BallTre * cdef ITYPE_t i */ -static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_copy_array(__pyx_t_7sklearn_9ball_tree_DTYPE_t *__pyx_v_x, __pyx_t_7sklearn_9ball_tree_DTYPE_t *__pyx_v_y, __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_n) { - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_i; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_t_1; +static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_copy_array(__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *__pyx_v_x, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *__pyx_v_y, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_n) { + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_i; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_t_1; __Pyx_RefNannySetupContext("copy_array"); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1238 + /* "scikits/learn/ball_tree.pyx":1238 * # copy array y into array x * cdef ITYPE_t i * for i from 0 <= i < n: # <<<<<<<<<<<<<< @@ -7274,7 +7264,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_copy_array(__pyx_t_7sklear __pyx_t_1 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1239 + /* "scikits/learn/ball_tree.pyx":1239 * cdef ITYPE_t i * for i from 0 <= i < n: * x[i] = y[i] # <<<<<<<<<<<<<< @@ -7287,7 +7277,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_copy_array(__pyx_t_7sklear __Pyx_RefNannyFinishContext(); } -/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1243 +/* "scikits/learn/ball_tree.pyx":1243 * * @cython.cdivision(True) * cdef void compute_centroid(DTYPE_t* centroid, # <<<<<<<<<<<<<< @@ -7295,15 +7285,16 @@ static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_copy_array(__pyx_t_7sklear * ITYPE_t* node_indices, */ -static void __pyx_f_7sklearn_9ball_tree_compute_centroid(__pyx_t_7sklearn_9ball_tree_DTYPE_t *__pyx_v_centroid, __pyx_t_7sklearn_9ball_tree_DTYPE_t *__pyx_v_data, __pyx_t_7sklearn_9ball_tree_ITYPE_t *__pyx_v_node_indices, __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_n_features, __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_n_points) { - __pyx_t_7sklearn_9ball_tree_DTYPE_t *__pyx_v_this_pt; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_i; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_j; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_t_1; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_t_2; +static void __pyx_f_7scikits_5learn_9ball_tree_compute_centroid(__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *__pyx_v_centroid, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *__pyx_v_data, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *__pyx_v_node_indices, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_n_features, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_n_points) { + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *__pyx_v_this_pt; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_i; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_j; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_t_1; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_t_2; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_t_3; __Pyx_RefNannySetupContext("compute_centroid"); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1254 + /* "scikits/learn/ball_tree.pyx":1254 * cdef ITYPE_t i, j * * for j from 0 <= j < n_features: # <<<<<<<<<<<<<< @@ -7313,7 +7304,7 @@ static void __pyx_f_7sklearn_9ball_tree_compute_centroid(__pyx_t_7sklearn_9ball __pyx_t_1 = __pyx_v_n_features; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_1; __pyx_v_j++) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1255 + /* "scikits/learn/ball_tree.pyx":1255 * * for j from 0 <= j < n_features: * centroid[j] = 0 # <<<<<<<<<<<<<< @@ -7323,7 +7314,7 @@ static void __pyx_f_7sklearn_9ball_tree_compute_centroid(__pyx_t_7sklearn_9ball (__pyx_v_centroid[__pyx_v_j]) = 0.0; } - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1257 + /* "scikits/learn/ball_tree.pyx":1257 * centroid[j] = 0 * * for i from 0 <= i < n_points: # <<<<<<<<<<<<<< @@ -7333,7 +7324,7 @@ static void __pyx_f_7sklearn_9ball_tree_compute_centroid(__pyx_t_7sklearn_9ball __pyx_t_1 = __pyx_v_n_points; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1258 + /* "scikits/learn/ball_tree.pyx":1258 * * for i from 0 <= i < n_points: * this_pt = data + n_features * node_indices[i] # <<<<<<<<<<<<<< @@ -7342,7 +7333,7 @@ static void __pyx_f_7sklearn_9ball_tree_compute_centroid(__pyx_t_7sklearn_9ball */ __pyx_v_this_pt = (__pyx_v_data + (__pyx_v_n_features * (__pyx_v_node_indices[__pyx_v_i]))); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1259 + /* "scikits/learn/ball_tree.pyx":1259 * for i from 0 <= i < n_points: * this_pt = data + n_features * node_indices[i] * for j from 0 <= j < n_features: # <<<<<<<<<<<<<< @@ -7352,18 +7343,19 @@ static void __pyx_f_7sklearn_9ball_tree_compute_centroid(__pyx_t_7sklearn_9ball __pyx_t_2 = __pyx_v_n_features; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_2; __pyx_v_j++) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1260 + /* "scikits/learn/ball_tree.pyx":1260 * this_pt = data + n_features * node_indices[i] * for j from 0 <= j < n_features: * centroid[j] += this_pt[j] # <<<<<<<<<<<<<< * * for j from 0 <= j < n_features: */ - (__pyx_v_centroid[__pyx_v_j]) += (__pyx_v_this_pt[__pyx_v_j]); + __pyx_t_3 = __pyx_v_j; + (__pyx_v_centroid[__pyx_t_3]) = ((__pyx_v_centroid[__pyx_t_3]) + (__pyx_v_this_pt[__pyx_v_j])); } } - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1262 + /* "scikits/learn/ball_tree.pyx":1262 * centroid[j] += this_pt[j] * * for j from 0 <= j < n_features: # <<<<<<<<<<<<<< @@ -7373,20 +7365,21 @@ static void __pyx_f_7sklearn_9ball_tree_compute_centroid(__pyx_t_7sklearn_9ball __pyx_t_1 = __pyx_v_n_features; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_1; __pyx_v_j++) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1263 + /* "scikits/learn/ball_tree.pyx":1263 * * for j from 0 <= j < n_features: * centroid[j] /= n_points # <<<<<<<<<<<<<< * * */ - (__pyx_v_centroid[__pyx_v_j]) /= __pyx_v_n_points; + __pyx_t_2 = __pyx_v_j; + (__pyx_v_centroid[__pyx_t_2]) = ((__pyx_v_centroid[__pyx_t_2]) / __pyx_v_n_points); } __Pyx_RefNannyFinishContext(); } -/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1266 +/* "scikits/learn/ball_tree.pyx":1266 * * * cdef ITYPE_t find_split_dim(DTYPE_t* data, # <<<<<<<<<<<<<< @@ -7394,22 +7387,22 @@ static void __pyx_f_7sklearn_9ball_tree_compute_centroid(__pyx_t_7sklearn_9ball * ITYPE_t n_features, */ -static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_find_split_dim(__pyx_t_7sklearn_9ball_tree_DTYPE_t *__pyx_v_data, __pyx_t_7sklearn_9ball_tree_ITYPE_t *__pyx_v_node_indices, __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_n_features, __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_n_points) { - __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_min_val; - __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_max_val; - __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_val; - __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_spread; - __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_max_spread; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_i; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_j; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_j_max; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_r; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_t_1; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_t_2; +static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball_tree_find_split_dim(__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *__pyx_v_data, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *__pyx_v_node_indices, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_n_features, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_n_points) { + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_min_val; + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_max_val; + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_val; + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_spread; + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_max_spread; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_i; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_j; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_j_max; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_r; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_t_1; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_t_2; int __pyx_t_3; __Pyx_RefNannySetupContext("find_split_dim"); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1275 + /* "scikits/learn/ball_tree.pyx":1275 * cdef ITYPE_t i, j, j_max * * j_max = 0 # <<<<<<<<<<<<<< @@ -7418,7 +7411,7 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_find_spl */ __pyx_v_j_max = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1276 + /* "scikits/learn/ball_tree.pyx":1276 * * j_max = 0 * max_spread = 0 # <<<<<<<<<<<<<< @@ -7427,7 +7420,7 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_find_spl */ __pyx_v_max_spread = 0.0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1278 + /* "scikits/learn/ball_tree.pyx":1278 * max_spread = 0 * * for j from 0 <= j < n_features: # <<<<<<<<<<<<<< @@ -7437,7 +7430,7 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_find_spl __pyx_t_1 = __pyx_v_n_features; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_1; __pyx_v_j++) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1279 + /* "scikits/learn/ball_tree.pyx":1279 * * for j from 0 <= j < n_features: * max_val = data[node_indices[0] * n_features + j] # <<<<<<<<<<<<<< @@ -7446,7 +7439,7 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_find_spl */ __pyx_v_max_val = (__pyx_v_data[(((__pyx_v_node_indices[0]) * __pyx_v_n_features) + __pyx_v_j)]); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1280 + /* "scikits/learn/ball_tree.pyx":1280 * for j from 0 <= j < n_features: * max_val = data[node_indices[0] * n_features + j] * min_val = max_val # <<<<<<<<<<<<<< @@ -7455,7 +7448,7 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_find_spl */ __pyx_v_min_val = __pyx_v_max_val; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1281 + /* "scikits/learn/ball_tree.pyx":1281 * max_val = data[node_indices[0] * n_features + j] * min_val = max_val * for i from 1 <= i < n_points: # <<<<<<<<<<<<<< @@ -7465,7 +7458,7 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_find_spl __pyx_t_2 = __pyx_v_n_points; for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1282 + /* "scikits/learn/ball_tree.pyx":1282 * min_val = max_val * for i from 1 <= i < n_points: * val = data[node_indices[i] * n_features + j] # <<<<<<<<<<<<<< @@ -7474,26 +7467,26 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_find_spl */ __pyx_v_val = (__pyx_v_data[(((__pyx_v_node_indices[__pyx_v_i]) * __pyx_v_n_features) + __pyx_v_j)]); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1283 + /* "scikits/learn/ball_tree.pyx":1283 * for i from 1 <= i < n_points: * val = data[node_indices[i] * n_features + j] * max_val = dmax(max_val, val) # <<<<<<<<<<<<<< * min_val = dmin(min_val, val) * spread = max_val - min_val */ - __pyx_v_max_val = __pyx_f_7sklearn_9ball_tree_dmax(__pyx_v_max_val, __pyx_v_val); + __pyx_v_max_val = __pyx_f_7scikits_5learn_9ball_tree_dmax(__pyx_v_max_val, __pyx_v_val); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1284 + /* "scikits/learn/ball_tree.pyx":1284 * val = data[node_indices[i] * n_features + j] * max_val = dmax(max_val, val) * min_val = dmin(min_val, val) # <<<<<<<<<<<<<< * spread = max_val - min_val * if spread > max_spread: */ - __pyx_v_min_val = __pyx_f_7sklearn_9ball_tree_dmin(__pyx_v_min_val, __pyx_v_val); + __pyx_v_min_val = __pyx_f_7scikits_5learn_9ball_tree_dmin(__pyx_v_min_val, __pyx_v_val); } - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1285 + /* "scikits/learn/ball_tree.pyx":1285 * max_val = dmax(max_val, val) * min_val = dmin(min_val, val) * spread = max_val - min_val # <<<<<<<<<<<<<< @@ -7502,7 +7495,7 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_find_spl */ __pyx_v_spread = (__pyx_v_max_val - __pyx_v_min_val); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1286 + /* "scikits/learn/ball_tree.pyx":1286 * min_val = dmin(min_val, val) * spread = max_val - min_val * if spread > max_spread: # <<<<<<<<<<<<<< @@ -7512,7 +7505,7 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_find_spl __pyx_t_3 = (__pyx_v_spread > __pyx_v_max_spread); if (__pyx_t_3) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1287 + /* "scikits/learn/ball_tree.pyx":1287 * spread = max_val - min_val * if spread > max_spread: * max_spread = spread # <<<<<<<<<<<<<< @@ -7521,7 +7514,7 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_find_spl */ __pyx_v_max_spread = __pyx_v_spread; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1288 + /* "scikits/learn/ball_tree.pyx":1288 * if spread > max_spread: * max_spread = spread * j_max = j # <<<<<<<<<<<<<< @@ -7534,7 +7527,7 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_find_spl __pyx_L7:; } - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1289 + /* "scikits/learn/ball_tree.pyx":1289 * max_spread = spread * j_max = j * return j_max # <<<<<<<<<<<<<< @@ -7550,7 +7543,7 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_find_spl return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1293 +/* "scikits/learn/ball_tree.pyx":1293 * * @cython.profile(False) * cdef inline void iswap(ITYPE_t* arr, ITYPE_t i1, ITYPE_t i2): # <<<<<<<<<<<<<< @@ -7558,11 +7551,11 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_find_spl * arr[i1] = arr[i2] */ -static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_iswap(__pyx_t_7sklearn_9ball_tree_ITYPE_t *__pyx_v_arr, __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_i1, __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_i2) { - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_tmp; +static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_iswap(__pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *__pyx_v_arr, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_i1, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_i2) { + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_tmp; __Pyx_RefNannySetupContext("iswap"); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1294 + /* "scikits/learn/ball_tree.pyx":1294 * @cython.profile(False) * cdef inline void iswap(ITYPE_t* arr, ITYPE_t i1, ITYPE_t i2): * cdef ITYPE_t tmp = arr[i1] # <<<<<<<<<<<<<< @@ -7571,7 +7564,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_iswap(__pyx_t_7sklearn_9ba */ __pyx_v_tmp = (__pyx_v_arr[__pyx_v_i1]); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1295 + /* "scikits/learn/ball_tree.pyx":1295 * cdef inline void iswap(ITYPE_t* arr, ITYPE_t i1, ITYPE_t i2): * cdef ITYPE_t tmp = arr[i1] * arr[i1] = arr[i2] # <<<<<<<<<<<<<< @@ -7580,7 +7573,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_iswap(__pyx_t_7sklearn_9ba */ (__pyx_v_arr[__pyx_v_i1]) = (__pyx_v_arr[__pyx_v_i2]); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1296 + /* "scikits/learn/ball_tree.pyx":1296 * cdef ITYPE_t tmp = arr[i1] * arr[i1] = arr[i2] * arr[i2] = tmp # <<<<<<<<<<<<<< @@ -7592,7 +7585,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_iswap(__pyx_t_7sklearn_9ba __Pyx_RefNannyFinishContext(); } -/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1300 +/* "scikits/learn/ball_tree.pyx":1300 * * @cython.profile(False) * cdef inline void dswap(DTYPE_t* arr, ITYPE_t i1, ITYPE_t i2): # <<<<<<<<<<<<<< @@ -7600,11 +7593,11 @@ static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_iswap(__pyx_t_7sklearn_9ba * arr[i1] = arr[i2] */ -static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_dswap(__pyx_t_7sklearn_9ball_tree_DTYPE_t *__pyx_v_arr, __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_i1, __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_i2) { - __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_tmp; +static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_dswap(__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *__pyx_v_arr, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_i1, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_i2) { + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_tmp; __Pyx_RefNannySetupContext("dswap"); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1301 + /* "scikits/learn/ball_tree.pyx":1301 * @cython.profile(False) * cdef inline void dswap(DTYPE_t* arr, ITYPE_t i1, ITYPE_t i2): * cdef DTYPE_t tmp = arr[i1] # <<<<<<<<<<<<<< @@ -7613,7 +7606,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_dswap(__pyx_t_7sklearn_9ba */ __pyx_v_tmp = (__pyx_v_arr[__pyx_v_i1]); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1302 + /* "scikits/learn/ball_tree.pyx":1302 * cdef inline void dswap(DTYPE_t* arr, ITYPE_t i1, ITYPE_t i2): * cdef DTYPE_t tmp = arr[i1] * arr[i1] = arr[i2] # <<<<<<<<<<<<<< @@ -7622,7 +7615,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_dswap(__pyx_t_7sklearn_9ba */ (__pyx_v_arr[__pyx_v_i1]) = (__pyx_v_arr[__pyx_v_i2]); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1303 + /* "scikits/learn/ball_tree.pyx":1303 * cdef DTYPE_t tmp = arr[i1] * arr[i1] = arr[i2] * arr[i2] = tmp # <<<<<<<<<<<<<< @@ -7634,7 +7627,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_dswap(__pyx_t_7sklearn_9ba __Pyx_RefNannyFinishContext(); } -/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1306 +/* "scikits/learn/ball_tree.pyx":1306 * * * cdef void partition_indices(DTYPE_t* data, # <<<<<<<<<<<<<< @@ -7642,18 +7635,18 @@ static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_dswap(__pyx_t_7sklearn_9ba * ITYPE_t split_dim, */ -static void __pyx_f_7sklearn_9ball_tree_partition_indices(__pyx_t_7sklearn_9ball_tree_DTYPE_t *__pyx_v_data, __pyx_t_7sklearn_9ball_tree_ITYPE_t *__pyx_v_node_indices, __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_split_dim, __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_split_index, __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_n_features, __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_n_points) { - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_left; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_right; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_midindex; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_i; - __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_d1; - __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_d2; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_t_1; +static void __pyx_f_7scikits_5learn_9ball_tree_partition_indices(__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *__pyx_v_data, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *__pyx_v_node_indices, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_split_dim, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_split_index, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_n_features, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_n_points) { + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_left; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_right; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_midindex; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_i; + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_d1; + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_d2; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_t_1; int __pyx_t_2; __Pyx_RefNannySetupContext("partition_indices"); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1322 + /* "scikits/learn/ball_tree.pyx":1322 * cdef ITYPE_t left, right, midindex, i * cdef DTYPE_t d1, d2 * left = 0 # <<<<<<<<<<<<<< @@ -7662,7 +7655,7 @@ static void __pyx_f_7sklearn_9ball_tree_partition_indices(__pyx_t_7sklearn_9bal */ __pyx_v_left = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1323 + /* "scikits/learn/ball_tree.pyx":1323 * cdef DTYPE_t d1, d2 * left = 0 * right = n_points - 1 # <<<<<<<<<<<<<< @@ -7671,7 +7664,7 @@ static void __pyx_f_7sklearn_9ball_tree_partition_indices(__pyx_t_7sklearn_9bal */ __pyx_v_right = (__pyx_v_n_points - 1); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1325 + /* "scikits/learn/ball_tree.pyx":1325 * right = n_points - 1 * * while True: # <<<<<<<<<<<<<< @@ -7681,7 +7674,7 @@ static void __pyx_f_7sklearn_9ball_tree_partition_indices(__pyx_t_7sklearn_9bal while (1) { if (!1) break; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1326 + /* "scikits/learn/ball_tree.pyx":1326 * * while True: * midindex = left # <<<<<<<<<<<<<< @@ -7690,7 +7683,7 @@ static void __pyx_f_7sklearn_9ball_tree_partition_indices(__pyx_t_7sklearn_9bal */ __pyx_v_midindex = __pyx_v_left; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1327 + /* "scikits/learn/ball_tree.pyx":1327 * while True: * midindex = left * for i from left <= i < right: # <<<<<<<<<<<<<< @@ -7700,7 +7693,7 @@ static void __pyx_f_7sklearn_9ball_tree_partition_indices(__pyx_t_7sklearn_9bal __pyx_t_1 = __pyx_v_right; for (__pyx_v_i = __pyx_v_left; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1328 + /* "scikits/learn/ball_tree.pyx":1328 * midindex = left * for i from left <= i < right: * d1 = data[node_indices[i] * n_features + split_dim] # <<<<<<<<<<<<<< @@ -7709,7 +7702,7 @@ static void __pyx_f_7sklearn_9ball_tree_partition_indices(__pyx_t_7sklearn_9bal */ __pyx_v_d1 = (__pyx_v_data[(((__pyx_v_node_indices[__pyx_v_i]) * __pyx_v_n_features) + __pyx_v_split_dim)]); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1329 + /* "scikits/learn/ball_tree.pyx":1329 * for i from left <= i < right: * d1 = data[node_indices[i] * n_features + split_dim] * d2 = data[node_indices[right] * n_features + split_dim] # <<<<<<<<<<<<<< @@ -7718,7 +7711,7 @@ static void __pyx_f_7sklearn_9ball_tree_partition_indices(__pyx_t_7sklearn_9bal */ __pyx_v_d2 = (__pyx_v_data[(((__pyx_v_node_indices[__pyx_v_right]) * __pyx_v_n_features) + __pyx_v_split_dim)]); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1330 + /* "scikits/learn/ball_tree.pyx":1330 * d1 = data[node_indices[i] * n_features + split_dim] * d2 = data[node_indices[right] * n_features + split_dim] * if d1 < d2: # <<<<<<<<<<<<<< @@ -7728,38 +7721,38 @@ static void __pyx_f_7sklearn_9ball_tree_partition_indices(__pyx_t_7sklearn_9bal __pyx_t_2 = (__pyx_v_d1 < __pyx_v_d2); if (__pyx_t_2) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1331 + /* "scikits/learn/ball_tree.pyx":1331 * d2 = data[node_indices[right] * n_features + split_dim] * if d1 < d2: * iswap(node_indices, i, midindex) # <<<<<<<<<<<<<< * midindex += 1 * iswap(node_indices, midindex, right) */ - __pyx_f_7sklearn_9ball_tree_iswap(__pyx_v_node_indices, __pyx_v_i, __pyx_v_midindex); + __pyx_f_7scikits_5learn_9ball_tree_iswap(__pyx_v_node_indices, __pyx_v_i, __pyx_v_midindex); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1332 + /* "scikits/learn/ball_tree.pyx":1332 * if d1 < d2: * iswap(node_indices, i, midindex) * midindex += 1 # <<<<<<<<<<<<<< * iswap(node_indices, midindex, right) * if midindex == split_index: */ - __pyx_v_midindex += 1; + __pyx_v_midindex = (__pyx_v_midindex + 1); goto __pyx_L7; } __pyx_L7:; } - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1333 + /* "scikits/learn/ball_tree.pyx":1333 * iswap(node_indices, i, midindex) * midindex += 1 * iswap(node_indices, midindex, right) # <<<<<<<<<<<<<< * if midindex == split_index: * break */ - __pyx_f_7sklearn_9ball_tree_iswap(__pyx_v_node_indices, __pyx_v_midindex, __pyx_v_right); + __pyx_f_7scikits_5learn_9ball_tree_iswap(__pyx_v_node_indices, __pyx_v_midindex, __pyx_v_right); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1334 + /* "scikits/learn/ball_tree.pyx":1334 * midindex += 1 * iswap(node_indices, midindex, right) * if midindex == split_index: # <<<<<<<<<<<<<< @@ -7769,7 +7762,7 @@ static void __pyx_f_7sklearn_9ball_tree_partition_indices(__pyx_t_7sklearn_9bal __pyx_t_2 = (__pyx_v_midindex == __pyx_v_split_index); if (__pyx_t_2) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1335 + /* "scikits/learn/ball_tree.pyx":1335 * iswap(node_indices, midindex, right) * if midindex == split_index: * break # <<<<<<<<<<<<<< @@ -7780,7 +7773,7 @@ static void __pyx_f_7sklearn_9ball_tree_partition_indices(__pyx_t_7sklearn_9bal goto __pyx_L8; } - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1336 + /* "scikits/learn/ball_tree.pyx":1336 * if midindex == split_index: * break * elif midindex < split_index: # <<<<<<<<<<<<<< @@ -7790,7 +7783,7 @@ static void __pyx_f_7sklearn_9ball_tree_partition_indices(__pyx_t_7sklearn_9bal __pyx_t_2 = (__pyx_v_midindex < __pyx_v_split_index); if (__pyx_t_2) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1337 + /* "scikits/learn/ball_tree.pyx":1337 * break * elif midindex < split_index: * left = midindex + 1 # <<<<<<<<<<<<<< @@ -7802,7 +7795,7 @@ static void __pyx_f_7sklearn_9ball_tree_partition_indices(__pyx_t_7sklearn_9bal } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1339 + /* "scikits/learn/ball_tree.pyx":1339 * left = midindex + 1 * else: * right = midindex - 1 # <<<<<<<<<<<<<< @@ -7818,7 +7811,7 @@ static void __pyx_f_7sklearn_9ball_tree_partition_indices(__pyx_t_7sklearn_9bal __Pyx_RefNannyFinishContext(); } -/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1347 +/* "scikits/learn/ball_tree.pyx":1347 * # This calculates the lower-bound distance between a point and a node * @cython.profile(False) * cdef inline DTYPE_t calc_dist_LB(DTYPE_t* pt, # <<<<<<<<<<<<<< @@ -7826,18 +7819,18 @@ static void __pyx_f_7sklearn_9ball_tree_partition_indices(__pyx_t_7sklearn_9bal * DTYPE_t radius, */ -static CYTHON_INLINE __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_calc_dist_LB(__pyx_t_7sklearn_9ball_tree_DTYPE_t *__pyx_v_pt, __pyx_t_7sklearn_9ball_tree_DTYPE_t *__pyx_v_centroid, __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_radius, __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_n_features, __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_p) { - __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_r; +static CYTHON_INLINE __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball_tree_calc_dist_LB(__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *__pyx_v_pt, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *__pyx_v_centroid, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_radius, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_n_features, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_p) { + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_r; __Pyx_RefNannySetupContext("calc_dist_LB"); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1353 + /* "scikits/learn/ball_tree.pyx":1353 * DTYPE_t p): * return dmax(0, (dist(pt, centroid, n_features, p) * - radius)) # <<<<<<<<<<<<<< * * */ - __pyx_r = __pyx_f_7sklearn_9ball_tree_dmax(0.0, (__pyx_f_7sklearn_9ball_tree_dist(__pyx_v_pt, __pyx_v_centroid, __pyx_v_n_features, __pyx_v_p) - __pyx_v_radius)); + __pyx_r = __pyx_f_7scikits_5learn_9ball_tree_dmax(0.0, (__pyx_f_7scikits_5learn_9ball_tree_dist(__pyx_v_pt, __pyx_v_centroid, __pyx_v_n_features, __pyx_v_p) - __pyx_v_radius)); goto __pyx_L0; __pyx_r = 0; @@ -7846,7 +7839,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_ return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1357 +/* "scikits/learn/ball_tree.pyx":1357 * * @cython.profile(False) * cdef inline DTYPE_t calc_dist_p_LB(DTYPE_t* pt, # <<<<<<<<<<<<<< @@ -7854,18 +7847,18 @@ static CYTHON_INLINE __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_ * DTYPE_t radius, */ -static CYTHON_INLINE __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_calc_dist_p_LB(__pyx_t_7sklearn_9ball_tree_DTYPE_t *__pyx_v_pt, __pyx_t_7sklearn_9ball_tree_DTYPE_t *__pyx_v_centroid, __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_radius, __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_n_features, __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_p) { - __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_r; +static CYTHON_INLINE __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball_tree_calc_dist_p_LB(__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *__pyx_v_pt, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *__pyx_v_centroid, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_radius, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_n_features, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_p) { + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_r; __Pyx_RefNannySetupContext("calc_dist_p_LB"); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1363 + /* "scikits/learn/ball_tree.pyx":1363 * DTYPE_t p): * return dist_p_from_dist(dmax(0, (dist(pt, centroid, n_features, p) * - radius)), p) # <<<<<<<<<<<<<< * * */ - __pyx_r = __pyx_f_7sklearn_9ball_tree_dist_p_from_dist(__pyx_f_7sklearn_9ball_tree_dmax(0.0, (__pyx_f_7sklearn_9ball_tree_dist(__pyx_v_pt, __pyx_v_centroid, __pyx_v_n_features, __pyx_v_p) - __pyx_v_radius)), __pyx_v_p); + __pyx_r = __pyx_f_7scikits_5learn_9ball_tree_dist_p_from_dist(__pyx_f_7scikits_5learn_9ball_tree_dmax(0.0, (__pyx_f_7scikits_5learn_9ball_tree_dist(__pyx_v_pt, __pyx_v_centroid, __pyx_v_n_features, __pyx_v_p) - __pyx_v_radius)), __pyx_v_p); goto __pyx_L0; __pyx_r = 0; @@ -7874,7 +7867,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_ return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1373 +/* "scikits/learn/ball_tree.pyx":1373 * # are represented by infinities. * @cython.profile(False) * cdef inline DTYPE_t pqueue_largest(DTYPE_t* queue, ITYPE_t queue_size): # <<<<<<<<<<<<<< @@ -7882,11 +7875,11 @@ static CYTHON_INLINE __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_ * */ -static CYTHON_INLINE __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_pqueue_largest(__pyx_t_7sklearn_9ball_tree_DTYPE_t *__pyx_v_queue, __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_queue_size) { - __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_r; +static CYTHON_INLINE __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball_tree_pqueue_largest(__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *__pyx_v_queue, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_queue_size) { + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_r; __Pyx_RefNannySetupContext("pqueue_largest"); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1374 + /* "scikits/learn/ball_tree.pyx":1374 * @cython.profile(False) * cdef inline DTYPE_t pqueue_largest(DTYPE_t* queue, ITYPE_t queue_size): * return queue[queue_size - 1] # <<<<<<<<<<<<<< @@ -7902,7 +7895,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_ return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1377 +/* "scikits/learn/ball_tree.pyx":1377 * * * cdef inline void pqueue_insert(DTYPE_t val, ITYPE_t i_val, # <<<<<<<<<<<<<< @@ -7910,16 +7903,16 @@ static CYTHON_INLINE __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_ * ITYPE_t queue_size): */ -static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_pqueue_insert(__pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_val, __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_i_val, __pyx_t_7sklearn_9ball_tree_DTYPE_t *__pyx_v_queue, __pyx_t_7sklearn_9ball_tree_ITYPE_t *__pyx_v_idx_array, __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_queue_size) { - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_i_lower; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_i_upper; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_i_mid; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_i; +static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_pqueue_insert(__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_val, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_i_val, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *__pyx_v_queue, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *__pyx_v_idx_array, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_queue_size) { + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_i_lower; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_i_upper; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_i_mid; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_i; int __pyx_t_1; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_t_2; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_t_2; __Pyx_RefNannySetupContext("pqueue_insert"); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1380 + /* "scikits/learn/ball_tree.pyx":1380 * DTYPE_t* queue, ITYPE_t* idx_array, * ITYPE_t queue_size): * cdef ITYPE_t i_lower = 0 # <<<<<<<<<<<<<< @@ -7928,7 +7921,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_pqueue_insert(__pyx_t_7skl */ __pyx_v_i_lower = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1381 + /* "scikits/learn/ball_tree.pyx":1381 * ITYPE_t queue_size): * cdef ITYPE_t i_lower = 0 * cdef ITYPE_t i_upper = queue_size - 1 # <<<<<<<<<<<<<< @@ -7937,7 +7930,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_pqueue_insert(__pyx_t_7skl */ __pyx_v_i_upper = (__pyx_v_queue_size - 1); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1385 + /* "scikits/learn/ball_tree.pyx":1385 * cdef ITYPE_t i * * if val >= queue[i_upper]: # <<<<<<<<<<<<<< @@ -7947,7 +7940,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_pqueue_insert(__pyx_t_7skl __pyx_t_1 = (__pyx_v_val >= (__pyx_v_queue[__pyx_v_i_upper])); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1386 + /* "scikits/learn/ball_tree.pyx":1386 * * if val >= queue[i_upper]: * return # <<<<<<<<<<<<<< @@ -7958,7 +7951,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_pqueue_insert(__pyx_t_7skl goto __pyx_L3; } - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1387 + /* "scikits/learn/ball_tree.pyx":1387 * if val >= queue[i_upper]: * return * elif val <= queue[i_lower]: # <<<<<<<<<<<<<< @@ -7968,7 +7961,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_pqueue_insert(__pyx_t_7skl __pyx_t_1 = (__pyx_v_val <= (__pyx_v_queue[__pyx_v_i_lower])); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1388 + /* "scikits/learn/ball_tree.pyx":1388 * return * elif val <= queue[i_lower]: * i_mid = i_lower # <<<<<<<<<<<<<< @@ -7980,7 +7973,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_pqueue_insert(__pyx_t_7skl } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1390 + /* "scikits/learn/ball_tree.pyx":1390 * i_mid = i_lower * else: * while True: # <<<<<<<<<<<<<< @@ -7990,7 +7983,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_pqueue_insert(__pyx_t_7skl while (1) { if (!1) break; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1391 + /* "scikits/learn/ball_tree.pyx":1391 * else: * while True: * if (i_upper - i_lower) < 2: # <<<<<<<<<<<<<< @@ -8000,7 +7993,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_pqueue_insert(__pyx_t_7skl __pyx_t_1 = ((__pyx_v_i_upper - __pyx_v_i_lower) < 2); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1392 + /* "scikits/learn/ball_tree.pyx":1392 * while True: * if (i_upper - i_lower) < 2: * i_mid = i_lower + 1 # <<<<<<<<<<<<<< @@ -8009,7 +8002,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_pqueue_insert(__pyx_t_7skl */ __pyx_v_i_mid = (__pyx_v_i_lower + 1); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1393 + /* "scikits/learn/ball_tree.pyx":1393 * if (i_upper - i_lower) < 2: * i_mid = i_lower + 1 * break # <<<<<<<<<<<<<< @@ -8021,7 +8014,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_pqueue_insert(__pyx_t_7skl } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1395 + /* "scikits/learn/ball_tree.pyx":1395 * break * else: * i_mid = (i_lower + i_upper) / 2 # <<<<<<<<<<<<<< @@ -8032,7 +8025,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_pqueue_insert(__pyx_t_7skl } __pyx_L6:; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1397 + /* "scikits/learn/ball_tree.pyx":1397 * i_mid = (i_lower + i_upper) / 2 * * if i_mid == i_lower: # <<<<<<<<<<<<<< @@ -8042,16 +8035,16 @@ static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_pqueue_insert(__pyx_t_7skl __pyx_t_1 = (__pyx_v_i_mid == __pyx_v_i_lower); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1398 + /* "scikits/learn/ball_tree.pyx":1398 * * if i_mid == i_lower: * i_mid += 1 # <<<<<<<<<<<<<< * break * */ - __pyx_v_i_mid += 1; + __pyx_v_i_mid = (__pyx_v_i_mid + 1); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1399 + /* "scikits/learn/ball_tree.pyx":1399 * if i_mid == i_lower: * i_mid += 1 * break # <<<<<<<<<<<<<< @@ -8063,7 +8056,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_pqueue_insert(__pyx_t_7skl } __pyx_L7:; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1401 + /* "scikits/learn/ball_tree.pyx":1401 * break * * if val >= queue[i_mid]: # <<<<<<<<<<<<<< @@ -8073,7 +8066,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_pqueue_insert(__pyx_t_7skl __pyx_t_1 = (__pyx_v_val >= (__pyx_v_queue[__pyx_v_i_mid])); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1402 + /* "scikits/learn/ball_tree.pyx":1402 * * if val >= queue[i_mid]: * i_lower = i_mid # <<<<<<<<<<<<<< @@ -8085,7 +8078,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_pqueue_insert(__pyx_t_7skl } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1404 + /* "scikits/learn/ball_tree.pyx":1404 * i_lower = i_mid * else: * i_upper = i_mid # <<<<<<<<<<<<<< @@ -8100,7 +8093,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_pqueue_insert(__pyx_t_7skl } __pyx_L3:; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1406 + /* "scikits/learn/ball_tree.pyx":1406 * i_upper = i_mid * * for i from queue_size > i > i_mid: # <<<<<<<<<<<<<< @@ -8110,7 +8103,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_pqueue_insert(__pyx_t_7skl __pyx_t_2 = __pyx_v_i_mid; for (__pyx_v_i = __pyx_v_queue_size-1; __pyx_v_i > __pyx_t_2; __pyx_v_i--) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1407 + /* "scikits/learn/ball_tree.pyx":1407 * * for i from queue_size > i > i_mid: * queue[i] = queue[i - 1] # <<<<<<<<<<<<<< @@ -8119,7 +8112,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_pqueue_insert(__pyx_t_7skl */ (__pyx_v_queue[__pyx_v_i]) = (__pyx_v_queue[(__pyx_v_i - 1)]); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1408 + /* "scikits/learn/ball_tree.pyx":1408 * for i from queue_size > i > i_mid: * queue[i] = queue[i - 1] * idx_array[i] = idx_array[i - 1] # <<<<<<<<<<<<<< @@ -8129,7 +8122,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_pqueue_insert(__pyx_t_7skl (__pyx_v_idx_array[__pyx_v_i]) = (__pyx_v_idx_array[(__pyx_v_i - 1)]); } - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1410 + /* "scikits/learn/ball_tree.pyx":1410 * idx_array[i] = idx_array[i - 1] * * queue[i_mid] = val # <<<<<<<<<<<<<< @@ -8138,7 +8131,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_pqueue_insert(__pyx_t_7skl */ (__pyx_v_queue[__pyx_v_i_mid]) = __pyx_v_val; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1411 + /* "scikits/learn/ball_tree.pyx":1411 * * queue[i_mid] = val * idx_array[i_mid] = i_val # <<<<<<<<<<<<<< @@ -8151,7 +8144,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_pqueue_insert(__pyx_t_7skl __Pyx_RefNannyFinishContext(); } -/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1437 +/* "scikits/learn/ball_tree.pyx":1437 * # `sort_dist_idx()` * @cython.profile(False) * cdef inline DTYPE_t max_heap_largest(DTYPE_t* heap, ITYPE_t k): # <<<<<<<<<<<<<< @@ -8159,11 +8152,11 @@ static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_pqueue_insert(__pyx_t_7skl * */ -static CYTHON_INLINE __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_tree_max_heap_largest(__pyx_t_7sklearn_9ball_tree_DTYPE_t *__pyx_v_heap, __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_k) { - __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_r; +static CYTHON_INLINE __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball_tree_max_heap_largest(__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *__pyx_v_heap, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_k) { + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_r; __Pyx_RefNannySetupContext("max_heap_largest"); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1438 + /* "scikits/learn/ball_tree.pyx":1438 * @cython.profile(False) * cdef inline DTYPE_t max_heap_largest(DTYPE_t* heap, ITYPE_t k): * return heap[0] # <<<<<<<<<<<<<< @@ -8179,7 +8172,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_ return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1441 +/* "scikits/learn/ball_tree.pyx":1441 * * * cdef void max_heap_insert(DTYPE_t val, ITYPE_t i_val, # <<<<<<<<<<<<<< @@ -8187,15 +8180,15 @@ static CYTHON_INLINE __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_f_7sklearn_9ball_ * ITYPE_t* idx_array, */ -static void __pyx_f_7sklearn_9ball_tree_max_heap_insert(__pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_val, __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_i_val, __pyx_t_7sklearn_9ball_tree_DTYPE_t *__pyx_v_heap, __pyx_t_7sklearn_9ball_tree_ITYPE_t *__pyx_v_idx_array, __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_heap_size) { - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_i; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_ic1; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_ic2; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_i_swap; +static void __pyx_f_7scikits_5learn_9ball_tree_max_heap_insert(__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_val, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_i_val, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *__pyx_v_heap, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *__pyx_v_idx_array, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_heap_size) { + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_i; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_ic1; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_ic2; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_i_swap; int __pyx_t_1; __Pyx_RefNannySetupContext("max_heap_insert"); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1449 + /* "scikits/learn/ball_tree.pyx":1449 * * # check if val should be in heap * if val > heap[0]: # <<<<<<<<<<<<<< @@ -8205,7 +8198,7 @@ static void __pyx_f_7sklearn_9ball_tree_max_heap_insert(__pyx_t_7sklearn_9ball_ __pyx_t_1 = (__pyx_v_val > (__pyx_v_heap[0])); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1450 + /* "scikits/learn/ball_tree.pyx":1450 * # check if val should be in heap * if val > heap[0]: * return # <<<<<<<<<<<<<< @@ -8217,7 +8210,7 @@ static void __pyx_f_7sklearn_9ball_tree_max_heap_insert(__pyx_t_7sklearn_9ball_ } __pyx_L3:; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1453 + /* "scikits/learn/ball_tree.pyx":1453 * * # insert val at position zero * heap[0] = val # <<<<<<<<<<<<<< @@ -8226,7 +8219,7 @@ static void __pyx_f_7sklearn_9ball_tree_max_heap_insert(__pyx_t_7sklearn_9ball_ */ (__pyx_v_heap[0]) = __pyx_v_val; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1454 + /* "scikits/learn/ball_tree.pyx":1454 * # insert val at position zero * heap[0] = val * idx_array[0] = i_val # <<<<<<<<<<<<<< @@ -8235,7 +8228,7 @@ static void __pyx_f_7sklearn_9ball_tree_max_heap_insert(__pyx_t_7sklearn_9ball_ */ (__pyx_v_idx_array[0]) = __pyx_v_i_val; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1457 + /* "scikits/learn/ball_tree.pyx":1457 * * #descend the heap, swapping values until the max heap criterion is met * i = 0 # <<<<<<<<<<<<<< @@ -8244,7 +8237,7 @@ static void __pyx_f_7sklearn_9ball_tree_max_heap_insert(__pyx_t_7sklearn_9ball_ */ __pyx_v_i = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1458 + /* "scikits/learn/ball_tree.pyx":1458 * #descend the heap, swapping values until the max heap criterion is met * i = 0 * while 1: # <<<<<<<<<<<<<< @@ -8254,7 +8247,7 @@ static void __pyx_f_7sklearn_9ball_tree_max_heap_insert(__pyx_t_7sklearn_9ball_ while (1) { if (!1) break; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1459 + /* "scikits/learn/ball_tree.pyx":1459 * i = 0 * while 1: * ic1 = 2 * i + 1 # <<<<<<<<<<<<<< @@ -8263,7 +8256,7 @@ static void __pyx_f_7sklearn_9ball_tree_max_heap_insert(__pyx_t_7sklearn_9ball_ */ __pyx_v_ic1 = ((2 * __pyx_v_i) + 1); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1460 + /* "scikits/learn/ball_tree.pyx":1460 * while 1: * ic1 = 2 * i + 1 * ic2 = ic1 + 1 # <<<<<<<<<<<<<< @@ -8272,7 +8265,7 @@ static void __pyx_f_7sklearn_9ball_tree_max_heap_insert(__pyx_t_7sklearn_9ball_ */ __pyx_v_ic2 = (__pyx_v_ic1 + 1); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1462 + /* "scikits/learn/ball_tree.pyx":1462 * ic2 = ic1 + 1 * * if ic1 >= heap_size: # <<<<<<<<<<<<<< @@ -8282,7 +8275,7 @@ static void __pyx_f_7sklearn_9ball_tree_max_heap_insert(__pyx_t_7sklearn_9ball_ __pyx_t_1 = (__pyx_v_ic1 >= __pyx_v_heap_size); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1463 + /* "scikits/learn/ball_tree.pyx":1463 * * if ic1 >= heap_size: * break # <<<<<<<<<<<<<< @@ -8293,7 +8286,7 @@ static void __pyx_f_7sklearn_9ball_tree_max_heap_insert(__pyx_t_7sklearn_9ball_ goto __pyx_L6; } - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1464 + /* "scikits/learn/ball_tree.pyx":1464 * if ic1 >= heap_size: * break * elif ic2 >= heap_size: # <<<<<<<<<<<<<< @@ -8303,7 +8296,7 @@ static void __pyx_f_7sklearn_9ball_tree_max_heap_insert(__pyx_t_7sklearn_9ball_ __pyx_t_1 = (__pyx_v_ic2 >= __pyx_v_heap_size); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1465 + /* "scikits/learn/ball_tree.pyx":1465 * break * elif ic2 >= heap_size: * if heap[ic1] > val: # <<<<<<<<<<<<<< @@ -8313,7 +8306,7 @@ static void __pyx_f_7sklearn_9ball_tree_max_heap_insert(__pyx_t_7sklearn_9ball_ __pyx_t_1 = ((__pyx_v_heap[__pyx_v_ic1]) > __pyx_v_val); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1466 + /* "scikits/learn/ball_tree.pyx":1466 * elif ic2 >= heap_size: * if heap[ic1] > val: * i_swap = ic1 # <<<<<<<<<<<<<< @@ -8325,7 +8318,7 @@ static void __pyx_f_7sklearn_9ball_tree_max_heap_insert(__pyx_t_7sklearn_9ball_ } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1468 + /* "scikits/learn/ball_tree.pyx":1468 * i_swap = ic1 * else: * break # <<<<<<<<<<<<<< @@ -8338,7 +8331,7 @@ static void __pyx_f_7sklearn_9ball_tree_max_heap_insert(__pyx_t_7sklearn_9ball_ goto __pyx_L6; } - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1469 + /* "scikits/learn/ball_tree.pyx":1469 * else: * break * elif heap[ic1] >= heap[ic2]: # <<<<<<<<<<<<<< @@ -8348,7 +8341,7 @@ static void __pyx_f_7sklearn_9ball_tree_max_heap_insert(__pyx_t_7sklearn_9ball_ __pyx_t_1 = ((__pyx_v_heap[__pyx_v_ic1]) >= (__pyx_v_heap[__pyx_v_ic2])); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1470 + /* "scikits/learn/ball_tree.pyx":1470 * break * elif heap[ic1] >= heap[ic2]: * if val < heap[ic1]: # <<<<<<<<<<<<<< @@ -8358,7 +8351,7 @@ static void __pyx_f_7sklearn_9ball_tree_max_heap_insert(__pyx_t_7sklearn_9ball_ __pyx_t_1 = (__pyx_v_val < (__pyx_v_heap[__pyx_v_ic1])); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1471 + /* "scikits/learn/ball_tree.pyx":1471 * elif heap[ic1] >= heap[ic2]: * if val < heap[ic1]: * i_swap = ic1 # <<<<<<<<<<<<<< @@ -8370,7 +8363,7 @@ static void __pyx_f_7sklearn_9ball_tree_max_heap_insert(__pyx_t_7sklearn_9ball_ } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1473 + /* "scikits/learn/ball_tree.pyx":1473 * i_swap = ic1 * else: * break # <<<<<<<<<<<<<< @@ -8384,7 +8377,7 @@ static void __pyx_f_7sklearn_9ball_tree_max_heap_insert(__pyx_t_7sklearn_9ball_ } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1475 + /* "scikits/learn/ball_tree.pyx":1475 * break * else: * if val < heap[ic2]: # <<<<<<<<<<<<<< @@ -8394,7 +8387,7 @@ static void __pyx_f_7sklearn_9ball_tree_max_heap_insert(__pyx_t_7sklearn_9ball_ __pyx_t_1 = (__pyx_v_val < (__pyx_v_heap[__pyx_v_ic2])); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1476 + /* "scikits/learn/ball_tree.pyx":1476 * else: * if val < heap[ic2]: * i_swap = ic2 # <<<<<<<<<<<<<< @@ -8406,7 +8399,7 @@ static void __pyx_f_7sklearn_9ball_tree_max_heap_insert(__pyx_t_7sklearn_9ball_ } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1478 + /* "scikits/learn/ball_tree.pyx":1478 * i_swap = ic2 * else: * break # <<<<<<<<<<<<<< @@ -8419,7 +8412,7 @@ static void __pyx_f_7sklearn_9ball_tree_max_heap_insert(__pyx_t_7sklearn_9ball_ } __pyx_L6:; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1480 + /* "scikits/learn/ball_tree.pyx":1480 * break * * heap[i] = heap[i_swap] # <<<<<<<<<<<<<< @@ -8428,7 +8421,7 @@ static void __pyx_f_7sklearn_9ball_tree_max_heap_insert(__pyx_t_7sklearn_9ball_ */ (__pyx_v_heap[__pyx_v_i]) = (__pyx_v_heap[__pyx_v_i_swap]); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1481 + /* "scikits/learn/ball_tree.pyx":1481 * * heap[i] = heap[i_swap] * idx_array[i] = idx_array[i_swap] # <<<<<<<<<<<<<< @@ -8437,7 +8430,7 @@ static void __pyx_f_7sklearn_9ball_tree_max_heap_insert(__pyx_t_7sklearn_9ball_ */ (__pyx_v_idx_array[__pyx_v_i]) = (__pyx_v_idx_array[__pyx_v_i_swap]); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1483 + /* "scikits/learn/ball_tree.pyx":1483 * idx_array[i] = idx_array[i_swap] * * i = i_swap # <<<<<<<<<<<<<< @@ -8448,7 +8441,7 @@ static void __pyx_f_7sklearn_9ball_tree_max_heap_insert(__pyx_t_7sklearn_9ball_ } __pyx_L5_break:; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1485 + /* "scikits/learn/ball_tree.pyx":1485 * i = i_swap * * heap[i] = val # <<<<<<<<<<<<<< @@ -8457,7 +8450,7 @@ static void __pyx_f_7sklearn_9ball_tree_max_heap_insert(__pyx_t_7sklearn_9ball_ */ (__pyx_v_heap[__pyx_v_i]) = __pyx_v_val; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1486 + /* "scikits/learn/ball_tree.pyx":1486 * * heap[i] = val * idx_array[i] = i_val # <<<<<<<<<<<<<< @@ -8470,7 +8463,7 @@ static void __pyx_f_7sklearn_9ball_tree_max_heap_insert(__pyx_t_7sklearn_9ball_ __Pyx_RefNannyFinishContext(); } -/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1493 +/* "scikits/learn/ball_tree.pyx":1493 * # this is a quicksort implementation which sorts `dist` and * # simultaneously performs the same swaps on `idx`. * cdef void sort_dist_idx(DTYPE_t* dist, ITYPE_t* idx, ITYPE_t k): # <<<<<<<<<<<<<< @@ -8478,12 +8471,12 @@ static void __pyx_f_7sklearn_9ball_tree_max_heap_insert(__pyx_t_7sklearn_9ball_ * if k > 1: */ -static void __pyx_f_7sklearn_9ball_tree_sort_dist_idx(__pyx_t_7sklearn_9ball_tree_DTYPE_t *__pyx_v_dist, __pyx_t_7sklearn_9ball_tree_ITYPE_t *__pyx_v_idx, __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_k) { - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_pivot_idx; +static void __pyx_f_7scikits_5learn_9ball_tree_sort_dist_idx(__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *__pyx_v_dist, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *__pyx_v_idx, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_k) { + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_pivot_idx; int __pyx_t_1; __Pyx_RefNannySetupContext("sort_dist_idx"); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1495 + /* "scikits/learn/ball_tree.pyx":1495 * cdef void sort_dist_idx(DTYPE_t* dist, ITYPE_t* idx, ITYPE_t k): * cdef ITYPE_t pivot_idx * if k > 1: # <<<<<<<<<<<<<< @@ -8493,32 +8486,32 @@ static void __pyx_f_7sklearn_9ball_tree_sort_dist_idx(__pyx_t_7sklearn_9ball_tr __pyx_t_1 = (__pyx_v_k > 1); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1496 + /* "scikits/learn/ball_tree.pyx":1496 * cdef ITYPE_t pivot_idx * if k > 1: * pivot_idx = partition_dist_idx(dist, idx, k) # <<<<<<<<<<<<<< * * sort_dist_idx(dist, idx, pivot_idx) */ - __pyx_v_pivot_idx = __pyx_f_7sklearn_9ball_tree_partition_dist_idx(__pyx_v_dist, __pyx_v_idx, __pyx_v_k); + __pyx_v_pivot_idx = __pyx_f_7scikits_5learn_9ball_tree_partition_dist_idx(__pyx_v_dist, __pyx_v_idx, __pyx_v_k); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1498 + /* "scikits/learn/ball_tree.pyx":1498 * pivot_idx = partition_dist_idx(dist, idx, k) * * sort_dist_idx(dist, idx, pivot_idx) # <<<<<<<<<<<<<< * * sort_dist_idx(dist + pivot_idx + 1, */ - __pyx_f_7sklearn_9ball_tree_sort_dist_idx(__pyx_v_dist, __pyx_v_idx, __pyx_v_pivot_idx); + __pyx_f_7scikits_5learn_9ball_tree_sort_dist_idx(__pyx_v_dist, __pyx_v_idx, __pyx_v_pivot_idx); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1502 + /* "scikits/learn/ball_tree.pyx":1502 * sort_dist_idx(dist + pivot_idx + 1, * idx + pivot_idx + 1, * k - pivot_idx - 1) # <<<<<<<<<<<<<< * * */ - __pyx_f_7sklearn_9ball_tree_sort_dist_idx(((__pyx_v_dist + __pyx_v_pivot_idx) + 1), ((__pyx_v_idx + __pyx_v_pivot_idx) + 1), ((__pyx_v_k - __pyx_v_pivot_idx) - 1)); + __pyx_f_7scikits_5learn_9ball_tree_sort_dist_idx(((__pyx_v_dist + __pyx_v_pivot_idx) + 1), ((__pyx_v_idx + __pyx_v_pivot_idx) + 1), ((__pyx_v_k - __pyx_v_pivot_idx) - 1)); goto __pyx_L3; } __pyx_L3:; @@ -8526,7 +8519,7 @@ static void __pyx_f_7sklearn_9ball_tree_sort_dist_idx(__pyx_t_7sklearn_9ball_tr __Pyx_RefNannyFinishContext(); } -/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1505 +/* "scikits/learn/ball_tree.pyx":1505 * * * cdef ITYPE_t partition_dist_idx(DTYPE_t* dist, ITYPE_t* idx, ITYPE_t k): # <<<<<<<<<<<<<< @@ -8534,17 +8527,17 @@ static void __pyx_f_7sklearn_9ball_tree_sort_dist_idx(__pyx_t_7sklearn_9ball_tr * cdef DTYPE_t pivot_val = dist[pivot_idx] */ -static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_partition_dist_idx(__pyx_t_7sklearn_9ball_tree_DTYPE_t *__pyx_v_dist, __pyx_t_7sklearn_9ball_tree_ITYPE_t *__pyx_v_idx, __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_k) { - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_pivot_idx; - __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_v_pivot_val; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_store_idx; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_i; - __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_r; +static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball_tree_partition_dist_idx(__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *__pyx_v_dist, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *__pyx_v_idx, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_k) { + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_pivot_idx; + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_v_pivot_val; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_store_idx; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_i; + __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_r; long __pyx_t_1; int __pyx_t_2; __Pyx_RefNannySetupContext("partition_dist_idx"); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1506 + /* "scikits/learn/ball_tree.pyx":1506 * * cdef ITYPE_t partition_dist_idx(DTYPE_t* dist, ITYPE_t* idx, ITYPE_t k): * cdef ITYPE_t pivot_idx = k / 2 # <<<<<<<<<<<<<< @@ -8553,7 +8546,7 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_partitio */ __pyx_v_pivot_idx = __Pyx_div_long(__pyx_v_k, 2); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1507 + /* "scikits/learn/ball_tree.pyx":1507 * cdef ITYPE_t partition_dist_idx(DTYPE_t* dist, ITYPE_t* idx, ITYPE_t k): * cdef ITYPE_t pivot_idx = k / 2 * cdef DTYPE_t pivot_val = dist[pivot_idx] # <<<<<<<<<<<<<< @@ -8562,7 +8555,7 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_partitio */ __pyx_v_pivot_val = (__pyx_v_dist[__pyx_v_pivot_idx]); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1508 + /* "scikits/learn/ball_tree.pyx":1508 * cdef ITYPE_t pivot_idx = k / 2 * cdef DTYPE_t pivot_val = dist[pivot_idx] * cdef ITYPE_t store_idx = 0 # <<<<<<<<<<<<<< @@ -8571,25 +8564,25 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_partitio */ __pyx_v_store_idx = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1511 + /* "scikits/learn/ball_tree.pyx":1511 * cdef ITYPE_t i * * dswap(dist, pivot_idx, k - 1) # <<<<<<<<<<<<<< * iswap(idx, pivot_idx, k - 1) * */ - __pyx_f_7sklearn_9ball_tree_dswap(__pyx_v_dist, __pyx_v_pivot_idx, (__pyx_v_k - 1)); + __pyx_f_7scikits_5learn_9ball_tree_dswap(__pyx_v_dist, __pyx_v_pivot_idx, (__pyx_v_k - 1)); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1512 + /* "scikits/learn/ball_tree.pyx":1512 * * dswap(dist, pivot_idx, k - 1) * iswap(idx, pivot_idx, k - 1) # <<<<<<<<<<<<<< * * for i from 0 <= i < k - 1: */ - __pyx_f_7sklearn_9ball_tree_iswap(__pyx_v_idx, __pyx_v_pivot_idx, (__pyx_v_k - 1)); + __pyx_f_7scikits_5learn_9ball_tree_iswap(__pyx_v_idx, __pyx_v_pivot_idx, (__pyx_v_k - 1)); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1514 + /* "scikits/learn/ball_tree.pyx":1514 * iswap(idx, pivot_idx, k - 1) * * for i from 0 <= i < k - 1: # <<<<<<<<<<<<<< @@ -8599,7 +8592,7 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_partitio __pyx_t_1 = (__pyx_v_k - 1); for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1515 + /* "scikits/learn/ball_tree.pyx":1515 * * for i from 0 <= i < k - 1: * if dist[i] < pivot_val: # <<<<<<<<<<<<<< @@ -8609,55 +8602,55 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_partitio __pyx_t_2 = ((__pyx_v_dist[__pyx_v_i]) < __pyx_v_pivot_val); if (__pyx_t_2) { - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1516 + /* "scikits/learn/ball_tree.pyx":1516 * for i from 0 <= i < k - 1: * if dist[i] < pivot_val: * dswap(dist, i, store_idx) # <<<<<<<<<<<<<< * iswap(idx, i, store_idx) * store_idx += 1 */ - __pyx_f_7sklearn_9ball_tree_dswap(__pyx_v_dist, __pyx_v_i, __pyx_v_store_idx); + __pyx_f_7scikits_5learn_9ball_tree_dswap(__pyx_v_dist, __pyx_v_i, __pyx_v_store_idx); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1517 + /* "scikits/learn/ball_tree.pyx":1517 * if dist[i] < pivot_val: * dswap(dist, i, store_idx) * iswap(idx, i, store_idx) # <<<<<<<<<<<<<< * store_idx += 1 * dswap(dist, store_idx, k - 1) */ - __pyx_f_7sklearn_9ball_tree_iswap(__pyx_v_idx, __pyx_v_i, __pyx_v_store_idx); + __pyx_f_7scikits_5learn_9ball_tree_iswap(__pyx_v_idx, __pyx_v_i, __pyx_v_store_idx); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1518 + /* "scikits/learn/ball_tree.pyx":1518 * dswap(dist, i, store_idx) * iswap(idx, i, store_idx) * store_idx += 1 # <<<<<<<<<<<<<< * dswap(dist, store_idx, k - 1) * iswap(idx, store_idx, k - 1) */ - __pyx_v_store_idx += 1; + __pyx_v_store_idx = (__pyx_v_store_idx + 1); goto __pyx_L5; } __pyx_L5:; } - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1519 + /* "scikits/learn/ball_tree.pyx":1519 * iswap(idx, i, store_idx) * store_idx += 1 * dswap(dist, store_idx, k - 1) # <<<<<<<<<<<<<< * iswap(idx, store_idx, k - 1) * return store_idx */ - __pyx_f_7sklearn_9ball_tree_dswap(__pyx_v_dist, __pyx_v_store_idx, (__pyx_v_k - 1)); + __pyx_f_7scikits_5learn_9ball_tree_dswap(__pyx_v_dist, __pyx_v_store_idx, (__pyx_v_k - 1)); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1520 + /* "scikits/learn/ball_tree.pyx":1520 * store_idx += 1 * dswap(dist, store_idx, k - 1) * iswap(idx, store_idx, k - 1) # <<<<<<<<<<<<<< * return store_idx */ - __pyx_f_7sklearn_9ball_tree_iswap(__pyx_v_idx, __pyx_v_store_idx, (__pyx_v_k - 1)); + __pyx_f_7scikits_5learn_9ball_tree_iswap(__pyx_v_idx, __pyx_v_store_idx, (__pyx_v_k - 1)); - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1521 + /* "scikits/learn/ball_tree.pyx":1521 * dswap(dist, store_idx, k - 1) * iswap(idx, store_idx, k - 1) * return store_idx # <<<<<<<<<<<<<< @@ -8671,7 +8664,7 @@ static __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_f_7sklearn_9ball_tree_partitio return __pyx_r; } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":188 +/* "numpy.pxd":188 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -8692,21 +8685,21 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ int __pyx_v_offset; int __pyx_v_hasfields; int __pyx_r; - int __pyx_t_1; + PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; + int __pyx_t_4; + int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; - int __pyx_t_8; + PyObject *__pyx_t_8 = NULL; char *__pyx_t_9; __Pyx_RefNannySetupContext("__getbuffer__"); if (__pyx_v_info == NULL) return 0; __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(__pyx_v_info->obj); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":194 + /* "numpy.pxd":194 * # of flags * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -8715,7 +8708,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_endian_detector = 1; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":195 + /* "numpy.pxd":195 * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -8724,26 +8717,29 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":197 + /* "numpy.pxd":197 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) * * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< * * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - __pyx_v_ndim = PyArray_NDIM(((PyArrayObject *)__pyx_v_self)); + __pyx_t_1 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_ndim = PyArray_NDIM(((PyArrayObject *)__pyx_t_1)); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":199 + /* "numpy.pxd":199 * 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))); - if (__pyx_t_1) { + __pyx_t_2 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); + if (__pyx_t_2) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":200 + /* "numpy.pxd":200 * * if sizeof(npy_intp) != sizeof(Py_ssize_t): * copy_shape = 1 # <<<<<<<<<<<<<< @@ -8755,7 +8751,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } /*else*/ { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":202 + /* "numpy.pxd":202 * copy_shape = 1 * else: * copy_shape = 0 # <<<<<<<<<<<<<< @@ -8766,108 +8762,105 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } __pyx_L5:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":204 + /* "numpy.pxd":204 * 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_1 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS); - if (__pyx_t_1) { + __pyx_t_2 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS); + if (__pyx_t_2) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":205 + /* "numpy.pxd":205 * * 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(((PyArrayObject *)__pyx_v_self), NPY_C_CONTIGUOUS)); - __pyx_t_3 = __pyx_t_2; + __pyx_t_1 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_t_1), NPY_C_CONTIGUOUS)); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __pyx_t_3; } else { - __pyx_t_3 = __pyx_t_1; + __pyx_t_4 = __pyx_t_2; } - if (__pyx_t_3) { + if (__pyx_t_4) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":206 + /* "numpy.pxd":206 * 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_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(((PyObject *)__pyx_kp_u_20)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_u_20)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_20)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_43), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[1]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":208 + /* "numpy.pxd":208 * 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_3 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS); - if (__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS); + if (__pyx_t_4) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":209 + /* "numpy.pxd":209 * * 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_1 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_v_self), NPY_F_CONTIGUOUS)); - __pyx_t_2 = __pyx_t_1; + __pyx_t_1 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_t_1), NPY_F_CONTIGUOUS)); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __pyx_t_2; } else { - __pyx_t_2 = __pyx_t_3; + __pyx_t_3 = __pyx_t_4; } - if (__pyx_t_2) { + if (__pyx_t_3) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":210 + /* "numpy.pxd":210 * 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_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_INCREF(((PyObject *)__pyx_kp_u_21)); - PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_u_21)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_21)); - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_45), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[1]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L7; } __pyx_L7:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":212 + /* "numpy.pxd":212 * 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(((PyArrayObject *)__pyx_v_self)); + __pyx_t_1 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_info->buf = PyArray_DATA(((PyArrayObject *)__pyx_t_1)); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":213 + /* "numpy.pxd":213 * * info.buf = PyArray_DATA(self) * info.ndim = ndim # <<<<<<<<<<<<<< @@ -8876,7 +8869,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->ndim = __pyx_v_ndim; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":214 + /* "numpy.pxd":214 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if copy_shape: # <<<<<<<<<<<<<< @@ -8885,7 +8878,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ if (__pyx_v_copy_shape) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":217 + /* "numpy.pxd":217 * # Allocate new buffer for strides and shape info. This is allocated * # as one block, strides first. * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< @@ -8894,7 +8887,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * __pyx_v_ndim) * 2))); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":218 + /* "numpy.pxd":218 * # as one block, strides first. * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) * info.shape = info.strides + ndim # <<<<<<<<<<<<<< @@ -8903,60 +8896,72 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":219 + /* "numpy.pxd":219 * info.strides = <Py_ssize_t*>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_6 = __pyx_v_ndim; - for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { - __pyx_v_i = __pyx_t_7; + __pyx_t_5 = __pyx_v_ndim; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":220 + /* "numpy.pxd":220 * 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(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]); + __pyx_t_1 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_1); + (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(((PyArrayObject *)__pyx_t_1))[__pyx_v_i]); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":221 + /* "numpy.pxd":221 * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< * else: * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) */ - (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]); + __pyx_t_1 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_1); + (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(((PyArrayObject *)__pyx_t_1))[__pyx_v_i]); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } goto __pyx_L8; } /*else*/ { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":223 + /* "numpy.pxd":223 * info.shape[i] = PyArray_DIMS(self)[i] * else: * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) # <<<<<<<<<<<<<< * info.shape = <Py_ssize_t*>PyArray_DIMS(self) * info.suboffsets = NULL */ - __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(((PyArrayObject *)__pyx_v_self))); + __pyx_t_1 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(((PyArrayObject *)__pyx_t_1))); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":224 + /* "numpy.pxd":224 * else: * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) * info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<< * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) */ - __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(((PyArrayObject *)__pyx_v_self))); + __pyx_t_1 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(((PyArrayObject *)__pyx_t_1))); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L8:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":225 + /* "numpy.pxd":225 * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) * info.shape = <Py_ssize_t*>PyArray_DIMS(self) * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -8965,25 +8970,31 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->suboffsets = NULL; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":226 + /* "numpy.pxd":226 * info.shape = <Py_ssize_t*>PyArray_DIMS(self) * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< * info.readonly = not PyArray_ISWRITEABLE(self) * */ - __pyx_v_info->itemsize = PyArray_ITEMSIZE(((PyArrayObject *)__pyx_v_self)); + __pyx_t_1 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_info->itemsize = PyArray_ITEMSIZE(((PyArrayObject *)__pyx_t_1)); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":227 + /* "numpy.pxd":227 * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< * * cdef int t */ - __pyx_v_info->readonly = (!PyArray_ISWRITEABLE(((PyArrayObject *)__pyx_v_self))); + __pyx_t_1 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_info->readonly = (!PyArray_ISWRITEABLE(((PyArrayObject *)__pyx_t_1))); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":230 + /* "numpy.pxd":230 * * cdef int t * cdef char* f = NULL # <<<<<<<<<<<<<< @@ -8992,7 +9003,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_f = NULL; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":231 + /* "numpy.pxd":231 * cdef int t * cdef char* f = NULL * cdef dtype descr = self.descr # <<<<<<<<<<<<<< @@ -9002,7 +9013,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_self)->descr)); __pyx_v_descr = ((PyArrayObject *)__pyx_v_self)->descr; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":235 + /* "numpy.pxd":235 * cdef int offset * * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< @@ -9011,23 +9022,23 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":237 + /* "numpy.pxd":237 * 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); - if (__pyx_t_2) { - __pyx_t_3 = (!__pyx_v_copy_shape); - __pyx_t_1 = __pyx_t_3; + __pyx_t_3 = (!__pyx_v_hasfields); + if (__pyx_t_3) { + __pyx_t_4 = (!__pyx_v_copy_shape); + __pyx_t_2 = __pyx_t_4; } else { - __pyx_t_1 = __pyx_t_2; + __pyx_t_2 = __pyx_t_3; } - if (__pyx_t_1) { + if (__pyx_t_2) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":239 + /* "numpy.pxd":239 * if not hasfields and not copy_shape: * # do not call releasebuffer * info.obj = None # <<<<<<<<<<<<<< @@ -9043,7 +9054,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } /*else*/ { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":242 + /* "numpy.pxd":242 * else: * # need to call releasebuffer * info.obj = self # <<<<<<<<<<<<<< @@ -9058,17 +9069,17 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } __pyx_L11:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":244 + /* "numpy.pxd":244 * info.obj = self * * if not hasfields: # <<<<<<<<<<<<<< * t = descr.type_num * if ((descr.byteorder == '>' and little_endian) or */ - __pyx_t_1 = (!__pyx_v_hasfields); - if (__pyx_t_1) { + __pyx_t_2 = (!__pyx_v_hasfields); + if (__pyx_t_2) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":245 + /* "numpy.pxd":245 * * if not hasfields: * t = descr.type_num # <<<<<<<<<<<<<< @@ -9077,312 +9088,306 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_t = __pyx_v_descr->type_num; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":246 + /* "numpy.pxd":246 * if not hasfields: * t = descr.type_num * if ((descr.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< * (descr.byteorder == '<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") */ - __pyx_t_1 = (__pyx_v_descr->byteorder == '>'); - if (__pyx_t_1) { - __pyx_t_2 = __pyx_v_little_endian; + __pyx_t_2 = (__pyx_v_descr->byteorder == '>'); + if (__pyx_t_2) { + __pyx_t_3 = __pyx_v_little_endian; } else { - __pyx_t_2 = __pyx_t_1; + __pyx_t_3 = __pyx_t_2; } - if (!__pyx_t_2) { + if (!__pyx_t_3) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":247 + /* "numpy.pxd":247 * t = descr.type_num * if ((descr.byteorder == '>' and little_endian) or * (descr.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" */ - __pyx_t_1 = (__pyx_v_descr->byteorder == '<'); - if (__pyx_t_1) { - __pyx_t_3 = (!__pyx_v_little_endian); - __pyx_t_8 = __pyx_t_3; + __pyx_t_2 = (__pyx_v_descr->byteorder == '<'); + if (__pyx_t_2) { + __pyx_t_4 = (!__pyx_v_little_endian); + __pyx_t_7 = __pyx_t_4; } else { - __pyx_t_8 = __pyx_t_1; + __pyx_t_7 = __pyx_t_2; } - __pyx_t_1 = __pyx_t_8; + __pyx_t_2 = __pyx_t_7; } else { - __pyx_t_1 = __pyx_t_2; + __pyx_t_2 = __pyx_t_3; } - if (__pyx_t_1) { + if (__pyx_t_2) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":248 + /* "numpy.pxd":248 * if ((descr.byteorder == '>' and little_endian) or * (descr.byteorder == '<' 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_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(((PyObject *)__pyx_kp_u_22)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_u_22)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_22)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_47), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[1]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L13; } __pyx_L13:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":249 + /* "numpy.pxd":249 * (descr.byteorder == '<' 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_BYTE); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_BYTE); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__b; goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":250 + /* "numpy.pxd":250 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_UBYTE); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_UBYTE); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__B; goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":251 + /* "numpy.pxd":251 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_SHORT); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_SHORT); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__h; goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":252 + /* "numpy.pxd":252 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_USHORT); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_USHORT); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__H; goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":253 + /* "numpy.pxd":253 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_INT); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_INT); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__i; goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":254 + /* "numpy.pxd":254 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_UINT); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_UINT); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__I; goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":255 + /* "numpy.pxd":255 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_LONG); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_LONG); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__l; goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":256 + /* "numpy.pxd":256 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_ULONG); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_ULONG); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__L; goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":257 + /* "numpy.pxd":257 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_LONGLONG); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_LONGLONG); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__q; goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":258 + /* "numpy.pxd":258 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_ULONGLONG); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_ULONGLONG); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__Q; goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":259 + /* "numpy.pxd":259 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_FLOAT); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_FLOAT); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__f; goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":260 + /* "numpy.pxd":260 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_DOUBLE); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_DOUBLE); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__d; goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":261 + /* "numpy.pxd":261 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_LONGDOUBLE); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_LONGDOUBLE); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__g; goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":262 + /* "numpy.pxd":262 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_CFLOAT); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_CFLOAT); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__Zf; goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":263 + /* "numpy.pxd":263 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_CDOUBLE); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_CDOUBLE); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__Zd; goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":264 + /* "numpy.pxd":264 * 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: */ - __pyx_t_1 = (__pyx_v_t == NPY_CLONGDOUBLE); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_CLONGDOUBLE); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__Zg; goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":265 + /* "numpy.pxd":265 * 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) */ - __pyx_t_1 = (__pyx_v_t == NPY_OBJECT); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_OBJECT); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__O; goto __pyx_L14; } /*else*/ { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":267 + /* "numpy.pxd":267 * elif t == NPY_OBJECT: f = "O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< * info.format = f * return */ - __pyx_t_5 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_23), __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_4)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_48), __pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_8)); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_8)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_8)); + __pyx_t_8 = 0; + __pyx_t_8 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_8, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L14:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":268 + /* "numpy.pxd":268 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f # <<<<<<<<<<<<<< @@ -9391,7 +9396,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->format = __pyx_v_f; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":269 + /* "numpy.pxd":269 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f * return # <<<<<<<<<<<<<< @@ -9404,7 +9409,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } /*else*/ { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":271 + /* "numpy.pxd":271 * return * else: * info.format = <char*>stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< @@ -9413,7 +9418,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->format = ((char *)malloc(255)); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":272 + /* "numpy.pxd":272 * else: * info.format = <char*>stdlib.malloc(_buffer_format_string_len) * info.format[0] = '^' # Native data types, manual alignment # <<<<<<<<<<<<<< @@ -9422,7 +9427,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ (__pyx_v_info->format[0]) = '^'; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":273 + /* "numpy.pxd":273 * info.format = <char*>stdlib.malloc(_buffer_format_string_len) * info.format[0] = '^' # Native data types, manual alignment * offset = 0 # <<<<<<<<<<<<<< @@ -9431,7 +9436,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_offset = 0; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":276 + /* "numpy.pxd":276 * f = _util_dtypestring(descr, info.format + 1, * info.format + _buffer_format_string_len, * &offset) # <<<<<<<<<<<<<< @@ -9441,7 +9446,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ __pyx_t_9 = __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_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_f = __pyx_t_9; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":277 + /* "numpy.pxd":277 * info.format + _buffer_format_string_len, * &offset) * f[0] = 0 # Terminate format string # <<<<<<<<<<<<<< @@ -9455,8 +9460,8 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("numpy.ndarray.__getbuffer__"); __pyx_r = -1; __Pyx_GOTREF(__pyx_v_info->obj); @@ -9473,7 +9478,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ return __pyx_r; } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":279 +/* "numpy.pxd":279 * f[0] = 0 # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -9481,22 +9486,26 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ * stdlib.free(info.format) */ -static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ -static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { - int __pyx_t_1; +static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray_1__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ +static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray_1__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; __Pyx_RefNannySetupContext("__releasebuffer__"); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":280 + /* "numpy.pxd":280 * * 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(((PyArrayObject *)__pyx_v_self)); - if (__pyx_t_1) { + __pyx_t_1 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = PyArray_HASFIELDS(((PyArrayObject *)__pyx_t_1)); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":281 + /* "numpy.pxd":281 * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): * stdlib.free(info.format) # <<<<<<<<<<<<<< @@ -9508,17 +9517,17 @@ static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *_ } __pyx_L5:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":282 + /* "numpy.pxd":282 * 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))); - if (__pyx_t_1) { + __pyx_t_2 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); + if (__pyx_t_2) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":283 + /* "numpy.pxd":283 * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): * stdlib.free(info.strides) # <<<<<<<<<<<<<< @@ -9533,7 +9542,7 @@ static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *_ __Pyx_RefNannyFinishContext(); } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":756 +/* "numpy.pxd":756 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -9546,7 +9555,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1"); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":757 + /* "numpy.pxd":757 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<< @@ -9572,7 +9581,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":759 +/* "numpy.pxd":759 * return PyArray_MultiIterNew(1, <void*>a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -9585,7 +9594,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2"); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":760 + /* "numpy.pxd":760 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<< @@ -9611,7 +9620,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":762 +/* "numpy.pxd":762 * return PyArray_MultiIterNew(2, <void*>a, <void*>b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -9624,7 +9633,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3"); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":763 + /* "numpy.pxd":763 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<< @@ -9650,7 +9659,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":765 +/* "numpy.pxd":765 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -9663,7 +9672,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4"); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":766 + /* "numpy.pxd":766 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<< @@ -9689,7 +9698,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":768 +/* "numpy.pxd":768 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -9702,7 +9711,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5"); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":769 + /* "numpy.pxd":769 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<< @@ -9728,7 +9737,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":771 +/* "numpy.pxd":771 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -9754,15 +9763,16 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx int __pyx_t_7; int __pyx_t_8; int __pyx_t_9; - char *__pyx_t_10; + long __pyx_t_10; + char *__pyx_t_11; __Pyx_RefNannySetupContext("_util_dtypestring"); __pyx_v_child = ((PyArray_Descr *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_fields = ((PyObject *)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_fields = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); __pyx_v_childname = Py_None; __Pyx_INCREF(Py_None); __pyx_v_new_offset = Py_None; __Pyx_INCREF(Py_None); __pyx_v_t = Py_None; __Pyx_INCREF(Py_None); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":778 + /* "numpy.pxd":778 * cdef int delta_offset * cdef tuple i * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -9771,7 +9781,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_endian_detector = 1; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":779 + /* "numpy.pxd":779 * cdef tuple i * cdef int endian_detector = 1 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -9780,18 +9790,17 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":782 + /* "numpy.pxd":782 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< * fields = descr.fields[childname] * child, new_offset = fields */ - if (likely(((PyObject *)__pyx_v_descr->names) != Py_None)) { - __pyx_t_1 = 0; __pyx_t_2 = ((PyObject *)__pyx_v_descr->names); __Pyx_INCREF(__pyx_t_2); - } else { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_v_descr->names == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = 0; __pyx_t_2 = ((PyObject *)__pyx_v_descr->names); __Pyx_INCREF(__pyx_t_2); for (;;) { if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break; __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; @@ -9799,7 +9808,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_v_childname = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":783 + /* "numpy.pxd":783 * * for childname in descr.names: * fields = descr.fields[childname] # <<<<<<<<<<<<<< @@ -9810,10 +9819,10 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_GOTREF(__pyx_t_3); if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_fields)); - __pyx_v_fields = ((PyObject *)__pyx_t_3); + __pyx_v_fields = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":784 + /* "numpy.pxd":784 * for childname in descr.names: * fields = descr.fields[childname] * child, new_offset = fields # <<<<<<<<<<<<<< @@ -9836,7 +9845,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx {__pyx_filename = __pyx_f[1]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":786 + /* "numpy.pxd":786 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< @@ -9861,29 +9870,23 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":787 + /* "numpy.pxd":787 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< * * if ((child.byteorder == '>' and little_endian) or */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_50), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_INCREF(((PyObject *)__pyx_kp_u_24)); - PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_u_24)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_24)); - __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L5; } __pyx_L5:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":789 + /* "numpy.pxd":789 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< @@ -9898,7 +9901,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } if (!__pyx_t_7) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":790 + /* "numpy.pxd":790 * * if ((child.byteorder == '>' and little_endian) or * (child.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< @@ -9918,21 +9921,15 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } if (__pyx_t_6) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":791 + /* "numpy.pxd":791 * if ((child.byteorder == '>' and little_endian) or * (child.byteorder == '<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(((PyObject *)__pyx_kp_u_22)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_u_22)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_22)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_51), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[1]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -9940,7 +9937,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L6:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":801 + /* "numpy.pxd":801 * * # Output padding bytes * while offset[0] < new_offset: # <<<<<<<<<<<<<< @@ -9957,7 +9954,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_6) break; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":802 + /* "numpy.pxd":802 * # Output padding bytes * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< @@ -9966,35 +9963,37 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ (__pyx_v_f[0]) = 120; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":803 + /* "numpy.pxd":803 * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte * f += 1 # <<<<<<<<<<<<<< * offset[0] += 1 * */ - __pyx_v_f += 1; + __pyx_v_f = (__pyx_v_f + 1); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":804 + /* "numpy.pxd":804 * f[0] = 120 # "x"; pad byte * f += 1 * offset[0] += 1 # <<<<<<<<<<<<<< * * offset[0] += child.itemsize */ - (__pyx_v_offset[0]) += 1; + __pyx_t_10 = 0; + (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + 1); } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":806 + /* "numpy.pxd":806 * offset[0] += 1 * * offset[0] += child.itemsize # <<<<<<<<<<<<<< * * if not PyDataType_HASFIELDS(child): */ - (__pyx_v_offset[0]) += __pyx_v_child->elsize; + __pyx_t_10 = 0; + (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + __pyx_v_child->elsize); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":808 + /* "numpy.pxd":808 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -10004,7 +10003,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = (!PyDataType_HASFIELDS(__pyx_v_child)); if (__pyx_t_6) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":809 + /* "numpy.pxd":809 * * if not PyDataType_HASFIELDS(child): * t = child.type_num # <<<<<<<<<<<<<< @@ -10017,7 +10016,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_v_t = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":810 + /* "numpy.pxd":810 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -10027,408 +10026,402 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = ((__pyx_v_end - __pyx_v_f) < 5); if (__pyx_t_6) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":811 + /* "numpy.pxd":811 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_53), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(((PyObject *)__pyx_kp_u_25)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_u_25)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_25)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[1]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L10; } __pyx_L10:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":814 + /* "numpy.pxd":814 * * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" */ - __pyx_t_5 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 98; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":815 + /* "numpy.pxd":815 * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" */ - __pyx_t_3 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 66; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":816 + /* "numpy.pxd":816 * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" */ - __pyx_t_5 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 104; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":817 + /* "numpy.pxd":817 * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" */ - __pyx_t_3 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 72; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":818 + /* "numpy.pxd":818 * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" */ - __pyx_t_5 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 105; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":819 + /* "numpy.pxd":819 * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" */ - __pyx_t_3 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 73; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":820 + /* "numpy.pxd":820 * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" */ - __pyx_t_5 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 108; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":821 + /* "numpy.pxd":821 * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" */ - __pyx_t_3 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 76; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":822 + /* "numpy.pxd":822 * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" */ - __pyx_t_5 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 113; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":823 + /* "numpy.pxd":823 * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" */ - __pyx_t_3 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 81; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":824 + /* "numpy.pxd":824 * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" */ - __pyx_t_5 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 102; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":825 + /* "numpy.pxd":825 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf */ - __pyx_t_3 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 100; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":826 + /* "numpy.pxd":826 * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd */ - __pyx_t_5 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 103; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":827 + /* "numpy.pxd":827 * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg */ - __pyx_t_3 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; (__pyx_v_f[1]) = 102; - __pyx_v_f += 1; + __pyx_v_f = (__pyx_v_f + 1); goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":828 + /* "numpy.pxd":828 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg * elif t == NPY_OBJECT: f[0] = 79 #"O" */ - __pyx_t_5 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; (__pyx_v_f[1]) = 100; - __pyx_v_f += 1; + __pyx_v_f = (__pyx_v_f + 1); goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":829 + /* "numpy.pxd":829 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: */ - __pyx_t_3 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; (__pyx_v_f[1]) = 103; - __pyx_v_f += 1; + __pyx_v_f = (__pyx_v_f + 1); goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":830 + /* "numpy.pxd":830 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) */ - __pyx_t_5 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 79; goto __pyx_L11; } /*else*/ { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":832 + /* "numpy.pxd":832 * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< * f += 1 * else: */ - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_23), __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_48), __pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_5)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_5)); + __pyx_t_5 = 0; + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L11:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":833 + /* "numpy.pxd":833 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * f += 1 # <<<<<<<<<<<<<< * else: * # Cython ignores struct boundary information ("T{...}"), */ - __pyx_v_f += 1; + __pyx_v_f = (__pyx_v_f + 1); goto __pyx_L9; } /*else*/ { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":837 + /* "numpy.pxd":837 * # Cython ignores struct boundary information ("T{...}"), * # so don't output it * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< * return f * */ - __pyx_t_10 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_f = __pyx_t_10; + __pyx_t_11 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_f = __pyx_t_11; } __pyx_L9:; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":838 + /* "numpy.pxd":838 * # so don't output it * f = _util_dtypestring(child, f, end, offset) * return f # <<<<<<<<<<<<<< @@ -10457,7 +10450,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx return __pyx_r; } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":953 +/* "numpy.pxd":953 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -10468,9 +10461,10 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { PyObject *__pyx_v_baseptr; int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("set_array_base"); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":955 + /* "numpy.pxd":955 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -10480,7 +10474,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __pyx_t_1 = (__pyx_v_base == Py_None); if (__pyx_t_1) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":956 + /* "numpy.pxd":956 * cdef PyObject* baseptr * if base is None: * baseptr = NULL # <<<<<<<<<<<<<< @@ -10492,16 +10486,19 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } /*else*/ { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":958 + /* "numpy.pxd":958 * baseptr = NULL * else: * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< * baseptr = <PyObject*>base * Py_XDECREF(arr.base) */ - Py_INCREF(__pyx_v_base); + __pyx_t_2 = __pyx_v_base; + __Pyx_INCREF(__pyx_t_2); + Py_INCREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":959 + /* "numpy.pxd":959 * else: * Py_INCREF(base) # important to do this before decref below! * baseptr = <PyObject*>base # <<<<<<<<<<<<<< @@ -10512,7 +10509,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } __pyx_L3:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":960 + /* "numpy.pxd":960 * Py_INCREF(base) # important to do this before decref below! * baseptr = <PyObject*>base * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< @@ -10521,7 +10518,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_XDECREF(__pyx_v_arr->base); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":961 + /* "numpy.pxd":961 * baseptr = <PyObject*>base * Py_XDECREF(arr.base) * arr.base = baseptr # <<<<<<<<<<<<<< @@ -10533,7 +10530,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyFinishContext(); } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":963 +/* "numpy.pxd":963 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -10546,7 +10543,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base"); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":964 + /* "numpy.pxd":964 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -10556,7 +10553,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_t_1 = (__pyx_v_arr->base == NULL); if (__pyx_t_1) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":965 + /* "numpy.pxd":965 * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: * return None # <<<<<<<<<<<<<< @@ -10571,7 +10568,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py } /*else*/ { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":967 + /* "numpy.pxd":967 * return None * else: * return <object>arr.base # <<<<<<<<<<<<<< @@ -10589,26 +10586,26 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __Pyx_RefNannyFinishContext(); return __pyx_r; } -static struct __pyx_vtabstruct_7sklearn_9ball_tree_BallTree __pyx_vtable_7sklearn_9ball_tree_BallTree; +static struct __pyx_vtabstruct_7scikits_5learn_9ball_tree_BallTree __pyx_vtable_7scikits_5learn_9ball_tree_BallTree; -static PyObject *__pyx_tp_new_7sklearn_9ball_tree_BallTree(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_7sklearn_9ball_tree_BallTree *p; +static PyObject *__pyx_tp_new_7scikits_5learn_9ball_tree_BallTree(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; - p = ((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)o); - p->__pyx_vtab = __pyx_vtabptr_7sklearn_9ball_tree_BallTree; + p = ((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)o); + p->__pyx_vtab = __pyx_vtabptr_7scikits_5learn_9ball_tree_BallTree; p->data = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); p->idx_array = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); p->node_centroid_arr = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); p->node_info_arr = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - if (__pyx_pf_7sklearn_9ball_tree_8BallTree___cinit__(o, __pyx_empty_tuple, NULL) < 0) { + if (__pyx_pf_7scikits_5learn_9ball_tree_8BallTree___cinit__(o, __pyx_empty_tuple, NULL) < 0) { Py_DECREF(o); o = 0; } return o; } -static void __pyx_tp_dealloc_7sklearn_9ball_tree_BallTree(PyObject *o) { - struct __pyx_obj_7sklearn_9ball_tree_BallTree *p = (struct __pyx_obj_7sklearn_9ball_tree_BallTree *)o; +static void __pyx_tp_dealloc_7scikits_5learn_9ball_tree_BallTree(PyObject *o) { + struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *p = (struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)o; Py_XDECREF(((PyObject *)p->data)); Py_XDECREF(((PyObject *)p->idx_array)); Py_XDECREF(((PyObject *)p->node_centroid_arr)); @@ -10616,9 +10613,9 @@ static void __pyx_tp_dealloc_7sklearn_9ball_tree_BallTree(PyObject *o) { (*Py_TYPE(o)->tp_free)(o); } -static int __pyx_tp_traverse_7sklearn_9ball_tree_BallTree(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_7scikits_5learn_9ball_tree_BallTree(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_7sklearn_9ball_tree_BallTree *p = (struct __pyx_obj_7sklearn_9ball_tree_BallTree *)o; + struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *p = (struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)o; if (p->data) { e = (*v)(((PyObject*)p->data), a); if (e) return e; } @@ -10634,8 +10631,8 @@ static int __pyx_tp_traverse_7sklearn_9ball_tree_BallTree(PyObject *o, visitproc return 0; } -static int __pyx_tp_clear_7sklearn_9ball_tree_BallTree(PyObject *o) { - struct __pyx_obj_7sklearn_9ball_tree_BallTree *p = (struct __pyx_obj_7sklearn_9ball_tree_BallTree *)o; +static int __pyx_tp_clear_7scikits_5learn_9ball_tree_BallTree(PyObject *o) { + struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *p = (struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)o; PyObject* tmp; tmp = ((PyObject*)p->data); p->data = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); @@ -10652,21 +10649,21 @@ static int __pyx_tp_clear_7sklearn_9ball_tree_BallTree(PyObject *o) { return 0; } -static PyObject *__pyx_getprop_7sklearn_9ball_tree_8BallTree_data(PyObject *o, void *x) { - return __pyx_pf_7sklearn_9ball_tree_8BallTree_4data___get__(o); +static PyObject *__pyx_getprop_7scikits_5learn_9ball_tree_8BallTree_data(PyObject *o, void *x) { + return __pyx_pf_7scikits_5learn_9ball_tree_8BallTree_4data___get__(o); } -static PyMethodDef __pyx_methods_7sklearn_9ball_tree_BallTree[] = { - {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__pyx_pf_7sklearn_9ball_tree_8BallTree___reduce__, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7sklearn_9ball_tree_8BallTree___reduce__)}, - {__Pyx_NAMESTR("__getstate__"), (PyCFunction)__pyx_pf_7sklearn_9ball_tree_8BallTree___getstate__, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7sklearn_9ball_tree_8BallTree___getstate__)}, - {__Pyx_NAMESTR("__setstate__"), (PyCFunction)__pyx_pf_7sklearn_9ball_tree_8BallTree___setstate__, METH_O, __Pyx_DOCSTR(__pyx_doc_7sklearn_9ball_tree_8BallTree___setstate__)}, - {__Pyx_NAMESTR("query"), (PyCFunction)__pyx_pf_7sklearn_9ball_tree_8BallTree_query, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7sklearn_9ball_tree_8BallTree_query)}, - {__Pyx_NAMESTR("query_radius"), (PyCFunction)__pyx_pf_7sklearn_9ball_tree_8BallTree_query_radius, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7sklearn_9ball_tree_8BallTree_query_radius)}, +static PyMethodDef __pyx_methods_7scikits_5learn_9ball_tree_BallTree[] = { + {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_2__reduce__, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7scikits_5learn_9ball_tree_8BallTree_2__reduce__)}, + {__Pyx_NAMESTR("__getstate__"), (PyCFunction)__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_3__getstate__, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_7scikits_5learn_9ball_tree_8BallTree_3__getstate__)}, + {__Pyx_NAMESTR("__setstate__"), (PyCFunction)__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_4__setstate__, METH_O, __Pyx_DOCSTR(__pyx_doc_7scikits_5learn_9ball_tree_8BallTree_4__setstate__)}, + {__Pyx_NAMESTR("query"), (PyCFunction)__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_5query, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7scikits_5learn_9ball_tree_8BallTree_5query)}, + {__Pyx_NAMESTR("query_radius"), (PyCFunction)__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_6query_radius, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7scikits_5learn_9ball_tree_8BallTree_6query_radius)}, {0, 0, 0, 0} }; -static struct PyGetSetDef __pyx_getsets_7sklearn_9ball_tree_BallTree[] = { - {(char *)"data", __pyx_getprop_7sklearn_9ball_tree_8BallTree_data, 0, 0, 0}, +static struct PyGetSetDef __pyx_getsets_7scikits_5learn_9ball_tree_BallTree[] = { + {(char *)"data", __pyx_getprop_7scikits_5learn_9ball_tree_8BallTree_data, 0, 0, 0}, {0, 0, 0, 0, 0} }; @@ -10768,12 +10765,12 @@ static PyBufferProcs __pyx_tp_as_buffer_BallTree = { #endif }; -PyTypeObject __pyx_type_7sklearn_9ball_tree_BallTree = { +static PyTypeObject __pyx_type_7scikits_5learn_9ball_tree_BallTree = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("sklearn.ball_tree.BallTree"), /*tp_name*/ - sizeof(struct __pyx_obj_7sklearn_9ball_tree_BallTree), /*tp_basicsize*/ + __Pyx_NAMESTR("scikits.learn.ball_tree.BallTree"), /*tp_name*/ + sizeof(struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_7sklearn_9ball_tree_BallTree, /*tp_dealloc*/ + __pyx_tp_dealloc_7scikits_5learn_9ball_tree_BallTree, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -10792,25 +10789,25 @@ PyTypeObject __pyx_type_7sklearn_9ball_tree_BallTree = { 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_BallTree, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ __Pyx_DOCSTR("\n Ball Tree for fast nearest-neighbor searches :\n\n BallTree(X, leaf_size=20, p=2.0)\n\n Parameters\n ----------\n X : array-like, shape = [n_samples, n_features]\n n_samples is the number of points in the data set, and\n n_features is the dimension of the parameter space.\n Note: if X is a C-contiguous array of doubles then data will\n not be copied. Otherwise, an internal copy will be made.\n\n leaf_size : positive integer (default = 20)\n Number of points at which to switch to brute-force. Changing\n leaf_size will not affect the results of a query, but can\n significantly impact the speed of a query and the memory required\n to store the built ball tree. The amount of memory needed to\n store the tree scales as\n 2 ** (1 + floor(log2((n_samples - 1) / leaf_size))) - 1\n For a specified ``leaf_size``, a leaf node is guaranteed to\n satisfy ``leaf_size <= n_points <= 2 * leaf_size``, except in\n the case that ``n_samples < leaf_size``.\n\n p : distance metric for the BallTree. ``p`` encodes the Minkowski\n p-distance:\n D = sum((X[i] - X[j]) ** p) ** (1. / p)\n p must be greater than or equal to 1, so that the triangle\n inequality will hold. If ``p == np.inf``, then the distance is\n equivalent to\n D = max(X[i] - X[j])\n\n Examples\n --------\n Query for k-nearest neighbors\n\n >>> import numpy as np\n >>> np.random.seed(0)\n >>> X = np.random.random((10,3)) # 10 points in 3 dimensions\n >>> ball_tree = BallTree(X, leaf_size=2)\n >>> dist, ind = ball_tree.query(X[0], n_neighbors=3)\n >>> print ind # indices of 3 closest neighbors\n [0 3 1]\n >>> print dist # distances to 3 closest neighbors\n [ 0. 0.19662693 0.29473397]\n\n Pickle and Unpickle a ball tree (using protocol = 2). Note that the\n state of the tree is saved in the pickle operation: the tree is not\n rebuilt on un-pickling\n\n >>> import numpy as np\n >>> import pickle\n >>> np.random.seed(0)\n >>> X = np.random.random((10,3)) # 10 points in 3 dimensions\n >>> ball_tree = BallTree(X, leaf_size=2)\n >>> s = pickle.dumps(ball_tree, protocol=2)\n >>> ball_tree_copy = pickle.loads(s)\n >>> dist, ind = ball_tree_copy.query(X[0], k=3)\n >>> print ind # indices of 3 closest neighbors\n [0 3 1]\n >>> print dist # distances to 3 closest neighbors\n [ 0. 0.19662693 0.29473397]\n "), /*tp_doc*/ - __pyx_tp_traverse_7sklearn_9ball_tree_BallTree, /*tp_traverse*/ - __pyx_tp_clear_7sklearn_9ball_tree_BallTree, /*tp_clear*/ + __pyx_tp_traverse_7scikits_5learn_9ball_tree_BallTree, /*tp_traverse*/ + __pyx_tp_clear_7scikits_5learn_9ball_tree_BallTree, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_7sklearn_9ball_tree_BallTree, /*tp_methods*/ + __pyx_methods_7scikits_5learn_9ball_tree_BallTree, /*tp_methods*/ 0, /*tp_members*/ - __pyx_getsets_7sklearn_9ball_tree_BallTree, /*tp_getset*/ + __pyx_getsets_7scikits_5learn_9ball_tree_BallTree, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - __pyx_pf_7sklearn_9ball_tree_8BallTree___init__, /*tp_init*/ + __pyx_pf_7scikits_5learn_9ball_tree_8BallTree_1__init__, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_7sklearn_9ball_tree_BallTree, /*tp_new*/ + __pyx_tp_new_7scikits_5learn_9ball_tree_BallTree, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -10825,7 +10822,6 @@ PyTypeObject __pyx_type_7sklearn_9ball_tree_BallTree = { }; static PyMethodDef __pyx_methods[] = { - {__Pyx_NAMESTR("newObj"), (PyCFunction)__pyx_pf_7sklearn_9ball_tree_newObj, METH_O, __Pyx_DOCSTR(0)}, {0, 0, 0, 0} }; @@ -10833,7 +10829,7 @@ static PyMethodDef __pyx_methods[] = { static struct PyModuleDef __pyx_moduledef = { PyModuleDef_HEAD_INIT, __Pyx_NAMESTR("ball_tree"), - __Pyx_DOCSTR(__pyx_k_26), /* m_doc */ + __Pyx_DOCSTR(__pyx_k_54), /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ @@ -10845,32 +10841,31 @@ static struct PyModuleDef __pyx_moduledef = { static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0}, + {&__pyx_kp_s_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 0, 1, 0}, {&__pyx_kp_s_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 0, 1, 0}, - {&__pyx_kp_s_14, __pyx_k_14, sizeof(__pyx_k_14), 0, 0, 1, 0}, {&__pyx_kp_s_15, __pyx_k_15, sizeof(__pyx_k_15), 0, 0, 1, 0}, - {&__pyx_n_s_16, __pyx_k_16, sizeof(__pyx_k_16), 0, 0, 1, 1}, - {&__pyx_n_s_17, __pyx_k_17, sizeof(__pyx_k_17), 0, 0, 1, 1}, - {&__pyx_kp_s_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 0, 1, 0}, - {&__pyx_kp_s_19, __pyx_k_19, sizeof(__pyx_k_19), 0, 0, 1, 0}, - {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0}, - {&__pyx_kp_u_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 1, 0, 0}, - {&__pyx_kp_u_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 1, 0, 0}, - {&__pyx_kp_u_22, __pyx_k_22, sizeof(__pyx_k_22), 0, 1, 0, 0}, - {&__pyx_kp_u_23, __pyx_k_23, sizeof(__pyx_k_23), 0, 1, 0, 0}, - {&__pyx_kp_u_24, __pyx_k_24, sizeof(__pyx_k_24), 0, 1, 0, 0}, - {&__pyx_kp_u_25, __pyx_k_25, sizeof(__pyx_k_25), 0, 1, 0, 0}, - {&__pyx_kp_u_27, __pyx_k_27, sizeof(__pyx_k_27), 0, 1, 0, 0}, - {&__pyx_kp_u_28, __pyx_k_28, sizeof(__pyx_k_28), 0, 1, 0, 0}, - {&__pyx_kp_u_29, __pyx_k_29, sizeof(__pyx_k_29), 0, 1, 0, 0}, + {&__pyx_kp_s_17, __pyx_k_17, sizeof(__pyx_k_17), 0, 0, 1, 0}, + {&__pyx_kp_s_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 0, 1, 0}, + {&__pyx_kp_s_22, __pyx_k_22, sizeof(__pyx_k_22), 0, 0, 1, 0}, + {&__pyx_kp_s_27, __pyx_k_27, sizeof(__pyx_k_27), 0, 0, 1, 0}, + {&__pyx_kp_s_29, __pyx_k_29, sizeof(__pyx_k_29), 0, 0, 1, 0}, {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0}, - {&__pyx_kp_u_30, __pyx_k_30, sizeof(__pyx_k_30), 0, 1, 0, 0}, - {&__pyx_kp_u_31, __pyx_k_31, sizeof(__pyx_k_31), 0, 1, 0, 0}, - {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0}, - {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0}, - {&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0}, - {&__pyx_kp_s_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 0, 1, 0}, - {&__pyx_kp_s_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 0, 1, 0}, - {&__pyx_n_s__BallTree, __pyx_k__BallTree, sizeof(__pyx_k__BallTree), 0, 0, 1, 1}, + {&__pyx_kp_s_33, __pyx_k_33, sizeof(__pyx_k_33), 0, 0, 1, 0}, + {&__pyx_n_s_36, __pyx_k_36, sizeof(__pyx_k_36), 0, 0, 1, 1}, + {&__pyx_n_s_37, __pyx_k_37, sizeof(__pyx_k_37), 0, 0, 1, 1}, + {&__pyx_kp_s_38, __pyx_k_38, sizeof(__pyx_k_38), 0, 0, 1, 0}, + {&__pyx_kp_s_40, __pyx_k_40, sizeof(__pyx_k_40), 0, 0, 1, 0}, + {&__pyx_kp_u_42, __pyx_k_42, sizeof(__pyx_k_42), 0, 1, 0, 0}, + {&__pyx_kp_u_44, __pyx_k_44, sizeof(__pyx_k_44), 0, 1, 0, 0}, + {&__pyx_kp_u_46, __pyx_k_46, sizeof(__pyx_k_46), 0, 1, 0, 0}, + {&__pyx_kp_u_48, __pyx_k_48, sizeof(__pyx_k_48), 0, 1, 0, 0}, + {&__pyx_kp_u_49, __pyx_k_49, sizeof(__pyx_k_49), 0, 1, 0, 0}, + {&__pyx_kp_u_52, __pyx_k_52, sizeof(__pyx_k_52), 0, 1, 0, 0}, + {&__pyx_n_s_55, __pyx_k_55, sizeof(__pyx_k_55), 0, 0, 1, 1}, + {&__pyx_kp_u_56, __pyx_k_56, sizeof(__pyx_k_56), 0, 1, 0, 0}, + {&__pyx_kp_u_57, __pyx_k_57, sizeof(__pyx_k_57), 0, 1, 0, 0}, + {&__pyx_kp_u_58, __pyx_k_58, sizeof(__pyx_k_58), 0, 1, 0, 0}, + {&__pyx_kp_u_59, __pyx_k_59, sizeof(__pyx_k_59), 0, 1, 0, 0}, {&__pyx_n_s__C, __pyx_k__C, sizeof(__pyx_k__C), 0, 0, 1, 1}, {&__pyx_n_s__DTYPE, __pyx_k__DTYPE, sizeof(__pyx_k__DTYPE), 0, 0, 1, 1}, {&__pyx_n_s__ITYPE, __pyx_k__ITYPE, sizeof(__pyx_k__ITYPE), 0, 0, 1, 1}, @@ -10880,8 +10875,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s____getstate__, __pyx_k____getstate__, sizeof(__pyx_k____getstate__), 0, 0, 1, 1}, {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1}, {&__pyx_n_s____new__, __pyx_k____new__, sizeof(__pyx_k____new__), 0, 0, 1, 1}, - {&__pyx_n_s____reduce__, __pyx_k____reduce__, sizeof(__pyx_k____reduce__), 0, 0, 1, 1}, - {&__pyx_n_s____setstate__, __pyx_k____setstate__, sizeof(__pyx_k____setstate__), 0, 0, 1, 1}, {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1}, {&__pyx_n_s__arange, __pyx_k__arange, sizeof(__pyx_k__arange), 0, 0, 1, 1}, {&__pyx_n_s__asarray, __pyx_k__asarray, sizeof(__pyx_k__asarray), 0, 0, 1, 1}, @@ -10931,9 +10924,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s__ones, __pyx_k__ones, sizeof(__pyx_k__ones), 0, 0, 1, 1}, {&__pyx_n_s__order, __pyx_k__order, sizeof(__pyx_k__order), 0, 0, 1, 1}, {&__pyx_n_s__p, __pyx_k__p, sizeof(__pyx_k__p), 0, 0, 1, 1}, - {&__pyx_n_s__query, __pyx_k__query, sizeof(__pyx_k__query), 0, 0, 1, 1}, {&__pyx_n_s__query_one_, __pyx_k__query_one_, sizeof(__pyx_k__query_one_), 0, 0, 1, 1}, - {&__pyx_n_s__query_radius, __pyx_k__query_radius, sizeof(__pyx_k__query_radius), 0, 0, 1, 1}, {&__pyx_n_s__query_radius_count_, __pyx_k__query_radius_count_, sizeof(__pyx_k__query_radius_count_), 0, 0, 1, 1}, {&__pyx_n_s__r, __pyx_k__r, sizeof(__pyx_k__r), 0, 0, 1, 1}, {&__pyx_n_s__radius, __pyx_k__radius, sizeof(__pyx_k__radius), 0, 0, 1, 1}, @@ -10960,6 +10951,397 @@ static int __Pyx_InitCachedBuiltins(void) { return -1; } +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants"); + + /* "scikits/learn/ball_tree.pyx":360 + * #print "resize", self.n, new_size + * if new_size < self.n: + * raise ValueError("new_size smaller than current") # <<<<<<<<<<<<<< + * + * self.size = new_size + */ + __pyx_k_tuple_2 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_2)); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_1)); + PyTuple_SET_ITEM(__pyx_k_tuple_2, 0, ((PyObject *)__pyx_kp_s_1)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_2)); + + /* "scikits/learn/ball_tree.pyx":379 + * cdef inline stack_item stack_pop(stack* self): + * if self.n == 0: + * raise ValueError("popping empty stack") # <<<<<<<<<<<<<< + * + * self.n -= 1 + */ + __pyx_k_tuple_4 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_4)); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_3)); + PyTuple_SET_ITEM(__pyx_k_tuple_4, 0, ((PyObject *)__pyx_kp_s_3)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_3)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_4)); + + /* "scikits/learn/ball_tree.pyx":473 + * in rare cases where __init__ is not called + * """ + * self.data = np.empty((0,0), dtype=DTYPE) # <<<<<<<<<<<<<< + * self.idx_array = np.empty(0, dtype=ITYPE) + * self.node_centroid_arr = np.empty((0,0), dtype=DTYPE) + */ + __pyx_k_tuple_5 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_5)); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_k_tuple_5, 0, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_k_tuple_5, 1, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_5)); + __pyx_k_tuple_6 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_6)); + __Pyx_INCREF(((PyObject *)__pyx_k_tuple_5)); + PyTuple_SET_ITEM(__pyx_k_tuple_6, 0, ((PyObject *)__pyx_k_tuple_5)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_5)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_6)); + + /* "scikits/learn/ball_tree.pyx":474 + * """ + * self.data = np.empty((0,0), dtype=DTYPE) + * self.idx_array = np.empty(0, dtype=ITYPE) # <<<<<<<<<<<<<< + * self.node_centroid_arr = np.empty((0,0), dtype=DTYPE) + * self.node_info_arr = np.empty(0, dtype='c') + */ + __pyx_k_tuple_7 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_7)); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_k_tuple_7, 0, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_7)); + + /* "scikits/learn/ball_tree.pyx":475 + * self.data = np.empty((0,0), dtype=DTYPE) + * self.idx_array = np.empty(0, dtype=ITYPE) + * self.node_centroid_arr = np.empty((0,0), dtype=DTYPE) # <<<<<<<<<<<<<< + * self.node_info_arr = np.empty(0, dtype='c') + * + */ + __pyx_k_tuple_8 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_8)); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_k_tuple_8, 0, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_k_tuple_8, 1, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_8)); + __pyx_k_tuple_9 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_9)); + __Pyx_INCREF(((PyObject *)__pyx_k_tuple_8)); + PyTuple_SET_ITEM(__pyx_k_tuple_9, 0, ((PyObject *)__pyx_k_tuple_8)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_8)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_9)); + + /* "scikits/learn/ball_tree.pyx":476 + * self.idx_array = np.empty(0, dtype=ITYPE) + * self.node_centroid_arr = np.empty((0,0), dtype=DTYPE) + * self.node_info_arr = np.empty(0, dtype='c') # <<<<<<<<<<<<<< + * + * def __init__(self, X, ITYPE_t leaf_size=20, DTYPE_t p=2): + */ + __pyx_k_tuple_10 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_10)); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_k_tuple_10, 0, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_10)); + + /* "scikits/learn/ball_tree.pyx":482 + * + * if X.size == 0: + * raise ValueError("X is an empty array") # <<<<<<<<<<<<<< + * + * if self.data.ndim != 2: + */ + __pyx_k_tuple_12 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_12)); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_11)); + PyTuple_SET_ITEM(__pyx_k_tuple_12, 0, ((PyObject *)__pyx_kp_s_11)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_11)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_12)); + + /* "scikits/learn/ball_tree.pyx":485 + * + * if self.data.ndim != 2: + * raise ValueError("X should have two dimensions") # <<<<<<<<<<<<<< + * + * if p < 1: + */ + __pyx_k_tuple_14 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_14)); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_13)); + PyTuple_SET_ITEM(__pyx_k_tuple_14, 0, ((PyObject *)__pyx_kp_s_13)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_13)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_14)); + + /* "scikits/learn/ball_tree.pyx":488 + * + * if p < 1: + * raise ValueError("p must be greater than or equal to 1") # <<<<<<<<<<<<<< + * self.p = p + * + */ + __pyx_k_tuple_16 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_16)); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_15)); + PyTuple_SET_ITEM(__pyx_k_tuple_16, 0, ((PyObject *)__pyx_kp_s_15)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_15)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_16)); + + /* "scikits/learn/ball_tree.pyx":492 + * + * if leaf_size < 1: + * raise ValueError("leaf_size must be greater than or equal to 1") # <<<<<<<<<<<<<< + * self.leaf_size = leaf_size + * + */ + __pyx_k_tuple_18 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_18)); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_17)); + PyTuple_SET_ITEM(__pyx_k_tuple_18, 0, ((PyObject *)__pyx_kp_s_17)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_17)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_18)); + + /* "scikits/learn/ball_tree.pyx":593 + * + * if X.shape[-1] != self.data.shape[1]: + * raise ValueError("query data dimension must match BallTree " # <<<<<<<<<<<<<< + * "data dimension") + * + */ + __pyx_k_tuple_21 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_21)); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_20)); + PyTuple_SET_ITEM(__pyx_k_tuple_21, 0, ((PyObject *)__pyx_kp_s_20)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_20)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_21)); + + /* "scikits/learn/ball_tree.pyx":597 + * + * if k > self.data.shape[0]: + * raise ValueError("k must be less than or equal " # <<<<<<<<<<<<<< + * "to the number of training points") + * + */ + __pyx_k_tuple_23 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_23)); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_22)); + PyTuple_SET_ITEM(__pyx_k_tuple_23, 0, ((PyObject *)__pyx_kp_s_22)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_22)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_23)); + + /* "scikits/learn/ball_tree.pyx":711 + * """ + * if count_only and return_distance: + * raise ValueError("count_only and return_distance " # <<<<<<<<<<<<<< + * "cannot both be true") + * + */ + __pyx_k_tuple_28 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_28)); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_27)); + PyTuple_SET_ITEM(__pyx_k_tuple_28, 0, ((PyObject *)__pyx_kp_s_27)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_27)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_28)); + + /* "scikits/learn/ball_tree.pyx":715 + * + * if sort_results and not return_distance: + * raise ValueError("return_distance must be True if sort_distances " # <<<<<<<<<<<<<< + * "is True") + * + */ + __pyx_k_tuple_30 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_30)); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_29)); + PyTuple_SET_ITEM(__pyx_k_tuple_30, 0, ((PyObject *)__pyx_kp_s_29)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_29)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_30)); + + /* "scikits/learn/ball_tree.pyx":726 + * X = np.atleast_2d(X) + * if X.shape[-1] != self.data.shape[1]: + * raise ValueError("query data dimension must match BallTree " # <<<<<<<<<<<<<< + * "data dimension") + * + */ + __pyx_k_tuple_31 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_31)); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_20)); + PyTuple_SET_ITEM(__pyx_k_tuple_31, 0, ((PyObject *)__pyx_kp_s_20)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_20)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_31)); + + /* "scikits/learn/ball_tree.pyx":732 + * r = np.asarray(r, dtype=DTYPE, order='C') + * r = np.atleast_1d(r) + * if r.shape == (1,): # <<<<<<<<<<<<<< + * r = r[0] * np.ones(X.shape[:-1], dtype=np.double) + * else: + */ + __pyx_k_tuple_32 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_32)); + __Pyx_INCREF(__pyx_int_1); + PyTuple_SET_ITEM(__pyx_k_tuple_32, 0, __pyx_int_1); + __Pyx_GIVEREF(__pyx_int_1); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_32)); + + /* "scikits/learn/ball_tree.pyx":736 + * else: + * if r.shape != X.shape[:-1]: + * raise ValueError("r must be broadcastable to X.shape") # <<<<<<<<<<<<<< + * + * # flatten X and r for iteration + */ + __pyx_k_tuple_34 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_34)); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_33)); + PyTuple_SET_ITEM(__pyx_k_tuple_34, 0, ((PyObject *)__pyx_kp_s_33)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_33)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_34)); + + /* "scikits/learn/ball_tree.pyx":741 + * orig_shape = X.shape + * X = X.reshape((-1, X.shape[-1])) + * r = r.reshape(-1) # <<<<<<<<<<<<<< + * + * cdef stack node_stack + */ + __pyx_k_tuple_35 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_35)); + __Pyx_INCREF(__pyx_int_neg_1); + PyTuple_SET_ITEM(__pyx_k_tuple_35, 0, __pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_int_neg_1); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_35)); + + /* "scikits/learn/ball_tree.pyx":860 + * + * if parent_info.is_leaf: + * raise ValueError("Fatal: parent is a leaf. Memory " # <<<<<<<<<<<<<< + * "allocation is flawed") + * + */ + __pyx_k_tuple_39 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_39)); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_38)); + PyTuple_SET_ITEM(__pyx_k_tuple_39, 0, ((PyObject *)__pyx_kp_s_38)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_38)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_39)); + + /* "scikits/learn/ball_tree.pyx":885 + * + * if n_points == 0: + * raise ValueError("zero-sized node") # <<<<<<<<<<<<<< + * + * elif n_points == 1: + */ + __pyx_k_tuple_41 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_41)); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_40)); + PyTuple_SET_ITEM(__pyx_k_tuple_41, 0, ((PyObject *)__pyx_kp_s_40)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_40)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_41)); + + /* "numpy.pxd":206 + * 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_k_tuple_43 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_43)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_43)); + __Pyx_INCREF(((PyObject *)__pyx_kp_u_42)); + PyTuple_SET_ITEM(__pyx_k_tuple_43, 0, ((PyObject *)__pyx_kp_u_42)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_42)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_43)); + + /* "numpy.pxd":210 + * 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_k_tuple_45 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_45)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_45)); + __Pyx_INCREF(((PyObject *)__pyx_kp_u_44)); + PyTuple_SET_ITEM(__pyx_k_tuple_45, 0, ((PyObject *)__pyx_kp_u_44)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_44)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_45)); + + /* "numpy.pxd":248 + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' 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_k_tuple_47 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_47)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_47)); + __Pyx_INCREF(((PyObject *)__pyx_kp_u_46)); + PyTuple_SET_ITEM(__pyx_k_tuple_47, 0, ((PyObject *)__pyx_kp_u_46)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_46)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_47)); + + /* "numpy.pxd":787 + * + * if (end - f) - (new_offset - offset[0]) < 15: + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + * + * if ((child.byteorder == '>' and little_endian) or + */ + __pyx_k_tuple_50 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_50)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_50)); + __Pyx_INCREF(((PyObject *)__pyx_kp_u_49)); + PyTuple_SET_ITEM(__pyx_k_tuple_50, 0, ((PyObject *)__pyx_kp_u_49)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_49)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_50)); + + /* "numpy.pxd":791 + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_k_tuple_51 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_51)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_51)); + __Pyx_INCREF(((PyObject *)__pyx_kp_u_46)); + PyTuple_SET_ITEM(__pyx_k_tuple_51, 0, ((PyObject *)__pyx_kp_u_46)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_46)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_51)); + + /* "numpy.pxd":811 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_k_tuple_53 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_53)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_53)); + __Pyx_INCREF(((PyObject *)__pyx_kp_u_52)); + PyTuple_SET_ITEM(__pyx_k_tuple_53, 0, ((PyObject *)__pyx_kp_u_52)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_52)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_53)); + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; @@ -10982,8 +11364,7 @@ PyMODINIT_FUNC PyInit_ball_tree(void) { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_t_3; - PyObject *__pyx_t_4 = NULL; + __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_t_3; #if CYTHON_REFNANNY void* __pyx_refnanny = NULL; __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); @@ -11009,7 +11390,7 @@ PyMODINIT_FUNC PyInit_ball_tree(void) #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4(__Pyx_NAMESTR("ball_tree"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_26), 0, PYTHON_API_VERSION); + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("ball_tree"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_54), 0, PYTHON_API_VERSION); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif @@ -11022,32 +11403,26 @@ PyMODINIT_FUNC PyInit_ball_tree(void) if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_module_is_main_sklearn__ball_tree) { + if (__pyx_module_is_main_scikits__learn__ball_tree) { if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; } /*--- Builtin init code ---*/ if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Constants init code ---*/ + if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ - __pyx_vtabptr_7sklearn_9ball_tree_BallTree = &__pyx_vtable_7sklearn_9ball_tree_BallTree; - #if PY_MAJOR_VERSION >= 3 - __pyx_vtable_7sklearn_9ball_tree_BallTree.build_tree_ = (void (*)(struct __pyx_obj_7sklearn_9ball_tree_BallTree *))__pyx_f_7sklearn_9ball_tree_8BallTree_build_tree_; - __pyx_vtable_7sklearn_9ball_tree_BallTree.query_one_ = (void (*)(struct __pyx_obj_7sklearn_9ball_tree_BallTree *, __pyx_t_7sklearn_9ball_tree_DTYPE_t *, __pyx_t_7sklearn_9ball_tree_ITYPE_t, __pyx_t_7sklearn_9ball_tree_DTYPE_t *, __pyx_t_7sklearn_9ball_tree_ITYPE_t *, struct __pyx_t_7sklearn_9ball_tree_stack *, __pyx_t_7sklearn_9ball_tree_ITYPE_t))__pyx_f_7sklearn_9ball_tree_8BallTree_query_one_; - __pyx_vtable_7sklearn_9ball_tree_BallTree.query_radius_count_ = (__pyx_t_7sklearn_9ball_tree_ITYPE_t (*)(struct __pyx_obj_7sklearn_9ball_tree_BallTree *, __pyx_t_7sklearn_9ball_tree_DTYPE_t *, __pyx_t_7sklearn_9ball_tree_DTYPE_t, struct __pyx_t_7sklearn_9ball_tree_stack *))__pyx_f_7sklearn_9ball_tree_8BallTree_query_radius_count_; - __pyx_vtable_7sklearn_9ball_tree_BallTree.query_radius_idx_only_ = (__pyx_t_7sklearn_9ball_tree_ITYPE_t (*)(struct __pyx_obj_7sklearn_9ball_tree_BallTree *, __pyx_t_7sklearn_9ball_tree_DTYPE_t *, __pyx_t_7sklearn_9ball_tree_DTYPE_t, __pyx_t_7sklearn_9ball_tree_ITYPE_t *, struct __pyx_t_7sklearn_9ball_tree_stack *))__pyx_f_7sklearn_9ball_tree_8BallTree_query_radius_idx_only_; - __pyx_vtable_7sklearn_9ball_tree_BallTree.query_radius_distances_ = (__pyx_t_7sklearn_9ball_tree_ITYPE_t (*)(struct __pyx_obj_7sklearn_9ball_tree_BallTree *, __pyx_t_7sklearn_9ball_tree_DTYPE_t *, __pyx_t_7sklearn_9ball_tree_DTYPE_t, __pyx_t_7sklearn_9ball_tree_ITYPE_t *, __pyx_t_7sklearn_9ball_tree_DTYPE_t *, struct __pyx_t_7sklearn_9ball_tree_stack *))__pyx_f_7sklearn_9ball_tree_8BallTree_query_radius_distances_; - #else - *(void(**)(void))&__pyx_vtable_7sklearn_9ball_tree_BallTree.build_tree_ = (void(*)(void))__pyx_f_7sklearn_9ball_tree_8BallTree_build_tree_; - *(void(**)(void))&__pyx_vtable_7sklearn_9ball_tree_BallTree.query_one_ = (void(*)(void))__pyx_f_7sklearn_9ball_tree_8BallTree_query_one_; - *(void(**)(void))&__pyx_vtable_7sklearn_9ball_tree_BallTree.query_radius_count_ = (void(*)(void))__pyx_f_7sklearn_9ball_tree_8BallTree_query_radius_count_; - *(void(**)(void))&__pyx_vtable_7sklearn_9ball_tree_BallTree.query_radius_idx_only_ = (void(*)(void))__pyx_f_7sklearn_9ball_tree_8BallTree_query_radius_idx_only_; - *(void(**)(void))&__pyx_vtable_7sklearn_9ball_tree_BallTree.query_radius_distances_ = (void(*)(void))__pyx_f_7sklearn_9ball_tree_8BallTree_query_radius_distances_; - #endif - if (PyType_Ready(&__pyx_type_7sklearn_9ball_tree_BallTree) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_7sklearn_9ball_tree_BallTree.tp_dict, __pyx_vtabptr_7sklearn_9ball_tree_BallTree) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "BallTree", (PyObject *)&__pyx_type_7sklearn_9ball_tree_BallTree) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_7sklearn_9ball_tree_BallTree = &__pyx_type_7sklearn_9ball_tree_BallTree; + __pyx_vtabptr_7scikits_5learn_9ball_tree_BallTree = &__pyx_vtable_7scikits_5learn_9ball_tree_BallTree; + __pyx_vtable_7scikits_5learn_9ball_tree_BallTree.build_tree_ = (void (*)(struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *))__pyx_f_7scikits_5learn_9ball_tree_8BallTree_build_tree_; + __pyx_vtable_7scikits_5learn_9ball_tree_BallTree.query_one_ = (void (*)(struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *, struct __pyx_t_7scikits_5learn_9ball_tree_stack *, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t))__pyx_f_7scikits_5learn_9ball_tree_8BallTree_query_one_; + __pyx_vtable_7scikits_5learn_9ball_tree_BallTree.query_radius_count_ = (__pyx_t_7scikits_5learn_9ball_tree_ITYPE_t (*)(struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t, struct __pyx_t_7scikits_5learn_9ball_tree_stack *))__pyx_f_7scikits_5learn_9ball_tree_8BallTree_query_radius_count_; + __pyx_vtable_7scikits_5learn_9ball_tree_BallTree.query_radius_idx_only_ = (__pyx_t_7scikits_5learn_9ball_tree_ITYPE_t (*)(struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *, struct __pyx_t_7scikits_5learn_9ball_tree_stack *))__pyx_f_7scikits_5learn_9ball_tree_8BallTree_query_radius_idx_only_; + __pyx_vtable_7scikits_5learn_9ball_tree_BallTree.query_radius_distances_ = (__pyx_t_7scikits_5learn_9ball_tree_ITYPE_t (*)(struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t, __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *, __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *, struct __pyx_t_7scikits_5learn_9ball_tree_stack *))__pyx_f_7scikits_5learn_9ball_tree_8BallTree_query_radius_distances_; + if (PyType_Ready(&__pyx_type_7scikits_5learn_9ball_tree_BallTree) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_7scikits_5learn_9ball_tree_BallTree.tp_dict, __pyx_vtabptr_7scikits_5learn_9ball_tree_BallTree) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "BallTree", (PyObject *)&__pyx_type_7scikits_5learn_9ball_tree_BallTree) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7scikits_5learn_9ball_tree_BallTree = &__pyx_type_7scikits_5learn_9ball_tree_BallTree; /*--- Type import code ---*/ __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -11057,7 +11432,7 @@ PyMODINIT_FUNC PyInit_ball_tree(void) /*--- Function import code ---*/ /*--- Execution code ---*/ - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":190 + /* "scikits/learn/ball_tree.pyx":190 * """ * * import numpy as np # <<<<<<<<<<<<<< @@ -11069,7 +11444,7 @@ PyMODINIT_FUNC PyInit_ball_tree(void) if (PyObject_SetAttr(__pyx_m, __pyx_n_s__np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":200 + /* "scikits/learn/ball_tree.pyx":200 * # * # type used for data * DTYPE = np.float64 # <<<<<<<<<<<<<< @@ -11084,7 +11459,7 @@ PyMODINIT_FUNC PyInit_ball_tree(void) if (PyObject_SetAttr(__pyx_m, __pyx_n_s__DTYPE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":204 + /* "scikits/learn/ball_tree.pyx":204 * * # type used for indices & counts * ITYPE = np.int32 # <<<<<<<<<<<<<< @@ -11099,7 +11474,7 @@ PyMODINIT_FUNC PyInit_ball_tree(void) if (PyObject_SetAttr(__pyx_m, __pyx_n_s__ITYPE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":208 + /* "scikits/learn/ball_tree.pyx":208 * * # infinity * cdef DTYPE_t infinity = np.inf # <<<<<<<<<<<<<< @@ -11113,9 +11488,21 @@ PyMODINIT_FUNC PyInit_ball_tree(void) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_7sklearn_9ball_tree_infinity = __pyx_t_3; + __pyx_v_7scikits_5learn_9ball_tree_infinity = __pyx_t_3; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":544 + /* "scikits/learn/ball_tree.pyx":388 + * # newObj function + * # this is a helper function for pickling + * def newObj(obj): # <<<<<<<<<<<<<< + * return obj.__new__(obj) + * + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7scikits_5learn_9ball_tree_newObj, NULL, __pyx_n_s_55); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__newObj, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "scikits/learn/ball_tree.pyx":544 * self.n_nodes = state[7] * * def query(self, X, k=1, return_distance=True): # <<<<<<<<<<<<<< @@ -11124,11 +11511,11 @@ PyMODINIT_FUNC PyInit_ball_tree(void) */ __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_k_7 = __pyx_t_2; + __pyx_k_19 = __pyx_t_2; __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":644 + /* "scikits/learn/ball_tree.pyx":644 * return idx_array.reshape((orig_shape[:-1]) + (k,)) * * def query_radius(self, X, r, return_distance=False, # <<<<<<<<<<<<<< @@ -11137,11 +11524,11 @@ PyMODINIT_FUNC PyInit_ball_tree(void) */ __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_k_10 = __pyx_t_2; + __pyx_k_24 = __pyx_t_2; __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":645 + /* "scikits/learn/ball_tree.pyx":645 * * def query_radius(self, X, r, return_distance=False, * count_only=False, sort_results=False): # <<<<<<<<<<<<<< @@ -11150,16 +11537,16 @@ PyMODINIT_FUNC PyInit_ball_tree(void) */ __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_k_11 = __pyx_t_2; + __pyx_k_25 = __pyx_t_2; __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_k_12 = __pyx_t_2; + __pyx_k_26 = __pyx_t_2; __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":2 + /* "scikits/learn/ball_tree.pyx":2 * * # Author: Jake Vanderplas <vanderplas@astro.washington.edu> # <<<<<<<<<<<<<< * # License: BSD @@ -11167,93 +11554,181 @@ PyMODINIT_FUNC PyInit_ball_tree(void) */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __pyx_t_1 = PyObject_GetAttr(__pyx_m, __pyx_n_s__BallTree); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____reduce__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_kp_u_27), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_m, __pyx_n_s__BallTree); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____getstate__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_kp_u_28), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_m, __pyx_n_s__BallTree); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____setstate__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_kp_u_29), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_m, __pyx_n_s__BallTree); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__query); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_kp_u_30), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_m, __pyx_n_s__BallTree); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__query_radius); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_kp_u_31), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_kp_u_56), ((PyObject *)__pyx_kp_u_57)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_kp_u_58), ((PyObject *)__pyx_kp_u_59)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/libc/stdio.pxd":1 - * # 7.19 Input/output <stdio.h> # <<<<<<<<<<<<<< - * - * cdef extern from *: - */ - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_4); - if (__pyx_m) { - __Pyx_AddTraceback("init sklearn.ball_tree"); - Py_DECREF(__pyx_m); __pyx_m = 0; - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init sklearn.ball_tree"); - } - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - #if PY_MAJOR_VERSION < 3 - return; - #else - return __pyx_m; - #endif + /* "libc/stdio.pxd":1 + * # 7.19 Input/output <stdio.h> # <<<<<<<<<<<<<< + * + * cdef extern from *: + */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + if (__pyx_m) { + __Pyx_AddTraceback("init scikits.learn.ball_tree"); + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init scikits.learn.ball_tree"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if PY_MAJOR_VERSION < 3 + return; + #else + return __pyx_m; + #endif +} + +/* Runtime support code */ + +static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { + PyObject *result; + result = PyObject_GetAttr(dict, name); + if (!result) + PyErr_SetObject(PyExc_NameError, name); + return result; +} + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} + +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} + + +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { + Py_XINCREF(type); + Py_XINCREF(value); + Py_XINCREF(tb); + /* First, check the traceback argument, replacing None with NULL. */ + if (tb == Py_None) { + Py_DECREF(tb); + tb = 0; + } + else if (tb != NULL && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + /* Next, replace a missing value with None */ + if (value == NULL) { + value = Py_None; + Py_INCREF(value); + } + #if PY_VERSION_HEX < 0x02050000 + if (!PyClass_Check(type)) + #else + if (!PyType_Check(type)) + #endif + { + /* Raising an instance. The value should be a dummy. */ + if (value != Py_None) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + /* Normalize to raise <class>, <instance> */ + Py_DECREF(value); + value = type; + #if PY_VERSION_HEX < 0x02050000 + if (PyInstance_Check(type)) { + type = (PyObject*) ((PyInstanceObject*)type)->in_class; + Py_INCREF(type); + } + else { + type = 0; + PyErr_SetString(PyExc_TypeError, + "raise: exception must be an old-style class or instance"); + goto raise_error; + } + #else + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + #endif + } + + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; } -/* Runtime support code */ +#else /* Python 3+ */ -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { - PyObject *result; - result = PyObject_GetAttr(dict, name); - if (!result) - PyErr_SetObject(PyExc_NameError, name); - return result; +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (!PyExceptionClass_Check(type)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + + PyErr_SetObject(type, value); + + if (tb) { + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } + } + +bad: + return; } +#endif static void __Pyx_RaiseArgtupleInvalid( const char* func_name, @@ -11497,143 +11972,6 @@ bad: return module; } -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyThreadState *tstate = PyThreadState_GET(); - - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -} - -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { - PyThreadState *tstate = PyThreadState_GET(); - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -} - - -#if PY_MAJOR_VERSION < 3 -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { - Py_XINCREF(type); - Py_XINCREF(value); - Py_XINCREF(tb); - /* First, check the traceback argument, replacing None with NULL. */ - if (tb == Py_None) { - Py_DECREF(tb); - tb = 0; - } - else if (tb != NULL && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - /* Next, replace a missing value with None */ - if (value == NULL) { - value = Py_None; - Py_INCREF(value); - } - #if PY_VERSION_HEX < 0x02050000 - if (!PyClass_Check(type)) - #else - if (!PyType_Check(type)) - #endif - { - /* Raising an instance. The value should be a dummy. */ - if (value != Py_None) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto raise_error; - } - /* Normalize to raise <class>, <instance> */ - Py_DECREF(value); - value = type; - #if PY_VERSION_HEX < 0x02050000 - if (PyInstance_Check(type)) { - type = (PyObject*) ((PyInstanceObject*)type)->in_class; - Py_INCREF(type); - } - else { - type = 0; - PyErr_SetString(PyExc_TypeError, - "raise: exception must be an old-style class or instance"); - goto raise_error; - } - #else - type = (PyObject*) Py_TYPE(type); - Py_INCREF(type); - if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto raise_error; - } - #endif - } - - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; -} - -#else /* Python 3+ */ - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { - if (tb == Py_None) { - tb = 0; - } else if (tb && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto bad; - } - if (value == Py_None) - value = 0; - - if (PyExceptionInstance_Check(type)) { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto bad; - } - value = type; - type = (PyObject*) Py_TYPE(value); - } else if (!PyExceptionClass_Check(type)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto bad; - } - - PyErr_SetObject(type, value); - - if (tb) { - PyThreadState *tstate = PyThreadState_GET(); - PyObject* tmp_tb = tstate->curexc_traceback; - if (tb != tmp_tb) { - Py_INCREF(tb); - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_tb); - } - } - -bad: - return; -} -#endif - static CYTHON_INLINE npy_int32 __Pyx_PyInt_from_py_npy_int32(PyObject* x) { const npy_int32 neg_one = (npy_int32)-1, const_zero = (npy_int32)0; const int is_unsigned = const_zero < neg_one; @@ -11822,15 +12160,60 @@ static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_Py_intptr_t(Py_intptr_t val) { z.imag = -a.imag; return z; } -/* - static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) { -#if HAVE_HYPOT - return hypotf(z.real, z.imag); -#else - return sqrtf(z.real*z.real + z.imag*z.imag); -#endif - } -*/ + #if 1 + static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrtf(z.real*z.real + z.imag*z.imag); + #else + return hypotf(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + float denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(a, a); + case 3: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(z, a); + case 4: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } + r = a.real; + theta = 0; + } else { + r = __Pyx_c_absf(a); + theta = atan2f(a.imag, a.real); + } + lnr = logf(r); + z_r = expf(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cosf(z_theta); + z.imag = z_r * sinf(z_theta); + return z; + } + #endif #endif #if CYTHON_CCOMPLEX @@ -11897,15 +12280,60 @@ static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_Py_intptr_t(Py_intptr_t val) { z.imag = -a.imag; return z; } -/* - static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) { -#if HAVE_HYPOT - return hypot(z.real, z.imag); -#else - return sqrt(z.real*z.real + z.imag*z.imag); -#endif - } -*/ + #if 1 + static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrt(z.real*z.real + z.imag*z.imag); + #else + return hypot(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + double denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(a, a); + case 3: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(z, a); + case 4: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } + r = a.real; + theta = 0; + } else { + r = __Pyx_c_abs(a); + theta = atan2(a.imag, a.real); + } + lnr = log(r); + z_r = exp(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cos(z_theta); + z.imag = z_r * sin(z_theta); + return z; + } + #endif #endif static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) { @@ -12371,13 +12799,13 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class if (!result) goto bad; if (!PyType_Check(result)) { - PyErr_Format(PyExc_TypeError, + PyErr_Format(PyExc_TypeError, "%s.%s is not a type object", module_name, class_name); goto bad; } if (!strict && ((PyTypeObject *)result)->tp_basicsize > size) { - PyOS_snprintf(warning, sizeof(warning), + PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility", module_name, class_name); #if PY_VERSION_HEX < 0x02050000 @@ -12387,7 +12815,7 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class #endif } else if (((PyTypeObject *)result)->tp_basicsize != size) { - PyErr_Format(PyExc_ValueError, + PyErr_Format(PyExc_ValueError, "%s.%s has the wrong size, try recompiling", module_name, class_name); goto bad; diff --git a/sklearn/ball_tree.pyx b/scikits/learn/ball_tree.pyx similarity index 100% rename from sklearn/ball_tree.pyx rename to scikits/learn/ball_tree.pyx diff --git a/sklearn/base.py b/scikits/learn/base.py similarity index 100% rename from sklearn/base.py rename to scikits/learn/base.py diff --git a/sklearn/check_build/__init__.py b/scikits/learn/check_build/__init__.py similarity index 100% rename from sklearn/check_build/__init__.py rename to scikits/learn/check_build/__init__.py diff --git a/sklearn/check_build/_check_build.c b/scikits/learn/check_build/_check_build.c similarity index 100% rename from sklearn/check_build/_check_build.c rename to scikits/learn/check_build/_check_build.c diff --git a/sklearn/check_build/_check_build.pyx b/scikits/learn/check_build/_check_build.pyx similarity index 100% rename from sklearn/check_build/_check_build.pyx rename to scikits/learn/check_build/_check_build.pyx diff --git a/sklearn/check_build/setup.py b/scikits/learn/check_build/setup.py similarity index 100% rename from sklearn/check_build/setup.py rename to scikits/learn/check_build/setup.py diff --git a/sklearn/cluster/__init__.py b/scikits/learn/cluster/__init__.py similarity index 100% rename from sklearn/cluster/__init__.py rename to scikits/learn/cluster/__init__.py diff --git a/sklearn/cluster/_feature_agglomeration.py b/scikits/learn/cluster/_feature_agglomeration.py similarity index 100% rename from sklearn/cluster/_feature_agglomeration.py rename to scikits/learn/cluster/_feature_agglomeration.py diff --git a/sklearn/cluster/_inertia.c b/scikits/learn/cluster/_inertia.c similarity index 100% rename from sklearn/cluster/_inertia.c rename to scikits/learn/cluster/_inertia.c diff --git a/sklearn/cluster/_inertia.pyx b/scikits/learn/cluster/_inertia.pyx similarity index 100% rename from sklearn/cluster/_inertia.pyx rename to scikits/learn/cluster/_inertia.pyx diff --git a/sklearn/cluster/_k_means.c b/scikits/learn/cluster/_k_means.c similarity index 100% rename from sklearn/cluster/_k_means.c rename to scikits/learn/cluster/_k_means.c diff --git a/sklearn/cluster/_k_means.pyx b/scikits/learn/cluster/_k_means.pyx similarity index 100% rename from sklearn/cluster/_k_means.pyx rename to scikits/learn/cluster/_k_means.pyx diff --git a/sklearn/cluster/affinity_propagation_.py b/scikits/learn/cluster/affinity_propagation_.py similarity index 100% rename from sklearn/cluster/affinity_propagation_.py rename to scikits/learn/cluster/affinity_propagation_.py diff --git a/sklearn/cluster/dbscan_.py b/scikits/learn/cluster/dbscan_.py similarity index 100% rename from sklearn/cluster/dbscan_.py rename to scikits/learn/cluster/dbscan_.py diff --git a/sklearn/cluster/hierarchical.py b/scikits/learn/cluster/hierarchical.py similarity index 100% rename from sklearn/cluster/hierarchical.py rename to scikits/learn/cluster/hierarchical.py diff --git a/sklearn/cluster/k_means_.py b/scikits/learn/cluster/k_means_.py similarity index 100% rename from sklearn/cluster/k_means_.py rename to scikits/learn/cluster/k_means_.py diff --git a/sklearn/cluster/mean_shift_.py b/scikits/learn/cluster/mean_shift_.py similarity index 100% rename from sklearn/cluster/mean_shift_.py rename to scikits/learn/cluster/mean_shift_.py diff --git a/sklearn/cluster/setup.py b/scikits/learn/cluster/setup.py similarity index 100% rename from sklearn/cluster/setup.py rename to scikits/learn/cluster/setup.py diff --git a/sklearn/cluster/spectral.py b/scikits/learn/cluster/spectral.py similarity index 100% rename from sklearn/cluster/spectral.py rename to scikits/learn/cluster/spectral.py diff --git a/sklearn/cluster/tests/__init__.py b/scikits/learn/cluster/tests/__init__.py similarity index 100% rename from sklearn/cluster/tests/__init__.py rename to scikits/learn/cluster/tests/__init__.py diff --git a/sklearn/cluster/tests/common.py b/scikits/learn/cluster/tests/common.py similarity index 100% rename from sklearn/cluster/tests/common.py rename to scikits/learn/cluster/tests/common.py diff --git a/sklearn/cluster/tests/test_affinity_propagation.py b/scikits/learn/cluster/tests/test_affinity_propagation.py similarity index 100% rename from sklearn/cluster/tests/test_affinity_propagation.py rename to scikits/learn/cluster/tests/test_affinity_propagation.py diff --git a/sklearn/cluster/tests/test_dbscan.py b/scikits/learn/cluster/tests/test_dbscan.py similarity index 98% rename from sklearn/cluster/tests/test_dbscan.py rename to scikits/learn/cluster/tests/test_dbscan.py index 442d3b305f676c4b42d72a721207bcb56586be48..7c36e710e7cd2bd5928e7bb75131a078f04ff846 100644 --- a/sklearn/cluster/tests/test_dbscan.py +++ b/scikits/learn/cluster/tests/test_dbscan.py @@ -8,7 +8,7 @@ import numpy as np from numpy.testing import assert_equal from scipy.spatial import distance -from sklearn.cluster.dbscan_ import DBSCAN, dbscan +from scikits.learn.cluster.dbscan_ import DBSCAN, dbscan from .common import generate_clustered_data diff --git a/sklearn/cluster/tests/test_hierarchical.py b/scikits/learn/cluster/tests/test_hierarchical.py similarity index 94% rename from sklearn/cluster/tests/test_hierarchical.py rename to scikits/learn/cluster/tests/test_hierarchical.py index 26ba26c02a2d8720c2498a55fe2a2440dd07540e..ce4daadc7408dbc00cfac07635a643a2caf76aca 100644 --- a/sklearn/cluster/tests/test_hierarchical.py +++ b/scikits/learn/cluster/tests/test_hierarchical.py @@ -7,9 +7,9 @@ Author : Vincent Michel, 2010 import numpy as np from scipy.cluster import hierarchy -from sklearn.cluster import Ward, WardAgglomeration, ward_tree -from sklearn.cluster.hierarchical import _hc_cut -from sklearn.feature_extraction.image import grid_to_graph +from scikits.learn.cluster import Ward, WardAgglomeration, ward_tree +from scikits.learn.cluster.hierarchical import _hc_cut +from scikits.learn.feature_extraction.image import grid_to_graph def test_structured_ward_tree(): diff --git a/sklearn/cluster/tests/test_k_means.py b/scikits/learn/cluster/tests/test_k_means.py similarity index 100% rename from sklearn/cluster/tests/test_k_means.py rename to scikits/learn/cluster/tests/test_k_means.py diff --git a/sklearn/cluster/tests/test_mean_shift.py b/scikits/learn/cluster/tests/test_mean_shift.py similarity index 100% rename from sklearn/cluster/tests/test_mean_shift.py rename to scikits/learn/cluster/tests/test_mean_shift.py diff --git a/sklearn/cluster/tests/test_spectral.py b/scikits/learn/cluster/tests/test_spectral.py similarity index 100% rename from sklearn/cluster/tests/test_spectral.py rename to scikits/learn/cluster/tests/test_spectral.py diff --git a/sklearn/covariance/__init__.py b/scikits/learn/covariance/__init__.py similarity index 88% rename from sklearn/covariance/__init__.py rename to scikits/learn/covariance/__init__.py index 7bc505dd088456e802ed11346a1b5fee1dcb810d..1a90db72dbced3e10e3351e3a42f003cd136b579 100644 --- a/sklearn/covariance/__init__.py +++ b/scikits/learn/covariance/__init__.py @@ -2,7 +2,7 @@ Covariance estimators ===================== -:mod:`sklearn.covariance` is a module to fit to estimate +:mod:`scikits.learn.covariance` is a module to fit to estimate robustly the covariance of features given a set of points. The precision matrix defined as the inverse of the covariance is also estimated. Covariance estimation is closely related diff --git a/sklearn/covariance/empirical_covariance_.py b/scikits/learn/covariance/empirical_covariance_.py similarity index 100% rename from sklearn/covariance/empirical_covariance_.py rename to scikits/learn/covariance/empirical_covariance_.py diff --git a/sklearn/covariance/shrunk_covariance_.py b/scikits/learn/covariance/shrunk_covariance_.py similarity index 100% rename from sklearn/covariance/shrunk_covariance_.py rename to scikits/learn/covariance/shrunk_covariance_.py diff --git a/sklearn/covariance/tests/__init__.py b/scikits/learn/covariance/tests/__init__.py similarity index 100% rename from sklearn/covariance/tests/__init__.py rename to scikits/learn/covariance/tests/__init__.py diff --git a/sklearn/covariance/tests/test_covariance.py b/scikits/learn/covariance/tests/test_covariance.py similarity index 99% rename from sklearn/covariance/tests/test_covariance.py rename to scikits/learn/covariance/tests/test_covariance.py index a685a1a425650083f59a995ced9d3f749781ca79..28463cab42d505aa26eb0519191885fce0ae574d 100644 --- a/sklearn/covariance/tests/test_covariance.py +++ b/scikits/learn/covariance/tests/test_covariance.py @@ -10,7 +10,7 @@ from .. import empirical_covariance, EmpiricalCovariance, \ ShrunkCovariance, shrunk_covariance, LedoitWolf, ledoit_wolf, OAS, oas import numpy as np -from sklearn import datasets +from scikits.learn import datasets X = datasets.load_iris().data n_samples, n_features = X.shape diff --git a/sklearn/cross_val.py b/scikits/learn/cross_val.py similarity index 97% rename from sklearn/cross_val.py rename to scikits/learn/cross_val.py index 1bea4475c5ce8869ed2c4959540a6b18d5fab7d4..9e332f7116e0c6084f70b788c04235f48e103a02 100644 --- a/sklearn/cross_val.py +++ b/scikits/learn/cross_val.py @@ -38,14 +38,14 @@ class LeaveOneOut(object): Examples ======== - >>> from sklearn import cross_val + >>> from scikits.learn import cross_val >>> X = np.array([[1, 2], [3, 4]]) >>> y = np.array([1, 2]) >>> loo = cross_val.LeaveOneOut(2) >>> len(loo) 2 >>> print loo - sklearn.cross_val.LeaveOneOut(n=2) + scikits.learn.cross_val.LeaveOneOut(n=2) >>> for train_index, test_index in loo: ... print "TRAIN:", train_index, "TEST:", test_index ... X_train, X_test = X[train_index], X[test_index] @@ -105,14 +105,14 @@ class LeavePOut(object): Examples ======== - >>> from sklearn import cross_val + >>> from scikits.learn import cross_val >>> X = np.array([[1, 2], [3, 4], [5, 6], [7, 8]]) >>> y = np.array([1, 2, 3, 4]) >>> lpo = cross_val.LeavePOut(4, 2) >>> len(lpo) 6 >>> print lpo - sklearn.cross_val.LeavePOut(n=4, p=2) + scikits.learn.cross_val.LeavePOut(n=4, p=2) >>> for train_index, test_index in lpo: ... print "TRAIN:", train_index, "TEST:", test_index ... X_train, X_test = X[train_index], X[test_index] @@ -179,14 +179,14 @@ class KFold(object): Examples -------- - >>> from sklearn import cross_val + >>> from scikits.learn import cross_val >>> X = np.array([[1, 2], [3, 4], [1, 2], [3, 4]]) >>> y = np.array([1, 2, 3, 4]) >>> kf = cross_val.KFold(4, k=2) >>> len(kf) 2 >>> print kf - sklearn.cross_val.KFold(n=4, k=2) + scikits.learn.cross_val.KFold(n=4, k=2) >>> for train_index, test_index in kf: ... print "TRAIN:", train_index, "TEST:", test_index ... X_train, X_test = X[train_index], X[test_index] @@ -264,14 +264,14 @@ class StratifiedKFold(object): Examples -------- - >>> from sklearn import cross_val + >>> from scikits.learn import cross_val >>> X = np.array([[1, 2], [3, 4], [1, 2], [3, 4]]) >>> y = np.array([0, 0, 1, 1]) >>> skf = cross_val.StratifiedKFold(y, k=2) >>> len(skf) 2 >>> print skf - sklearn.cross_val.StratifiedKFold(labels=[0 0 1 1], k=2) + scikits.learn.cross_val.StratifiedKFold(labels=[0 0 1 1], k=2) >>> for train_index, test_index in skf: ... print "TRAIN:", train_index, "TEST:", test_index ... X_train, X_test = X[train_index], X[test_index] @@ -349,7 +349,7 @@ class LeaveOneLabelOut(object): Examples ---------- - >>> from sklearn import cross_val + >>> from scikits.learn import cross_val >>> X = np.array([[1, 2], [3, 4], [5, 6], [7, 8]]) >>> y = np.array([1, 2, 1, 2]) >>> labels = np.array([1, 1, 2, 2]) @@ -357,7 +357,7 @@ class LeaveOneLabelOut(object): >>> len(lol) 2 >>> print lol - sklearn.cross_val.LeaveOneLabelOut(labels=[1 1 2 2]) + scikits.learn.cross_val.LeaveOneLabelOut(labels=[1 1 2 2]) >>> for train_index, test_index in lol: ... print "TRAIN:", train_index, "TEST:", test_index ... X_train, X_test = X[train_index], X[test_index] @@ -423,7 +423,7 @@ class LeavePLabelOut(object): Examples ---------- - >>> from sklearn import cross_val + >>> from scikits.learn import cross_val >>> X = np.array([[1, 2], [3, 4], [5, 6]]) >>> y = np.array([1, 2, 1]) >>> labels = np.array([1, 2, 3]) @@ -431,7 +431,7 @@ class LeavePLabelOut(object): >>> len(lpl) 3 >>> print lpl - sklearn.cross_val.LeavePLabelOut(labels=[1 2 3], p=2) + scikits.learn.cross_val.LeavePLabelOut(labels=[1 2 3], p=2) >>> for train_index, test_index in lpl: ... print "TRAIN:", train_index, "TEST:", test_index ... X_train, X_test = X[train_index], X[test_index] @@ -536,7 +536,7 @@ class Bootstrap(object): Examples ---------- - >>> from sklearn import cross_val + >>> from scikits.learn import cross_val >>> bs = cross_val.Bootstrap(9, random_state=0) >>> len(bs) 3 @@ -635,7 +635,7 @@ class ShuffleSplit(object): Examples ---------- - >>> from sklearn import cross_val + >>> from scikits.learn import cross_val >>> rs = cross_val.ShuffleSplit(4, n_splits=3, test_fraction=.25, ... random_state=0) >>> len(rs) @@ -826,7 +826,7 @@ def permutation_test_score(estimator, X, y, score_func, cv=None, cv : integer or crossvalidation generator, optional If an integer is passed, it is the number of fold (default 3). Specific crossvalidation objects can be passed, see - sklearn.cross_val module for the list of possible objects + scikits.learn.cross_val module for the list of possible objects n_jobs: integer, optional The number of CPUs to use to do the computation. -1 means 'all CPUs'. diff --git a/sklearn/datasets/DATASET_PROPOSAL.txt b/scikits/learn/datasets/DATASET_PROPOSAL.txt similarity index 100% rename from sklearn/datasets/DATASET_PROPOSAL.txt rename to scikits/learn/datasets/DATASET_PROPOSAL.txt diff --git a/sklearn/datasets/__init__.py b/scikits/learn/datasets/__init__.py similarity index 91% rename from sklearn/datasets/__init__.py rename to scikits/learn/datasets/__init__.py index 77c4fffe7b02cc25527f468b6c0b8d0ee854a422..4fec421c4ea9d9db7980951453218cc1a751c87d 100644 --- a/sklearn/datasets/__init__.py +++ b/scikits/learn/datasets/__init__.py @@ -34,7 +34,7 @@ from ..utils import deprecated # backward compatibility @deprecated("to be removed in 0.9;" - " use sklearn.datasets.load_files instead") + " use scikits.learn.datasets.load_files instead") def load_filenames(*args, **kwargs): - """Deprecated, use ``sklearn.datasets.load_files`` instead""" + """Deprecated, use ``scikits.learn.datasets.load_files`` instead""" return load_files(*args, **kwargs) diff --git a/sklearn/datasets/base.py b/scikits/learn/datasets/base.py similarity index 97% rename from sklearn/datasets/base.py rename to scikits/learn/datasets/base.py index dbea85522f87482f4b667f40e0a8b6e7d1abda8c..8cc60fd2184da826dc74ca4ddd05172d44ed1af6 100644 --- a/sklearn/datasets/base.py +++ b/scikits/learn/datasets/base.py @@ -85,7 +85,7 @@ def load_files(container_path, description=None, categories=None, does not try to load the files in memory. To use utf-8 text files in a scikit-learn classification or clustering - algorithm you will first need to use the `sklearn.features.text` + algorithm you will first need to use the `scikits.learn.features.text` module to build a feature extraction transformer that suits your problem. @@ -189,7 +189,7 @@ def load_iris(): Let's say you are interested in the samples 10, 25, and 50, and want to know their class name. - >>> from sklearn.datasets import load_iris + >>> from scikits.learn.datasets import load_iris >>> data = load_iris() >>> data.target[[10, 25, 50]] array([0, 0, 1]) @@ -237,7 +237,7 @@ def load_digits(n_class=10): -------- To load the data and visualize the images:: - >>> from sklearn.datasets import load_digits + >>> from scikits.learn.datasets import load_digits >>> digits = load_digits() >>> # import pylab as pl @@ -323,7 +323,7 @@ def load_boston(): Examples -------- - >>> from sklearn.datasets import load_boston + >>> from scikits.learn.datasets import load_boston >>> data = load_boston() """ module_path = dirname(__file__) @@ -363,7 +363,7 @@ def load_sample_images(): -------- To load the data and visualize the images:: - >>> from sklearn.datasets import load_sample_images + >>> from scikits.learn.datasets import load_sample_images >>> dataset = load_sample_images() >>> len(dataset.images) 2 diff --git a/sklearn/datasets/data/boston_house_prices.csv b/scikits/learn/datasets/data/boston_house_prices.csv similarity index 100% rename from sklearn/datasets/data/boston_house_prices.csv rename to scikits/learn/datasets/data/boston_house_prices.csv diff --git a/sklearn/datasets/data/diabetes_data.csv.gz b/scikits/learn/datasets/data/diabetes_data.csv.gz similarity index 100% rename from sklearn/datasets/data/diabetes_data.csv.gz rename to scikits/learn/datasets/data/diabetes_data.csv.gz diff --git a/sklearn/datasets/data/diabetes_target.csv.gz b/scikits/learn/datasets/data/diabetes_target.csv.gz similarity index 100% rename from sklearn/datasets/data/diabetes_target.csv.gz rename to scikits/learn/datasets/data/diabetes_target.csv.gz diff --git a/sklearn/datasets/data/digits.csv.gz b/scikits/learn/datasets/data/digits.csv.gz similarity index 100% rename from sklearn/datasets/data/digits.csv.gz rename to scikits/learn/datasets/data/digits.csv.gz diff --git a/sklearn/datasets/data/iris.csv b/scikits/learn/datasets/data/iris.csv similarity index 100% rename from sklearn/datasets/data/iris.csv rename to scikits/learn/datasets/data/iris.csv diff --git a/sklearn/datasets/data/linnerud_exercise.csv b/scikits/learn/datasets/data/linnerud_exercise.csv similarity index 100% rename from sklearn/datasets/data/linnerud_exercise.csv rename to scikits/learn/datasets/data/linnerud_exercise.csv diff --git a/sklearn/datasets/data/linnerud_physiological.csv b/scikits/learn/datasets/data/linnerud_physiological.csv similarity index 100% rename from sklearn/datasets/data/linnerud_physiological.csv rename to scikits/learn/datasets/data/linnerud_physiological.csv diff --git a/sklearn/datasets/descr/boston_house_prices.rst b/scikits/learn/datasets/descr/boston_house_prices.rst similarity index 100% rename from sklearn/datasets/descr/boston_house_prices.rst rename to scikits/learn/datasets/descr/boston_house_prices.rst diff --git a/sklearn/datasets/descr/diabetes.rst b/scikits/learn/datasets/descr/diabetes.rst similarity index 100% rename from sklearn/datasets/descr/diabetes.rst rename to scikits/learn/datasets/descr/diabetes.rst diff --git a/sklearn/datasets/descr/digits.rst b/scikits/learn/datasets/descr/digits.rst similarity index 100% rename from sklearn/datasets/descr/digits.rst rename to scikits/learn/datasets/descr/digits.rst diff --git a/sklearn/datasets/descr/iris.rst b/scikits/learn/datasets/descr/iris.rst similarity index 100% rename from sklearn/datasets/descr/iris.rst rename to scikits/learn/datasets/descr/iris.rst diff --git a/sklearn/datasets/descr/linnerud.rst b/scikits/learn/datasets/descr/linnerud.rst similarity index 100% rename from sklearn/datasets/descr/linnerud.rst rename to scikits/learn/datasets/descr/linnerud.rst diff --git a/sklearn/datasets/images/README.txt b/scikits/learn/datasets/images/README.txt similarity index 100% rename from sklearn/datasets/images/README.txt rename to scikits/learn/datasets/images/README.txt diff --git a/sklearn/datasets/images/china.jpg b/scikits/learn/datasets/images/china.jpg similarity index 100% rename from sklearn/datasets/images/china.jpg rename to scikits/learn/datasets/images/china.jpg diff --git a/sklearn/datasets/images/flower.jpg b/scikits/learn/datasets/images/flower.jpg similarity index 100% rename from sklearn/datasets/images/flower.jpg rename to scikits/learn/datasets/images/flower.jpg diff --git a/sklearn/datasets/lfw.py b/scikits/learn/datasets/lfw.py similarity index 99% rename from sklearn/datasets/lfw.py rename to scikits/learn/datasets/lfw.py index d20fbbd38d220d3f0b435813f56c2bdca847c463..1d506d6f41dcb112bb4a64dee9e83e8a9ad52538 100644 --- a/sklearn/datasets/lfw.py +++ b/scikits/learn/datasets/lfw.py @@ -113,7 +113,7 @@ def _load_imgs(file_paths, slice_, color, resize): """Internally used to load images""" # Try to import imread and imresize from PIL. We do this here to prevent - # the whole sklearn.datasets module from depending on PIL. + # the whole scikits.learn.datasets module from depending on PIL. try: try: from scipy.misc import imread diff --git a/sklearn/datasets/mlcomp.py b/scikits/learn/datasets/mlcomp.py similarity index 98% rename from sklearn/datasets/mlcomp.py rename to scikits/learn/datasets/mlcomp.py index d0a44f6c396c3f55da8bd5b2022c16cdaebf3049..f2991aed4cfd363afa5551fd9338efd4b5fbfca8 100644 --- a/sklearn/datasets/mlcomp.py +++ b/scikits/learn/datasets/mlcomp.py @@ -3,7 +3,7 @@ """Glue code to load http://mlcomp.org data as a scikit.learn dataset""" import os -from sklearn.datasets.base import load_files +from scikits.learn.datasets.base import load_files def _load_document_classification(dataset_path, metadata, set_=None, **kwargs): diff --git a/sklearn/datasets/mldata.py b/scikits/learn/datasets/mldata.py similarity index 96% rename from sklearn/datasets/mldata.py rename to scikits/learn/datasets/mldata.py index dc8b3054b800bd31d97b556f4941a5cd85cb4a6b..4f40d71acd8f214c88f5a87540216c9041f45bc8 100644 --- a/sklearn/datasets/mldata.py +++ b/scikits/learn/datasets/mldata.py @@ -36,7 +36,7 @@ def fetch_mldata(dataname, target_name='label', data_name='data', 2) alternatively, the first column stores target values, and the second data values 3) the data array is stored as `n_features x n_samples` , and thus needs - to be transposed to match the `sklearn` standard + to be transposed to match the `scikits.learn` standard Keyword arguments allow to adapt these defaults to specific data sets (see parameters `target_name`, `data_name`, `transpose_data`, and @@ -78,7 +78,7 @@ def fetch_mldata(dataname, target_name='label', data_name='data', Examples -------- Load the 'iris' dataset from mldata.org: - >>> from sklearn.datasets.mldata import fetch_mldata + >>> from scikits.learn.datasets.mldata import fetch_mldata >>> iris = fetch_mldata('iris') >>> print iris.target[0] 1 @@ -86,7 +86,7 @@ def fetch_mldata(dataname, target_name='label', data_name='data', [-0.555556 0.25 -0.864407 -0.916667] Load the 'leukemia' dataset from mldata.org, which respects the - sklearn axes convention: + scikits.learn axes convention: >>> leuk = fetch_mldata('leukemia', transpose_data=False) >>> print leuk.data.shape[0] 7129 @@ -181,7 +181,7 @@ def fetch_mldata(dataname, target_name='label', data_name='data', del dataset[col_names[1]] dataset['data'] = matlab_dict[col_names[1]] - # set axes to sklearn conventions + # set axes to scikits.learn conventions if transpose_data: dataset['data'] = dataset['data'].T if 'target' in dataset: diff --git a/sklearn/datasets/olivetti_faces.py b/scikits/learn/datasets/olivetti_faces.py similarity index 100% rename from sklearn/datasets/olivetti_faces.py rename to scikits/learn/datasets/olivetti_faces.py diff --git a/sklearn/datasets/samples_generator.py b/scikits/learn/datasets/samples_generator.py similarity index 99% rename from sklearn/datasets/samples_generator.py rename to scikits/learn/datasets/samples_generator.py index e961dc35ee159723419a96c1b162b8fde7ccfdcd..8539543ebb009f501d64a0d54cd5e3189785e9e4 100644 --- a/sklearn/datasets/samples_generator.py +++ b/scikits/learn/datasets/samples_generator.py @@ -382,7 +382,7 @@ def make_blobs(n_samples=100, n_features=2, centers=3, cluster_std=1.0, Examples -------- - >>> from sklearn.datasets.samples_generator import make_blobs + >>> from scikits.learn.datasets.samples_generator import make_blobs >>> X, y = make_blobs(n_samples=10, centers=3, n_features=2, random_state=0) >>> X.shape (10, 2) diff --git a/sklearn/datasets/setup.py b/scikits/learn/datasets/setup.py similarity index 100% rename from sklearn/datasets/setup.py rename to scikits/learn/datasets/setup.py diff --git a/sklearn/datasets/svmlight_format.py b/scikits/learn/datasets/svmlight_format.py similarity index 100% rename from sklearn/datasets/svmlight_format.py rename to scikits/learn/datasets/svmlight_format.py diff --git a/sklearn/datasets/tests/__init__.py b/scikits/learn/datasets/tests/__init__.py similarity index 100% rename from sklearn/datasets/tests/__init__.py rename to scikits/learn/datasets/tests/__init__.py diff --git a/sklearn/datasets/tests/data/svmlight_classification.txt b/scikits/learn/datasets/tests/data/svmlight_classification.txt similarity index 100% rename from sklearn/datasets/tests/data/svmlight_classification.txt rename to scikits/learn/datasets/tests/data/svmlight_classification.txt diff --git a/sklearn/datasets/tests/data/svmlight_invalid.txt b/scikits/learn/datasets/tests/data/svmlight_invalid.txt similarity index 100% rename from sklearn/datasets/tests/data/svmlight_invalid.txt rename to scikits/learn/datasets/tests/data/svmlight_invalid.txt diff --git a/sklearn/datasets/tests/test_20news.py b/scikits/learn/datasets/tests/test_20news.py similarity index 97% rename from sklearn/datasets/tests/test_20news.py rename to scikits/learn/datasets/tests/test_20news.py index 4aa63cdab46c7aabf6249553e9e213ac2ec8f3a1..21434a5a4927ad93c0e36fe23f9084f6e0c5e37d 100644 --- a/sklearn/datasets/tests/test_20news.py +++ b/scikits/learn/datasets/tests/test_20news.py @@ -3,7 +3,7 @@ import numpy as np from nose.tools import assert_equal from nose.plugins.skip import SkipTest -from sklearn import datasets +from scikits.learn import datasets def test_20news(): try: diff --git a/sklearn/datasets/tests/test_base.py b/scikits/learn/datasets/tests/test_base.py similarity index 90% rename from sklearn/datasets/tests/test_base.py rename to scikits/learn/datasets/tests/test_base.py index f8dfae333dbdfad40015c017730ec9889cd35689..bff8f71f914b1afc66c76c3251bb5a89e757a99c 100644 --- a/sklearn/datasets/tests/test_base.py +++ b/scikits/learn/datasets/tests/test_base.py @@ -2,8 +2,8 @@ import os import shutil import tempfile -from sklearn.datasets import get_data_home -from sklearn.datasets import clear_data_home +from scikits.learn.datasets import get_data_home +from scikits.learn.datasets import clear_data_home from nose.tools import assert_false from nose.tools import assert_true diff --git a/sklearn/datasets/tests/test_lfw.py b/scikits/learn/datasets/tests/test_lfw.py similarity index 97% rename from sklearn/datasets/tests/test_lfw.py rename to scikits/learn/datasets/tests/test_lfw.py index f474d4c1dae0a5fcd5e666860d139eac918bea52..0ddf95b47d17d0bac9d391f142b8ec1c0439735a 100644 --- a/sklearn/datasets/tests/test_lfw.py +++ b/scikits/learn/datasets/tests/test_lfw.py @@ -21,9 +21,9 @@ try: except ImportError: imsave = None -from sklearn.datasets import load_lfw_pairs -from sklearn.datasets import load_lfw_people -from sklearn.datasets import get_data_home +from scikits.learn.datasets import load_lfw_pairs +from scikits.learn.datasets import load_lfw_people +from scikits.learn.datasets import get_data_home from numpy.testing import assert_array_equal from numpy.testing import assert_equal diff --git a/sklearn/datasets/tests/test_mldata.py b/scikits/learn/datasets/tests/test_mldata.py similarity index 96% rename from sklearn/datasets/tests/test_mldata.py rename to scikits/learn/datasets/tests/test_mldata.py index c0e51c766f59ba708e2ecd36f2f188ae2b924995..5d49836303203973aed1c64a16261f22ddcf8f48 100644 --- a/sklearn/datasets/tests/test_mldata.py +++ b/scikits/learn/datasets/tests/test_mldata.py @@ -1,8 +1,8 @@ """Test functionality of mldata fetching utilities.""" -from sklearn import datasets -from sklearn.datasets import mldata_filename, fetch_mldata -from sklearn.utils.testing import (assert_in, mock_urllib2) +from scikits.learn import datasets +from scikits.learn.datasets import mldata_filename, fetch_mldata +from scikits.learn.utils.testing import (assert_in, mock_urllib2) from nose.tools import assert_equal, assert_raises from nose import with_setup from numpy.testing import assert_array_equal diff --git a/sklearn/datasets/tests/test_samples_generator.py b/scikits/learn/datasets/tests/test_samples_generator.py similarity index 100% rename from sklearn/datasets/tests/test_samples_generator.py rename to scikits/learn/datasets/tests/test_samples_generator.py diff --git a/sklearn/datasets/tests/test_svmlight_format.py b/scikits/learn/datasets/tests/test_svmlight_format.py similarity index 97% rename from sklearn/datasets/tests/test_svmlight_format.py rename to scikits/learn/datasets/tests/test_svmlight_format.py index 8708fff1c614fbc1e6c8f13d8fd1fe811662f8ec..fedf53c7dd253fbf0fefb2f00fa649c8f0810154 100644 --- a/sklearn/datasets/tests/test_svmlight_format.py +++ b/scikits/learn/datasets/tests/test_svmlight_format.py @@ -4,7 +4,7 @@ import os.path from numpy.testing import assert_equal, assert_array_equal from nose.tools import raises -from sklearn.datasets import load_svmlight_file +from scikits.learn.datasets import load_svmlight_file currdir = os.path.dirname(os.path.abspath(__file__)) datafile = os.path.join(currdir, "data", "svmlight_classification.txt") diff --git a/sklearn/datasets/twenty_newsgroups.py b/scikits/learn/datasets/twenty_newsgroups.py similarity index 100% rename from sklearn/datasets/twenty_newsgroups.py rename to scikits/learn/datasets/twenty_newsgroups.py diff --git a/sklearn/decomposition/__init__.py b/scikits/learn/decomposition/__init__.py similarity index 100% rename from sklearn/decomposition/__init__.py rename to scikits/learn/decomposition/__init__.py diff --git a/sklearn/decomposition/fastica_.py b/scikits/learn/decomposition/fastica_.py similarity index 100% rename from sklearn/decomposition/fastica_.py rename to scikits/learn/decomposition/fastica_.py diff --git a/sklearn/decomposition/kernel_pca.py b/scikits/learn/decomposition/kernel_pca.py similarity index 100% rename from sklearn/decomposition/kernel_pca.py rename to scikits/learn/decomposition/kernel_pca.py diff --git a/sklearn/decomposition/nmf.py b/scikits/learn/decomposition/nmf.py similarity index 99% rename from sklearn/decomposition/nmf.py rename to scikits/learn/decomposition/nmf.py index f40479f39e7376954af678436aece35d473d9d93..1324988a76a67f4f15727e21b332baf7efe801cb 100644 --- a/sklearn/decomposition/nmf.py +++ b/scikits/learn/decomposition/nmf.py @@ -291,7 +291,7 @@ class ProjectedGradientNMF(BaseEstimator, TransformerMixin): >>> import numpy as np >>> X = np.array([[1,1], [2, 1], [3, 1.2], [4, 1], [5, 0.8], [6, 1]]) - >>> from sklearn.decomposition import ProjectedGradientNMF + >>> from scikits.learn.decomposition import ProjectedGradientNMF >>> model = ProjectedGradientNMF(n_components=2, init=0) >>> model.fit(X) #doctest: +ELLIPSIS +NORMALIZE_WHITESPACE ProjectedGradientNMF(beta=1, eta=0.1, diff --git a/sklearn/decomposition/pca.py b/scikits/learn/decomposition/pca.py similarity index 99% rename from sklearn/decomposition/pca.py rename to scikits/learn/decomposition/pca.py index 5b6ccbf53e49b68bc3e7101b253ec9980cc0aae1..02511ce690c5d043606e3275b09ea50ceb197f62 100644 --- a/sklearn/decomposition/pca.py +++ b/scikits/learn/decomposition/pca.py @@ -154,7 +154,7 @@ class PCA(BaseEstimator, TransformerMixin): Examples -------- >>> import numpy as np - >>> from sklearn.decomposition import PCA + >>> from scikits.learn.decomposition import PCA >>> X = np.array([[-1, -1], [-2, -1], [-3, -2], [1, 1], [2, 1], [3, 2]]) >>> pca = PCA(n_components=2) >>> pca.fit(X) @@ -390,7 +390,7 @@ class RandomizedPCA(BaseEstimator, TransformerMixin): Examples -------- >>> import numpy as np - >>> from sklearn.decomposition import RandomizedPCA + >>> from scikits.learn.decomposition import RandomizedPCA >>> X = np.array([[-1, -1], [-2, -1], [-3, -2], [1, 1], [2, 1], [3, 2]]) >>> pca = RandomizedPCA(n_components=2) >>> pca.fit(X) diff --git a/sklearn/decomposition/sparse_pca.py b/scikits/learn/decomposition/sparse_pca.py similarity index 100% rename from sklearn/decomposition/sparse_pca.py rename to scikits/learn/decomposition/sparse_pca.py diff --git a/sklearn/decomposition/tests/__init__.py b/scikits/learn/decomposition/tests/__init__.py similarity index 100% rename from sklearn/decomposition/tests/__init__.py rename to scikits/learn/decomposition/tests/__init__.py diff --git a/sklearn/decomposition/tests/test_fastica.py b/scikits/learn/decomposition/tests/test_fastica.py similarity index 100% rename from sklearn/decomposition/tests/test_fastica.py rename to scikits/learn/decomposition/tests/test_fastica.py diff --git a/sklearn/decomposition/tests/test_kernel_pca.py b/scikits/learn/decomposition/tests/test_kernel_pca.py similarity index 100% rename from sklearn/decomposition/tests/test_kernel_pca.py rename to scikits/learn/decomposition/tests/test_kernel_pca.py diff --git a/sklearn/decomposition/tests/test_nmf.py b/scikits/learn/decomposition/tests/test_nmf.py similarity index 100% rename from sklearn/decomposition/tests/test_nmf.py rename to scikits/learn/decomposition/tests/test_nmf.py diff --git a/sklearn/decomposition/tests/test_pca.py b/scikits/learn/decomposition/tests/test_pca.py similarity index 100% rename from sklearn/decomposition/tests/test_pca.py rename to scikits/learn/decomposition/tests/test_pca.py diff --git a/sklearn/decomposition/tests/test_sparse_pca.py b/scikits/learn/decomposition/tests/test_sparse_pca.py similarity index 97% rename from sklearn/decomposition/tests/test_sparse_pca.py rename to scikits/learn/decomposition/tests/test_sparse_pca.py index f7da34a75ae9c682f5bc3f677fa1ed89d0550065..bb9f3e03a8bedaaace7986de25c1a5ad73797c96 100644 --- a/sklearn/decomposition/tests/test_sparse_pca.py +++ b/scikits/learn/decomposition/tests/test_sparse_pca.py @@ -58,7 +58,7 @@ def test_fit_transform(): U1 = spca_lars.transform(Y) # Test multiple CPUs if sys.platform == 'win32': # fake parallelism for win32 - import sklearn.externals.joblib.parallel as joblib_par + import scikits.learn.externals.joblib.parallel as joblib_par _mp = joblib_par.multiprocessing joblib_par.multiprocessing = None try: @@ -140,7 +140,7 @@ def test_mini_batch_fit_transform(): U1 = spca_lars.transform(Y) # Test multiple CPUs if sys.platform == 'win32': # fake parallelism for win32 - import sklearn.externals.joblib.parallel as joblib_par + import scikits.learn.externals.joblib.parallel as joblib_par _mp = joblib_par.multiprocessing joblib_par.multiprocessing = None try: diff --git a/sklearn/externals/README b/scikits/learn/externals/README similarity index 100% rename from sklearn/externals/README rename to scikits/learn/externals/README diff --git a/sklearn/externals/__init__.py b/scikits/learn/externals/__init__.py similarity index 100% rename from sklearn/externals/__init__.py rename to scikits/learn/externals/__init__.py diff --git a/sklearn/externals/copy_joblib.sh b/scikits/learn/externals/copy_joblib.sh similarity index 100% rename from sklearn/externals/copy_joblib.sh rename to scikits/learn/externals/copy_joblib.sh diff --git a/sklearn/externals/joblib/__init__.py b/scikits/learn/externals/joblib/__init__.py similarity index 96% rename from sklearn/externals/joblib/__init__.py rename to scikits/learn/externals/joblib/__init__.py index 581a4d506378782f56962c6d7893226008efcdc1..c587ab4e723a7a5254cd7663511227de6694496c 100755 --- a/sklearn/externals/joblib/__init__.py +++ b/scikits/learn/externals/joblib/__init__.py @@ -59,7 +59,7 @@ Main features inputs and outputs: Python functions. Joblib can save their computation to disk and rerun it only if necessary:: - >>> from sklearn.externals.joblib import Memory + >>> from scikits.learn.externals.joblib import Memory >>> mem = Memory(cachedir='/tmp/joblib') >>> import numpy as np >>> a = np.vander(np.arange(3)) @@ -78,7 +78,7 @@ Main features 2) **Embarrassingly parallel helper:** to make is easy to write readable parallel code and debug it quickly: - >>> from sklearn.externals.joblib import Parallel, delayed + >>> from scikits.learn.externals.joblib import Parallel, delayed >>> from math import sqrt >>> Parallel(n_jobs=1)(delayed(sqrt)(i**2) for i in range(10)) [0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0] diff --git a/sklearn/externals/joblib/disk.py b/scikits/learn/externals/joblib/disk.py similarity index 100% rename from sklearn/externals/joblib/disk.py rename to scikits/learn/externals/joblib/disk.py diff --git a/sklearn/externals/joblib/format_stack.py b/scikits/learn/externals/joblib/format_stack.py similarity index 100% rename from sklearn/externals/joblib/format_stack.py rename to scikits/learn/externals/joblib/format_stack.py diff --git a/sklearn/externals/joblib/func_inspect.py b/scikits/learn/externals/joblib/func_inspect.py similarity index 100% rename from sklearn/externals/joblib/func_inspect.py rename to scikits/learn/externals/joblib/func_inspect.py diff --git a/sklearn/externals/joblib/hashing.py b/scikits/learn/externals/joblib/hashing.py similarity index 100% rename from sklearn/externals/joblib/hashing.py rename to scikits/learn/externals/joblib/hashing.py diff --git a/sklearn/externals/joblib/logger.py b/scikits/learn/externals/joblib/logger.py similarity index 100% rename from sklearn/externals/joblib/logger.py rename to scikits/learn/externals/joblib/logger.py diff --git a/sklearn/externals/joblib/memory.py b/scikits/learn/externals/joblib/memory.py similarity index 100% rename from sklearn/externals/joblib/memory.py rename to scikits/learn/externals/joblib/memory.py diff --git a/sklearn/externals/joblib/my_exceptions.py b/scikits/learn/externals/joblib/my_exceptions.py similarity index 100% rename from sklearn/externals/joblib/my_exceptions.py rename to scikits/learn/externals/joblib/my_exceptions.py diff --git a/sklearn/externals/joblib/numpy_pickle.py b/scikits/learn/externals/joblib/numpy_pickle.py similarity index 100% rename from sklearn/externals/joblib/numpy_pickle.py rename to scikits/learn/externals/joblib/numpy_pickle.py diff --git a/sklearn/externals/joblib/parallel.py b/scikits/learn/externals/joblib/parallel.py similarity index 97% rename from sklearn/externals/joblib/parallel.py rename to scikits/learn/externals/joblib/parallel.py index 312f4ee9a8d6da82843db71151125b7f0c8d2471..782bcd6f2da43b14df68b554726e0b376fa9b956 100755 --- a/sklearn/externals/joblib/parallel.py +++ b/scikits/learn/externals/joblib/parallel.py @@ -199,7 +199,7 @@ class Parallel(Logger): A simple example: >>> from math import sqrt - >>> from sklearn.externals.joblib import Parallel, delayed + >>> from scikits.learn.externals.joblib import Parallel, delayed >>> Parallel(n_jobs=1)(delayed(sqrt)(i**2) for i in range(10)) [0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0] @@ -207,7 +207,7 @@ class Parallel(Logger): values: >>> from math import modf - >>> from sklearn.externals.joblib import Parallel, delayed + >>> from scikits.learn.externals.joblib import Parallel, delayed >>> r = Parallel(n_jobs=1)(delayed(modf)(i/2.) for i in range(10)) >>> res, i = zip(*r) >>> res @@ -218,7 +218,7 @@ class Parallel(Logger): The progress meter:: >>> from time import sleep - >>> from sklearn.externals.joblib import Parallel, delayed + >>> from scikits.learn.externals.joblib import Parallel, delayed >>> r = Parallel(n_jobs=2, verbose=1)(delayed(sleep)(.1) for _ in range(10)) #doctest: +SKIP [Parallel(n_jobs=2)]: Done 1 out of 10 |elapsed: 0.1s remaining: 0.9s [Parallel(n_jobs=2)]: Done 3 out of 10 |elapsed: 0.2s remaining: 0.5s @@ -232,7 +232,7 @@ class Parallel(Logger): child process:: >>> from string import atoi - >>> from sklearn.externals.joblib import Parallel, delayed + >>> from scikits.learn.externals.joblib import Parallel, delayed >>> Parallel(n_jobs=2)(delayed(atoi)(n) for n in ('1', '300', 30)) #doctest: +SKIP #... --------------------------------------------------------------------------- @@ -263,7 +263,7 @@ class Parallel(Logger): number of iterations reported is underestimated:: >>> from math import sqrt - >>> from sklearn.externals.joblib import Parallel, delayed + >>> from scikits.learn.externals.joblib import Parallel, delayed >>> def producer(): ... for i in range(6): diff --git a/sklearn/externals/joblib/test/__init__.py b/scikits/learn/externals/joblib/test/__init__.py similarity index 100% rename from sklearn/externals/joblib/test/__init__.py rename to scikits/learn/externals/joblib/test/__init__.py diff --git a/sklearn/externals/joblib/test/common.py b/scikits/learn/externals/joblib/test/common.py similarity index 100% rename from sklearn/externals/joblib/test/common.py rename to scikits/learn/externals/joblib/test/common.py diff --git a/sklearn/externals/joblib/test/test_format_stack.py b/scikits/learn/externals/joblib/test/test_format_stack.py similarity index 100% rename from sklearn/externals/joblib/test/test_format_stack.py rename to scikits/learn/externals/joblib/test/test_format_stack.py diff --git a/sklearn/externals/joblib/test/test_func_inspect.py b/scikits/learn/externals/joblib/test/test_func_inspect.py similarity index 100% rename from sklearn/externals/joblib/test/test_func_inspect.py rename to scikits/learn/externals/joblib/test/test_func_inspect.py diff --git a/sklearn/externals/joblib/test/test_hashing.py b/scikits/learn/externals/joblib/test/test_hashing.py similarity index 100% rename from sklearn/externals/joblib/test/test_hashing.py rename to scikits/learn/externals/joblib/test/test_hashing.py diff --git a/sklearn/externals/joblib/test/test_logger.py b/scikits/learn/externals/joblib/test/test_logger.py similarity index 100% rename from sklearn/externals/joblib/test/test_logger.py rename to scikits/learn/externals/joblib/test/test_logger.py diff --git a/sklearn/externals/joblib/test/test_memory.py b/scikits/learn/externals/joblib/test/test_memory.py similarity index 100% rename from sklearn/externals/joblib/test/test_memory.py rename to scikits/learn/externals/joblib/test/test_memory.py diff --git a/sklearn/externals/joblib/test/test_my_exceptions.py b/scikits/learn/externals/joblib/test/test_my_exceptions.py similarity index 100% rename from sklearn/externals/joblib/test/test_my_exceptions.py rename to scikits/learn/externals/joblib/test/test_my_exceptions.py diff --git a/sklearn/externals/joblib/test/test_numpy_pickle.py b/scikits/learn/externals/joblib/test/test_numpy_pickle.py similarity index 100% rename from sklearn/externals/joblib/test/test_numpy_pickle.py rename to scikits/learn/externals/joblib/test/test_numpy_pickle.py diff --git a/sklearn/externals/joblib/test/test_parallel.py b/scikits/learn/externals/joblib/test/test_parallel.py similarity index 100% rename from sklearn/externals/joblib/test/test_parallel.py rename to scikits/learn/externals/joblib/test/test_parallel.py diff --git a/sklearn/externals/joblib/testing.py b/scikits/learn/externals/joblib/testing.py similarity index 100% rename from sklearn/externals/joblib/testing.py rename to scikits/learn/externals/joblib/testing.py diff --git a/sklearn/externals/setup.py b/scikits/learn/externals/setup.py similarity index 100% rename from sklearn/externals/setup.py rename to scikits/learn/externals/setup.py diff --git a/sklearn/externals/test_externals_setup.py b/scikits/learn/externals/test_externals_setup.py similarity index 100% rename from sklearn/externals/test_externals_setup.py rename to scikits/learn/externals/test_externals_setup.py diff --git a/sklearn/feature_extraction/__init__.py b/scikits/learn/feature_extraction/__init__.py similarity index 100% rename from sklearn/feature_extraction/__init__.py rename to scikits/learn/feature_extraction/__init__.py diff --git a/sklearn/feature_extraction/image.py b/scikits/learn/feature_extraction/image.py similarity index 100% rename from sklearn/feature_extraction/image.py rename to scikits/learn/feature_extraction/image.py diff --git a/sklearn/feature_extraction/tests/__init__.py b/scikits/learn/feature_extraction/tests/__init__.py similarity index 100% rename from sklearn/feature_extraction/tests/__init__.py rename to scikits/learn/feature_extraction/tests/__init__.py diff --git a/sklearn/feature_extraction/tests/test_image.py b/scikits/learn/feature_extraction/tests/test_image.py similarity index 100% rename from sklearn/feature_extraction/tests/test_image.py rename to scikits/learn/feature_extraction/tests/test_image.py diff --git a/sklearn/feature_extraction/tests/test_text.py b/scikits/learn/feature_extraction/tests/test_text.py similarity index 94% rename from sklearn/feature_extraction/tests/test_text.py rename to scikits/learn/feature_extraction/tests/test_text.py index 979f7796d3ceed1cfba2dc1244a23b8953251262..429c54b283f0e790f735bdc5cadf0e0fc9cc1271 100644 --- a/sklearn/feature_extraction/tests/test_text.py +++ b/scikits/learn/feature_extraction/tests/test_text.py @@ -1,15 +1,15 @@ -from sklearn.feature_extraction.text import CharNGramAnalyzer -from sklearn.feature_extraction.text import WordNGramAnalyzer -from sklearn.feature_extraction.text import strip_accents -from sklearn.feature_extraction.text import to_ascii - -from sklearn.feature_extraction.text import CountVectorizer -from sklearn.feature_extraction.text import TfidfTransformer -from sklearn.feature_extraction.text import Vectorizer - -from sklearn.grid_search import GridSearchCV -from sklearn.pipeline import Pipeline -from sklearn.svm.sparse import LinearSVC as LinearSVC +from scikits.learn.feature_extraction.text import CharNGramAnalyzer +from scikits.learn.feature_extraction.text import WordNGramAnalyzer +from scikits.learn.feature_extraction.text import strip_accents +from scikits.learn.feature_extraction.text import to_ascii + +from scikits.learn.feature_extraction.text import CountVectorizer +from scikits.learn.feature_extraction.text import TfidfTransformer +from scikits.learn.feature_extraction.text import Vectorizer + +from scikits.learn.grid_search import GridSearchCV +from scikits.learn.pipeline import Pipeline +from scikits.learn.svm.sparse import LinearSVC as LinearSVC import numpy as np from nose.tools import assert_equal, assert_equals, \ diff --git a/sklearn/feature_extraction/text.py b/scikits/learn/feature_extraction/text.py similarity index 100% rename from sklearn/feature_extraction/text.py rename to scikits/learn/feature_extraction/text.py diff --git a/sklearn/feature_selection/__init__.py b/scikits/learn/feature_selection/__init__.py similarity index 100% rename from sklearn/feature_selection/__init__.py rename to scikits/learn/feature_selection/__init__.py diff --git a/sklearn/feature_selection/rfe.py b/scikits/learn/feature_selection/rfe.py similarity index 100% rename from sklearn/feature_selection/rfe.py rename to scikits/learn/feature_selection/rfe.py diff --git a/sklearn/feature_selection/tests/__init__.py b/scikits/learn/feature_selection/tests/__init__.py similarity index 100% rename from sklearn/feature_selection/tests/__init__.py rename to scikits/learn/feature_selection/tests/__init__.py diff --git a/sklearn/feature_selection/tests/test_chi2.py b/scikits/learn/feature_selection/tests/test_chi2.py similarity index 100% rename from sklearn/feature_selection/tests/test_chi2.py rename to scikits/learn/feature_selection/tests/test_chi2.py diff --git a/sklearn/feature_selection/tests/test_feature_select.py b/scikits/learn/feature_selection/tests/test_feature_select.py similarity index 99% rename from sklearn/feature_selection/tests/test_feature_select.py rename to scikits/learn/feature_selection/tests/test_feature_select.py index 4d4771665af1b3e6832b28719bdeff3f022a699c..4319a83e5294eb262d43dedf3f67c1ae6ae0d0bc 100644 --- a/sklearn/feature_selection/tests/test_feature_select.py +++ b/scikits/learn/feature_selection/tests/test_feature_select.py @@ -9,7 +9,7 @@ from ..univariate_selection import (f_classif, f_regression, f_oneway, import numpy as np from numpy.testing import assert_array_equal from scipy import stats -from sklearn.datasets.samples_generator import make_classification, \ +from scikits.learn.datasets.samples_generator import make_classification, \ make_regression ############################################################################## diff --git a/sklearn/feature_selection/tests/test_rfe.py b/scikits/learn/feature_selection/tests/test_rfe.py similarity index 100% rename from sklearn/feature_selection/tests/test_rfe.py rename to scikits/learn/feature_selection/tests/test_rfe.py diff --git a/sklearn/feature_selection/univariate_selection.py b/scikits/learn/feature_selection/univariate_selection.py similarity index 100% rename from sklearn/feature_selection/univariate_selection.py rename to scikits/learn/feature_selection/univariate_selection.py diff --git a/sklearn/gaussian_process/__init__.py b/scikits/learn/gaussian_process/__init__.py similarity index 100% rename from sklearn/gaussian_process/__init__.py rename to scikits/learn/gaussian_process/__init__.py diff --git a/sklearn/gaussian_process/correlation_models.py b/scikits/learn/gaussian_process/correlation_models.py similarity index 100% rename from sklearn/gaussian_process/correlation_models.py rename to scikits/learn/gaussian_process/correlation_models.py diff --git a/sklearn/gaussian_process/gaussian_process.py b/scikits/learn/gaussian_process/gaussian_process.py similarity index 99% rename from sklearn/gaussian_process/gaussian_process.py rename to scikits/learn/gaussian_process/gaussian_process.py index 1639396e99fa170a6e2bdd0db20f91aac67feba2..0a85246f847c7712951bc349081ae55ec7a3f8fd 100644 --- a/sklearn/gaussian_process/gaussian_process.py +++ b/scikits/learn/gaussian_process/gaussian_process.py @@ -158,7 +158,7 @@ class GaussianProcess(BaseEstimator, RegressorMixin): Example ------- >>> import numpy as np - >>> from sklearn.gaussian_process import GaussianProcess + >>> from scikits.learn.gaussian_process import GaussianProcess >>> X = np.atleast_2d([1., 3., 5., 6., 7., 8.]).T >>> y = (X * np.sin(X)).ravel() >>> gp = GaussianProcess(theta0=0.1, thetaL=.001, thetaU=1.) diff --git a/sklearn/gaussian_process/regression_models.py b/scikits/learn/gaussian_process/regression_models.py similarity index 100% rename from sklearn/gaussian_process/regression_models.py rename to scikits/learn/gaussian_process/regression_models.py diff --git a/sklearn/gaussian_process/tests/__init__.py b/scikits/learn/gaussian_process/tests/__init__.py similarity index 100% rename from sklearn/gaussian_process/tests/__init__.py rename to scikits/learn/gaussian_process/tests/__init__.py diff --git a/sklearn/gaussian_process/tests/test_gaussian_process.py b/scikits/learn/gaussian_process/tests/test_gaussian_process.py similarity index 97% rename from sklearn/gaussian_process/tests/test_gaussian_process.py rename to scikits/learn/gaussian_process/tests/test_gaussian_process.py index 89ea1d5b25b91dda4c16fe3cf798ac5a889181ef..0f0e643a31c8bb2577f45c12d75be393cb0ac263 100644 --- a/sklearn/gaussian_process/tests/test_gaussian_process.py +++ b/scikits/learn/gaussian_process/tests/test_gaussian_process.py @@ -1,5 +1,5 @@ """ -Testing for Gaussian Process module (sklearn.gaussian_process) +Testing for Gaussian Process module (scikits.learn.gaussian_process) """ # Author: Vincent Dubourg <vincent.dubourg@gmail.com> diff --git a/sklearn/grid_search.py b/scikits/learn/grid_search.py similarity index 98% rename from sklearn/grid_search.py rename to scikits/learn/grid_search.py index 63292db3b2ab65db2f32d2b49ca6cce4021e361f..36c30f80132daef8565a8675ba2775fec4628812 100644 --- a/sklearn/grid_search.py +++ b/scikits/learn/grid_search.py @@ -33,7 +33,7 @@ class IterGrid(object): Examples --------- - >>> from sklearn.grid_search import IterGrid + >>> from scikits.learn.grid_search import IterGrid >>> param_grid = {'a':[1, 2], 'b':[True, False]} >>> list(IterGrid(param_grid)) #doctest: +NORMALIZE_WHITESPACE [{'a': 1, 'b': True}, {'a': 1, 'b': False}, @@ -183,7 +183,7 @@ class GridSearchCV(BaseEstimator): cv : integer or crossvalidation generator, optional If an integer is passed, it is the number of fold (default 3). Specific crossvalidation objects can be passed, see - sklearn.cross_val module for the list of possible objects + scikits.learn.cross_val module for the list of possible objects refit: boolean refit the best estimator with the entire dataset @@ -193,7 +193,7 @@ class GridSearchCV(BaseEstimator): Examples -------- - >>> from sklearn import svm, grid_search, datasets + >>> from scikits.learn import svm, grid_search, datasets >>> iris = datasets.load_iris() >>> parameters = {'kernel':('linear', 'rbf'), 'C':[1, 10]} >>> svr = svm.SVR() diff --git a/sklearn/hmm.py b/scikits/learn/hmm.py similarity index 99% rename from sklearn/hmm.py rename to scikits/learn/hmm.py index b949bb17c1b345403bde99bed5a3a84d5f57cb7b..8023901092145d84b8ec8b973d27c250bfe4b43d 100644 --- a/sklearn/hmm.py +++ b/scikits/learn/hmm.py @@ -578,7 +578,7 @@ class GaussianHMM(_BaseHMM): Examples -------- - >>> from sklearn.hmm import GaussianHMM + >>> from scikits.learn.hmm import GaussianHMM >>> GaussianHMM(n_components=2) GaussianHMM(covars_prior=0.01, covars_weight=1, cvtype='diag', means_prior=None, means_weight=0, n_components=2, @@ -823,7 +823,7 @@ class MultinomialHMM(_BaseHMM): Examples -------- - >>> from sklearn.hmm import MultinomialHMM + >>> from scikits.learn.hmm import MultinomialHMM >>> MultinomialHMM(n_components=2) ... #doctest: +ELLIPSIS +NORMALIZE_WHITESPACE MultinomialHMM(n_components=2, startprob=array([ 0.5, 0.5]), @@ -942,7 +942,7 @@ class GMMHMM(_BaseHMM): Examples -------- - >>> from sklearn.hmm import GMMHMM + >>> from scikits.learn.hmm import GMMHMM >>> GMMHMM(n_components=2, n_mix=10, cvtype='diag') ... # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE GMMHMM(cvtype='diag', diff --git a/sklearn/lda.py b/scikits/learn/lda.py similarity index 99% rename from sklearn/lda.py rename to scikits/learn/lda.py index 46427a6ea0ed8b7334d3e0a39de967d4a72d4520..224b8f6211be3dc0ef49eaad11e6f991ab075f95 100644 --- a/sklearn/lda.py +++ b/scikits/learn/lda.py @@ -40,7 +40,7 @@ class LDA(BaseEstimator, ClassifierMixin, TransformerMixin): Examples -------- >>> import numpy as np - >>> from sklearn.lda import LDA + >>> from scikits.learn.lda import LDA >>> X = np.array([[-1, -1], [-2, -1], [-3, -2], [1, 1], [2, 1], [3, 2]]) >>> y = np.array([1, 1, 1, 2, 2, 2]) >>> clf = LDA() diff --git a/sklearn/linear_model/__init__.py b/scikits/learn/linear_model/__init__.py similarity index 93% rename from sklearn/linear_model/__init__.py rename to scikits/learn/linear_model/__init__.py index 2bb97881639bb9f51e61ee9bf6e201637141d4f2..65a7dae88d03f9636e21b97c52fdcd79777a835d 100644 --- a/sklearn/linear_model/__init__.py +++ b/scikits/learn/linear_model/__init__.py @@ -1,5 +1,5 @@ """ -:mod:`sklearn.linear_model` is a module to fit genelarized linear +:mod:`scikits.learn.linear_model` is a module to fit genelarized linear models. It includes Ridge regression, Bayesian Regression, Lasso and Elastic Net estimators computed with Least Angle Regression and coordinate descent. diff --git a/sklearn/linear_model/base.py b/scikits/learn/linear_model/base.py similarity index 99% rename from sklearn/linear_model/base.py rename to scikits/learn/linear_model/base.py index 996fdc35df2eb04ac86108cab8c41918b7d4c916..ddc5cd0a37e4f821be7d9a1660c83e1505b9ea2c 100644 --- a/sklearn/linear_model/base.py +++ b/scikits/learn/linear_model/base.py @@ -55,7 +55,7 @@ class LinearModel(BaseEstimator, RegressorMixin): nearly all linear models will want their data to be centered. WARNING : This function modifies X inplace : - Use sklearn.utils.as_float_array before to convert X to np.float. + Use scikits.learn.utils.as_float_array before to convert X to np.float. You can specify an argument overwrite_X (default is False). """ if fit_intercept: diff --git a/sklearn/linear_model/bayes.py b/scikits/learn/linear_model/bayes.py similarity index 99% rename from sklearn/linear_model/bayes.py rename to scikits/learn/linear_model/bayes.py index 374f6fcf31374376c48b115ccf464ab57b070001..6a8eaedf3d7e6d34e6079bb42125fb8f8b88a219 100644 --- a/sklearn/linear_model/bayes.py +++ b/scikits/learn/linear_model/bayes.py @@ -101,7 +101,7 @@ class BayesianRidge(LinearModel): Examples -------- - >>> from sklearn import linear_model + >>> from scikits.learn import linear_model >>> clf = linear_model.BayesianRidge() >>> clf.fit([[0,0], [1, 1], [2, 2]], [0, 1, 2]) BayesianRidge(alpha_1=1e-06, alpha_2=1e-06, compute_score=False, @@ -321,7 +321,7 @@ class ARDRegression(LinearModel): Examples -------- - >>> from sklearn import linear_model + >>> from scikits.learn import linear_model >>> clf = linear_model.ARDRegression() >>> clf.fit([[0,0], [1, 1], [2, 2]], [0, 1, 2]) ARDRegression(alpha_1=1e-06, alpha_2=1e-06, compute_score=False, diff --git a/sklearn/linear_model/cd_fast.c b/scikits/learn/linear_model/cd_fast.c similarity index 100% rename from sklearn/linear_model/cd_fast.c rename to scikits/learn/linear_model/cd_fast.c diff --git a/sklearn/linear_model/cd_fast.pyx b/scikits/learn/linear_model/cd_fast.pyx similarity index 100% rename from sklearn/linear_model/cd_fast.pyx rename to scikits/learn/linear_model/cd_fast.pyx diff --git a/sklearn/linear_model/coordinate_descent.py b/scikits/learn/linear_model/coordinate_descent.py similarity index 99% rename from sklearn/linear_model/coordinate_descent.py rename to scikits/learn/linear_model/coordinate_descent.py index 49b662073002deef1c3aedae09b776c504ce8cac..89bc7c762b540bcf495125b1af9d009d29b9629f 100644 --- a/sklearn/linear_model/coordinate_descent.py +++ b/scikits/learn/linear_model/coordinate_descent.py @@ -226,7 +226,7 @@ class Lasso(ElasticNet): Examples -------- - >>> from sklearn import linear_model + >>> from scikits.learn import linear_model >>> clf = linear_model.Lasso(alpha=0.1) >>> clf.fit([[0,0], [1, 1], [2, 2]], [0, 1, 2]) Lasso(alpha=0.1, fit_intercept=True, max_iter=1000, normalize=False, @@ -546,7 +546,7 @@ class LassoCV(LinearModelCV): cv : integer or crossvalidation generator, optional If an integer is passed, it is the number of fold (default 3). Specific crossvalidation objects can be passed, see - sklearn.cross_val module for the list of possible objects + scikits.learn.cross_val module for the list of possible objects Notes ----- @@ -601,7 +601,7 @@ class ElasticNetCV(LinearModelCV): cv : integer or crossvalidation generator, optional If an integer is passed, it is the number of fold (default 3). Specific crossvalidation objects can be passed, see - sklearn.cross_val module for the list of possible objects + scikits.learn.cross_val module for the list of possible objects Notes diff --git a/sklearn/linear_model/least_angle.py b/scikits/learn/linear_model/least_angle.py similarity index 99% rename from sklearn/linear_model/least_angle.py rename to scikits/learn/linear_model/least_angle.py index c9be3dc9e2b3eba0ec496bfb67ecdd07ef71bf83..847c68f0b7cb9d5da3dbf1a78d096d31ff41cba2 100644 --- a/sklearn/linear_model/least_angle.py +++ b/scikits/learn/linear_model/least_angle.py @@ -343,7 +343,7 @@ class Lars(LinearModel): Examples -------- - >>> from sklearn import linear_model + >>> from scikits.learn import linear_model >>> clf = linear_model.Lars(n_nonzero_coefs=1) >>> clf.fit([[-1, 1], [0, 0], [1, 1]], [-1.1111, 0, -1.1111]) # doctest: +ELLIPSIS Lars(eps=..., fit_intercept=True, n_nonzero_coefs=1, @@ -479,7 +479,7 @@ class LassoLars(Lars): Examples -------- - >>> from sklearn import linear_model + >>> from scikits.learn import linear_model >>> clf = linear_model.LassoLars(alpha=0.01) >>> clf.fit([[-1, 1], [0, 0], [1, 1]], [-1, 0, -1]) # doctest: +ELLIPSIS LassoLars(alpha=0.01, eps=..., fit_intercept=True, @@ -642,7 +642,7 @@ class LarsCV(LARS): Maximum number of iterations to perform. cv : crossvalidation generator, optional - see sklearn.cross_val module. If None is passed, default to + see scikits.learn.cross_val module. If None is passed, default to a 5-fold strategy n_jobs : integer, optional @@ -775,7 +775,7 @@ class LassoLarsCV(LarsCV): Maximum number of iterations to perform. cv : crossvalidation generator, optional - see sklearn.cross_val module. If None is passed, default to + see scikits.learn.cross_val module. If None is passed, default to a 5-fold strategy n_jobs : integer, optional @@ -890,7 +890,7 @@ class LassoLarsIC(LassoLars): Examples -------- - >>> from sklearn import linear_model + >>> from scikits.learn import linear_model >>> clf = linear_model.LassoLarsIC(criterion='bic') >>> clf.fit([[-1, 1], [0, 0], [1, 1]], [-1.1111, 0, -1.1111]) # doctest: +ELLIPSIS LassoLarsIC(criterion='bic', eps=..., fit_intercept=True, diff --git a/sklearn/linear_model/logistic.py b/scikits/learn/linear_model/logistic.py similarity index 100% rename from sklearn/linear_model/logistic.py rename to scikits/learn/linear_model/logistic.py diff --git a/sklearn/linear_model/omp.py b/scikits/learn/linear_model/omp.py similarity index 100% rename from sklearn/linear_model/omp.py rename to scikits/learn/linear_model/omp.py diff --git a/sklearn/linear_model/ridge.py b/scikits/learn/linear_model/ridge.py similarity index 99% rename from sklearn/linear_model/ridge.py rename to scikits/learn/linear_model/ridge.py index 578af2791e12d134c513c7e4cbc1b2389a47e707..c31b314109ee00b2d9070670e917cb5233a72fcf 100644 --- a/sklearn/linear_model/ridge.py +++ b/scikits/learn/linear_model/ridge.py @@ -155,7 +155,7 @@ class Ridge(LinearModel): Examples -------- - >>> from sklearn.linear_model import Ridge + >>> from scikits.learn.linear_model import Ridge >>> import numpy as np >>> n_samples, n_features = 10, 5 >>> np.random.seed(0) diff --git a/sklearn/linear_model/setup.py b/scikits/learn/linear_model/setup.py similarity index 100% rename from sklearn/linear_model/setup.py rename to scikits/learn/linear_model/setup.py diff --git a/sklearn/linear_model/sgd_fast.c b/scikits/learn/linear_model/sgd_fast.c similarity index 74% rename from sklearn/linear_model/sgd_fast.c rename to scikits/learn/linear_model/sgd_fast.c index 7cebda799c4f19b2e9beb799597f3a8127c5fe50..8d1f8e86ca74e5768e77eb330f063cc7c16fce25 100644 --- a/sklearn/linear_model/sgd_fast.c +++ b/scikits/learn/linear_model/sgd_fast.c @@ -1,18 +1,39 @@ -/* Generated by Cython 0.12.1 on Fri Sep 2 11:08:27 2011 */ +/* Generated by Cython 0.14.1 on Wed May 11 16:17:32 2011 */ #define PY_SSIZE_T_CLEAN #include "Python.h" -#include "structmember.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #else -#ifndef PY_LONG_LONG - #define PY_LONG_LONG LONG_LONG +#include <stddef.h> /* For offsetof */ +#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 + #if PY_VERSION_HEX < 0x02040000 #define METH_COEXIST 0 #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type) @@ -82,14 +103,43 @@ #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 -#else +#endif + +#if PY_VERSION_HEX < 0x02060000 + #define PyBytesObject PyStringObject #define PyBytes_Type PyString_Type + #define PyBytes_Check PyString_Check #define PyBytes_CheckExact PyString_CheckExact + #define PyBytes_FromString PyString_FromString + #define PyBytes_FromStringAndSize PyString_FromStringAndSize + #define PyBytes_FromFormat PyString_FromFormat + #define PyBytes_DecodeEscape PyString_DecodeEscape + #define PyBytes_AsString PyString_AsString + #define PyBytes_AsStringAndSize PyString_AsStringAndSize + #define PyBytes_Size PyString_Size + #define PyBytes_AS_STRING PyString_AS_STRING + #define PyBytes_GET_SIZE PyString_GET_SIZE + #define PyBytes_Repr PyString_Repr + #define PyBytes_Concat PyString_Concat + #define PyBytes_ConcatAndDel PyString_ConcatAndDel +#endif + +#if PY_VERSION_HEX < 0x02060000 + #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) + #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) #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) @@ -103,30 +153,42 @@ #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask +#endif + +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#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 -#if PY_MAJOR_VERSION >= 3 - #define PyMethod_New(func, self, klass) PyInstanceMethod_New(func) +#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) + #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) + #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) +#else + #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) + #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) #endif -#if !defined(WIN32) && !defined(MS_WINDOWS) - #ifndef __stdcall - #define __stdcall - #endif - #ifndef __cdecl - #define __cdecl - #endif - #ifndef __fastcall - #define __fastcall - #endif -#else - #define _USE_MATH_DEFINES +#if PY_MAJOR_VERSION >= 3 + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #endif #if PY_VERSION_HEX < 0x02050000 @@ -146,113 +208,69 @@ #define __Pyx_NAMESTR(n) (n) #define __Pyx_DOCSTR(n) (n) #endif + #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif + +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif #include <math.h> -#define __PYX_HAVE_API__sklearn__linear_model__sgd_fast -#include "stdlib.h" +#define __PYX_HAVE_API__scikits__learn__linear_model__sgd_fast #include "stdio.h" +#include "stdlib.h" #include "numpy/arrayobject.h" #include "numpy/ufuncobject.h" #include "math.h" +#ifdef PYREX_WITHOUT_ASSERTIONS +#define CYTHON_WITHOUT_ASSERTIONS +#endif + + +/* inline attribute */ #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 + #define CYTHON_INLINE #endif #endif +/* unused attribute */ +#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) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif + typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ /* Type Conversion Predeclarations */ -#if PY_MAJOR_VERSION < 3 -#define __Pyx_PyBytes_FromString PyString_FromString -#define __Pyx_PyBytes_FromStringAndSize PyString_FromStringAndSize -#define __Pyx_PyBytes_AsString PyString_AsString -#else -#define __Pyx_PyBytes_FromString PyBytes_FromString -#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize -#define __Pyx_PyBytes_AsString PyBytes_AsString -#endif - -#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s) -#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) __Pyx_PyBytes_AsString(s)) +#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s) +#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) PyBytes_AsString(s)) #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); -#if !defined(T_PYSSIZET) -#if PY_VERSION_HEX < 0x02050000 -#define T_PYSSIZET T_INT -#elif !defined(T_LONGLONG) -#define T_PYSSIZET \ - ((sizeof(Py_ssize_t) == sizeof(int)) ? T_INT : \ - ((sizeof(Py_ssize_t) == sizeof(long)) ? T_LONG : -1)) -#else -#define T_PYSSIZET \ - ((sizeof(Py_ssize_t) == sizeof(int)) ? T_INT : \ - ((sizeof(Py_ssize_t) == sizeof(long)) ? T_LONG : \ - ((sizeof(Py_ssize_t) == sizeof(PY_LONG_LONG)) ? T_LONGLONG : -1))) -#endif -#endif - - -#if !defined(T_ULONGLONG) -#define __Pyx_T_UNSIGNED_INT(x) \ - ((sizeof(x) == sizeof(unsigned char)) ? T_UBYTE : \ - ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \ - ((sizeof(x) == sizeof(unsigned int)) ? T_UINT : \ - ((sizeof(x) == sizeof(unsigned long)) ? T_ULONG : -1)))) -#else -#define __Pyx_T_UNSIGNED_INT(x) \ - ((sizeof(x) == sizeof(unsigned char)) ? T_UBYTE : \ - ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \ - ((sizeof(x) == sizeof(unsigned int)) ? T_UINT : \ - ((sizeof(x) == sizeof(unsigned long)) ? T_ULONG : \ - ((sizeof(x) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1))))) -#endif -#if !defined(T_LONGLONG) -#define __Pyx_T_SIGNED_INT(x) \ - ((sizeof(x) == sizeof(char)) ? T_BYTE : \ - ((sizeof(x) == sizeof(short)) ? T_SHORT : \ - ((sizeof(x) == sizeof(int)) ? T_INT : \ - ((sizeof(x) == sizeof(long)) ? T_LONG : -1)))) -#else -#define __Pyx_T_SIGNED_INT(x) \ - ((sizeof(x) == sizeof(char)) ? T_BYTE : \ - ((sizeof(x) == sizeof(short)) ? T_SHORT : \ - ((sizeof(x) == sizeof(int)) ? T_INT : \ - ((sizeof(x) == sizeof(long)) ? T_LONG : \ - ((sizeof(x) == sizeof(PY_LONG_LONG)) ? T_LONGLONG : -1))))) -#endif - -#define __Pyx_T_FLOATING(x) \ - ((sizeof(x) == sizeof(float)) ? T_FLOAT : \ - ((sizeof(x) == sizeof(double)) ? T_DOUBLE : -1)) - -#if !defined(T_SIZET) -#if !defined(T_ULONGLONG) -#define T_SIZET \ - ((sizeof(size_t) == sizeof(unsigned int)) ? T_UINT : \ - ((sizeof(size_t) == sizeof(unsigned long)) ? T_ULONG : -1)) -#else -#define T_SIZET \ - ((sizeof(size_t) == sizeof(unsigned int)) ? T_UINT : \ - ((sizeof(size_t) == sizeof(unsigned long)) ? T_ULONG : \ - ((sizeof(size_t) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1))) -#endif -#endif - static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); @@ -262,7 +280,7 @@ static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); #ifdef __GNUC__ /* Test for GCC > 2.95 */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) +#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* __GNUC__ > 2 ... */ @@ -282,7 +300,6 @@ static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; -static const char **__pyx_f; #if !defined(CYTHON_CCOMPLEX) @@ -308,6 +325,11 @@ static const char **__pyx_f; #define _Complex_I 1.0fj #endif +static const char *__pyx_f[] = { + "sgd_fast.pyx", + "numpy.pxd", +}; + typedef npy_int8 __pyx_t_5numpy_int8_t; typedef npy_int16 __pyx_t_5numpy_int16_t; @@ -346,9 +368,9 @@ typedef npy_double __pyx_t_5numpy_double_t; typedef npy_longdouble __pyx_t_5numpy_longdouble_t; -typedef __pyx_t_5numpy_float64_t __pyx_t_7sklearn_12linear_model_8sgd_fast_DOUBLE; +typedef __pyx_t_5numpy_float64_t __pyx_t_7scikits_5learn_12linear_model_8sgd_fast_DOUBLE; -typedef __pyx_t_5numpy_int32_t __pyx_t_7sklearn_12linear_model_8sgd_fast_INTEGER; +typedef __pyx_t_5numpy_int32_t __pyx_t_7scikits_5learn_12linear_model_8sgd_fast_INTEGER; #if CYTHON_CCOMPLEX #ifdef __cplusplus @@ -380,7 +402,7 @@ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; typedef npy_cdouble __pyx_t_5numpy_complex_t; -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pxd":20 +/* "scikits/learn/linear_model/sgd_fast.pxd":20 * # ----------------------------------------- * * cdef class LossFunction: # <<<<<<<<<<<<<< @@ -388,12 +410,12 @@ typedef npy_cdouble __pyx_t_5numpy_complex_t; * cpdef double dloss(self, double p, double y) */ -struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction { +struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction { PyObject_HEAD - struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_LossFunction *__pyx_vtab; + struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *__pyx_vtab; }; -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pxd":24 +/* "scikits/learn/linear_model/sgd_fast.pxd":24 * cpdef double dloss(self, double p, double y) * * cdef class Regression(LossFunction): # <<<<<<<<<<<<<< @@ -401,24 +423,23 @@ struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction { * cpdef double dloss(self,double p, double y) */ -struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Regression { - struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction __pyx_base; +struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Regression { + struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction __pyx_base; }; -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pxd":48 +/* "scikits/learn/linear_model/sgd_fast.pxd":44 * cpdef double dloss(self, double p, double y) * - * cdef class Huber(Regression): # <<<<<<<<<<<<<< - * cdef double c + * cdef class SquaredLoss(Regression): # <<<<<<<<<<<<<< * cpdef double loss(self, double p, double y) + * cpdef double dloss(self, double p, double y) */ -struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Huber { - struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Regression __pyx_base; - double c; +struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss { + struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Regression __pyx_base; }; -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pxd":28 +/* "scikits/learn/linear_model/sgd_fast.pxd":28 * cpdef double dloss(self,double p, double y) * * cdef class Classification(LossFunction): # <<<<<<<<<<<<<< @@ -426,35 +447,36 @@ struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Huber { * cpdef double dloss(self, double p, double y) */ -struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Classification { - struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction __pyx_base; +struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Classification { + struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction __pyx_base; }; -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pxd":40 +/* "scikits/learn/linear_model/sgd_fast.pxd":36 * cpdef double dloss(self, double p, double y) * - * cdef class Log(Classification): # <<<<<<<<<<<<<< + * cdef class Hinge(Classification): # <<<<<<<<<<<<<< * cpdef double loss(self, double p, double y) * cpdef double dloss(self, double p, double y) */ -struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Log { - struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Classification __pyx_base; +struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Hinge { + struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Classification __pyx_base; }; -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pxd":36 +/* "scikits/learn/linear_model/sgd_fast.pxd":48 * cpdef double dloss(self, double p, double y) * - * cdef class Hinge(Classification): # <<<<<<<<<<<<<< + * cdef class Huber(Regression): # <<<<<<<<<<<<<< + * cdef double c * cpdef double loss(self, double p, double y) - * cpdef double dloss(self, double p, double y) */ -struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Hinge { - struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Classification __pyx_base; +struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Huber { + struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Regression __pyx_base; + double c; }; -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pxd":32 +/* "scikits/learn/linear_model/sgd_fast.pxd":32 * cpdef double dloss(self, double p, double y) * * cdef class ModifiedHuber(Classification): # <<<<<<<<<<<<<< @@ -462,24 +484,24 @@ struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Hinge { * cpdef double dloss(self, double p, double y) */ -struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_ModifiedHuber { - struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Classification __pyx_base; +struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber { + struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Classification __pyx_base; }; -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pxd":44 +/* "scikits/learn/linear_model/sgd_fast.pxd":40 * cpdef double dloss(self, double p, double y) * - * cdef class SquaredLoss(Regression): # <<<<<<<<<<<<<< + * cdef class Log(Classification): # <<<<<<<<<<<<<< * cpdef double loss(self, double p, double y) * cpdef double dloss(self, double p, double y) */ -struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_SquaredLoss { - struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Regression __pyx_base; +struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Log { + struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Classification __pyx_base; }; -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":31 +/* "scikits/learn/linear_model/sgd_fast.pyx":31 * # ---------------------------------------- * * cdef class LossFunction: # <<<<<<<<<<<<<< @@ -487,14 +509,14 @@ struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_SquaredLoss { * */ -struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_LossFunction { - double (*loss)(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *, double, double, int __pyx_skip_dispatch); - double (*dloss)(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *, double, double, int __pyx_skip_dispatch); +struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_LossFunction { + double (*loss)(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *, double, double, int __pyx_skip_dispatch); + double (*dloss)(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *, double, double, int __pyx_skip_dispatch); }; -static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_LossFunction *__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_LossFunction; +static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_LossFunction; -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":69 +/* "scikits/learn/linear_model/sgd_fast.pyx":69 * * * cdef class Regression(LossFunction): # <<<<<<<<<<<<<< @@ -502,27 +524,27 @@ static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_LossFunction *_ * */ -struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Regression { - struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_LossFunction __pyx_base; +struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Regression { + struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_LossFunction __pyx_base; }; -static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Regression *__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_Regression; +static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Regression *__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Regression; -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":162 +/* "scikits/learn/linear_model/sgd_fast.pyx":174 * * - * cdef class SquaredLoss(Regression): # <<<<<<<<<<<<<< - * """Squared loss traditional used in linear regression.""" - * cpdef double loss(self, double p, double y): + * cdef class Huber(Regression): # <<<<<<<<<<<<<< + * """Huber regression loss + * */ -struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_SquaredLoss { - struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Regression __pyx_base; +struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Huber { + struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Regression __pyx_base; }; -static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_SquaredLoss *__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_SquaredLoss; +static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Huber *__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Huber; -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":79 +/* "scikits/learn/linear_model/sgd_fast.pyx":79 * * * cdef class Classification(LossFunction): # <<<<<<<<<<<<<< @@ -530,27 +552,27 @@ static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_SquaredLoss *__ * */ -struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Classification { - struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_LossFunction __pyx_base; +struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Classification { + struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_LossFunction __pyx_base; }; -static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Classification *__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_Classification; +static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Classification *__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Classification; -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":89 +/* "scikits/learn/linear_model/sgd_fast.pyx":119 * * - * cdef class ModifiedHuber(Classification): # <<<<<<<<<<<<<< - * """Modified Huber loss for binary classification with y in {-1, 1} - * + * cdef class Hinge(Classification): # <<<<<<<<<<<<<< + * """SVM loss for binary classification tasks with y in {-1,1}""" + * cpdef double loss(self, double p, double y): */ -struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_ModifiedHuber { - struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Classification __pyx_base; +struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Hinge { + struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Classification __pyx_base; }; -static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_ModifiedHuber *__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_ModifiedHuber; +static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Hinge *__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Hinge; -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":137 +/* "scikits/learn/linear_model/sgd_fast.pyx":137 * * * cdef class Log(Classification): # <<<<<<<<<<<<<< @@ -558,38 +580,38 @@ static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_ModifiedHuber * * */ -struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Log { - struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Classification __pyx_base; +struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Log { + struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Classification __pyx_base; }; -static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Log *__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_Log; +static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Log *__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Log; -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":174 +/* "scikits/learn/linear_model/sgd_fast.pyx":89 * * - * cdef class Huber(Regression): # <<<<<<<<<<<<<< - * """Huber regression loss + * cdef class ModifiedHuber(Classification): # <<<<<<<<<<<<<< + * """Modified Huber loss for binary classification with y in {-1, 1} * */ -struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Huber { - struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Regression __pyx_base; +struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber { + struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Classification __pyx_base; }; -static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Huber *__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_Huber; +static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber *__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber; -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":119 +/* "scikits/learn/linear_model/sgd_fast.pyx":162 * * - * cdef class Hinge(Classification): # <<<<<<<<<<<<<< - * """SVM loss for binary classification tasks with y in {-1,1}""" + * cdef class SquaredLoss(Regression): # <<<<<<<<<<<<<< + * """Squared loss traditional used in linear regression.""" * cpdef double loss(self, double p, double y): */ -struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Hinge { - struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Classification __pyx_base; +struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss { + struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Regression __pyx_base; }; -static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Hinge *__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_Hinge; +static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss *__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss; #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 @@ -637,14 +659,24 @@ static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Hinge *__pyx_vt #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0) -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, PyObject* kw_name); /*proto*/ +static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ + +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ 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); /*proto*/ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, PyObject* kw_name); /*proto*/ + static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/ +static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact); /*proto*/ + /* Run-time type information about structs used with buffers */ struct __Pyx_StructField_; @@ -667,8 +699,8 @@ typedef struct { } __Pyx_BufFmt_StackElem; +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); -static int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ @@ -684,11 +716,11 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j } -#define __Pyx_GetItemInt_List(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_List_Fast(o, i, size <= sizeof(long)) : \ +#define __Pyx_GetItemInt_List(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \ + __Pyx_GetItemInt_List_Fast(o, i) : \ __Pyx_GetItemInt_Generic(o, to_py_func(i))) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int fits_long) { +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i) { if (likely(o != Py_None)) { if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, i); @@ -701,14 +733,14 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_ return r; } } - return __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i)); + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } -#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_Tuple_Fast(o, i, size <= sizeof(long)) : \ +#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \ + __Pyx_GetItemInt_Tuple_Fast(o, i) : \ __Pyx_GetItemInt_Generic(o, to_py_func(i))) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int fits_long) { +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i) { if (likely(o != Py_None)) { if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, i); @@ -721,15 +753,15 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize return r; } } - return __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i)); + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } -#define __Pyx_GetItemInt(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_Fast(o, i, size <= sizeof(long)) : \ +#define __Pyx_GetItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \ + __Pyx_GetItemInt_Fast(o, i) : \ __Pyx_GetItemInt_Generic(o, to_py_func(i))) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int fits_long) { +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) { PyObject *r; if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) { r = PyList_GET_ITEM(o, i); @@ -743,27 +775,18 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, r = PySequence_GetItem(o, i); } else { - r = __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i)); + r = __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } return r; } -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(void); - -static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); /*proto*/ -static int __Pyx_EndUnpack(PyObject *); /*proto*/ - -static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /*proto*/ - -static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact); /*proto*/ #if PY_MAJOR_VERSION < 3 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); static void __Pyx_ReleaseBuffer(Py_buffer *view); @@ -777,17 +800,13 @@ Py_ssize_t __Pyx_minusones[] = {-1, -1}; static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ - -static int __Pyx_Print(PyObject *, int); /*proto*/ +static int __Pyx_Print(PyObject*, PyObject *, int); /*proto*/ #if PY_MAJOR_VERSION >= 3 static PyObject* __pyx_print = 0; static PyObject* __pyx_print_kwargs = 0; #endif -static int __Pyx_PrintOne(PyObject *o); /*proto*/ +static int __Pyx_PrintOne(PyObject* stream, PyObject *o); /*proto*/ #if CYTHON_CCOMPLEX #ifdef __cplusplus @@ -822,11 +841,17 @@ static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(floa #ifdef __cplusplus #define __Pyx_c_is_zerof(z) ((z)==(float)0) #define __Pyx_c_conjf(z) (::std::conj(z)) - /*#define __Pyx_c_absf(z) (::std::abs(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)) - /*#define __Pyx_c_absf(z) (cabsf(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); @@ -837,7 +862,10 @@ static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(floa 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); - /*static CYTHON_INLINE float __Pyx_c_absf(__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); @@ -852,11 +880,17 @@ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(do #ifdef __cplusplus #define __Pyx_c_is_zero(z) ((z)==(double)0) #define __Pyx_c_conj(z) (::std::conj(z)) - /*#define __Pyx_c_abs(z) (::std::abs(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)) - /*#define __Pyx_c_abs(z) (cabs(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); @@ -867,7 +901,10 @@ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(do 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); - /*static CYTHON_INLINE double __Pyx_c_abs(__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 CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *); @@ -888,6 +925,8 @@ static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *); static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *); +static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *); + static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *); static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *); @@ -911,13 +950,15 @@ static PyObject *__Pyx_ImportModule(const char *name); /*proto*/ static void __Pyx_AddTraceback(const char *funcname); /*proto*/ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ -/* Module declarations from python_buffer */ +/* Module declarations from cpython.buffer */ -/* Module declarations from python_ref */ +/* Module declarations from cpython.ref */ -/* Module declarations from stdlib */ +/* Module declarations from libc.stdio */ -/* Module declarations from stdio */ +/* Module declarations from cpython.object */ + +/* Module declarations from libc.stdlib */ /* Module declarations from numpy */ @@ -938,28 +979,28 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *, PyObjec static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *); /*proto*/ /* Module declarations from cython */ -/* Module declarations from sklearn.linear_model.sgd_fast */ - -static PyTypeObject *__pyx_ptype_7sklearn_12linear_model_8sgd_fast_LossFunction = 0; -static PyTypeObject *__pyx_ptype_7sklearn_12linear_model_8sgd_fast_Regression = 0; -static PyTypeObject *__pyx_ptype_7sklearn_12linear_model_8sgd_fast_Classification = 0; -static PyTypeObject *__pyx_ptype_7sklearn_12linear_model_8sgd_fast_ModifiedHuber = 0; -static PyTypeObject *__pyx_ptype_7sklearn_12linear_model_8sgd_fast_Hinge = 0; -static PyTypeObject *__pyx_ptype_7sklearn_12linear_model_8sgd_fast_Log = 0; -static PyTypeObject *__pyx_ptype_7sklearn_12linear_model_8sgd_fast_SquaredLoss = 0; -static PyTypeObject *__pyx_ptype_7sklearn_12linear_model_8sgd_fast_Huber = 0; -static CYTHON_INLINE double __pyx_f_7sklearn_12linear_model_8sgd_fast_max(double, double); /*proto*/ -static CYTHON_INLINE double __pyx_f_7sklearn_12linear_model_8sgd_fast_min(double, double); /*proto*/ -static double __pyx_f_7sklearn_12linear_model_8sgd_fast_dot(double *, double *, int, unsigned int); /*proto*/ -static double __pyx_f_7sklearn_12linear_model_8sgd_fast_add(double *, double, double *, int, unsigned int, double); /*proto*/ -static void __pyx_f_7sklearn_12linear_model_8sgd_fast_l1penalty(double *, double, double *, unsigned int, double); /*proto*/ -static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "numpy.float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), 'R' }; +/* Module declarations from scikits.learn.linear_model.sgd_fast */ + +static PyTypeObject *__pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_LossFunction = 0; +static PyTypeObject *__pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_Regression = 0; +static PyTypeObject *__pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_Classification = 0; +static PyTypeObject *__pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber = 0; +static PyTypeObject *__pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_Hinge = 0; +static PyTypeObject *__pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_Log = 0; +static PyTypeObject *__pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss = 0; +static PyTypeObject *__pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_Huber = 0; +static CYTHON_INLINE double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_max(double, double); /*proto*/ +static CYTHON_INLINE double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_min(double, double); /*proto*/ +static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_dot(double *, double *, int, unsigned int); /*proto*/ +static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_add(double *, double, double *, int, unsigned int, double); /*proto*/ +static void __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_l1penalty(double *, double, double *, unsigned int, double); /*proto*/ +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), 'R' }; static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), 'R' }; -static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t = { "numpy.int32_t", NULL, sizeof(__pyx_t_5numpy_int32_t), 'I' }; -#define __Pyx_MODULE_NAME "sklearn.linear_model.sgd_fast" -int __pyx_module_is_main_sklearn__linear_model__sgd_fast = 0; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t = { "int32_t", NULL, sizeof(__pyx_t_5numpy_int32_t), 'I' }; +#define __Pyx_MODULE_NAME "scikits.learn.linear_model.sgd_fast" +static int __pyx_module_is_main_scikits__learn__linear_model__sgd_fast = 0; -/* Implementation of sklearn.linear_model.sgd_fast */ +/* Implementation of scikits.learn.linear_model.sgd_fast */ static PyObject *__pyx_builtin_NotImplementedError; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_range; @@ -968,12 +1009,13 @@ static char __pyx_k_1[] = "-- Epoch %d"; static char __pyx_k_2[] = "Norm: %.2f, NNZs: %d, Bias: %.6f, T: %d, Avg. loss: %.6f"; static char __pyx_k_3[] = "Total training time: %.2f seconds."; static char __pyx_k_4[] = "floating-point under-/overflow occured."; -static char __pyx_k_5[] = "ndarray is not C contiguous"; -static char __pyx_k_6[] = "ndarray is not Fortran contiguous"; -static char __pyx_k_7[] = "Non-native byte order not supported"; -static char __pyx_k_8[] = "unknown dtype code in numpy.pxd (%d)"; -static char __pyx_k_9[] = "Format string allocated too short, see comment in numpy.pxd"; -static char __pyx_k_10[] = "Format string allocated too short."; +static char __pyx_k_6[] = "ndarray is not C contiguous"; +static char __pyx_k_8[] = "ndarray is not Fortran contiguous"; +static char __pyx_k_10[] = "Non-native byte order not supported"; +static char __pyx_k_12[] = "unknown dtype code in numpy.pxd (%d)"; +static char __pyx_k_13[] = "Format string allocated too short, see comment in numpy.pxd"; +static char __pyx_k_16[] = "Format string allocated too short."; +static char __pyx_k_18[] = "scikits.learn.linear_model.sgd_fast"; static char __pyx_k__B[] = "B"; static char __pyx_k__H[] = "H"; static char __pyx_k__I[] = "I"; @@ -1036,11 +1078,13 @@ static char __pyx_k__shuffle[] = "shuffle"; static char __pyx_k__strides[] = "strides"; static char __pyx_k__verbose[] = "verbose"; static char __pyx_k____main__[] = "__main__"; +static char __pyx_k____test__[] = "__test__"; static char __pyx_k__itemsize[] = "itemsize"; static char __pyx_k__readonly[] = "readonly"; static char __pyx_k__type_num[] = "type_num"; static char __pyx_k__byteorder[] = "byteorder"; static char __pyx_k__intercept[] = "intercept"; +static char __pyx_k__plain_sgd[] = "plain_sgd"; static char __pyx_k__ValueError[] = "ValueError"; static char __pyx_k__suboffsets[] = "suboffsets"; static char __pyx_k__weight_neg[] = "weight_neg"; @@ -1054,14 +1098,15 @@ static char __pyx_k__sample_weight[] = "sample_weight"; static char __pyx_k__NotImplementedError[] = "NotImplementedError"; static PyObject *__pyx_kp_s_1; static PyObject *__pyx_kp_u_10; +static PyObject *__pyx_kp_u_12; +static PyObject *__pyx_kp_u_13; +static PyObject *__pyx_kp_u_16; +static PyObject *__pyx_n_s_18; static PyObject *__pyx_kp_s_2; static PyObject *__pyx_kp_s_3; static PyObject *__pyx_kp_s_4; -static PyObject *__pyx_kp_u_5; static PyObject *__pyx_kp_u_6; -static PyObject *__pyx_kp_u_7; static PyObject *__pyx_kp_u_8; -static PyObject *__pyx_kp_u_9; static PyObject *__pyx_n_s__NotImplementedError; static PyObject *__pyx_n_s__RandomState; static PyObject *__pyx_n_s__RuntimeError; @@ -1069,6 +1114,7 @@ static PyObject *__pyx_n_s__ValueError; static PyObject *__pyx_n_s__X; static PyObject *__pyx_n_s__Y; static PyObject *__pyx_n_s____main__; +static PyObject *__pyx_n_s____test__; static PyObject *__pyx_n_s__alpha; static PyObject *__pyx_n_s__any; static PyObject *__pyx_n_s__arange; @@ -1103,6 +1149,7 @@ static PyObject *__pyx_n_s__obj; static PyObject *__pyx_n_s__order; static PyObject *__pyx_n_s__p; static PyObject *__pyx_n_s__penalty_type; +static PyObject *__pyx_n_s__plain_sgd; static PyObject *__pyx_n_s__power_t; static PyObject *__pyx_n_s__random; static PyObject *__pyx_n_s__range; @@ -1124,8 +1171,15 @@ static PyObject *__pyx_n_s__weight_pos; static PyObject *__pyx_n_s__y; static PyObject *__pyx_n_s__zeros; static PyObject *__pyx_int_15; - -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":34 +static PyObject *__pyx_k_tuple_5; +static PyObject *__pyx_k_tuple_7; +static PyObject *__pyx_k_tuple_9; +static PyObject *__pyx_k_tuple_11; +static PyObject *__pyx_k_tuple_14; +static PyObject *__pyx_k_tuple_15; +static PyObject *__pyx_k_tuple_17; + +/* "scikits/learn/linear_model/sgd_fast.pyx":34 * """Base class for convex loss functions""" * * cpdef double loss(self, double p, double y): # <<<<<<<<<<<<<< @@ -1133,8 +1187,8 @@ static PyObject *__pyx_int_15; * */ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_12LossFunction_loss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static double __pyx_f_7sklearn_12linear_model_8sgd_fast_12LossFunction_loss(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *__pyx_v_self, double __pyx_v_p, double __pyx_v_y, int __pyx_skip_dispatch) { +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_12LossFunction_loss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_12LossFunction_loss(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *__pyx_v_self, double __pyx_v_p, double __pyx_v_y, int __pyx_skip_dispatch) { double __pyx_r; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -1148,22 +1202,22 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_12LossFunction_loss(str else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__loss); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_7sklearn_12linear_model_8sgd_fast_12LossFunction_loss)) { + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_12LossFunction_loss)) { __pyx_t_2 = PyFloat_FromDouble(__pyx_v_p); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyFloat_FromDouble(__pyx_v_y); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_5; @@ -1173,7 +1227,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_12LossFunction_loss(str __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":49 + /* "scikits/learn/linear_model/sgd_fast.pyx":49 * The loss evaluated at `p` and `y`. * """ * raise NotImplementedError() # <<<<<<<<<<<<<< @@ -1193,14 +1247,14 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_12LossFunction_loss(str __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_WriteUnraisable("sklearn.linear_model.sgd_fast.LossFunction.loss"); + __Pyx_WriteUnraisable("scikits.learn.linear_model.sgd_fast.LossFunction.loss"); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":34 +/* "scikits/learn/linear_model/sgd_fast.pyx":34 * """Base class for convex loss functions""" * * cpdef double loss(self, double p, double y): # <<<<<<<<<<<<<< @@ -1208,9 +1262,9 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_12LossFunction_loss(str * */ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_12LossFunction_loss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_7sklearn_12linear_model_8sgd_fast_12LossFunction_loss[] = "Evaluate the loss function.\n\n Parameters\n ----------\n p : double\n The prediction, p = w^T x\n y : double\n The true value (aka target)\n\n Returns\n -------\n double\n The loss evaluated at `p` and `y`.\n "; -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_12LossFunction_loss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_12LossFunction_loss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_7scikits_5learn_12linear_model_8sgd_fast_12LossFunction_loss[] = "Evaluate the loss function.\n\n Parameters\n ----------\n p : double\n The prediction, p = w^T x\n y : double\n The true value (aka target)\n\n Returns\n -------\n double\n The loss evaluated at `p` and `y`.\n "; +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_12LossFunction_loss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { double __pyx_v_p; double __pyx_v_y; PyObject *__pyx_r = NULL; @@ -1253,11 +1307,12 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_12LossFunction_loss( __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("loss", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.LossFunction.loss"); + __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.LossFunction.loss"); + __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_LossFunction *)((struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *)__pyx_v_self)->__pyx_vtab)->loss(((struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *)__pyx_v_self), __pyx_v_p, __pyx_v_y, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *)((struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *)__pyx_v_self)->__pyx_vtab)->loss(((struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *)__pyx_v_self), __pyx_v_p, __pyx_v_y, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -1267,7 +1322,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_12LossFunction_loss( goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.LossFunction.loss"); + __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.LossFunction.loss"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -1275,7 +1330,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_12LossFunction_loss( return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":51 +/* "scikits/learn/linear_model/sgd_fast.pyx":51 * raise NotImplementedError() * * cpdef double dloss(self, double p, double y): # <<<<<<<<<<<<<< @@ -1283,8 +1338,8 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_12LossFunction_loss( * the prediction `p`. */ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_12LossFunction_dloss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static double __pyx_f_7sklearn_12linear_model_8sgd_fast_12LossFunction_dloss(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *__pyx_v_self, double __pyx_v_p, double __pyx_v_y, int __pyx_skip_dispatch) { +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_12LossFunction_1dloss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_12LossFunction_dloss(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *__pyx_v_self, double __pyx_v_p, double __pyx_v_y, int __pyx_skip_dispatch) { double __pyx_r; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -1298,22 +1353,22 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_12LossFunction_dloss(st else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__dloss); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_7sklearn_12linear_model_8sgd_fast_12LossFunction_dloss)) { + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_12LossFunction_1dloss)) { __pyx_t_2 = PyFloat_FromDouble(__pyx_v_p); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyFloat_FromDouble(__pyx_v_y); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_5; @@ -1323,7 +1378,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_12LossFunction_dloss(st __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":66 + /* "scikits/learn/linear_model/sgd_fast.pyx":66 * The derivative of the loss function w.r.t. `p`. * """ * raise NotImplementedError() # <<<<<<<<<<<<<< @@ -1343,14 +1398,14 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_12LossFunction_dloss(st __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_WriteUnraisable("sklearn.linear_model.sgd_fast.LossFunction.dloss"); + __Pyx_WriteUnraisable("scikits.learn.linear_model.sgd_fast.LossFunction.dloss"); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":51 +/* "scikits/learn/linear_model/sgd_fast.pyx":51 * raise NotImplementedError() * * cpdef double dloss(self, double p, double y): # <<<<<<<<<<<<<< @@ -1358,9 +1413,9 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_12LossFunction_dloss(st * the prediction `p`. */ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_12LossFunction_dloss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_7sklearn_12linear_model_8sgd_fast_12LossFunction_dloss[] = "Evaluate the derivative of the loss function with respect to\n the prediction `p`.\n \n Parameters\n ----------\n p : double\n The prediction, p = w^T x\n y : double\n The true value (aka target)\n Returns\n -------\n double\n The derivative of the loss function w.r.t. `p`.\n "; -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_12LossFunction_dloss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_12LossFunction_1dloss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_7scikits_5learn_12linear_model_8sgd_fast_12LossFunction_1dloss[] = "Evaluate the derivative of the loss function with respect to\n the prediction `p`.\n \n Parameters\n ----------\n p : double\n The prediction, p = w^T x\n y : double\n The true value (aka target)\n Returns\n -------\n double\n The derivative of the loss function w.r.t. `p`.\n "; +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_12LossFunction_1dloss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { double __pyx_v_p; double __pyx_v_y; PyObject *__pyx_r = NULL; @@ -1403,11 +1458,12 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_12LossFunction_dloss __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("dloss", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.LossFunction.dloss"); + __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.LossFunction.dloss"); + __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_LossFunction *)((struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *)__pyx_v_self)->__pyx_vtab)->dloss(((struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *)__pyx_v_self), __pyx_v_p, __pyx_v_y, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *)((struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *)__pyx_v_self)->__pyx_vtab)->dloss(((struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *)__pyx_v_self), __pyx_v_p, __pyx_v_y, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -1417,7 +1473,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_12LossFunction_dloss goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.LossFunction.dloss"); + __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.LossFunction.dloss"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -1425,7 +1481,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_12LossFunction_dloss return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":72 +/* "scikits/learn/linear_model/sgd_fast.pyx":72 * """Base class for loss functions for regression""" * * cpdef double loss(self, double p, double y): # <<<<<<<<<<<<<< @@ -1433,8 +1489,8 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_12LossFunction_dloss * */ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_10Regression_loss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static double __pyx_f_7sklearn_12linear_model_8sgd_fast_10Regression_loss(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Regression *__pyx_v_self, double __pyx_v_p, double __pyx_v_y, int __pyx_skip_dispatch) { +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_10Regression_loss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_10Regression_loss(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Regression *__pyx_v_self, double __pyx_v_p, double __pyx_v_y, int __pyx_skip_dispatch) { double __pyx_r; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -1448,22 +1504,22 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_10Regression_loss(struc else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__loss); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_7sklearn_12linear_model_8sgd_fast_10Regression_loss)) { + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_10Regression_loss)) { __pyx_t_2 = PyFloat_FromDouble(__pyx_v_p); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyFloat_FromDouble(__pyx_v_y); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_5; @@ -1473,7 +1529,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_10Regression_loss(struc __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":73 + /* "scikits/learn/linear_model/sgd_fast.pyx":73 * * cpdef double loss(self, double p, double y): * raise NotImplementedError() # <<<<<<<<<<<<<< @@ -1493,14 +1549,14 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_10Regression_loss(struc __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_WriteUnraisable("sklearn.linear_model.sgd_fast.Regression.loss"); + __Pyx_WriteUnraisable("scikits.learn.linear_model.sgd_fast.Regression.loss"); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":72 +/* "scikits/learn/linear_model/sgd_fast.pyx":72 * """Base class for loss functions for regression""" * * cpdef double loss(self, double p, double y): # <<<<<<<<<<<<<< @@ -1508,8 +1564,8 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_10Regression_loss(struc * */ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_10Regression_loss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_10Regression_loss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_10Regression_loss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_10Regression_loss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { double __pyx_v_p; double __pyx_v_y; PyObject *__pyx_r = NULL; @@ -1552,11 +1608,12 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_10Regression_loss(Py __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("loss", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Regression.loss"); + __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.Regression.loss"); + __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Regression *)((struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Regression *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.loss(((struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *)__pyx_v_self), __pyx_v_p, __pyx_v_y, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Regression *)((struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Regression *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.loss(((struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *)__pyx_v_self), __pyx_v_p, __pyx_v_y, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -1566,7 +1623,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_10Regression_loss(Py goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Regression.loss"); + __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.Regression.loss"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -1574,7 +1631,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_10Regression_loss(Py return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":75 +/* "scikits/learn/linear_model/sgd_fast.pyx":75 * raise NotImplementedError() * * cpdef double dloss(self, double p, double y): # <<<<<<<<<<<<<< @@ -1582,8 +1639,8 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_10Regression_loss(Py * */ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_10Regression_dloss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static double __pyx_f_7sklearn_12linear_model_8sgd_fast_10Regression_dloss(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Regression *__pyx_v_self, double __pyx_v_p, double __pyx_v_y, int __pyx_skip_dispatch) { +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_10Regression_1dloss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_10Regression_dloss(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Regression *__pyx_v_self, double __pyx_v_p, double __pyx_v_y, int __pyx_skip_dispatch) { double __pyx_r; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -1597,22 +1654,22 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_10Regression_dloss(stru else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__dloss); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_7sklearn_12linear_model_8sgd_fast_10Regression_dloss)) { + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_10Regression_1dloss)) { __pyx_t_2 = PyFloat_FromDouble(__pyx_v_p); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyFloat_FromDouble(__pyx_v_y); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_5; @@ -1622,7 +1679,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_10Regression_dloss(stru __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":76 + /* "scikits/learn/linear_model/sgd_fast.pyx":76 * * cpdef double dloss(self, double p, double y): * raise NotImplementedError() # <<<<<<<<<<<<<< @@ -1642,14 +1699,14 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_10Regression_dloss(stru __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_WriteUnraisable("sklearn.linear_model.sgd_fast.Regression.dloss"); + __Pyx_WriteUnraisable("scikits.learn.linear_model.sgd_fast.Regression.dloss"); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":75 +/* "scikits/learn/linear_model/sgd_fast.pyx":75 * raise NotImplementedError() * * cpdef double dloss(self, double p, double y): # <<<<<<<<<<<<<< @@ -1657,8 +1714,8 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_10Regression_dloss(stru * */ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_10Regression_dloss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_10Regression_dloss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_10Regression_1dloss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_10Regression_1dloss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { double __pyx_v_p; double __pyx_v_y; PyObject *__pyx_r = NULL; @@ -1701,11 +1758,12 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_10Regression_dloss(P __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("dloss", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Regression.dloss"); + __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.Regression.dloss"); + __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Regression *)((struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Regression *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.dloss(((struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *)__pyx_v_self), __pyx_v_p, __pyx_v_y, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Regression *)((struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Regression *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.dloss(((struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *)__pyx_v_self), __pyx_v_p, __pyx_v_y, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -1715,7 +1773,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_10Regression_dloss(P goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Regression.dloss"); + __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.Regression.dloss"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -1723,7 +1781,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_10Regression_dloss(P return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":82 +/* "scikits/learn/linear_model/sgd_fast.pyx":82 * """Base class for loss functions for classification""" * * cpdef double loss(self, double p, double y): # <<<<<<<<<<<<<< @@ -1731,8 +1789,8 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_10Regression_dloss(P * */ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_14Classification_loss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static double __pyx_f_7sklearn_12linear_model_8sgd_fast_14Classification_loss(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Classification *__pyx_v_self, double __pyx_v_p, double __pyx_v_y, int __pyx_skip_dispatch) { +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_14Classification_loss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_14Classification_loss(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Classification *__pyx_v_self, double __pyx_v_p, double __pyx_v_y, int __pyx_skip_dispatch) { double __pyx_r; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -1746,22 +1804,22 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_14Classification_loss(s else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__loss); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_7sklearn_12linear_model_8sgd_fast_14Classification_loss)) { + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_14Classification_loss)) { __pyx_t_2 = PyFloat_FromDouble(__pyx_v_p); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyFloat_FromDouble(__pyx_v_y); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_5; @@ -1771,7 +1829,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_14Classification_loss(s __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":83 + /* "scikits/learn/linear_model/sgd_fast.pyx":83 * * cpdef double loss(self, double p, double y): * raise NotImplementedError() # <<<<<<<<<<<<<< @@ -1791,14 +1849,14 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_14Classification_loss(s __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_WriteUnraisable("sklearn.linear_model.sgd_fast.Classification.loss"); + __Pyx_WriteUnraisable("scikits.learn.linear_model.sgd_fast.Classification.loss"); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":82 +/* "scikits/learn/linear_model/sgd_fast.pyx":82 * """Base class for loss functions for classification""" * * cpdef double loss(self, double p, double y): # <<<<<<<<<<<<<< @@ -1806,8 +1864,8 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_14Classification_loss(s * */ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_14Classification_loss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_14Classification_loss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_14Classification_loss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_14Classification_loss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { double __pyx_v_p; double __pyx_v_y; PyObject *__pyx_r = NULL; @@ -1850,11 +1908,12 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_14Classification_los __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("loss", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Classification.loss"); + __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.Classification.loss"); + __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Classification *)((struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Classification *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.loss(((struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *)__pyx_v_self), __pyx_v_p, __pyx_v_y, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Classification *)((struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Classification *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.loss(((struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *)__pyx_v_self), __pyx_v_p, __pyx_v_y, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -1864,7 +1923,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_14Classification_los goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Classification.loss"); + __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.Classification.loss"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -1872,7 +1931,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_14Classification_los return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":85 +/* "scikits/learn/linear_model/sgd_fast.pyx":85 * raise NotImplementedError() * * cpdef double dloss(self, double p, double y): # <<<<<<<<<<<<<< @@ -1880,8 +1939,8 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_14Classification_los * */ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_14Classification_dloss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static double __pyx_f_7sklearn_12linear_model_8sgd_fast_14Classification_dloss(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Classification *__pyx_v_self, double __pyx_v_p, double __pyx_v_y, int __pyx_skip_dispatch) { +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_14Classification_1dloss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_14Classification_dloss(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Classification *__pyx_v_self, double __pyx_v_p, double __pyx_v_y, int __pyx_skip_dispatch) { double __pyx_r; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -1895,22 +1954,22 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_14Classification_dloss( else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__dloss); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_7sklearn_12linear_model_8sgd_fast_14Classification_dloss)) { + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_14Classification_1dloss)) { __pyx_t_2 = PyFloat_FromDouble(__pyx_v_p); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyFloat_FromDouble(__pyx_v_y); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_5; @@ -1920,7 +1979,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_14Classification_dloss( __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":86 + /* "scikits/learn/linear_model/sgd_fast.pyx":86 * * cpdef double dloss(self, double p, double y): * raise NotImplementedError() # <<<<<<<<<<<<<< @@ -1940,14 +1999,14 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_14Classification_dloss( __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_WriteUnraisable("sklearn.linear_model.sgd_fast.Classification.dloss"); + __Pyx_WriteUnraisable("scikits.learn.linear_model.sgd_fast.Classification.dloss"); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":85 +/* "scikits/learn/linear_model/sgd_fast.pyx":85 * raise NotImplementedError() * * cpdef double dloss(self, double p, double y): # <<<<<<<<<<<<<< @@ -1955,8 +2014,8 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_14Classification_dloss( * */ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_14Classification_dloss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_14Classification_dloss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_14Classification_1dloss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_14Classification_1dloss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { double __pyx_v_p; double __pyx_v_y; PyObject *__pyx_r = NULL; @@ -1999,11 +2058,12 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_14Classification_dlo __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("dloss", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Classification.dloss"); + __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.Classification.dloss"); + __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Classification *)((struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Classification *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.dloss(((struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *)__pyx_v_self), __pyx_v_p, __pyx_v_y, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Classification *)((struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Classification *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.dloss(((struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *)__pyx_v_self), __pyx_v_p, __pyx_v_y, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -2013,7 +2073,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_14Classification_dlo goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Classification.dloss"); + __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.Classification.dloss"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -2021,7 +2081,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_14Classification_dlo return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":97 +/* "scikits/learn/linear_model/sgd_fast.pyx":97 * Stochastic Gradient Descent', ICML'04. * """ * cpdef double loss(self, double p, double y): # <<<<<<<<<<<<<< @@ -2029,8 +2089,8 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_14Classification_dlo * if z >= 1.0: */ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_13ModifiedHuber_loss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static double __pyx_f_7sklearn_12linear_model_8sgd_fast_13ModifiedHuber_loss(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_ModifiedHuber *__pyx_v_self, double __pyx_v_p, double __pyx_v_y, int __pyx_skip_dispatch) { +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_13ModifiedHuber_loss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_13ModifiedHuber_loss(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber *__pyx_v_self, double __pyx_v_p, double __pyx_v_y, int __pyx_skip_dispatch) { double __pyx_v_z; double __pyx_r; PyObject *__pyx_t_1 = NULL; @@ -2040,29 +2100,28 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_13ModifiedHuber_loss(st double __pyx_t_5; int __pyx_t_6; __Pyx_RefNannySetupContext("loss"); - __Pyx_INCREF((PyObject *)__pyx_v_self); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overriden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__loss); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_7sklearn_12linear_model_8sgd_fast_13ModifiedHuber_loss)) { + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_13ModifiedHuber_loss)) { __pyx_t_2 = PyFloat_FromDouble(__pyx_v_p); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyFloat_FromDouble(__pyx_v_y); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_5; @@ -2072,7 +2131,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_13ModifiedHuber_loss(st __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":98 + /* "scikits/learn/linear_model/sgd_fast.pyx":98 * """ * cpdef double loss(self, double p, double y): * cdef double z = p * y # <<<<<<<<<<<<<< @@ -2081,7 +2140,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_13ModifiedHuber_loss(st */ __pyx_v_z = (__pyx_v_p * __pyx_v_y); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":99 + /* "scikits/learn/linear_model/sgd_fast.pyx":99 * cpdef double loss(self, double p, double y): * cdef double z = p * y * if z >= 1.0: # <<<<<<<<<<<<<< @@ -2091,7 +2150,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_13ModifiedHuber_loss(st __pyx_t_6 = (__pyx_v_z >= 1.0); if (__pyx_t_6) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":100 + /* "scikits/learn/linear_model/sgd_fast.pyx":100 * cdef double z = p * y * if z >= 1.0: * return 0.0 # <<<<<<<<<<<<<< @@ -2103,17 +2162,17 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_13ModifiedHuber_loss(st goto __pyx_L3; } - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":101 + /* "scikits/learn/linear_model/sgd_fast.pyx":101 * if z >= 1.0: * return 0.0 * elif z >= -1.0: # <<<<<<<<<<<<<< * return (1.0 - z) * (1.0 - z) * else: */ - __pyx_t_6 = (__pyx_v_z >= (-1.0)); + __pyx_t_6 = (__pyx_v_z >= -1.0); if (__pyx_t_6) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":102 + /* "scikits/learn/linear_model/sgd_fast.pyx":102 * return 0.0 * elif z >= -1.0: * return (1.0 - z) * (1.0 - z) # <<<<<<<<<<<<<< @@ -2126,14 +2185,14 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_13ModifiedHuber_loss(st } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":104 + /* "scikits/learn/linear_model/sgd_fast.pyx":104 * return (1.0 - z) * (1.0 - z) * else: * return -4.0 * z # <<<<<<<<<<<<<< * * cpdef double dloss(self, double p, double y): */ - __pyx_r = ((-4.0) * __pyx_v_z); + __pyx_r = (-4.0 * __pyx_v_z); goto __pyx_L0; } __pyx_L3:; @@ -2145,15 +2204,14 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_13ModifiedHuber_loss(st __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_WriteUnraisable("sklearn.linear_model.sgd_fast.ModifiedHuber.loss"); + __Pyx_WriteUnraisable("scikits.learn.linear_model.sgd_fast.ModifiedHuber.loss"); __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":97 +/* "scikits/learn/linear_model/sgd_fast.pyx":97 * Stochastic Gradient Descent', ICML'04. * """ * cpdef double loss(self, double p, double y): # <<<<<<<<<<<<<< @@ -2161,8 +2219,8 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_13ModifiedHuber_loss(st * if z >= 1.0: */ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_13ModifiedHuber_loss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_13ModifiedHuber_loss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_13ModifiedHuber_loss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_13ModifiedHuber_loss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { double __pyx_v_p; double __pyx_v_y; PyObject *__pyx_r = NULL; @@ -2205,11 +2263,12 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_13ModifiedHuber_loss __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("loss", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.ModifiedHuber.loss"); + __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.ModifiedHuber.loss"); + __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_ModifiedHuber *)((struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_ModifiedHuber *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.loss(((struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *)__pyx_v_self), __pyx_v_p, __pyx_v_y, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber *)((struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.loss(((struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *)__pyx_v_self), __pyx_v_p, __pyx_v_y, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -2219,7 +2278,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_13ModifiedHuber_loss goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.ModifiedHuber.loss"); + __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.ModifiedHuber.loss"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -2227,7 +2286,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_13ModifiedHuber_loss return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":106 +/* "scikits/learn/linear_model/sgd_fast.pyx":106 * return -4.0 * z * * cpdef double dloss(self, double p, double y): # <<<<<<<<<<<<<< @@ -2235,8 +2294,8 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_13ModifiedHuber_loss * if z >= 1.0: */ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_13ModifiedHuber_dloss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static double __pyx_f_7sklearn_12linear_model_8sgd_fast_13ModifiedHuber_dloss(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_ModifiedHuber *__pyx_v_self, double __pyx_v_p, double __pyx_v_y, int __pyx_skip_dispatch) { +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_13ModifiedHuber_1dloss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_13ModifiedHuber_dloss(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber *__pyx_v_self, double __pyx_v_p, double __pyx_v_y, int __pyx_skip_dispatch) { double __pyx_v_z; double __pyx_r; PyObject *__pyx_t_1 = NULL; @@ -2246,29 +2305,28 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_13ModifiedHuber_dloss(s double __pyx_t_5; int __pyx_t_6; __Pyx_RefNannySetupContext("dloss"); - __Pyx_INCREF((PyObject *)__pyx_v_self); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overriden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__dloss); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_7sklearn_12linear_model_8sgd_fast_13ModifiedHuber_dloss)) { + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_13ModifiedHuber_1dloss)) { __pyx_t_2 = PyFloat_FromDouble(__pyx_v_p); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyFloat_FromDouble(__pyx_v_y); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_5; @@ -2278,7 +2336,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_13ModifiedHuber_dloss(s __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":107 + /* "scikits/learn/linear_model/sgd_fast.pyx":107 * * cpdef double dloss(self, double p, double y): * cdef double z = p * y # <<<<<<<<<<<<<< @@ -2287,7 +2345,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_13ModifiedHuber_dloss(s */ __pyx_v_z = (__pyx_v_p * __pyx_v_y); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":108 + /* "scikits/learn/linear_model/sgd_fast.pyx":108 * cpdef double dloss(self, double p, double y): * cdef double z = p * y * if z >= 1.0: # <<<<<<<<<<<<<< @@ -2297,7 +2355,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_13ModifiedHuber_dloss(s __pyx_t_6 = (__pyx_v_z >= 1.0); if (__pyx_t_6) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":109 + /* "scikits/learn/linear_model/sgd_fast.pyx":109 * cdef double z = p * y * if z >= 1.0: * return 0.0 # <<<<<<<<<<<<<< @@ -2309,17 +2367,17 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_13ModifiedHuber_dloss(s goto __pyx_L3; } - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":110 + /* "scikits/learn/linear_model/sgd_fast.pyx":110 * if z >= 1.0: * return 0.0 * elif z >= -1.0: # <<<<<<<<<<<<<< * return 2.0 * (1.0 - z) * -y * else: */ - __pyx_t_6 = (__pyx_v_z >= (-1.0)); + __pyx_t_6 = (__pyx_v_z >= -1.0); if (__pyx_t_6) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":111 + /* "scikits/learn/linear_model/sgd_fast.pyx":111 * return 0.0 * elif z >= -1.0: * return 2.0 * (1.0 - z) * -y # <<<<<<<<<<<<<< @@ -2332,14 +2390,14 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_13ModifiedHuber_dloss(s } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":113 + /* "scikits/learn/linear_model/sgd_fast.pyx":113 * return 2.0 * (1.0 - z) * -y * else: * return -4.0 * y # <<<<<<<<<<<<<< * * def __reduce__(self): */ - __pyx_r = ((-4.0) * __pyx_v_y); + __pyx_r = (-4.0 * __pyx_v_y); goto __pyx_L0; } __pyx_L3:; @@ -2351,15 +2409,14 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_13ModifiedHuber_dloss(s __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_WriteUnraisable("sklearn.linear_model.sgd_fast.ModifiedHuber.dloss"); + __Pyx_WriteUnraisable("scikits.learn.linear_model.sgd_fast.ModifiedHuber.dloss"); __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":106 +/* "scikits/learn/linear_model/sgd_fast.pyx":106 * return -4.0 * z * * cpdef double dloss(self, double p, double y): # <<<<<<<<<<<<<< @@ -2367,8 +2424,8 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_13ModifiedHuber_dloss(s * if z >= 1.0: */ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_13ModifiedHuber_dloss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_13ModifiedHuber_dloss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_13ModifiedHuber_1dloss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_13ModifiedHuber_1dloss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { double __pyx_v_p; double __pyx_v_y; PyObject *__pyx_r = NULL; @@ -2411,11 +2468,12 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_13ModifiedHuber_dlos __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("dloss", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.ModifiedHuber.dloss"); + __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.ModifiedHuber.dloss"); + __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_ModifiedHuber *)((struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_ModifiedHuber *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.dloss(((struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *)__pyx_v_self), __pyx_v_p, __pyx_v_y, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber *)((struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.dloss(((struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *)__pyx_v_self), __pyx_v_p, __pyx_v_y, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -2425,7 +2483,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_13ModifiedHuber_dlos goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.ModifiedHuber.dloss"); + __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.ModifiedHuber.dloss"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -2433,7 +2491,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_13ModifiedHuber_dlos return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":115 +/* "scikits/learn/linear_model/sgd_fast.pyx":115 * return -4.0 * y * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -2441,13 +2499,13 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_13ModifiedHuber_dlos * */ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_13ModifiedHuber___reduce__(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_13ModifiedHuber___reduce__(PyObject *__pyx_v_self, PyObject *unused) { +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_13ModifiedHuber_2__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_13ModifiedHuber_2__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce__"); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":116 + /* "scikits/learn/linear_model/sgd_fast.pyx":116 * * def __reduce__(self): * return ModifiedHuber, () # <<<<<<<<<<<<<< @@ -2456,14 +2514,14 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_13ModifiedHuber___re */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_12linear_model_8sgd_fast_ModifiedHuber))); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)__pyx_ptype_7sklearn_12linear_model_8sgd_fast_ModifiedHuber))); - __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_12linear_model_8sgd_fast_ModifiedHuber))); + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)__pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber))); __Pyx_INCREF(((PyObject *)__pyx_empty_tuple)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_empty_tuple)); __Pyx_GIVEREF(((PyObject *)__pyx_empty_tuple)); - __pyx_r = __pyx_t_1; + __pyx_r = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; @@ -2471,7 +2529,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_13ModifiedHuber___re goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.ModifiedHuber.__reduce__"); + __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.ModifiedHuber.__reduce__"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -2479,7 +2537,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_13ModifiedHuber___re return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":121 +/* "scikits/learn/linear_model/sgd_fast.pyx":121 * cdef class Hinge(Classification): * """SVM loss for binary classification tasks with y in {-1,1}""" * cpdef double loss(self, double p, double y): # <<<<<<<<<<<<<< @@ -2487,8 +2545,8 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_13ModifiedHuber___re * if z < 1.0: */ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Hinge_loss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static double __pyx_f_7sklearn_12linear_model_8sgd_fast_5Hinge_loss(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Hinge *__pyx_v_self, double __pyx_v_p, double __pyx_v_y, int __pyx_skip_dispatch) { +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Hinge_loss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_5Hinge_loss(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Hinge *__pyx_v_self, double __pyx_v_p, double __pyx_v_y, int __pyx_skip_dispatch) { double __pyx_v_z; double __pyx_r; PyObject *__pyx_t_1 = NULL; @@ -2498,29 +2556,28 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_5Hinge_loss(struct __py double __pyx_t_5; int __pyx_t_6; __Pyx_RefNannySetupContext("loss"); - __Pyx_INCREF((PyObject *)__pyx_v_self); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overriden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__loss); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Hinge_loss)) { + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Hinge_loss)) { __pyx_t_2 = PyFloat_FromDouble(__pyx_v_p); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyFloat_FromDouble(__pyx_v_y); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_5; @@ -2530,7 +2587,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_5Hinge_loss(struct __py __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":122 + /* "scikits/learn/linear_model/sgd_fast.pyx":122 * """SVM loss for binary classification tasks with y in {-1,1}""" * cpdef double loss(self, double p, double y): * cdef double z = p * y # <<<<<<<<<<<<<< @@ -2539,7 +2596,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_5Hinge_loss(struct __py */ __pyx_v_z = (__pyx_v_p * __pyx_v_y); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":123 + /* "scikits/learn/linear_model/sgd_fast.pyx":123 * cpdef double loss(self, double p, double y): * cdef double z = p * y * if z < 1.0: # <<<<<<<<<<<<<< @@ -2549,20 +2606,20 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_5Hinge_loss(struct __py __pyx_t_6 = (__pyx_v_z < 1.0); if (__pyx_t_6) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":124 + /* "scikits/learn/linear_model/sgd_fast.pyx":124 * cdef double z = p * y * if z < 1.0: * return (1 - z) # <<<<<<<<<<<<<< * return 0.0 * */ - __pyx_r = (1 - __pyx_v_z); + __pyx_r = (1.0 - __pyx_v_z); goto __pyx_L0; goto __pyx_L3; } __pyx_L3:; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":125 + /* "scikits/learn/linear_model/sgd_fast.pyx":125 * if z < 1.0: * return (1 - z) * return 0.0 # <<<<<<<<<<<<<< @@ -2579,15 +2636,14 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_5Hinge_loss(struct __py __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_WriteUnraisable("sklearn.linear_model.sgd_fast.Hinge.loss"); + __Pyx_WriteUnraisable("scikits.learn.linear_model.sgd_fast.Hinge.loss"); __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":121 +/* "scikits/learn/linear_model/sgd_fast.pyx":121 * cdef class Hinge(Classification): * """SVM loss for binary classification tasks with y in {-1,1}""" * cpdef double loss(self, double p, double y): # <<<<<<<<<<<<<< @@ -2595,8 +2651,8 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_5Hinge_loss(struct __py * if z < 1.0: */ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Hinge_loss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Hinge_loss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Hinge_loss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Hinge_loss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { double __pyx_v_p; double __pyx_v_y; PyObject *__pyx_r = NULL; @@ -2639,11 +2695,12 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Hinge_loss(PyObject __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("loss", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Hinge.loss"); + __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.Hinge.loss"); + __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Hinge *)((struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Hinge *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.loss(((struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *)__pyx_v_self), __pyx_v_p, __pyx_v_y, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Hinge *)((struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Hinge *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.loss(((struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *)__pyx_v_self), __pyx_v_p, __pyx_v_y, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -2653,7 +2710,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Hinge_loss(PyObject goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Hinge.loss"); + __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.Hinge.loss"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -2661,7 +2718,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Hinge_loss(PyObject return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":127 +/* "scikits/learn/linear_model/sgd_fast.pyx":127 * return 0.0 * * cpdef double dloss(self, double p, double y): # <<<<<<<<<<<<<< @@ -2669,8 +2726,8 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Hinge_loss(PyObject * if z < 1.0: */ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Hinge_dloss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static double __pyx_f_7sklearn_12linear_model_8sgd_fast_5Hinge_dloss(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Hinge *__pyx_v_self, double __pyx_v_p, double __pyx_v_y, int __pyx_skip_dispatch) { +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Hinge_1dloss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_5Hinge_dloss(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Hinge *__pyx_v_self, double __pyx_v_p, double __pyx_v_y, int __pyx_skip_dispatch) { double __pyx_v_z; double __pyx_r; PyObject *__pyx_t_1 = NULL; @@ -2680,29 +2737,28 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_5Hinge_dloss(struct __p double __pyx_t_5; int __pyx_t_6; __Pyx_RefNannySetupContext("dloss"); - __Pyx_INCREF((PyObject *)__pyx_v_self); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overriden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__dloss); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Hinge_dloss)) { + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Hinge_1dloss)) { __pyx_t_2 = PyFloat_FromDouble(__pyx_v_p); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyFloat_FromDouble(__pyx_v_y); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_5; @@ -2712,7 +2768,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_5Hinge_dloss(struct __p __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":128 + /* "scikits/learn/linear_model/sgd_fast.pyx":128 * * cpdef double dloss(self, double p, double y): * cdef double z = p * y # <<<<<<<<<<<<<< @@ -2721,7 +2777,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_5Hinge_dloss(struct __p */ __pyx_v_z = (__pyx_v_p * __pyx_v_y); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":129 + /* "scikits/learn/linear_model/sgd_fast.pyx":129 * cpdef double dloss(self, double p, double y): * cdef double z = p * y * if z < 1.0: # <<<<<<<<<<<<<< @@ -2731,7 +2787,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_5Hinge_dloss(struct __p __pyx_t_6 = (__pyx_v_z < 1.0); if (__pyx_t_6) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":130 + /* "scikits/learn/linear_model/sgd_fast.pyx":130 * cdef double z = p * y * if z < 1.0: * return -y # <<<<<<<<<<<<<< @@ -2744,7 +2800,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_5Hinge_dloss(struct __p } __pyx_L3:; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":131 + /* "scikits/learn/linear_model/sgd_fast.pyx":131 * if z < 1.0: * return -y * return 0.0 # <<<<<<<<<<<<<< @@ -2761,15 +2817,14 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_5Hinge_dloss(struct __p __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_WriteUnraisable("sklearn.linear_model.sgd_fast.Hinge.dloss"); + __Pyx_WriteUnraisable("scikits.learn.linear_model.sgd_fast.Hinge.dloss"); __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":127 +/* "scikits/learn/linear_model/sgd_fast.pyx":127 * return 0.0 * * cpdef double dloss(self, double p, double y): # <<<<<<<<<<<<<< @@ -2777,8 +2832,8 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_5Hinge_dloss(struct __p * if z < 1.0: */ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Hinge_dloss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Hinge_dloss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Hinge_1dloss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Hinge_1dloss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { double __pyx_v_p; double __pyx_v_y; PyObject *__pyx_r = NULL; @@ -2821,11 +2876,12 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Hinge_dloss(PyObjec __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("dloss", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Hinge.dloss"); + __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.Hinge.dloss"); + __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Hinge *)((struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Hinge *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.dloss(((struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *)__pyx_v_self), __pyx_v_p, __pyx_v_y, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Hinge *)((struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Hinge *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.dloss(((struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *)__pyx_v_self), __pyx_v_p, __pyx_v_y, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -2835,7 +2891,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Hinge_dloss(PyObjec goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Hinge.dloss"); + __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.Hinge.dloss"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -2843,7 +2899,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Hinge_dloss(PyObjec return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":133 +/* "scikits/learn/linear_model/sgd_fast.pyx":133 * return 0.0 * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -2851,13 +2907,13 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Hinge_dloss(PyObjec * */ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Hinge___reduce__(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Hinge___reduce__(PyObject *__pyx_v_self, PyObject *unused) { +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Hinge_2__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Hinge_2__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce__"); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":134 + /* "scikits/learn/linear_model/sgd_fast.pyx":134 * * def __reduce__(self): * return Hinge, () # <<<<<<<<<<<<<< @@ -2866,14 +2922,14 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Hinge___reduce__(Py */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_12linear_model_8sgd_fast_Hinge))); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)__pyx_ptype_7sklearn_12linear_model_8sgd_fast_Hinge))); - __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_12linear_model_8sgd_fast_Hinge))); + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_Hinge))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)__pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_Hinge))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_Hinge))); __Pyx_INCREF(((PyObject *)__pyx_empty_tuple)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_empty_tuple)); __Pyx_GIVEREF(((PyObject *)__pyx_empty_tuple)); - __pyx_r = __pyx_t_1; + __pyx_r = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; @@ -2881,7 +2937,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Hinge___reduce__(Py goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Hinge.__reduce__"); + __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.Hinge.__reduce__"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -2889,7 +2945,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Hinge___reduce__(Py return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":140 +/* "scikits/learn/linear_model/sgd_fast.pyx":140 * """Logistic regression loss for binary classification with y in {-1, 1}""" * * cpdef double loss(self, double p, double y): # <<<<<<<<<<<<<< @@ -2897,8 +2953,8 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Hinge___reduce__(Py * # approximately equal and saves the computation of the log */ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_3Log_loss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static double __pyx_f_7sklearn_12linear_model_8sgd_fast_3Log_loss(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Log *__pyx_v_self, double __pyx_v_p, double __pyx_v_y, int __pyx_skip_dispatch) { +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_3Log_loss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_3Log_loss(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Log *__pyx_v_self, double __pyx_v_p, double __pyx_v_y, int __pyx_skip_dispatch) { double __pyx_v_z; double __pyx_r; PyObject *__pyx_t_1 = NULL; @@ -2908,29 +2964,28 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_3Log_loss(struct __pyx_ double __pyx_t_5; int __pyx_t_6; __Pyx_RefNannySetupContext("loss"); - __Pyx_INCREF((PyObject *)__pyx_v_self); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overriden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__loss); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_7sklearn_12linear_model_8sgd_fast_3Log_loss)) { + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_3Log_loss)) { __pyx_t_2 = PyFloat_FromDouble(__pyx_v_p); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyFloat_FromDouble(__pyx_v_y); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_5; @@ -2940,7 +2995,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_3Log_loss(struct __pyx_ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":141 + /* "scikits/learn/linear_model/sgd_fast.pyx":141 * * cpdef double loss(self, double p, double y): * cdef double z = p * y # <<<<<<<<<<<<<< @@ -2949,17 +3004,17 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_3Log_loss(struct __pyx_ */ __pyx_v_z = (__pyx_v_p * __pyx_v_y); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":143 + /* "scikits/learn/linear_model/sgd_fast.pyx":143 * cdef double z = p * y * # approximately equal and saves the computation of the log * if z > 18: # <<<<<<<<<<<<<< * return exp(-z) * if z < -18: */ - __pyx_t_6 = (__pyx_v_z > 18); + __pyx_t_6 = (__pyx_v_z > 18.0); if (__pyx_t_6) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":144 + /* "scikits/learn/linear_model/sgd_fast.pyx":144 * # approximately equal and saves the computation of the log * if z > 18: * return exp(-z) # <<<<<<<<<<<<<< @@ -2972,17 +3027,17 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_3Log_loss(struct __pyx_ } __pyx_L3:; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":145 + /* "scikits/learn/linear_model/sgd_fast.pyx":145 * if z > 18: * return exp(-z) * if z < -18: # <<<<<<<<<<<<<< * return -z * return log(1.0 + exp(-z)) */ - __pyx_t_6 = (__pyx_v_z < -18); + __pyx_t_6 = (__pyx_v_z < -18.0); if (__pyx_t_6) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":146 + /* "scikits/learn/linear_model/sgd_fast.pyx":146 * return exp(-z) * if z < -18: * return -z # <<<<<<<<<<<<<< @@ -2995,7 +3050,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_3Log_loss(struct __pyx_ } __pyx_L4:; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":147 + /* "scikits/learn/linear_model/sgd_fast.pyx":147 * if z < -18: * return -z * return log(1.0 + exp(-z)) # <<<<<<<<<<<<<< @@ -3012,15 +3067,14 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_3Log_loss(struct __pyx_ __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_WriteUnraisable("sklearn.linear_model.sgd_fast.Log.loss"); + __Pyx_WriteUnraisable("scikits.learn.linear_model.sgd_fast.Log.loss"); __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":140 +/* "scikits/learn/linear_model/sgd_fast.pyx":140 * """Logistic regression loss for binary classification with y in {-1, 1}""" * * cpdef double loss(self, double p, double y): # <<<<<<<<<<<<<< @@ -3028,8 +3082,8 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_3Log_loss(struct __pyx_ * # approximately equal and saves the computation of the log */ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_3Log_loss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_3Log_loss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_3Log_loss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_3Log_loss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { double __pyx_v_p; double __pyx_v_y; PyObject *__pyx_r = NULL; @@ -3072,11 +3126,12 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_3Log_loss(PyObject * __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("loss", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Log.loss"); + __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.Log.loss"); + __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Log *)((struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Log *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.loss(((struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *)__pyx_v_self), __pyx_v_p, __pyx_v_y, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Log *)((struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Log *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.loss(((struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *)__pyx_v_self), __pyx_v_p, __pyx_v_y, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -3086,7 +3141,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_3Log_loss(PyObject * goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Log.loss"); + __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.Log.loss"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -3094,7 +3149,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_3Log_loss(PyObject * return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":149 +/* "scikits/learn/linear_model/sgd_fast.pyx":149 * return log(1.0 + exp(-z)) * * cpdef double dloss(self, double p, double y): # <<<<<<<<<<<<<< @@ -3102,8 +3157,8 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_3Log_loss(PyObject * * # approximately equal and saves the computation of the log */ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_3Log_dloss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static double __pyx_f_7sklearn_12linear_model_8sgd_fast_3Log_dloss(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Log *__pyx_v_self, double __pyx_v_p, double __pyx_v_y, int __pyx_skip_dispatch) { +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_3Log_1dloss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_3Log_dloss(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Log *__pyx_v_self, double __pyx_v_p, double __pyx_v_y, int __pyx_skip_dispatch) { double __pyx_v_z; double __pyx_r; PyObject *__pyx_t_1 = NULL; @@ -3113,29 +3168,28 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_3Log_dloss(struct __pyx double __pyx_t_5; int __pyx_t_6; __Pyx_RefNannySetupContext("dloss"); - __Pyx_INCREF((PyObject *)__pyx_v_self); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overriden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__dloss); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_7sklearn_12linear_model_8sgd_fast_3Log_dloss)) { + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_3Log_1dloss)) { __pyx_t_2 = PyFloat_FromDouble(__pyx_v_p); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyFloat_FromDouble(__pyx_v_y); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_5; @@ -3145,7 +3199,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_3Log_dloss(struct __pyx __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":150 + /* "scikits/learn/linear_model/sgd_fast.pyx":150 * * cpdef double dloss(self, double p, double y): * cdef double z = p * y # <<<<<<<<<<<<<< @@ -3154,7 +3208,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_3Log_dloss(struct __pyx */ __pyx_v_z = (__pyx_v_p * __pyx_v_y); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":152 + /* "scikits/learn/linear_model/sgd_fast.pyx":152 * cdef double z = p * y * # approximately equal and saves the computation of the log * if z > 18.0: # <<<<<<<<<<<<<< @@ -3164,7 +3218,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_3Log_dloss(struct __pyx __pyx_t_6 = (__pyx_v_z > 18.0); if (__pyx_t_6) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":153 + /* "scikits/learn/linear_model/sgd_fast.pyx":153 * # approximately equal and saves the computation of the log * if z > 18.0: * return exp(-z) * -y # <<<<<<<<<<<<<< @@ -3177,17 +3231,17 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_3Log_dloss(struct __pyx } __pyx_L3:; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":154 + /* "scikits/learn/linear_model/sgd_fast.pyx":154 * if z > 18.0: * return exp(-z) * -y * if z < -18.0: # <<<<<<<<<<<<<< * return -y * return -y / (exp(z) + 1.0) */ - __pyx_t_6 = (__pyx_v_z < (-18.0)); + __pyx_t_6 = (__pyx_v_z < -18.0); if (__pyx_t_6) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":155 + /* "scikits/learn/linear_model/sgd_fast.pyx":155 * return exp(-z) * -y * if z < -18.0: * return -y # <<<<<<<<<<<<<< @@ -3200,7 +3254,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_3Log_dloss(struct __pyx } __pyx_L4:; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":156 + /* "scikits/learn/linear_model/sgd_fast.pyx":156 * if z < -18.0: * return -y * return -y / (exp(z) + 1.0) # <<<<<<<<<<<<<< @@ -3217,15 +3271,14 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_3Log_dloss(struct __pyx __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_WriteUnraisable("sklearn.linear_model.sgd_fast.Log.dloss"); + __Pyx_WriteUnraisable("scikits.learn.linear_model.sgd_fast.Log.dloss"); __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":149 +/* "scikits/learn/linear_model/sgd_fast.pyx":149 * return log(1.0 + exp(-z)) * * cpdef double dloss(self, double p, double y): # <<<<<<<<<<<<<< @@ -3233,8 +3286,8 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_3Log_dloss(struct __pyx * # approximately equal and saves the computation of the log */ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_3Log_dloss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_3Log_dloss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_3Log_1dloss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_3Log_1dloss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { double __pyx_v_p; double __pyx_v_y; PyObject *__pyx_r = NULL; @@ -3277,11 +3330,12 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_3Log_dloss(PyObject __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("dloss", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Log.dloss"); + __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.Log.dloss"); + __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Log *)((struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Log *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.dloss(((struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *)__pyx_v_self), __pyx_v_p, __pyx_v_y, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Log *)((struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Log *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.dloss(((struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *)__pyx_v_self), __pyx_v_p, __pyx_v_y, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -3291,7 +3345,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_3Log_dloss(PyObject goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Log.dloss"); + __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.Log.dloss"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -3299,7 +3353,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_3Log_dloss(PyObject return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":158 +/* "scikits/learn/linear_model/sgd_fast.pyx":158 * return -y / (exp(z) + 1.0) * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -3307,13 +3361,13 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_3Log_dloss(PyObject * */ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_3Log___reduce__(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_3Log___reduce__(PyObject *__pyx_v_self, PyObject *unused) { +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_3Log_2__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_3Log_2__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce__"); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":159 + /* "scikits/learn/linear_model/sgd_fast.pyx":159 * * def __reduce__(self): * return Log, () # <<<<<<<<<<<<<< @@ -3322,14 +3376,14 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_3Log___reduce__(PyOb */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_12linear_model_8sgd_fast_Log))); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)__pyx_ptype_7sklearn_12linear_model_8sgd_fast_Log))); - __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_12linear_model_8sgd_fast_Log))); + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_Log))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)__pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_Log))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_Log))); __Pyx_INCREF(((PyObject *)__pyx_empty_tuple)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_empty_tuple)); __Pyx_GIVEREF(((PyObject *)__pyx_empty_tuple)); - __pyx_r = __pyx_t_1; + __pyx_r = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; @@ -3337,7 +3391,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_3Log___reduce__(PyOb goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Log.__reduce__"); + __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.Log.__reduce__"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -3345,7 +3399,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_3Log___reduce__(PyOb return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":164 +/* "scikits/learn/linear_model/sgd_fast.pyx":164 * cdef class SquaredLoss(Regression): * """Squared loss traditional used in linear regression.""" * cpdef double loss(self, double p, double y): # <<<<<<<<<<<<<< @@ -3353,8 +3407,8 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_3Log___reduce__(PyOb * */ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_11SquaredLoss_loss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static double __pyx_f_7sklearn_12linear_model_8sgd_fast_11SquaredLoss_loss(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_SquaredLoss *__pyx_v_self, double __pyx_v_p, double __pyx_v_y, int __pyx_skip_dispatch) { +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_11SquaredLoss_loss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_11SquaredLoss_loss(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss *__pyx_v_self, double __pyx_v_p, double __pyx_v_y, int __pyx_skip_dispatch) { double __pyx_r; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -3368,22 +3422,22 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_11SquaredLoss_loss(stru else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__loss); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_7sklearn_12linear_model_8sgd_fast_11SquaredLoss_loss)) { + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_11SquaredLoss_loss)) { __pyx_t_2 = PyFloat_FromDouble(__pyx_v_p); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyFloat_FromDouble(__pyx_v_y); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_5; @@ -3393,7 +3447,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_11SquaredLoss_loss(stru __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":165 + /* "scikits/learn/linear_model/sgd_fast.pyx":165 * """Squared loss traditional used in linear regression.""" * cpdef double loss(self, double p, double y): * return 0.5 * (p - y) * (p - y) # <<<<<<<<<<<<<< @@ -3410,14 +3464,14 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_11SquaredLoss_loss(stru __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_WriteUnraisable("sklearn.linear_model.sgd_fast.SquaredLoss.loss"); + __Pyx_WriteUnraisable("scikits.learn.linear_model.sgd_fast.SquaredLoss.loss"); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":164 +/* "scikits/learn/linear_model/sgd_fast.pyx":164 * cdef class SquaredLoss(Regression): * """Squared loss traditional used in linear regression.""" * cpdef double loss(self, double p, double y): # <<<<<<<<<<<<<< @@ -3425,8 +3479,8 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_11SquaredLoss_loss(stru * */ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_11SquaredLoss_loss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_11SquaredLoss_loss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_11SquaredLoss_loss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_11SquaredLoss_loss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { double __pyx_v_p; double __pyx_v_y; PyObject *__pyx_r = NULL; @@ -3469,11 +3523,12 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_11SquaredLoss_loss(P __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("loss", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.SquaredLoss.loss"); + __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.SquaredLoss.loss"); + __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_SquaredLoss *)((struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_SquaredLoss *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.loss(((struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *)__pyx_v_self), __pyx_v_p, __pyx_v_y, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss *)((struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.loss(((struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *)__pyx_v_self), __pyx_v_p, __pyx_v_y, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -3483,7 +3538,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_11SquaredLoss_loss(P goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.SquaredLoss.loss"); + __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.SquaredLoss.loss"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -3491,7 +3546,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_11SquaredLoss_loss(P return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":167 +/* "scikits/learn/linear_model/sgd_fast.pyx":167 * return 0.5 * (p - y) * (p - y) * * cpdef double dloss(self, double p, double y): # <<<<<<<<<<<<<< @@ -3499,8 +3554,8 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_11SquaredLoss_loss(P * */ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_11SquaredLoss_dloss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static double __pyx_f_7sklearn_12linear_model_8sgd_fast_11SquaredLoss_dloss(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_SquaredLoss *__pyx_v_self, double __pyx_v_p, double __pyx_v_y, int __pyx_skip_dispatch) { +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_11SquaredLoss_1dloss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_11SquaredLoss_dloss(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss *__pyx_v_self, double __pyx_v_p, double __pyx_v_y, int __pyx_skip_dispatch) { double __pyx_r; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -3514,22 +3569,22 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_11SquaredLoss_dloss(str else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__dloss); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_7sklearn_12linear_model_8sgd_fast_11SquaredLoss_dloss)) { + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_11SquaredLoss_1dloss)) { __pyx_t_2 = PyFloat_FromDouble(__pyx_v_p); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyFloat_FromDouble(__pyx_v_y); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_5; @@ -3539,7 +3594,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_11SquaredLoss_dloss(str __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":168 + /* "scikits/learn/linear_model/sgd_fast.pyx":168 * * cpdef double dloss(self, double p, double y): * return p - y # <<<<<<<<<<<<<< @@ -3556,14 +3611,14 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_11SquaredLoss_dloss(str __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_WriteUnraisable("sklearn.linear_model.sgd_fast.SquaredLoss.dloss"); + __Pyx_WriteUnraisable("scikits.learn.linear_model.sgd_fast.SquaredLoss.dloss"); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":167 +/* "scikits/learn/linear_model/sgd_fast.pyx":167 * return 0.5 * (p - y) * (p - y) * * cpdef double dloss(self, double p, double y): # <<<<<<<<<<<<<< @@ -3571,8 +3626,8 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_11SquaredLoss_dloss(str * */ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_11SquaredLoss_dloss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_11SquaredLoss_dloss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_11SquaredLoss_1dloss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_11SquaredLoss_1dloss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { double __pyx_v_p; double __pyx_v_y; PyObject *__pyx_r = NULL; @@ -3615,11 +3670,12 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_11SquaredLoss_dloss( __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("dloss", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.SquaredLoss.dloss"); + __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.SquaredLoss.dloss"); + __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_SquaredLoss *)((struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_SquaredLoss *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.dloss(((struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *)__pyx_v_self), __pyx_v_p, __pyx_v_y, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss *)((struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.dloss(((struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *)__pyx_v_self), __pyx_v_p, __pyx_v_y, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -3629,7 +3685,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_11SquaredLoss_dloss( goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.SquaredLoss.dloss"); + __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.SquaredLoss.dloss"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -3637,7 +3693,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_11SquaredLoss_dloss( return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":170 +/* "scikits/learn/linear_model/sgd_fast.pyx":170 * return p - y * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -3645,13 +3701,13 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_11SquaredLoss_dloss( * */ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_11SquaredLoss___reduce__(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_11SquaredLoss___reduce__(PyObject *__pyx_v_self, PyObject *unused) { +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_11SquaredLoss_2__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_11SquaredLoss_2__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce__"); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":171 + /* "scikits/learn/linear_model/sgd_fast.pyx":171 * * def __reduce__(self): * return SquaredLoss, () # <<<<<<<<<<<<<< @@ -3660,14 +3716,14 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_11SquaredLoss___redu */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_12linear_model_8sgd_fast_SquaredLoss))); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)__pyx_ptype_7sklearn_12linear_model_8sgd_fast_SquaredLoss))); - __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_12linear_model_8sgd_fast_SquaredLoss))); + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)__pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss))); __Pyx_INCREF(((PyObject *)__pyx_empty_tuple)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_empty_tuple)); __Pyx_GIVEREF(((PyObject *)__pyx_empty_tuple)); - __pyx_r = __pyx_t_1; + __pyx_r = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; @@ -3675,7 +3731,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_11SquaredLoss___redu goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.SquaredLoss.__reduce__"); + __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.SquaredLoss.__reduce__"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -3683,7 +3739,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_11SquaredLoss___redu return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":186 +/* "scikits/learn/linear_model/sgd_fast.pyx":186 * """ * * def __init__(self, c): # <<<<<<<<<<<<<< @@ -3691,8 +3747,8 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_11SquaredLoss___redu * */ -static int __pyx_pf_7sklearn_12linear_model_8sgd_fast_5Huber___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pf_7sklearn_12linear_model_8sgd_fast_5Huber___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static int __pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Huber___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Huber___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_c = 0; int __pyx_r; double __pyx_t_1; @@ -3725,11 +3781,12 @@ static int __pyx_pf_7sklearn_12linear_model_8sgd_fast_5Huber___init__(PyObject * __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Huber.__init__"); + __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.Huber.__init__"); + __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":187 + /* "scikits/learn/linear_model/sgd_fast.pyx":187 * * def __init__(self, c): * self.c = c # <<<<<<<<<<<<<< @@ -3737,19 +3794,19 @@ static int __pyx_pf_7sklearn_12linear_model_8sgd_fast_5Huber___init__(PyObject * * cpdef double loss(self, double p, double y): */ __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_c); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - ((struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Huber *)__pyx_v_self)->c = __pyx_t_1; + ((struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Huber *)__pyx_v_self)->c = __pyx_t_1; __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; - __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Huber.__init__"); + __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.Huber.__init__"); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":189 +/* "scikits/learn/linear_model/sgd_fast.pyx":189 * self.c = c * * cpdef double loss(self, double p, double y): # <<<<<<<<<<<<<< @@ -3757,8 +3814,8 @@ static int __pyx_pf_7sklearn_12linear_model_8sgd_fast_5Huber___init__(PyObject * * cdef double abs_r = abs(r) */ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Huber_loss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static double __pyx_f_7sklearn_12linear_model_8sgd_fast_5Huber_loss(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Huber *__pyx_v_self, double __pyx_v_p, double __pyx_v_y, int __pyx_skip_dispatch) { +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Huber_1loss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_5Huber_loss(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Huber *__pyx_v_self, double __pyx_v_p, double __pyx_v_y, int __pyx_skip_dispatch) { double __pyx_v_r; double __pyx_v_abs_r; double __pyx_r; @@ -3769,29 +3826,28 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_5Huber_loss(struct __py double __pyx_t_5; int __pyx_t_6; __Pyx_RefNannySetupContext("loss"); - __Pyx_INCREF((PyObject *)__pyx_v_self); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overriden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__loss); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Huber_loss)) { + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Huber_1loss)) { __pyx_t_2 = PyFloat_FromDouble(__pyx_v_p); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyFloat_FromDouble(__pyx_v_y); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_5; @@ -3801,7 +3857,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_5Huber_loss(struct __py __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":190 + /* "scikits/learn/linear_model/sgd_fast.pyx":190 * * cpdef double loss(self, double p, double y): * cdef double r = p - y # <<<<<<<<<<<<<< @@ -3810,7 +3866,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_5Huber_loss(struct __py */ __pyx_v_r = (__pyx_v_p - __pyx_v_y); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":191 + /* "scikits/learn/linear_model/sgd_fast.pyx":191 * cpdef double loss(self, double p, double y): * cdef double r = p - y * cdef double abs_r = abs(r) # <<<<<<<<<<<<<< @@ -3826,7 +3882,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_5Huber_loss(struct __py __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_abs_r = __pyx_t_5; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":192 + /* "scikits/learn/linear_model/sgd_fast.pyx":192 * cdef double r = p - y * cdef double abs_r = abs(r) * if abs_r <= self.c: # <<<<<<<<<<<<<< @@ -3836,7 +3892,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_5Huber_loss(struct __py __pyx_t_6 = (__pyx_v_abs_r <= __pyx_v_self->c); if (__pyx_t_6) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":193 + /* "scikits/learn/linear_model/sgd_fast.pyx":193 * cdef double abs_r = abs(r) * if abs_r <= self.c: * return 0.5 * r * r # <<<<<<<<<<<<<< @@ -3849,7 +3905,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_5Huber_loss(struct __py } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":195 + /* "scikits/learn/linear_model/sgd_fast.pyx":195 * return 0.5 * r * r * else: * return self.c * abs_r - (0.5 * self.c * self.c) # <<<<<<<<<<<<<< @@ -3868,15 +3924,14 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_5Huber_loss(struct __py __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_WriteUnraisable("sklearn.linear_model.sgd_fast.Huber.loss"); + __Pyx_WriteUnraisable("scikits.learn.linear_model.sgd_fast.Huber.loss"); __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":189 +/* "scikits/learn/linear_model/sgd_fast.pyx":189 * self.c = c * * cpdef double loss(self, double p, double y): # <<<<<<<<<<<<<< @@ -3884,8 +3939,8 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_5Huber_loss(struct __py * cdef double abs_r = abs(r) */ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Huber_loss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Huber_loss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Huber_1loss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Huber_1loss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { double __pyx_v_p; double __pyx_v_y; PyObject *__pyx_r = NULL; @@ -3928,11 +3983,12 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Huber_loss(PyObject __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("loss", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Huber.loss"); + __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.Huber.loss"); + __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Huber *)((struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Huber *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.loss(((struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *)__pyx_v_self), __pyx_v_p, __pyx_v_y, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Huber *)((struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Huber *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.loss(((struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *)__pyx_v_self), __pyx_v_p, __pyx_v_y, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -3942,7 +3998,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Huber_loss(PyObject goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Huber.loss"); + __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.Huber.loss"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -3950,7 +4006,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Huber_loss(PyObject return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":197 +/* "scikits/learn/linear_model/sgd_fast.pyx":197 * return self.c * abs_r - (0.5 * self.c * self.c) * * cpdef double dloss(self, double p, double y): # <<<<<<<<<<<<<< @@ -3958,8 +4014,8 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Huber_loss(PyObject * cdef double abs_r = abs(r) */ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Huber_dloss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static double __pyx_f_7sklearn_12linear_model_8sgd_fast_5Huber_dloss(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Huber *__pyx_v_self, double __pyx_v_p, double __pyx_v_y, int __pyx_skip_dispatch) { +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Huber_2dloss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_5Huber_dloss(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Huber *__pyx_v_self, double __pyx_v_p, double __pyx_v_y, int __pyx_skip_dispatch) { double __pyx_v_r; double __pyx_v_abs_r; double __pyx_r; @@ -3970,29 +4026,28 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_5Huber_dloss(struct __p double __pyx_t_5; int __pyx_t_6; __Pyx_RefNannySetupContext("dloss"); - __Pyx_INCREF((PyObject *)__pyx_v_self); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overriden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__dloss); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Huber_dloss)) { + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Huber_2dloss)) { __pyx_t_2 = PyFloat_FromDouble(__pyx_v_p); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyFloat_FromDouble(__pyx_v_y); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_5; @@ -4002,7 +4057,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_5Huber_dloss(struct __p __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":198 + /* "scikits/learn/linear_model/sgd_fast.pyx":198 * * cpdef double dloss(self, double p, double y): * cdef double r = p - y # FIXME y - p # <<<<<<<<<<<<<< @@ -4011,7 +4066,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_5Huber_dloss(struct __p */ __pyx_v_r = (__pyx_v_p - __pyx_v_y); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":199 + /* "scikits/learn/linear_model/sgd_fast.pyx":199 * cpdef double dloss(self, double p, double y): * cdef double r = p - y # FIXME y - p * cdef double abs_r = abs(r) # <<<<<<<<<<<<<< @@ -4027,7 +4082,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_5Huber_dloss(struct __p __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_abs_r = __pyx_t_5; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":200 + /* "scikits/learn/linear_model/sgd_fast.pyx":200 * cdef double r = p - y # FIXME y - p * cdef double abs_r = abs(r) * if abs_r <= self.c: # <<<<<<<<<<<<<< @@ -4037,7 +4092,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_5Huber_dloss(struct __p __pyx_t_6 = (__pyx_v_abs_r <= __pyx_v_self->c); if (__pyx_t_6) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":201 + /* "scikits/learn/linear_model/sgd_fast.pyx":201 * cdef double abs_r = abs(r) * if abs_r <= self.c: * return r # <<<<<<<<<<<<<< @@ -4049,7 +4104,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_5Huber_dloss(struct __p goto __pyx_L3; } - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":202 + /* "scikits/learn/linear_model/sgd_fast.pyx":202 * if abs_r <= self.c: * return r * elif r > 0.0: # <<<<<<<<<<<<<< @@ -4059,7 +4114,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_5Huber_dloss(struct __p __pyx_t_6 = (__pyx_v_r > 0.0); if (__pyx_t_6) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":203 + /* "scikits/learn/linear_model/sgd_fast.pyx":203 * return r * elif r > 0.0: * return self.c # <<<<<<<<<<<<<< @@ -4072,7 +4127,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_5Huber_dloss(struct __p } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":205 + /* "scikits/learn/linear_model/sgd_fast.pyx":205 * return self.c * else: * return -self.c # <<<<<<<<<<<<<< @@ -4091,15 +4146,14 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_5Huber_dloss(struct __p __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_WriteUnraisable("sklearn.linear_model.sgd_fast.Huber.dloss"); + __Pyx_WriteUnraisable("scikits.learn.linear_model.sgd_fast.Huber.dloss"); __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":197 +/* "scikits/learn/linear_model/sgd_fast.pyx":197 * return self.c * abs_r - (0.5 * self.c * self.c) * * cpdef double dloss(self, double p, double y): # <<<<<<<<<<<<<< @@ -4107,8 +4161,8 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_5Huber_dloss(struct __p * cdef double abs_r = abs(r) */ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Huber_dloss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Huber_dloss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Huber_2dloss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Huber_2dloss(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { double __pyx_v_p; double __pyx_v_y; PyObject *__pyx_r = NULL; @@ -4151,11 +4205,12 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Huber_dloss(PyObjec __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("dloss", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Huber.dloss"); + __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.Huber.dloss"); + __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Huber *)((struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Huber *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.dloss(((struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *)__pyx_v_self), __pyx_v_p, __pyx_v_y, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Huber *)((struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Huber *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.dloss(((struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *)__pyx_v_self), __pyx_v_p, __pyx_v_y, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -4165,7 +4220,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Huber_dloss(PyObjec goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Huber.dloss"); + __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.Huber.dloss"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -4173,7 +4228,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Huber_dloss(PyObjec return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":207 +/* "scikits/learn/linear_model/sgd_fast.pyx":207 * return -self.c * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -4181,14 +4236,14 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Huber_dloss(PyObjec * */ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Huber___reduce__(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Huber___reduce__(PyObject *__pyx_v_self, PyObject *unused) { +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Huber_3__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Huber_3__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__reduce__"); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":208 + /* "scikits/learn/linear_model/sgd_fast.pyx":208 * * def __reduce__(self): * return Huber, (self.c,) # <<<<<<<<<<<<<< @@ -4196,22 +4251,22 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Huber___reduce__(Py * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Huber *)__pyx_v_self)->c); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Huber *)__pyx_v_self)->c); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_12linear_model_8sgd_fast_Huber))); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)__pyx_ptype_7sklearn_12linear_model_8sgd_fast_Huber))); - __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_12linear_model_8sgd_fast_Huber))); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_Huber))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)__pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_Huber))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_Huber))); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_t_2)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_r = __pyx_t_1; + __pyx_r = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; @@ -4220,7 +4275,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Huber___reduce__(Py __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Huber.__reduce__"); + __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.Huber.__reduce__"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -4228,7 +4283,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Huber___reduce__(Py return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":214 +/* "scikits/learn/linear_model/sgd_fast.pyx":214 * @cython.wraparound(False) * @cython.cdivision(True) * def plain_sgd(np.ndarray[np.float64_t, ndim=1, mode='c'] w, # <<<<<<<<<<<<<< @@ -4236,12 +4291,13 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Huber___reduce__(Py * LossFunction loss, */ -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_7sklearn_12linear_model_8sgd_fast_plain_sgd[] = "Cython impl. of SGD for generic loss functions and penalties\n\n This implementation assumes X represented as a dense array of floats.\n\n Parameters\n ----------\n w : ndarray[double, ndim=1]\n The allocated coef_ vector.\n intercept : double\n The initial intercept\n loss : LossFunction\n A concrete LossFunction object.\n penalty_type : int\n The penalty 2 for L2, 1 for L1, and 3 for Elastic-Net.\n alpha : float\n The regularization parameter.\n rho : float\n The elastic net hyperparameter.\n X : ndarray[double, ndim=2]\n The dataset as a dense numpy array.\n Y : ndarray[double, ndim=1]\n The labels.\n n_iter : int\n The number of iterations (epochs).\n fit_intercept : int\n Whether or not to fit the intercept (1 or 0).\n verbose : int\n Print verbose output; 0 for quite.\n shuffle : int\n Whether to shuffle the training data before each epoch.\n weight_pos : float\n The weight of the positive class.\n weight_neg : float\n The weight of the negative class.\n seed : int\n The seed of the pseudo random number generator to use when\n shuffling the data\n sample_weight : array, shape = [n_samples]\n The importance weight of each sample.\n learning_rate : int\n The learning rate:\n (1) constant, eta = eta0\n (2) optimal, eta = 1.0/(t+t0)\n (3) inverse scaling, eta = eta0 / pow(t, power_t)\n eta0 : double\n The initial learning rate.\n power_t : double\n The exponent for inverse scaling learning rate.\n\n Returns\n -------\n w : array, shape [n_features]\n The fitted weight vector.\n intercept : float\n The fitted intercept term.\n\n "; -static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd[] = "Cython impl. of SGD for generic loss functions and penalties\n\n This implementation assumes X represented as a dense array of floats.\n\n Parameters\n ----------\n w : ndarray[double, ndim=1]\n The allocated coef_ vector.\n intercept : double\n The initial intercept\n loss : LossFunction\n A concrete LossFunction object.\n penalty_type : int\n The penalty 2 for L2, 1 for L1, and 3 for Elastic-Net.\n alpha : float\n The regularization parameter.\n rho : float\n The elastic net hyperparameter.\n X : ndarray[double, ndim=2]\n The dataset as a dense numpy array.\n Y : ndarray[double, ndim=1]\n The labels.\n n_iter : int\n The number of iterations (epochs).\n fit_intercept : int\n Whether or not to fit the intercept (1 or 0).\n verbose : int\n Print verbose output; 0 for quite.\n shuffle : int\n Whether to shuffle the training data before each epoch.\n weight_pos : float\n The weight of the positive class.\n weight_neg : float\n The weight of the negative class.\n seed : int\n The seed of the pseudo random number generator to use when\n shuffling the data\n sample_weight : array, shape = [n_samples]\n The importance weight of each sample.\n learning_rate : int\n The learning rate:\n (1) constant, eta = eta0\n (2) optimal, eta = 1.0/(t+t0)\n (3) inverse scaling, eta = eta0 / pow(t, power_t)\n eta0 : double\n The initial learning rate.\n power_t : double\n The exponent for inverse scaling learning rate.\n\n Returns\n -------\n w : array, shape [n_features]\n The fitted weight vector.\n intercept : float\n The fitted intercept term.\n\n "; +static PyMethodDef __pyx_mdef_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd = {__Pyx_NAMESTR("plain_sgd"), (PyCFunction)__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd)}; +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyArrayObject *__pyx_v_w = 0; double __pyx_v_intercept; - struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *__pyx_v_loss = 0; + struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *__pyx_v_loss = 0; int __pyx_v_penalty_type; double __pyx_v_alpha; double __pyx_v_rho; @@ -4320,9 +4376,9 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; - int __pyx_t_13; - unsigned int __pyx_t_14; - PyArrayObject *__pyx_t_15 = NULL; + unsigned int __pyx_t_13; + PyArrayObject *__pyx_t_14 = NULL; + int __pyx_t_15; double __pyx_t_16; PyObject *__pyx_t_17 = NULL; int __pyx_t_18; @@ -4477,7 +4533,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * } __pyx_v_w = ((PyArrayObject *)values[0]); __pyx_v_intercept = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_intercept == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_loss = ((struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *)values[2]); + __pyx_v_loss = ((struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *)values[2]); __pyx_v_penalty_type = __Pyx_PyInt_AsInt(values[3]); if (unlikely((__pyx_v_penalty_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_alpha = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_alpha == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_rho = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_rho == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} @@ -4499,7 +4555,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * } else { __pyx_v_w = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 0)); __pyx_v_intercept = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_intercept == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_loss = ((struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *)PyTuple_GET_ITEM(__pyx_args, 2)); + __pyx_v_loss = ((struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *)PyTuple_GET_ITEM(__pyx_args, 2)); __pyx_v_penalty_type = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 3)); if (unlikely((__pyx_v_penalty_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_alpha = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 4)); if (unlikely((__pyx_v_alpha == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_rho = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 5)); if (unlikely((__pyx_v_rho == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} @@ -4521,14 +4577,11 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("plain_sgd", 1, 19, 19, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.plain_sgd"); + __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.plain_sgd"); + __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_INCREF((PyObject *)__pyx_v_w); - __Pyx_INCREF((PyObject *)__pyx_v_loss); - __Pyx_INCREF((PyObject *)__pyx_v_X); - __Pyx_INCREF((PyObject *)__pyx_v_Y); - __Pyx_INCREF((PyObject *)__pyx_v_sample_weight); __pyx_v_t_start = Py_None; __Pyx_INCREF(Py_None); __pyx_bstruct_index.buf = NULL; __pyx_bstruct_q.buf = NULL; @@ -4537,7 +4590,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * __pyx_bstruct_Y.buf = NULL; __pyx_bstruct_sample_weight.buf = NULL; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_w), __pyx_ptype_5numpy_ndarray, 1, "w", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loss), __pyx_ptype_7sklearn_12linear_model_8sgd_fast_LossFunction, 1, "loss", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loss), __pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_LossFunction, 1, "loss", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_X), __pyx_ptype_5numpy_ndarray, 1, "X", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_Y), __pyx_ptype_5numpy_ndarray, 1, "Y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sample_weight), __pyx_ptype_5numpy_ndarray, 1, "sample_weight", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -4566,7 +4619,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * __pyx_bstride_0_sample_weight = __pyx_bstruct_sample_weight.strides[0]; __pyx_bshape_0_sample_weight = __pyx_bstruct_sample_weight.shape[0]; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":286 + /* "scikits/learn/linear_model/sgd_fast.pyx":286 * * # get the data information into easy vars * cdef unsigned int n_samples = Y.shape[0] # <<<<<<<<<<<<<< @@ -4575,7 +4628,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * */ __pyx_v_n_samples = (__pyx_v_Y->dimensions[0]); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":287 + /* "scikits/learn/linear_model/sgd_fast.pyx":287 * # get the data information into easy vars * cdef unsigned int n_samples = Y.shape[0] * cdef unsigned int n_features = w.shape[0] # <<<<<<<<<<<<<< @@ -4584,7 +4637,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * */ __pyx_v_n_features = (__pyx_v_w->dimensions[0]); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":290 + /* "scikits/learn/linear_model/sgd_fast.pyx":290 * * # Array strides to get to next feature or example * cdef int row_stride = X.strides[0] # <<<<<<<<<<<<<< @@ -4593,7 +4646,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * */ __pyx_v_row_stride = (__pyx_v_X->strides[0]); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":291 + /* "scikits/learn/linear_model/sgd_fast.pyx":291 * # Array strides to get to next feature or example * cdef int row_stride = X.strides[0] * cdef int elem_stride = X.strides[1] # <<<<<<<<<<<<<< @@ -4602,7 +4655,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * */ __pyx_v_elem_stride = (__pyx_v_X->strides[1]); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":293 + /* "scikits/learn/linear_model/sgd_fast.pyx":293 * cdef int elem_stride = X.strides[1] * * cdef double *w_data_ptr = <double *>w.data # <<<<<<<<<<<<<< @@ -4611,7 +4664,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * */ __pyx_v_w_data_ptr = ((double *)__pyx_v_w->data); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":294 + /* "scikits/learn/linear_model/sgd_fast.pyx":294 * * cdef double *w_data_ptr = <double *>w.data * cdef double *X_data_ptr = <double *>X.data # <<<<<<<<<<<<<< @@ -4620,7 +4673,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * */ __pyx_v_X_data_ptr = ((double *)__pyx_v_X->data); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":295 + /* "scikits/learn/linear_model/sgd_fast.pyx":295 * cdef double *w_data_ptr = <double *>w.data * cdef double *X_data_ptr = <double *>X.data * cdef double *Y_data_ptr = <double *>Y.data # <<<<<<<<<<<<<< @@ -4629,7 +4682,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * */ __pyx_v_Y_data_ptr = ((double *)__pyx_v_Y->data); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":297 + /* "scikits/learn/linear_model/sgd_fast.pyx":297 * cdef double *Y_data_ptr = <double *>Y.data * * cdef double *sample_weight_data = <double *>sample_weight.data # <<<<<<<<<<<<<< @@ -4638,7 +4691,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * */ __pyx_v_sample_weight_data = ((double *)__pyx_v_sample_weight->data); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":301 + /* "scikits/learn/linear_model/sgd_fast.pyx":301 * # Use index array for fast shuffling * cdef np.ndarray[np.int32_t, ndim=1, * mode="c"] index = np.arange(n_samples, # <<<<<<<<<<<<<< @@ -4653,14 +4706,14 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_v_n_samples); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":302 + /* "scikits/learn/linear_model/sgd_fast.pyx":302 * cdef np.ndarray[np.int32_t, ndim=1, * mode="c"] index = np.arange(n_samples, * dtype=np.int32) # <<<<<<<<<<<<<< @@ -4674,10 +4727,10 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); @@ -4694,7 +4747,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * __pyx_v_index = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":303 + /* "scikits/learn/linear_model/sgd_fast.pyx":303 * mode="c"] index = np.arange(n_samples, * dtype=np.int32) * cdef int *index_data_ptr = <int *>index.data # <<<<<<<<<<<<<< @@ -4703,7 +4756,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * */ __pyx_v_index_data_ptr = ((int *)__pyx_v_index->data); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":306 + /* "scikits/learn/linear_model/sgd_fast.pyx":306 * * # helper variable * cdef int offset = 0 # <<<<<<<<<<<<<< @@ -4712,7 +4765,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * */ __pyx_v_offset = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":307 + /* "scikits/learn/linear_model/sgd_fast.pyx":307 * # helper variable * cdef int offset = 0 * cdef double wscale = 1.0 # <<<<<<<<<<<<<< @@ -4721,7 +4774,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * */ __pyx_v_wscale = 1.0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":308 + /* "scikits/learn/linear_model/sgd_fast.pyx":308 * cdef int offset = 0 * cdef double wscale = 1.0 * cdef double eta = 0.0 # <<<<<<<<<<<<<< @@ -4730,7 +4783,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * */ __pyx_v_eta = 0.0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":309 + /* "scikits/learn/linear_model/sgd_fast.pyx":309 * cdef double wscale = 1.0 * cdef double eta = 0.0 * cdef double p = 0.0 # <<<<<<<<<<<<<< @@ -4739,7 +4792,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * */ __pyx_v_p = 0.0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":310 + /* "scikits/learn/linear_model/sgd_fast.pyx":310 * cdef double eta = 0.0 * cdef double p = 0.0 * cdef double update = 0.0 # <<<<<<<<<<<<<< @@ -4748,7 +4801,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * */ __pyx_v_update = 0.0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":311 + /* "scikits/learn/linear_model/sgd_fast.pyx":311 * cdef double p = 0.0 * cdef double update = 0.0 * cdef double sumloss = 0.0 # <<<<<<<<<<<<<< @@ -4757,7 +4810,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * */ __pyx_v_sumloss = 0.0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":312 + /* "scikits/learn/linear_model/sgd_fast.pyx":312 * cdef double update = 0.0 * cdef double sumloss = 0.0 * cdef double wnorm = 0.0 # <<<<<<<<<<<<<< @@ -4766,7 +4819,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * */ __pyx_v_wnorm = 0.0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":313 + /* "scikits/learn/linear_model/sgd_fast.pyx":313 * cdef double sumloss = 0.0 * cdef double wnorm = 0.0 * cdef double t = 0.0 # <<<<<<<<<<<<<< @@ -4775,7 +4828,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * */ __pyx_v_t = 0.0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":314 + /* "scikits/learn/linear_model/sgd_fast.pyx":314 * cdef double wnorm = 0.0 * cdef double t = 0.0 * cdef double y = 0.0 # <<<<<<<<<<<<<< @@ -4784,7 +4837,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * */ __pyx_v_y = 0.0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":315 + /* "scikits/learn/linear_model/sgd_fast.pyx":315 * cdef double t = 0.0 * cdef double y = 0.0 * cdef double class_weight = 1.0 # <<<<<<<<<<<<<< @@ -4793,7 +4846,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * */ __pyx_v_class_weight = 1.0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":316 + /* "scikits/learn/linear_model/sgd_fast.pyx":316 * cdef double y = 0.0 * cdef double class_weight = 1.0 * cdef unsigned int count = 0 # <<<<<<<<<<<<<< @@ -4802,7 +4855,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * */ __pyx_v_count = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":317 + /* "scikits/learn/linear_model/sgd_fast.pyx":317 * cdef double class_weight = 1.0 * cdef unsigned int count = 0 * cdef unsigned int epoch = 0 # <<<<<<<<<<<<<< @@ -4811,7 +4864,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * */ __pyx_v_epoch = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":318 + /* "scikits/learn/linear_model/sgd_fast.pyx":318 * cdef unsigned int count = 0 * cdef unsigned int epoch = 0 * cdef unsigned int i = 0 # <<<<<<<<<<<<<< @@ -4820,7 +4873,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * */ __pyx_v_i = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":319 + /* "scikits/learn/linear_model/sgd_fast.pyx":319 * cdef unsigned int epoch = 0 * cdef unsigned int i = 0 * cdef int sample_idx = 0 # <<<<<<<<<<<<<< @@ -4829,7 +4882,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * */ __pyx_v_sample_idx = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":322 + /* "scikits/learn/linear_model/sgd_fast.pyx":322 * * # q vector is only used for L1 regularization * cdef np.ndarray[np.float64_t, ndim=1, mode="c"] q = None # <<<<<<<<<<<<<< @@ -4850,7 +4903,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * __Pyx_INCREF(Py_None); __pyx_v_q = ((PyArrayObject *)Py_None); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":324 + /* "scikits/learn/linear_model/sgd_fast.pyx":324 * cdef np.ndarray[np.float64_t, ndim=1, mode="c"] q = None * cdef double *q_data_ptr * if penalty_type != L2: # <<<<<<<<<<<<<< @@ -4860,7 +4913,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * __pyx_t_8 = (__pyx_v_penalty_type != 2); if (__pyx_t_8) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":325 + /* "scikits/learn/linear_model/sgd_fast.pyx":325 * cdef double *q_data_ptr * if penalty_type != L2: * q = np.zeros((n_features,), dtype=np.float64, order="c") # <<<<<<<<<<<<<< @@ -4875,14 +4928,14 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * __pyx_t_5 = PyLong_FromUnsignedLong(__pyx_v_n_features); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __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_GOTREF(((PyObject *)__pyx_t_5)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_3)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); @@ -4894,10 +4947,10 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__order), ((PyObject *)__pyx_n_s__c)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_1, __pyx_t_5, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = ((PyArrayObject *)__pyx_t_4); @@ -4923,7 +4976,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * __pyx_v_q = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":326 + /* "scikits/learn/linear_model/sgd_fast.pyx":326 * if penalty_type != L2: * q = np.zeros((n_features,), dtype=np.float64, order="c") * q_data_ptr = <double *> q.data # <<<<<<<<<<<<<< @@ -4935,7 +4988,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * } __pyx_L6:; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":327 + /* "scikits/learn/linear_model/sgd_fast.pyx":327 * q = np.zeros((n_features,), dtype=np.float64, order="c") * q_data_ptr = <double *> q.data * cdef double u = 0.0 # <<<<<<<<<<<<<< @@ -4944,7 +4997,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * */ __pyx_v_u = 0.0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":329 + /* "scikits/learn/linear_model/sgd_fast.pyx":329 * cdef double u = 0.0 * * cdef double typw = sqrt(1.0 / sqrt(alpha)) # <<<<<<<<<<<<<< @@ -4953,7 +5006,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * */ __pyx_v_typw = sqrt((1.0 / sqrt(__pyx_v_alpha))); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":331 + /* "scikits/learn/linear_model/sgd_fast.pyx":331 * cdef double typw = sqrt(1.0 / sqrt(alpha)) * * if learning_rate == OPTIMAL: # <<<<<<<<<<<<<< @@ -4963,19 +5016,19 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * __pyx_t_8 = (__pyx_v_learning_rate == 2); if (__pyx_t_8) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":333 + /* "scikits/learn/linear_model/sgd_fast.pyx":333 * if learning_rate == OPTIMAL: * # computing eta0, the initial learning rate * eta0 = typw / max(1.0, loss.dloss(-typw, 1.0)) # <<<<<<<<<<<<<< * else: * eta = eta0 */ - __pyx_v_eta0 = (__pyx_v_typw / __pyx_f_7sklearn_12linear_model_8sgd_fast_max(1.0, ((struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_LossFunction *)__pyx_v_loss->__pyx_vtab)->dloss(__pyx_v_loss, (-__pyx_v_typw), 1.0, 0))); + __pyx_v_eta0 = (__pyx_v_typw / __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_max(1.0, ((struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *)__pyx_v_loss->__pyx_vtab)->dloss(__pyx_v_loss, (-__pyx_v_typw), 1.0, 0))); goto __pyx_L7; } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":335 + /* "scikits/learn/linear_model/sgd_fast.pyx":335 * eta0 = typw / max(1.0, loss.dloss(-typw, 1.0)) * else: * eta = eta0 # <<<<<<<<<<<<<< @@ -4986,7 +5039,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * } __pyx_L7:; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":337 + /* "scikits/learn/linear_model/sgd_fast.pyx":337 * eta = eta0 * * if learning_rate == OPTIMAL: # <<<<<<<<<<<<<< @@ -4996,7 +5049,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * __pyx_t_8 = (__pyx_v_learning_rate == 2); if (__pyx_t_8) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":339 + /* "scikits/learn/linear_model/sgd_fast.pyx":339 * if learning_rate == OPTIMAL: * # initialize t such that eta at first example equals eta0 * t = 1.0 / (eta0 * alpha) # <<<<<<<<<<<<<< @@ -5008,7 +5061,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":341 + /* "scikits/learn/linear_model/sgd_fast.pyx":341 * t = 1.0 / (eta0 * alpha) * else: * t = 1.0 # <<<<<<<<<<<<<< @@ -5019,7 +5072,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * } __pyx_L8:; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":343 + /* "scikits/learn/linear_model/sgd_fast.pyx":343 * t = 1.0 * * t_start = time() # <<<<<<<<<<<<<< @@ -5035,7 +5088,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * __pyx_v_t_start = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":344 + /* "scikits/learn/linear_model/sgd_fast.pyx":344 * * t_start = time() * for epoch from 0 <= epoch < n_iter: # <<<<<<<<<<<<<< @@ -5045,7 +5098,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * __pyx_t_9 = __pyx_v_n_iter; for (__pyx_v_epoch = 0; __pyx_v_epoch < __pyx_t_9; __pyx_v_epoch++) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":345 + /* "scikits/learn/linear_model/sgd_fast.pyx":345 * t_start = time() * for epoch from 0 <= epoch < n_iter: * if verbose > 0: # <<<<<<<<<<<<<< @@ -5055,35 +5108,34 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * __pyx_t_8 = (__pyx_v_verbose > 0); if (__pyx_t_8) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":346 + /* "scikits/learn/linear_model/sgd_fast.pyx":346 * for epoch from 0 <= epoch < n_iter: * if verbose > 0: * print("-- Epoch %d" % (epoch + 1)) # <<<<<<<<<<<<<< * if shuffle: * np.random.RandomState(seed).shuffle(index) */ - __pyx_t_3 = PyLong_FromUnsignedLong((__pyx_v_epoch + 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong((__pyx_v_epoch + 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_1), __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_PrintOne(__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_PrintOne(0, ((PyObject *)__pyx_t_4)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; goto __pyx_L11; } __pyx_L11:; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":347 + /* "scikits/learn/linear_model/sgd_fast.pyx":347 * if verbose > 0: * print("-- Epoch %d" % (epoch + 1)) * if shuffle: # <<<<<<<<<<<<<< * np.random.RandomState(seed).shuffle(index) * for i from 0 <= i < n_samples: */ - __pyx_t_13 = __pyx_v_shuffle; - if (__pyx_t_13) { + if (__pyx_v_shuffle) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":348 + /* "scikits/learn/linear_model/sgd_fast.pyx":348 * print("-- Epoch %d" % (epoch + 1)) * if shuffle: * np.random.RandomState(seed).shuffle(index) # <<<<<<<<<<<<<< @@ -5101,42 +5153,42 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * __pyx_t_3 = PyInt_FromLong(__pyx_v_seed); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__shuffle); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __Pyx_INCREF(((PyObject *)__pyx_v_index)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_index)); __Pyx_GIVEREF(((PyObject *)__pyx_v_index)); - __pyx_t_4 = PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L12; } __pyx_L12:; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":349 + /* "scikits/learn/linear_model/sgd_fast.pyx":349 * if shuffle: * np.random.RandomState(seed).shuffle(index) * for i from 0 <= i < n_samples: # <<<<<<<<<<<<<< * sample_idx = index_data_ptr[i] * */ - __pyx_t_14 = __pyx_v_n_samples; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_14; __pyx_v_i++) { + __pyx_t_13 = __pyx_v_n_samples; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_13; __pyx_v_i++) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":350 + /* "scikits/learn/linear_model/sgd_fast.pyx":350 * np.random.RandomState(seed).shuffle(index) * for i from 0 <= i < n_samples: * sample_idx = index_data_ptr[i] # <<<<<<<<<<<<<< @@ -5145,7 +5197,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * */ __pyx_v_sample_idx = (__pyx_v_index_data_ptr[__pyx_v_i]); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":353 + /* "scikits/learn/linear_model/sgd_fast.pyx":353 * * # row offset in elem * offset = row_stride * sample_idx / elem_stride # <<<<<<<<<<<<<< @@ -5154,7 +5206,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * */ __pyx_v_offset = ((__pyx_v_row_stride * __pyx_v_sample_idx) / __pyx_v_elem_stride); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":354 + /* "scikits/learn/linear_model/sgd_fast.pyx":354 * # row offset in elem * offset = row_stride * sample_idx / elem_stride * y = Y_data_ptr[sample_idx] # <<<<<<<<<<<<<< @@ -5163,17 +5215,25 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * */ __pyx_v_y = (__pyx_v_Y_data_ptr[__pyx_v_sample_idx]); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":355 + /* "scikits/learn/linear_model/sgd_fast.pyx":357 + * if learning_rate == OPTIMAL: + * eta = 1.0 / (alpha * t) + * elif learning_rate == INVSCALING: # <<<<<<<<<<<<<< + * eta = eta0 / pow(t, power_t) + * p = (dot(w_data_ptr, X_data_ptr, offset, n_features) * wscale + */ + switch (__pyx_v_learning_rate) { + + /* "scikits/learn/linear_model/sgd_fast.pyx":355 * offset = row_stride * sample_idx / elem_stride * y = Y_data_ptr[sample_idx] * if learning_rate == OPTIMAL: # <<<<<<<<<<<<<< * eta = 1.0 / (alpha * t) * elif learning_rate == INVSCALING: */ - switch (__pyx_v_learning_rate) { case 2: - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":356 + /* "scikits/learn/linear_model/sgd_fast.pyx":356 * y = Y_data_ptr[sample_idx] * if learning_rate == OPTIMAL: * eta = 1.0 / (alpha * t) # <<<<<<<<<<<<<< @@ -5183,7 +5243,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * __pyx_v_eta = (1.0 / (__pyx_v_alpha * __pyx_v_t)); break; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":357 + /* "scikits/learn/linear_model/sgd_fast.pyx":357 * if learning_rate == OPTIMAL: * eta = 1.0 / (alpha * t) * elif learning_rate == INVSCALING: # <<<<<<<<<<<<<< @@ -5192,7 +5252,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * */ case 3: - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":358 + /* "scikits/learn/linear_model/sgd_fast.pyx":358 * eta = 1.0 / (alpha * t) * elif learning_rate == INVSCALING: * eta = eta0 / pow(t, power_t) # <<<<<<<<<<<<<< @@ -5203,35 +5263,35 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * break; } - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":360 + /* "scikits/learn/linear_model/sgd_fast.pyx":360 * eta = eta0 / pow(t, power_t) * p = (dot(w_data_ptr, X_data_ptr, offset, n_features) * wscale * ) + intercept # <<<<<<<<<<<<<< * sumloss += loss.loss(p, y) * if y > 0: */ - __pyx_v_p = ((__pyx_f_7sklearn_12linear_model_8sgd_fast_dot(__pyx_v_w_data_ptr, __pyx_v_X_data_ptr, __pyx_v_offset, __pyx_v_n_features) * __pyx_v_wscale) + __pyx_v_intercept); + __pyx_v_p = ((__pyx_f_7scikits_5learn_12linear_model_8sgd_fast_dot(__pyx_v_w_data_ptr, __pyx_v_X_data_ptr, __pyx_v_offset, __pyx_v_n_features) * __pyx_v_wscale) + __pyx_v_intercept); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":361 + /* "scikits/learn/linear_model/sgd_fast.pyx":361 * p = (dot(w_data_ptr, X_data_ptr, offset, n_features) * wscale * ) + intercept * sumloss += loss.loss(p, y) # <<<<<<<<<<<<<< * if y > 0: * class_weight = weight_pos */ - __pyx_v_sumloss += ((struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_LossFunction *)__pyx_v_loss->__pyx_vtab)->loss(__pyx_v_loss, __pyx_v_p, __pyx_v_y, 0); + __pyx_v_sumloss = (__pyx_v_sumloss + ((struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *)__pyx_v_loss->__pyx_vtab)->loss(__pyx_v_loss, __pyx_v_p, __pyx_v_y, 0)); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":362 + /* "scikits/learn/linear_model/sgd_fast.pyx":362 * ) + intercept * sumloss += loss.loss(p, y) * if y > 0: # <<<<<<<<<<<<<< * class_weight = weight_pos * else: */ - __pyx_t_8 = (__pyx_v_y > 0); + __pyx_t_8 = (__pyx_v_y > 0.0); if (__pyx_t_8) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":363 + /* "scikits/learn/linear_model/sgd_fast.pyx":363 * sumloss += loss.loss(p, y) * if y > 0: * class_weight = weight_pos # <<<<<<<<<<<<<< @@ -5243,7 +5303,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":365 + /* "scikits/learn/linear_model/sgd_fast.pyx":365 * class_weight = weight_pos * else: * class_weight = weight_neg # <<<<<<<<<<<<<< @@ -5254,16 +5314,16 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * } __pyx_L15:; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":367 + /* "scikits/learn/linear_model/sgd_fast.pyx":367 * class_weight = weight_neg * update = eta * loss.dloss(p, y) * class_weight * \ * sample_weight_data[sample_idx] # <<<<<<<<<<<<<< * if update != 0.0: * add(w_data_ptr, wscale, X_data_ptr, offset, n_features, -update) */ - __pyx_v_update = (((__pyx_v_eta * ((struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_LossFunction *)__pyx_v_loss->__pyx_vtab)->dloss(__pyx_v_loss, __pyx_v_p, __pyx_v_y, 0)) * __pyx_v_class_weight) * (__pyx_v_sample_weight_data[__pyx_v_sample_idx])); + __pyx_v_update = (((__pyx_v_eta * ((struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *)__pyx_v_loss->__pyx_vtab)->dloss(__pyx_v_loss, __pyx_v_p, __pyx_v_y, 0)) * __pyx_v_class_weight) * (__pyx_v_sample_weight_data[__pyx_v_sample_idx])); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":368 + /* "scikits/learn/linear_model/sgd_fast.pyx":368 * update = eta * loss.dloss(p, y) * class_weight * \ * sample_weight_data[sample_idx] * if update != 0.0: # <<<<<<<<<<<<<< @@ -5273,16 +5333,16 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * __pyx_t_8 = (__pyx_v_update != 0.0); if (__pyx_t_8) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":369 + /* "scikits/learn/linear_model/sgd_fast.pyx":369 * sample_weight_data[sample_idx] * if update != 0.0: * add(w_data_ptr, wscale, X_data_ptr, offset, n_features, -update) # <<<<<<<<<<<<<< * if fit_intercept == 1: * intercept -= update */ - __pyx_f_7sklearn_12linear_model_8sgd_fast_add(__pyx_v_w_data_ptr, __pyx_v_wscale, __pyx_v_X_data_ptr, __pyx_v_offset, __pyx_v_n_features, (-__pyx_v_update)); + __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_add(__pyx_v_w_data_ptr, __pyx_v_wscale, __pyx_v_X_data_ptr, __pyx_v_offset, __pyx_v_n_features, (-__pyx_v_update)); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":370 + /* "scikits/learn/linear_model/sgd_fast.pyx":370 * if update != 0.0: * add(w_data_ptr, wscale, X_data_ptr, offset, n_features, -update) * if fit_intercept == 1: # <<<<<<<<<<<<<< @@ -5292,14 +5352,14 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * __pyx_t_8 = (__pyx_v_fit_intercept == 1); if (__pyx_t_8) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":371 + /* "scikits/learn/linear_model/sgd_fast.pyx":371 * add(w_data_ptr, wscale, X_data_ptr, offset, n_features, -update) * if fit_intercept == 1: * intercept -= update # <<<<<<<<<<<<<< * if penalty_type != L1: * wscale *= (1.0 - (rho * eta * alpha)) */ - __pyx_v_intercept -= __pyx_v_update; + __pyx_v_intercept = (__pyx_v_intercept - __pyx_v_update); goto __pyx_L17; } __pyx_L17:; @@ -5307,7 +5367,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * } __pyx_L16:; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":372 + /* "scikits/learn/linear_model/sgd_fast.pyx":372 * if fit_intercept == 1: * intercept -= update * if penalty_type != L1: # <<<<<<<<<<<<<< @@ -5317,26 +5377,26 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * __pyx_t_8 = (__pyx_v_penalty_type != 1); if (__pyx_t_8) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":373 + /* "scikits/learn/linear_model/sgd_fast.pyx":373 * intercept -= update * if penalty_type != L1: * wscale *= (1.0 - (rho * eta * alpha)) # <<<<<<<<<<<<<< * if wscale < 1e-9: * w *= wscale */ - __pyx_v_wscale *= (1.0 - ((__pyx_v_rho * __pyx_v_eta) * __pyx_v_alpha)); + __pyx_v_wscale = (__pyx_v_wscale * (1.0 - ((__pyx_v_rho * __pyx_v_eta) * __pyx_v_alpha))); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":374 + /* "scikits/learn/linear_model/sgd_fast.pyx":374 * if penalty_type != L1: * wscale *= (1.0 - (rho * eta * alpha)) * if wscale < 1e-9: # <<<<<<<<<<<<<< * w *= wscale * wscale = 1.0 */ - __pyx_t_8 = (__pyx_v_wscale < 1.0000000000000001e-09); + __pyx_t_8 = (__pyx_v_wscale < 1e-9); if (__pyx_t_8) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":375 + /* "scikits/learn/linear_model/sgd_fast.pyx":375 * wscale *= (1.0 - (rho * eta * alpha)) * if wscale < 1e-9: * w *= wscale # <<<<<<<<<<<<<< @@ -5347,14 +5407,14 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyNumber_InPlaceMultiply(((PyObject *)__pyx_v_w), __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_15 = ((PyArrayObject *)__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_w); - __pyx_t_13 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_w, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack); - if (unlikely(__pyx_t_13 < 0)) { + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_w, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_w, (PyObject*)__pyx_v_w, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) { Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); @@ -5365,14 +5425,14 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * } __pyx_bstride_0_w = __pyx_bstruct_w.strides[0]; __pyx_bshape_0_w = __pyx_bstruct_w.shape[0]; - if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_15 = 0; + __pyx_t_14 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_w)); __pyx_v_w = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":376 + /* "scikits/learn/linear_model/sgd_fast.pyx":376 * if wscale < 1e-9: * w *= wscale * wscale = 1.0 # <<<<<<<<<<<<<< @@ -5387,7 +5447,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * } __pyx_L18:; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":377 + /* "scikits/learn/linear_model/sgd_fast.pyx":377 * w *= wscale * wscale = 1.0 * if penalty_type == L1 or penalty_type == ELASTICNET: # <<<<<<<<<<<<<< @@ -5398,46 +5458,46 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * case 1: case 3: - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":378 + /* "scikits/learn/linear_model/sgd_fast.pyx":378 * wscale = 1.0 * if penalty_type == L1 or penalty_type == ELASTICNET: * u += ((1.0 - rho) * eta * alpha) # <<<<<<<<<<<<<< * l1penalty(w_data_ptr, wscale, q_data_ptr, n_features, u) * t += 1 */ - __pyx_v_u += (((1.0 - __pyx_v_rho) * __pyx_v_eta) * __pyx_v_alpha); + __pyx_v_u = (__pyx_v_u + (((1.0 - __pyx_v_rho) * __pyx_v_eta) * __pyx_v_alpha)); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":379 + /* "scikits/learn/linear_model/sgd_fast.pyx":379 * if penalty_type == L1 or penalty_type == ELASTICNET: * u += ((1.0 - rho) * eta * alpha) * l1penalty(w_data_ptr, wscale, q_data_ptr, n_features, u) # <<<<<<<<<<<<<< * t += 1 * count += 1 */ - __pyx_f_7sklearn_12linear_model_8sgd_fast_l1penalty(__pyx_v_w_data_ptr, __pyx_v_wscale, __pyx_v_q_data_ptr, __pyx_v_n_features, __pyx_v_u); + __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_l1penalty(__pyx_v_w_data_ptr, __pyx_v_wscale, __pyx_v_q_data_ptr, __pyx_v_n_features, __pyx_v_u); break; } - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":380 + /* "scikits/learn/linear_model/sgd_fast.pyx":380 * u += ((1.0 - rho) * eta * alpha) * l1penalty(w_data_ptr, wscale, q_data_ptr, n_features, u) * t += 1 # <<<<<<<<<<<<<< * count += 1 * */ - __pyx_v_t += 1; + __pyx_v_t = (__pyx_v_t + 1.0); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":381 + /* "scikits/learn/linear_model/sgd_fast.pyx":381 * l1penalty(w_data_ptr, wscale, q_data_ptr, n_features, u) * t += 1 * count += 1 # <<<<<<<<<<<<<< * * # report epoche information */ - __pyx_v_count += 1; + __pyx_v_count = (__pyx_v_count + 1); } - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":384 + /* "scikits/learn/linear_model/sgd_fast.pyx":384 * * # report epoche information * if verbose > 0: # <<<<<<<<<<<<<< @@ -5447,7 +5507,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * __pyx_t_8 = (__pyx_v_verbose > 0); if (__pyx_t_8) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":385 + /* "scikits/learn/linear_model/sgd_fast.pyx":385 * # report epoche information * if verbose > 0: * wnorm = sqrt(np.dot(w, w) * wscale * wscale) # <<<<<<<<<<<<<< @@ -5460,17 +5520,17 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __Pyx_INCREF(((PyObject *)__pyx_v_w)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_w)); __Pyx_GIVEREF(((PyObject *)__pyx_v_w)); __Pyx_INCREF(((PyObject *)__pyx_v_w)); PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_w)); __Pyx_GIVEREF(((PyObject *)__pyx_v_w)); - __pyx_t_5 = PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __pyx_t_3 = PyFloat_FromDouble(__pyx_v_wscale); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyNumber_Multiply(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -5487,7 +5547,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_wnorm = sqrt(__pyx_t_16); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":387 + /* "scikits/learn/linear_model/sgd_fast.pyx":387 * wnorm = sqrt(np.dot(w, w) * wscale * wscale) * print("Norm: %.2f, NNZs: %d, "\ * "Bias: %.6f, T: %d, Avg. loss: %.6f" % (wnorm, # <<<<<<<<<<<<<< @@ -5497,7 +5557,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * __pyx_t_5 = PyFloat_FromDouble(__pyx_v_wnorm); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":388 + /* "scikits/learn/linear_model/sgd_fast.pyx":388 * print("Norm: %.2f, NNZs: %d, "\ * "Bias: %.6f, T: %d, Avg. loss: %.6f" % (wnorm, * w.nonzero()[0].shape[0], # <<<<<<<<<<<<<< @@ -5519,7 +5579,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":389 + /* "scikits/learn/linear_model/sgd_fast.pyx":389 * "Bias: %.6f, T: %d, Avg. loss: %.6f" % (wnorm, * w.nonzero()[0].shape[0], * intercept, count, # <<<<<<<<<<<<<< @@ -5531,7 +5591,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_v_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":390 + /* "scikits/learn/linear_model/sgd_fast.pyx":390 * w.nonzero()[0].shape[0], * intercept, count, * sumloss / count)) # <<<<<<<<<<<<<< @@ -5541,7 +5601,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * __pyx_t_2 = PyFloat_FromDouble((__pyx_v_sumloss / __pyx_v_count)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_17 = PyTuple_New(5); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_17); + __Pyx_GOTREF(((PyObject *)__pyx_t_17)); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_3); @@ -5557,13 +5617,13 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * __pyx_t_4 = 0; __pyx_t_1 = 0; __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_2), __pyx_t_17); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - if (__Pyx_PrintOne(__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_2), ((PyObject *)__pyx_t_17)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0; + if (__Pyx_PrintOne(0, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":391 + /* "scikits/learn/linear_model/sgd_fast.pyx":391 * intercept, count, * sumloss / count)) * print("Total training time: %.2f seconds." % (time() - t_start)) # <<<<<<<<<<<<<< @@ -5579,15 +5639,15 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __pyx_t_17 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_3), __pyx_t_2); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_17); + __Pyx_GOTREF(((PyObject *)__pyx_t_17)); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_PrintOne(__pyx_t_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + if (__Pyx_PrintOne(0, ((PyObject *)__pyx_t_17)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0; goto __pyx_L20; } __pyx_L20:; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":394 + /* "scikits/learn/linear_model/sgd_fast.pyx":394 * * # floating-point under-/overflow check. * if np.any(np.isinf(w)) or np.any(np.isnan(w)) \ # <<<<<<<<<<<<<< @@ -5605,28 +5665,28 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_17); + __Pyx_GOTREF(((PyObject *)__pyx_t_17)); __Pyx_INCREF(((PyObject *)__pyx_v_w)); PyTuple_SET_ITEM(__pyx_t_17, 0, ((PyObject *)__pyx_v_w)); __Pyx_GIVEREF(((PyObject *)__pyx_v_w)); - __pyx_t_4 = PyObject_Call(__pyx_t_1, __pyx_t_17, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_17), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0; __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_17); + __Pyx_GOTREF(((PyObject *)__pyx_t_17)); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_2, __pyx_t_17, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_17), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __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_17); __pyx_t_17 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_8) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":395 + /* "scikits/learn/linear_model/sgd_fast.pyx":395 * # floating-point under-/overflow check. * if np.any(np.isinf(w)) or np.any(np.isnan(w)) \ * or np.isnan(intercept) or np.isinf(intercept): # <<<<<<<<<<<<<< @@ -5639,7 +5699,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":394 + /* "scikits/learn/linear_model/sgd_fast.pyx":394 * * # floating-point under-/overflow check. * if np.any(np.isinf(w)) or np.any(np.isnan(w)) \ # <<<<<<<<<<<<<< @@ -5652,28 +5712,28 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * __Pyx_GOTREF(__pyx_t_2); __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 = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); __Pyx_INCREF(((PyObject *)__pyx_v_w)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_w)); __Pyx_GIVEREF(((PyObject *)__pyx_v_w)); - __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __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_DECREF(((PyObject *)__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 = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_17, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_17, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_18 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_18) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":395 + /* "scikits/learn/linear_model/sgd_fast.pyx":395 * # floating-point under-/overflow check. * if np.any(np.isinf(w)) or np.any(np.isnan(w)) \ * or np.isnan(intercept) or np.isinf(intercept): # <<<<<<<<<<<<<< @@ -5688,14 +5748,14 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * __pyx_t_1 = PyFloat_FromDouble(__pyx_v_intercept); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_17); + __Pyx_GOTREF(((PyObject *)__pyx_t_17)); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_4, __pyx_t_17, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_17), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __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_17); __pyx_t_17 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0; __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_19) { @@ -5707,14 +5767,14 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * __pyx_t_1 = PyFloat_FromDouble(__pyx_v_intercept); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_17, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_17, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_20 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_21 = __pyx_t_20; @@ -5731,47 +5791,41 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * } if (__pyx_t_18) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":396 + /* "scikits/learn/linear_model/sgd_fast.pyx":396 * if np.any(np.isinf(w)) or np.any(np.isnan(w)) \ * or np.isnan(intercept) or np.isinf(intercept): * raise ValueError("floating-point under-/overflow occured.") # <<<<<<<<<<<<<< * * w *= wscale */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_4)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_4)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_4)); - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_1, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L21; } __pyx_L21:; } - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":398 + /* "scikits/learn/linear_model/sgd_fast.pyx":398 * raise ValueError("floating-point under-/overflow occured.") * * w *= wscale # <<<<<<<<<<<<<< * return w, intercept * */ - __pyx_t_4 = PyFloat_FromDouble(__pyx_v_wscale); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyNumber_InPlaceMultiply(((PyObject *)__pyx_v_w), __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_wscale); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_15 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_4 = PyNumber_InPlaceMultiply(((PyObject *)__pyx_v_w), __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_w); - __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_w, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack); + __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_w, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack); if (unlikely(__pyx_t_9 < 0)) { PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_w, (PyObject*)__pyx_v_w, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) { @@ -5785,12 +5839,12 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * __pyx_bshape_0_w = __pyx_bstruct_w.shape[0]; if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_15 = 0; + __pyx_t_14 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_w)); - __pyx_v_w = ((PyArrayObject *)__pyx_t_1); - __pyx_t_1 = 0; + __pyx_v_w = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":399 + /* "scikits/learn/linear_model/sgd_fast.pyx":399 * * w *= wscale * return w, intercept # <<<<<<<<<<<<<< @@ -5798,18 +5852,18 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_intercept); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyFloat_FromDouble(__pyx_v_intercept); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_INCREF(((PyObject *)__pyx_v_w)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_w)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_w)); __Pyx_GIVEREF(((PyObject *)__pyx_v_w)); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; - __pyx_r = __pyx_t_4; + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = ((PyObject *)__pyx_t_1); + __pyx_t_1 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -5830,7 +5884,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * __Pyx_SafeReleaseBuffer(&__pyx_bstruct_q); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_w); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.plain_sgd"); + __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.plain_sgd"); __pyx_r = NULL; goto __pyx_L2; __pyx_L0:; @@ -5845,16 +5899,12 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * __Pyx_XDECREF((PyObject *)__pyx_v_q); __Pyx_DECREF(__pyx_v_t_start); __Pyx_DECREF((PyObject *)__pyx_v_w); - __Pyx_DECREF((PyObject *)__pyx_v_loss); - __Pyx_DECREF((PyObject *)__pyx_v_X); - __Pyx_DECREF((PyObject *)__pyx_v_Y); - __Pyx_DECREF((PyObject *)__pyx_v_sample_weight); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":402 +/* "scikits/learn/linear_model/sgd_fast.pyx":402 * * * cdef inline double max(double a, double b): # <<<<<<<<<<<<<< @@ -5862,12 +5912,12 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(PyObject * * */ -static CYTHON_INLINE double __pyx_f_7sklearn_12linear_model_8sgd_fast_max(double __pyx_v_a, double __pyx_v_b) { +static CYTHON_INLINE double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_max(double __pyx_v_a, double __pyx_v_b) { double __pyx_r; double __pyx_t_1; __Pyx_RefNannySetupContext("max"); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":403 + /* "scikits/learn/linear_model/sgd_fast.pyx":403 * * cdef inline double max(double a, double b): * return a if a >= b else b # <<<<<<<<<<<<<< @@ -5888,7 +5938,7 @@ static CYTHON_INLINE double __pyx_f_7sklearn_12linear_model_8sgd_fast_max(double return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":406 +/* "scikits/learn/linear_model/sgd_fast.pyx":406 * * * cdef inline double min(double a, double b): # <<<<<<<<<<<<<< @@ -5896,12 +5946,12 @@ static CYTHON_INLINE double __pyx_f_7sklearn_12linear_model_8sgd_fast_max(double * */ -static CYTHON_INLINE double __pyx_f_7sklearn_12linear_model_8sgd_fast_min(double __pyx_v_a, double __pyx_v_b) { +static CYTHON_INLINE double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_min(double __pyx_v_a, double __pyx_v_b) { double __pyx_r; double __pyx_t_1; __Pyx_RefNannySetupContext("min"); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":407 + /* "scikits/learn/linear_model/sgd_fast.pyx":407 * * cdef inline double min(double a, double b): * return a if a <= b else b # <<<<<<<<<<<<<< @@ -5922,7 +5972,7 @@ static CYTHON_INLINE double __pyx_f_7sklearn_12linear_model_8sgd_fast_min(double return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":410 +/* "scikits/learn/linear_model/sgd_fast.pyx":410 * * * cdef double dot(double *w_data_ptr, double *X_data_ptr, # <<<<<<<<<<<<<< @@ -5930,14 +5980,14 @@ static CYTHON_INLINE double __pyx_f_7sklearn_12linear_model_8sgd_fast_min(double * cdef double sum = 0.0 */ -static double __pyx_f_7sklearn_12linear_model_8sgd_fast_dot(double *__pyx_v_w_data_ptr, double *__pyx_v_X_data_ptr, int __pyx_v_offset, unsigned int __pyx_v_n_features) { +static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_dot(double *__pyx_v_w_data_ptr, double *__pyx_v_X_data_ptr, int __pyx_v_offset, unsigned int __pyx_v_n_features) { double __pyx_v_sum; int __pyx_v_j; double __pyx_r; unsigned int __pyx_t_1; __Pyx_RefNannySetupContext("dot"); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":412 + /* "scikits/learn/linear_model/sgd_fast.pyx":412 * cdef double dot(double *w_data_ptr, double *X_data_ptr, * int offset, unsigned int n_features): * cdef double sum = 0.0 # <<<<<<<<<<<<<< @@ -5946,7 +5996,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_dot(double *__pyx_v_w_d */ __pyx_v_sum = 0.0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":414 + /* "scikits/learn/linear_model/sgd_fast.pyx":414 * cdef double sum = 0.0 * cdef int j * for j from 0 <= j < n_features: # <<<<<<<<<<<<<< @@ -5956,17 +6006,17 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_dot(double *__pyx_v_w_d __pyx_t_1 = __pyx_v_n_features; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_1; __pyx_v_j++) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":415 + /* "scikits/learn/linear_model/sgd_fast.pyx":415 * cdef int j * for j from 0 <= j < n_features: * sum += w_data_ptr[j] * X_data_ptr[offset + j] # <<<<<<<<<<<<<< * return sum * */ - __pyx_v_sum += ((__pyx_v_w_data_ptr[__pyx_v_j]) * (__pyx_v_X_data_ptr[(__pyx_v_offset + __pyx_v_j)])); + __pyx_v_sum = (__pyx_v_sum + ((__pyx_v_w_data_ptr[__pyx_v_j]) * (__pyx_v_X_data_ptr[(__pyx_v_offset + __pyx_v_j)]))); } - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":416 + /* "scikits/learn/linear_model/sgd_fast.pyx":416 * for j from 0 <= j < n_features: * sum += w_data_ptr[j] * X_data_ptr[offset + j] * return sum # <<<<<<<<<<<<<< @@ -5982,7 +6032,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_dot(double *__pyx_v_w_d return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":419 +/* "scikits/learn/linear_model/sgd_fast.pyx":419 * * * cdef double add(double *w_data_ptr, double wscale, double *X_data_ptr, # <<<<<<<<<<<<<< @@ -5990,16 +6040,17 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_dot(double *__pyx_v_w_d * """Scales example x by constant c and adds it to the weight vector w""" */ -static double __pyx_f_7sklearn_12linear_model_8sgd_fast_add(double *__pyx_v_w_data_ptr, double __pyx_v_wscale, double *__pyx_v_X_data_ptr, int __pyx_v_offset, unsigned int __pyx_v_n_features, double __pyx_v_c) { +static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_add(double *__pyx_v_w_data_ptr, double __pyx_v_wscale, double *__pyx_v_X_data_ptr, int __pyx_v_offset, unsigned int __pyx_v_n_features, double __pyx_v_c) { int __pyx_v_j; double __pyx_v_val; double __pyx_v_innerprod; double __pyx_v_xsqnorm; double __pyx_r; unsigned int __pyx_t_1; + int __pyx_t_2; __Pyx_RefNannySetupContext("add"); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":425 + /* "scikits/learn/linear_model/sgd_fast.pyx":425 * cdef int idx * cdef double val * cdef double innerprod = 0.0 # <<<<<<<<<<<<<< @@ -6008,7 +6059,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_add(double *__pyx_v_w_d */ __pyx_v_innerprod = 0.0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":426 + /* "scikits/learn/linear_model/sgd_fast.pyx":426 * cdef double val * cdef double innerprod = 0.0 * cdef double xsqnorm = 0.0 # <<<<<<<<<<<<<< @@ -6017,7 +6068,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_add(double *__pyx_v_w_d */ __pyx_v_xsqnorm = 0.0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":427 + /* "scikits/learn/linear_model/sgd_fast.pyx":427 * cdef double innerprod = 0.0 * cdef double xsqnorm = 0.0 * for j from 0 <= j < n_features: # <<<<<<<<<<<<<< @@ -6027,7 +6078,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_add(double *__pyx_v_w_d __pyx_t_1 = __pyx_v_n_features; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_1; __pyx_v_j++) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":428 + /* "scikits/learn/linear_model/sgd_fast.pyx":428 * cdef double xsqnorm = 0.0 * for j from 0 <= j < n_features: * val = X_data_ptr[offset + j] # <<<<<<<<<<<<<< @@ -6036,35 +6087,36 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_add(double *__pyx_v_w_d */ __pyx_v_val = (__pyx_v_X_data_ptr[(__pyx_v_offset + __pyx_v_j)]); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":429 + /* "scikits/learn/linear_model/sgd_fast.pyx":429 * for j from 0 <= j < n_features: * val = X_data_ptr[offset + j] * innerprod += (w_data_ptr[j] * val) # <<<<<<<<<<<<<< * xsqnorm += (val * val) * w_data_ptr[j] += val * (c / wscale) */ - __pyx_v_innerprod += ((__pyx_v_w_data_ptr[__pyx_v_j]) * __pyx_v_val); + __pyx_v_innerprod = (__pyx_v_innerprod + ((__pyx_v_w_data_ptr[__pyx_v_j]) * __pyx_v_val)); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":430 + /* "scikits/learn/linear_model/sgd_fast.pyx":430 * val = X_data_ptr[offset + j] * innerprod += (w_data_ptr[j] * val) * xsqnorm += (val * val) # <<<<<<<<<<<<<< * w_data_ptr[j] += val * (c / wscale) * */ - __pyx_v_xsqnorm += (__pyx_v_val * __pyx_v_val); + __pyx_v_xsqnorm = (__pyx_v_xsqnorm + (__pyx_v_val * __pyx_v_val)); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":431 + /* "scikits/learn/linear_model/sgd_fast.pyx":431 * innerprod += (w_data_ptr[j] * val) * xsqnorm += (val * val) * w_data_ptr[j] += val * (c / wscale) # <<<<<<<<<<<<<< * * # TODO this is needed for PEGASOS only */ - (__pyx_v_w_data_ptr[__pyx_v_j]) += (__pyx_v_val * (__pyx_v_c / __pyx_v_wscale)); + __pyx_t_2 = __pyx_v_j; + (__pyx_v_w_data_ptr[__pyx_t_2]) = ((__pyx_v_w_data_ptr[__pyx_t_2]) + (__pyx_v_val * (__pyx_v_c / __pyx_v_wscale))); } - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":434 + /* "scikits/learn/linear_model/sgd_fast.pyx":434 * * # TODO this is needed for PEGASOS only * return (xsqnorm * c * c) + (2.0 * innerprod * wscale * c) # <<<<<<<<<<<<<< @@ -6080,7 +6132,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_add(double *__pyx_v_w_d return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":437 +/* "scikits/learn/linear_model/sgd_fast.pyx":437 * * * cdef void l1penalty(double *w_data_ptr, double wscale, double *q_data_ptr, # <<<<<<<<<<<<<< @@ -6088,15 +6140,16 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_add(double *__pyx_v_w_d * """Apply the L1 penalty to each updated feature */ -static void __pyx_f_7sklearn_12linear_model_8sgd_fast_l1penalty(double *__pyx_v_w_data_ptr, double __pyx_v_wscale, double *__pyx_v_q_data_ptr, unsigned int __pyx_v_n_features, double __pyx_v_u) { +static void __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_l1penalty(double *__pyx_v_w_data_ptr, double __pyx_v_wscale, double *__pyx_v_q_data_ptr, unsigned int __pyx_v_n_features, double __pyx_v_u) { double __pyx_v_z; int __pyx_v_j; int __pyx_v_idx; unsigned int __pyx_t_1; int __pyx_t_2; + int __pyx_t_3; __Pyx_RefNannySetupContext("l1penalty"); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":447 + /* "scikits/learn/linear_model/sgd_fast.pyx":447 * Empirical results look better this way... * """ * cdef double z = 0.0 # <<<<<<<<<<<<<< @@ -6105,7 +6158,7 @@ static void __pyx_f_7sklearn_12linear_model_8sgd_fast_l1penalty(double *__pyx_v */ __pyx_v_z = 0.0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":448 + /* "scikits/learn/linear_model/sgd_fast.pyx":448 * """ * cdef double z = 0.0 * cdef int j = 0 # <<<<<<<<<<<<<< @@ -6114,7 +6167,7 @@ static void __pyx_f_7sklearn_12linear_model_8sgd_fast_l1penalty(double *__pyx_v */ __pyx_v_j = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":449 + /* "scikits/learn/linear_model/sgd_fast.pyx":449 * cdef double z = 0.0 * cdef int j = 0 * cdef int idx = 0 # <<<<<<<<<<<<<< @@ -6123,7 +6176,7 @@ static void __pyx_f_7sklearn_12linear_model_8sgd_fast_l1penalty(double *__pyx_v */ __pyx_v_idx = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":450 + /* "scikits/learn/linear_model/sgd_fast.pyx":450 * cdef int j = 0 * cdef int idx = 0 * for j from 0 <= j < n_features: # <<<<<<<<<<<<<< @@ -6133,7 +6186,7 @@ static void __pyx_f_7sklearn_12linear_model_8sgd_fast_l1penalty(double *__pyx_v __pyx_t_1 = __pyx_v_n_features; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_1; __pyx_v_j++) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":451 + /* "scikits/learn/linear_model/sgd_fast.pyx":451 * cdef int idx = 0 * for j from 0 <= j < n_features: * z = w_data_ptr[j] # <<<<<<<<<<<<<< @@ -6142,7 +6195,7 @@ static void __pyx_f_7sklearn_12linear_model_8sgd_fast_l1penalty(double *__pyx_v */ __pyx_v_z = (__pyx_v_w_data_ptr[__pyx_v_j]); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":452 + /* "scikits/learn/linear_model/sgd_fast.pyx":452 * for j from 0 <= j < n_features: * z = w_data_ptr[j] * if (wscale * w_data_ptr[j]) > 0.0: # <<<<<<<<<<<<<< @@ -6152,18 +6205,18 @@ static void __pyx_f_7sklearn_12linear_model_8sgd_fast_l1penalty(double *__pyx_v __pyx_t_2 = ((__pyx_v_wscale * (__pyx_v_w_data_ptr[__pyx_v_j])) > 0.0); if (__pyx_t_2) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":453 + /* "scikits/learn/linear_model/sgd_fast.pyx":453 * z = w_data_ptr[j] * if (wscale * w_data_ptr[j]) > 0.0: * w_data_ptr[j] = max(0.0, w_data_ptr[j] - ((u + q_data_ptr[j]) # <<<<<<<<<<<<<< * / wscale)) * elif (wscale * w_data_ptr[j]) < 0.0: */ - (__pyx_v_w_data_ptr[__pyx_v_j]) = __pyx_f_7sklearn_12linear_model_8sgd_fast_max(0.0, ((__pyx_v_w_data_ptr[__pyx_v_j]) - ((__pyx_v_u + (__pyx_v_q_data_ptr[__pyx_v_j])) / __pyx_v_wscale))); + (__pyx_v_w_data_ptr[__pyx_v_j]) = __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_max(0.0, ((__pyx_v_w_data_ptr[__pyx_v_j]) - ((__pyx_v_u + (__pyx_v_q_data_ptr[__pyx_v_j])) / __pyx_v_wscale))); goto __pyx_L5; } - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":455 + /* "scikits/learn/linear_model/sgd_fast.pyx":455 * w_data_ptr[j] = max(0.0, w_data_ptr[j] - ((u + q_data_ptr[j]) * / wscale)) * elif (wscale * w_data_ptr[j]) < 0.0: # <<<<<<<<<<<<<< @@ -6173,30 +6226,31 @@ static void __pyx_f_7sklearn_12linear_model_8sgd_fast_l1penalty(double *__pyx_v __pyx_t_2 = ((__pyx_v_wscale * (__pyx_v_w_data_ptr[__pyx_v_j])) < 0.0); if (__pyx_t_2) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":456 + /* "scikits/learn/linear_model/sgd_fast.pyx":456 * / wscale)) * elif (wscale * w_data_ptr[j]) < 0.0: * w_data_ptr[j] = min(0.0, w_data_ptr[j] + ((u - q_data_ptr[j]) # <<<<<<<<<<<<<< * / wscale)) * q_data_ptr[j] += (wscale * (w_data_ptr[j] - z)) */ - (__pyx_v_w_data_ptr[__pyx_v_j]) = __pyx_f_7sklearn_12linear_model_8sgd_fast_min(0.0, ((__pyx_v_w_data_ptr[__pyx_v_j]) + ((__pyx_v_u - (__pyx_v_q_data_ptr[__pyx_v_j])) / __pyx_v_wscale))); + (__pyx_v_w_data_ptr[__pyx_v_j]) = __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_min(0.0, ((__pyx_v_w_data_ptr[__pyx_v_j]) + ((__pyx_v_u - (__pyx_v_q_data_ptr[__pyx_v_j])) / __pyx_v_wscale))); goto __pyx_L5; } __pyx_L5:; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":458 + /* "scikits/learn/linear_model/sgd_fast.pyx":458 * w_data_ptr[j] = min(0.0, w_data_ptr[j] + ((u - q_data_ptr[j]) * / wscale)) * q_data_ptr[j] += (wscale * (w_data_ptr[j] - z)) # <<<<<<<<<<<<<< */ - (__pyx_v_q_data_ptr[__pyx_v_j]) += (__pyx_v_wscale * ((__pyx_v_w_data_ptr[__pyx_v_j]) - __pyx_v_z)); + __pyx_t_3 = __pyx_v_j; + (__pyx_v_q_data_ptr[__pyx_t_3]) = ((__pyx_v_q_data_ptr[__pyx_t_3]) + (__pyx_v_wscale * ((__pyx_v_w_data_ptr[__pyx_v_j]) - __pyx_v_z))); } __Pyx_RefNannyFinishContext(); } -/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":187 +/* "numpy.pxd":188 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -6204,8 +6258,8 @@ static void __pyx_f_7sklearn_12linear_model_8sgd_fast_l1penalty(double *__pyx_v * # requirements, and does not yet fullfill the PEP. */ -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { +static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__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; @@ -6217,22 +6271,21 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf int __pyx_v_offset; int __pyx_v_hasfields; int __pyx_r; - int __pyx_t_1; + PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; + int __pyx_t_4; + int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; - int __pyx_t_8; + PyObject *__pyx_t_8 = NULL; char *__pyx_t_9; __Pyx_RefNannySetupContext("__getbuffer__"); if (__pyx_v_info == NULL) return 0; __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(__pyx_v_info->obj); - __Pyx_INCREF((PyObject *)__pyx_v_self); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":193 + /* "numpy.pxd":194 * # of flags * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -6241,7 +6294,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ __pyx_v_endian_detector = 1; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":194 + /* "numpy.pxd":195 * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -6250,26 +6303,29 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":196 + /* "numpy.pxd":197 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) * * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< * * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - __pyx_v_ndim = PyArray_NDIM(((PyArrayObject *)__pyx_v_self)); + __pyx_t_1 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_ndim = PyArray_NDIM(((PyArrayObject *)__pyx_t_1)); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":198 + /* "numpy.pxd":199 * 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))); - if (__pyx_t_1) { + __pyx_t_2 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); + if (__pyx_t_2) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":199 + /* "numpy.pxd":200 * * if sizeof(npy_intp) != sizeof(Py_ssize_t): * copy_shape = 1 # <<<<<<<<<<<<<< @@ -6281,7 +6337,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf } /*else*/ { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":201 + /* "numpy.pxd":202 * copy_shape = 1 * else: * copy_shape = 0 # <<<<<<<<<<<<<< @@ -6292,108 +6348,105 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf } __pyx_L5:; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":203 + /* "numpy.pxd":204 * 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_1 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS); - if (__pyx_t_1) { + __pyx_t_2 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS); + if (__pyx_t_2) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":204 + /* "numpy.pxd":205 * * 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(((PyArrayObject *)__pyx_v_self), NPY_C_CONTIGUOUS)); - __pyx_t_3 = __pyx_t_2; + __pyx_t_1 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_t_1), NPY_C_CONTIGUOUS)); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __pyx_t_3; } else { - __pyx_t_3 = __pyx_t_1; + __pyx_t_4 = __pyx_t_2; } - if (__pyx_t_3) { + if (__pyx_t_4) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":205 + /* "numpy.pxd":206 * 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_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(((PyObject *)__pyx_kp_u_5)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_u_5)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_5)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_7), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":207 + /* "numpy.pxd":208 * 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_3 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS); - if (__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS); + if (__pyx_t_4) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":208 + /* "numpy.pxd":209 * * 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_1 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_v_self), NPY_F_CONTIGUOUS)); - __pyx_t_2 = __pyx_t_1; + __pyx_t_1 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_t_1), NPY_F_CONTIGUOUS)); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __pyx_t_2; } else { - __pyx_t_2 = __pyx_t_3; + __pyx_t_3 = __pyx_t_4; } - if (__pyx_t_2) { + if (__pyx_t_3) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":209 + /* "numpy.pxd":210 * 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_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_INCREF(((PyObject *)__pyx_kp_u_6)); - PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_u_6)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_6)); - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_9), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L7; } __pyx_L7:; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":211 + /* "numpy.pxd":212 * 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(((PyArrayObject *)__pyx_v_self)); + __pyx_t_1 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_info->buf = PyArray_DATA(((PyArrayObject *)__pyx_t_1)); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":212 + /* "numpy.pxd":213 * * info.buf = PyArray_DATA(self) * info.ndim = ndim # <<<<<<<<<<<<<< @@ -6402,17 +6455,16 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ __pyx_v_info->ndim = __pyx_v_ndim; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":213 + /* "numpy.pxd":214 * 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_6 = __pyx_v_copy_shape; - if (__pyx_t_6) { + if (__pyx_v_copy_shape) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":216 + /* "numpy.pxd":217 * # Allocate new buffer for strides and shape info. This is allocated * # as one block, strides first. * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< @@ -6421,7 +6473,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * __pyx_v_ndim) * 2))); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":217 + /* "numpy.pxd":218 * # as one block, strides first. * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) * info.shape = info.strides + ndim # <<<<<<<<<<<<<< @@ -6430,60 +6482,72 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":218 + /* "numpy.pxd":219 * info.strides = <Py_ssize_t*>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_6 = __pyx_v_ndim; - for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { - __pyx_v_i = __pyx_t_7; + __pyx_t_5 = __pyx_v_ndim; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":219 + /* "numpy.pxd":220 * 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(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]); + __pyx_t_1 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_1); + (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(((PyArrayObject *)__pyx_t_1))[__pyx_v_i]); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":220 + /* "numpy.pxd":221 * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< * else: * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) */ - (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]); + __pyx_t_1 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_1); + (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(((PyArrayObject *)__pyx_t_1))[__pyx_v_i]); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } goto __pyx_L8; } /*else*/ { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":222 + /* "numpy.pxd":223 * info.shape[i] = PyArray_DIMS(self)[i] * else: * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) # <<<<<<<<<<<<<< * info.shape = <Py_ssize_t*>PyArray_DIMS(self) * info.suboffsets = NULL */ - __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(((PyArrayObject *)__pyx_v_self))); + __pyx_t_1 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(((PyArrayObject *)__pyx_t_1))); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":223 + /* "numpy.pxd":224 * else: * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) * info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<< * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) */ - __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(((PyArrayObject *)__pyx_v_self))); + __pyx_t_1 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(((PyArrayObject *)__pyx_t_1))); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L8:; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":224 + /* "numpy.pxd":225 * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) * info.shape = <Py_ssize_t*>PyArray_DIMS(self) * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -6492,25 +6556,31 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ __pyx_v_info->suboffsets = NULL; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":225 + /* "numpy.pxd":226 * info.shape = <Py_ssize_t*>PyArray_DIMS(self) * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< * info.readonly = not PyArray_ISWRITEABLE(self) * */ - __pyx_v_info->itemsize = PyArray_ITEMSIZE(((PyArrayObject *)__pyx_v_self)); + __pyx_t_1 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_info->itemsize = PyArray_ITEMSIZE(((PyArrayObject *)__pyx_t_1)); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":226 + /* "numpy.pxd":227 * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< * * cdef int t */ - __pyx_v_info->readonly = (!PyArray_ISWRITEABLE(((PyArrayObject *)__pyx_v_self))); + __pyx_t_1 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_info->readonly = (!PyArray_ISWRITEABLE(((PyArrayObject *)__pyx_t_1))); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":229 + /* "numpy.pxd":230 * * cdef int t * cdef char* f = NULL # <<<<<<<<<<<<<< @@ -6519,7 +6589,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ __pyx_v_f = NULL; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":230 + /* "numpy.pxd":231 * cdef int t * cdef char* f = NULL * cdef dtype descr = self.descr # <<<<<<<<<<<<<< @@ -6529,7 +6599,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_self)->descr)); __pyx_v_descr = ((PyArrayObject *)__pyx_v_self)->descr; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":234 + /* "numpy.pxd":235 * cdef int offset * * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< @@ -6538,23 +6608,23 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":236 + /* "numpy.pxd":237 * 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); - if (__pyx_t_2) { - __pyx_t_3 = (!__pyx_v_copy_shape); - __pyx_t_1 = __pyx_t_3; + __pyx_t_3 = (!__pyx_v_hasfields); + if (__pyx_t_3) { + __pyx_t_4 = (!__pyx_v_copy_shape); + __pyx_t_2 = __pyx_t_4; } else { - __pyx_t_1 = __pyx_t_2; + __pyx_t_2 = __pyx_t_3; } - if (__pyx_t_1) { + if (__pyx_t_2) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":238 + /* "numpy.pxd":239 * if not hasfields and not copy_shape: * # do not call releasebuffer * info.obj = None # <<<<<<<<<<<<<< @@ -6570,7 +6640,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf } /*else*/ { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":241 + /* "numpy.pxd":242 * else: * # need to call releasebuffer * info.obj = self # <<<<<<<<<<<<<< @@ -6585,17 +6655,17 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf } __pyx_L11:; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":243 + /* "numpy.pxd":244 * info.obj = self * * if not hasfields: # <<<<<<<<<<<<<< * t = descr.type_num * if ((descr.byteorder == '>' and little_endian) or */ - __pyx_t_1 = (!__pyx_v_hasfields); - if (__pyx_t_1) { + __pyx_t_2 = (!__pyx_v_hasfields); + if (__pyx_t_2) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":244 + /* "numpy.pxd":245 * * if not hasfields: * t = descr.type_num # <<<<<<<<<<<<<< @@ -6604,312 +6674,306 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ __pyx_v_t = __pyx_v_descr->type_num; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":245 + /* "numpy.pxd":246 * if not hasfields: * t = descr.type_num * if ((descr.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< * (descr.byteorder == '<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") */ - __pyx_t_1 = (__pyx_v_descr->byteorder == '>'); - if (__pyx_t_1) { - __pyx_t_2 = __pyx_v_little_endian; + __pyx_t_2 = (__pyx_v_descr->byteorder == '>'); + if (__pyx_t_2) { + __pyx_t_3 = __pyx_v_little_endian; } else { - __pyx_t_2 = __pyx_t_1; + __pyx_t_3 = __pyx_t_2; } - if (!__pyx_t_2) { + if (!__pyx_t_3) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":246 + /* "numpy.pxd":247 * t = descr.type_num * if ((descr.byteorder == '>' and little_endian) or * (descr.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" */ - __pyx_t_1 = (__pyx_v_descr->byteorder == '<'); - if (__pyx_t_1) { - __pyx_t_3 = (!__pyx_v_little_endian); - __pyx_t_8 = __pyx_t_3; + __pyx_t_2 = (__pyx_v_descr->byteorder == '<'); + if (__pyx_t_2) { + __pyx_t_4 = (!__pyx_v_little_endian); + __pyx_t_7 = __pyx_t_4; } else { - __pyx_t_8 = __pyx_t_1; + __pyx_t_7 = __pyx_t_2; } - __pyx_t_1 = __pyx_t_8; + __pyx_t_2 = __pyx_t_7; } else { - __pyx_t_1 = __pyx_t_2; + __pyx_t_2 = __pyx_t_3; } - if (__pyx_t_1) { + if (__pyx_t_2) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":247 + /* "numpy.pxd":248 * if ((descr.byteorder == '>' and little_endian) or * (descr.byteorder == '<' 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_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(((PyObject *)__pyx_kp_u_7)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_u_7)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_7)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_11), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L13; } __pyx_L13:; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":248 + /* "numpy.pxd":249 * (descr.byteorder == '<' 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_BYTE); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_BYTE); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__b; goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":249 + /* "numpy.pxd":250 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_UBYTE); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_UBYTE); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__B; goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":250 + /* "numpy.pxd":251 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_SHORT); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_SHORT); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__h; goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":251 + /* "numpy.pxd":252 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_USHORT); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_USHORT); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__H; goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":252 + /* "numpy.pxd":253 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_INT); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_INT); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__i; goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":253 + /* "numpy.pxd":254 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_UINT); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_UINT); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__I; goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":254 + /* "numpy.pxd":255 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_LONG); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_LONG); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__l; goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":255 + /* "numpy.pxd":256 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_ULONG); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_ULONG); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__L; goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":256 + /* "numpy.pxd":257 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_LONGLONG); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_LONGLONG); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__q; goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":257 + /* "numpy.pxd":258 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_ULONGLONG); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_ULONGLONG); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__Q; goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":258 + /* "numpy.pxd":259 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_FLOAT); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_FLOAT); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__f; goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":259 + /* "numpy.pxd":260 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_DOUBLE); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_DOUBLE); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__d; goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":260 + /* "numpy.pxd":261 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_LONGDOUBLE); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_LONGDOUBLE); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__g; goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":261 + /* "numpy.pxd":262 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_CFLOAT); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_CFLOAT); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__Zf; goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":262 + /* "numpy.pxd":263 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_CDOUBLE); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_CDOUBLE); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__Zd; goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":263 + /* "numpy.pxd":264 * 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: */ - __pyx_t_1 = (__pyx_v_t == NPY_CLONGDOUBLE); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_CLONGDOUBLE); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__Zg; goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":264 + /* "numpy.pxd":265 * 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) */ - __pyx_t_1 = (__pyx_v_t == NPY_OBJECT); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_OBJECT); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__O; goto __pyx_L14; } /*else*/ { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":266 + /* "numpy.pxd":267 * elif t == NPY_OBJECT: f = "O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< * info.format = f * return */ - __pyx_t_5 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_8), __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __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 = 0; - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_12), __pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_8)); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_8)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_8)); + __pyx_t_8 = 0; + __pyx_t_8 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_8, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L14:; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":267 + /* "numpy.pxd":268 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f # <<<<<<<<<<<<<< @@ -6918,7 +6982,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ __pyx_v_info->format = __pyx_v_f; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":268 + /* "numpy.pxd":269 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f * return # <<<<<<<<<<<<<< @@ -6931,7 +6995,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf } /*else*/ { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":270 + /* "numpy.pxd":271 * return * else: * info.format = <char*>stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< @@ -6940,7 +7004,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ __pyx_v_info->format = ((char *)malloc(255)); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":271 + /* "numpy.pxd":272 * else: * info.format = <char*>stdlib.malloc(_buffer_format_string_len) * info.format[0] = '^' # Native data types, manual alignment # <<<<<<<<<<<<<< @@ -6949,7 +7013,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ (__pyx_v_info->format[0]) = '^'; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":272 + /* "numpy.pxd":273 * info.format = <char*>stdlib.malloc(_buffer_format_string_len) * info.format[0] = '^' # Native data types, manual alignment * offset = 0 # <<<<<<<<<<<<<< @@ -6958,17 +7022,17 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ __pyx_v_offset = 0; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":275 + /* "numpy.pxd":276 * f = _util_dtypestring(descr, info.format + 1, * info.format + _buffer_format_string_len, * &offset) # <<<<<<<<<<<<<< * f[0] = 0 # Terminate format string * */ - __pyx_t_9 = __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_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __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_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_f = __pyx_t_9; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":276 + /* "numpy.pxd":277 * info.format + _buffer_format_string_len, * &offset) * f[0] = 0 # Terminate format string # <<<<<<<<<<<<<< @@ -6982,8 +7046,8 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("numpy.ndarray.__getbuffer__"); __pyx_r = -1; __Pyx_GOTREF(__pyx_v_info->obj); @@ -6996,12 +7060,11 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf } __pyx_L2:; __Pyx_XDECREF((PyObject *)__pyx_v_descr); - __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":278 +/* "numpy.pxd":279 * f[0] = 0 # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -7009,23 +7072,26 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf * stdlib.free(info.format) */ -static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ -static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { - int __pyx_t_1; +static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray_1__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ +static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray_1__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; __Pyx_RefNannySetupContext("__releasebuffer__"); - __Pyx_INCREF((PyObject *)__pyx_v_self); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":279 + /* "numpy.pxd":280 * * 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(((PyArrayObject *)__pyx_v_self)); - if (__pyx_t_1) { + __pyx_t_1 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = PyArray_HASFIELDS(((PyArrayObject *)__pyx_t_1)); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":280 + /* "numpy.pxd":281 * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): * stdlib.free(info.format) # <<<<<<<<<<<<<< @@ -7037,17 +7103,17 @@ static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, P } __pyx_L5:; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":281 + /* "numpy.pxd":282 * 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))); - if (__pyx_t_1) { + __pyx_t_2 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); + if (__pyx_t_2) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":282 + /* "numpy.pxd":283 * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): * stdlib.free(info.strides) # <<<<<<<<<<<<<< @@ -7059,11 +7125,10 @@ static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, P } __pyx_L6:; - __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_RefNannyFinishContext(); } -/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":755 +/* "numpy.pxd":756 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -7076,7 +7141,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1"); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":756 + /* "numpy.pxd":757 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<< @@ -7084,7 +7149,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ * 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 = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -7102,7 +7167,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":758 +/* "numpy.pxd":759 * return PyArray_MultiIterNew(1, <void*>a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -7115,7 +7180,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2"); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":759 + /* "numpy.pxd":760 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<< @@ -7123,7 +7188,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ * 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 = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -7141,7 +7206,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":761 +/* "numpy.pxd":762 * return PyArray_MultiIterNew(2, <void*>a, <void*>b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -7154,7 +7219,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3"); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":762 + /* "numpy.pxd":763 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<< @@ -7162,7 +7227,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ * 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 = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -7180,7 +7245,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":764 +/* "numpy.pxd":765 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -7193,7 +7258,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4"); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":765 + /* "numpy.pxd":766 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<< @@ -7201,7 +7266,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ * 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 = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -7219,7 +7284,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":767 +/* "numpy.pxd":768 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -7232,7 +7297,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5"); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":768 + /* "numpy.pxd":769 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<< @@ -7240,7 +7305,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ * 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 = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -7258,7 +7323,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":770 +/* "numpy.pxd":771 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -7284,16 +7349,16 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx int __pyx_t_7; int __pyx_t_8; int __pyx_t_9; - char *__pyx_t_10; + long __pyx_t_10; + char *__pyx_t_11; __Pyx_RefNannySetupContext("_util_dtypestring"); - __Pyx_INCREF((PyObject *)__pyx_v_descr); __pyx_v_child = ((PyArray_Descr *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_fields = ((PyObject *)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_fields = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); __pyx_v_childname = Py_None; __Pyx_INCREF(Py_None); __pyx_v_new_offset = Py_None; __Pyx_INCREF(Py_None); __pyx_v_t = Py_None; __Pyx_INCREF(Py_None); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":777 + /* "numpy.pxd":778 * cdef int delta_offset * cdef tuple i * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -7302,7 +7367,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_endian_detector = 1; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":778 + /* "numpy.pxd":779 * cdef tuple i * cdef int endian_detector = 1 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -7311,18 +7376,17 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":781 + /* "numpy.pxd":782 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< * fields = descr.fields[childname] * child, new_offset = fields */ - if (likely(((PyObject *)__pyx_v_descr->names) != Py_None)) { - __pyx_t_1 = 0; __pyx_t_2 = ((PyObject *)__pyx_v_descr->names); __Pyx_INCREF(__pyx_t_2); - } else { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_v_descr->names == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = 0; __pyx_t_2 = ((PyObject *)__pyx_v_descr->names); __Pyx_INCREF(__pyx_t_2); for (;;) { if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break; __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; @@ -7330,21 +7394,21 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_v_childname = __pyx_t_3; __pyx_t_3 = 0; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":782 + /* "numpy.pxd":783 * * for childname in descr.names: * fields = descr.fields[childname] # <<<<<<<<<<<<<< * child, new_offset = fields * */ - __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (!__pyx_t_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (!__pyx_t_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_fields)); - __pyx_v_fields = ((PyObject *)__pyx_t_3); + __pyx_v_fields = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":783 + /* "numpy.pxd":784 * for childname in descr.names: * fields = descr.fields[childname] * child, new_offset = fields # <<<<<<<<<<<<<< @@ -7354,7 +7418,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx if (likely(((PyObject *)__pyx_v_fields) != Py_None) && likely(PyTuple_GET_SIZE(((PyObject *)__pyx_v_fields)) == 2)) { PyObject* tuple = ((PyObject *)__pyx_v_fields); __pyx_t_3 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_4); __Pyx_DECREF(((PyObject *)__pyx_v_child)); __pyx_v_child = ((PyArray_Descr *)__pyx_t_3); @@ -7364,57 +7428,51 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_4 = 0; } else { __Pyx_UnpackTupleError(((PyObject *)__pyx_v_fields), 2); - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":785 + /* "numpy.pxd":786 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * */ - __pyx_t_4 = PyInt_FromLong((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":786 + /* "numpy.pxd":787 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< * * if ((child.byteorder == '>' and little_endian) or */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_14), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_INCREF(((PyObject *)__pyx_kp_u_9)); - PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_u_9)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_9)); - __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L5; } __pyx_L5:; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":788 + /* "numpy.pxd":789 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< @@ -7429,7 +7487,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } if (!__pyx_t_7) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":789 + /* "numpy.pxd":790 * * if ((child.byteorder == '>' and little_endian) or * (child.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< @@ -7449,29 +7507,23 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } if (__pyx_t_6) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":790 + /* "numpy.pxd":791 * if ((child.byteorder == '>' and little_endian) or * (child.byteorder == '<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(((PyObject *)__pyx_kp_u_7)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_u_7)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_7)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_15), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":800 + /* "numpy.pxd":801 * * # Output padding bytes * while offset[0] < new_offset: # <<<<<<<<<<<<<< @@ -7479,16 +7531,16 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx * f += 1 */ while (1) { - __pyx_t_5 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_6) break; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":801 + /* "numpy.pxd":802 * # Output padding bytes * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< @@ -7497,35 +7549,37 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ (__pyx_v_f[0]) = 120; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":802 + /* "numpy.pxd":803 * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte * f += 1 # <<<<<<<<<<<<<< * offset[0] += 1 * */ - __pyx_v_f += 1; + __pyx_v_f = (__pyx_v_f + 1); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":803 + /* "numpy.pxd":804 * f[0] = 120 # "x"; pad byte * f += 1 * offset[0] += 1 # <<<<<<<<<<<<<< * * offset[0] += child.itemsize */ - (__pyx_v_offset[0]) += 1; + __pyx_t_10 = 0; + (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + 1); } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":805 + /* "numpy.pxd":806 * offset[0] += 1 * * offset[0] += child.itemsize # <<<<<<<<<<<<<< * * if not PyDataType_HASFIELDS(child): */ - (__pyx_v_offset[0]) += __pyx_v_child->elsize; + __pyx_t_10 = 0; + (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + __pyx_v_child->elsize); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":807 + /* "numpy.pxd":808 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -7535,20 +7589,20 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = (!PyDataType_HASFIELDS(__pyx_v_child)); if (__pyx_t_6) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":808 + /* "numpy.pxd":809 * * if not PyDataType_HASFIELDS(child): * t = child.type_num # <<<<<<<<<<<<<< * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") */ - __pyx_t_3 = PyInt_FromLong(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_v_t); __pyx_v_t = __pyx_t_3; __pyx_t_3 = 0; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":809 + /* "numpy.pxd":810 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -7558,408 +7612,402 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = ((__pyx_v_end - __pyx_v_f) < 5); if (__pyx_t_6) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":810 + /* "numpy.pxd":811 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_17), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(((PyObject *)__pyx_kp_u_10)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_u_10)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_10)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L10; } __pyx_L10:; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":813 + /* "numpy.pxd":814 * * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" */ - __pyx_t_5 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 98; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":814 + /* "numpy.pxd":815 * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" */ - __pyx_t_3 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 66; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":815 + /* "numpy.pxd":816 * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" */ - __pyx_t_5 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 104; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":816 + /* "numpy.pxd":817 * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" */ - __pyx_t_3 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 72; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":817 + /* "numpy.pxd":818 * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" */ - __pyx_t_5 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 105; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":818 + /* "numpy.pxd":819 * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" */ - __pyx_t_3 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 73; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":819 + /* "numpy.pxd":820 * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" */ - __pyx_t_5 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 108; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":820 + /* "numpy.pxd":821 * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" */ - __pyx_t_3 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 76; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":821 + /* "numpy.pxd":822 * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" */ - __pyx_t_5 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 113; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":822 + /* "numpy.pxd":823 * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" */ - __pyx_t_3 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 81; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":823 + /* "numpy.pxd":824 * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" */ - __pyx_t_5 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 102; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":824 + /* "numpy.pxd":825 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf */ - __pyx_t_3 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 100; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":825 + /* "numpy.pxd":826 * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd */ - __pyx_t_5 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 103; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":826 + /* "numpy.pxd":827 * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg */ - __pyx_t_3 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; (__pyx_v_f[1]) = 102; - __pyx_v_f += 1; + __pyx_v_f = (__pyx_v_f + 1); goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":827 + /* "numpy.pxd":828 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg * elif t == NPY_OBJECT: f[0] = 79 #"O" */ - __pyx_t_5 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; (__pyx_v_f[1]) = 100; - __pyx_v_f += 1; + __pyx_v_f = (__pyx_v_f + 1); goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":828 + /* "numpy.pxd":829 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: */ - __pyx_t_3 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; (__pyx_v_f[1]) = 103; - __pyx_v_f += 1; + __pyx_v_f = (__pyx_v_f + 1); goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":829 + /* "numpy.pxd":830 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) */ - __pyx_t_5 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 79; goto __pyx_L11; } /*else*/ { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":831 + /* "numpy.pxd":832 * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< * f += 1 * else: */ - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_8), __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_12), __pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_5)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_5)); + __pyx_t_5 = 0; + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __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 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L11:; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":832 + /* "numpy.pxd":833 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * f += 1 # <<<<<<<<<<<<<< * else: * # Cython ignores struct boundary information ("T{...}"), */ - __pyx_v_f += 1; + __pyx_v_f = (__pyx_v_f + 1); goto __pyx_L9; } /*else*/ { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":836 + /* "numpy.pxd":837 * # Cython ignores struct boundary information ("T{...}"), * # so don't output it * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< * return f * */ - __pyx_t_10 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_f = __pyx_t_10; + __pyx_t_11 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_f = __pyx_t_11; } __pyx_L9:; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":837 + /* "numpy.pxd":838 * # so don't output it * f = _util_dtypestring(child, f, end, offset) * return f # <<<<<<<<<<<<<< @@ -7984,12 +8032,11 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_v_childname); __Pyx_DECREF(__pyx_v_new_offset); __Pyx_DECREF(__pyx_v_t); - __Pyx_DECREF((PyObject *)__pyx_v_descr); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":952 +/* "numpy.pxd":953 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -8000,11 +8047,10 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { PyObject *__pyx_v_baseptr; int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("set_array_base"); - __Pyx_INCREF((PyObject *)__pyx_v_arr); - __Pyx_INCREF(__pyx_v_base); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":954 + /* "numpy.pxd":955 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -8014,7 +8060,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __pyx_t_1 = (__pyx_v_base == Py_None); if (__pyx_t_1) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":955 + /* "numpy.pxd":956 * cdef PyObject* baseptr * if base is None: * baseptr = NULL # <<<<<<<<<<<<<< @@ -8026,16 +8072,19 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } /*else*/ { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":957 + /* "numpy.pxd":958 * baseptr = NULL * else: * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< * baseptr = <PyObject*>base * Py_XDECREF(arr.base) */ - Py_INCREF(__pyx_v_base); + __pyx_t_2 = __pyx_v_base; + __Pyx_INCREF(__pyx_t_2); + Py_INCREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":958 + /* "numpy.pxd":959 * else: * Py_INCREF(base) # important to do this before decref below! * baseptr = <PyObject*>base # <<<<<<<<<<<<<< @@ -8046,7 +8095,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } __pyx_L3:; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":959 + /* "numpy.pxd":960 * Py_INCREF(base) # important to do this before decref below! * baseptr = <PyObject*>base * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< @@ -8055,7 +8104,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_XDECREF(__pyx_v_arr->base); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":960 + /* "numpy.pxd":961 * baseptr = <PyObject*>base * Py_XDECREF(arr.base) * arr.base = baseptr # <<<<<<<<<<<<<< @@ -8064,12 +8113,10 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ __pyx_v_arr->base = __pyx_v_baseptr; - __Pyx_DECREF((PyObject *)__pyx_v_arr); - __Pyx_DECREF(__pyx_v_base); __Pyx_RefNannyFinishContext(); } -/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":962 +/* "numpy.pxd":963 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -8081,9 +8128,8 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py PyObject *__pyx_r = NULL; int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base"); - __Pyx_INCREF((PyObject *)__pyx_v_arr); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":963 + /* "numpy.pxd":964 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -8093,7 +8139,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_t_1 = (__pyx_v_arr->base == NULL); if (__pyx_t_1) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":964 + /* "numpy.pxd":965 * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: * return None # <<<<<<<<<<<<<< @@ -8108,7 +8154,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py } /*else*/ { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":966 + /* "numpy.pxd":967 * return None * else: * return <object>arr.base # <<<<<<<<<<<<<< @@ -8122,29 +8168,28 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = Py_None; __Pyx_INCREF(Py_None); __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_arr); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_LossFunction __pyx_vtable_7sklearn_12linear_model_8sgd_fast_LossFunction; +static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_LossFunction __pyx_vtable_7scikits_5learn_12linear_model_8sgd_fast_LossFunction; -static PyObject *__pyx_tp_new_7sklearn_12linear_model_8sgd_fast_LossFunction(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *p; +static PyObject *__pyx_tp_new_7scikits_5learn_12linear_model_8sgd_fast_LossFunction(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; - p = ((struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *)o); - p->__pyx_vtab = __pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_LossFunction; + p = ((struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *)o); + p->__pyx_vtab = __pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_LossFunction; return o; } -static void __pyx_tp_dealloc_7sklearn_12linear_model_8sgd_fast_LossFunction(PyObject *o) { +static void __pyx_tp_dealloc_7scikits_5learn_12linear_model_8sgd_fast_LossFunction(PyObject *o) { (*Py_TYPE(o)->tp_free)(o); } -static struct PyMethodDef __pyx_methods_7sklearn_12linear_model_8sgd_fast_LossFunction[] = { - {__Pyx_NAMESTR("loss"), (PyCFunction)__pyx_pf_7sklearn_12linear_model_8sgd_fast_12LossFunction_loss, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7sklearn_12linear_model_8sgd_fast_12LossFunction_loss)}, - {__Pyx_NAMESTR("dloss"), (PyCFunction)__pyx_pf_7sklearn_12linear_model_8sgd_fast_12LossFunction_dloss, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7sklearn_12linear_model_8sgd_fast_12LossFunction_dloss)}, +static PyMethodDef __pyx_methods_7scikits_5learn_12linear_model_8sgd_fast_LossFunction[] = { + {__Pyx_NAMESTR("loss"), (PyCFunction)__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_12LossFunction_loss, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7scikits_5learn_12linear_model_8sgd_fast_12LossFunction_loss)}, + {__Pyx_NAMESTR("dloss"), (PyCFunction)__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_12LossFunction_1dloss, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7scikits_5learn_12linear_model_8sgd_fast_12LossFunction_1dloss)}, {0, 0, 0, 0} }; @@ -8172,10 +8217,10 @@ static PyNumberMethods __pyx_tp_as_number_LossFunction = { 0, /*nb_coerce*/ #endif 0, /*nb_int*/ - #if PY_MAJOR_VERSION >= 3 - 0, /*reserved*/ - #else + #if PY_MAJOR_VERSION < 3 0, /*nb_long*/ + #else + 0, /*reserved*/ #endif 0, /*nb_float*/ #if PY_MAJOR_VERSION < 3 @@ -8201,7 +8246,7 @@ static PyNumberMethods __pyx_tp_as_number_LossFunction = { 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ - #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX) + #if PY_VERSION_HEX >= 0x02050000 0, /*nb_index*/ #endif }; @@ -8246,16 +8291,20 @@ static PyBufferProcs __pyx_tp_as_buffer_LossFunction = { #endif }; -PyTypeObject __pyx_type_7sklearn_12linear_model_8sgd_fast_LossFunction = { +static PyTypeObject __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_LossFunction = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("sklearn.linear_model.sgd_fast.LossFunction"), /*tp_name*/ - sizeof(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction), /*tp_basicsize*/ + __Pyx_NAMESTR("scikits.learn.linear_model.sgd_fast.LossFunction"), /*tp_name*/ + sizeof(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_7sklearn_12linear_model_8sgd_fast_LossFunction, /*tp_dealloc*/ + __pyx_tp_dealloc_7scikits_5learn_12linear_model_8sgd_fast_LossFunction, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif 0, /*tp_repr*/ &__pyx_tp_as_number_LossFunction, /*tp_as_number*/ &__pyx_tp_as_sequence_LossFunction, /*tp_as_sequence*/ @@ -8266,7 +8315,7 @@ PyTypeObject __pyx_type_7sklearn_12linear_model_8sgd_fast_LossFunction = { 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_LossFunction, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ __Pyx_DOCSTR("Base class for convex loss functions"), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ @@ -8274,7 +8323,7 @@ PyTypeObject __pyx_type_7sklearn_12linear_model_8sgd_fast_LossFunction = { 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_7sklearn_12linear_model_8sgd_fast_LossFunction, /*tp_methods*/ + __pyx_methods_7scikits_5learn_12linear_model_8sgd_fast_LossFunction, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -8284,7 +8333,7 @@ PyTypeObject __pyx_type_7sklearn_12linear_model_8sgd_fast_LossFunction = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_7sklearn_12linear_model_8sgd_fast_LossFunction, /*tp_new*/ + __pyx_tp_new_7scikits_5learn_12linear_model_8sgd_fast_LossFunction, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -8297,20 +8346,20 @@ PyTypeObject __pyx_type_7sklearn_12linear_model_8sgd_fast_LossFunction = { 0, /*tp_version_tag*/ #endif }; -static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Regression __pyx_vtable_7sklearn_12linear_model_8sgd_fast_Regression; +static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Regression __pyx_vtable_7scikits_5learn_12linear_model_8sgd_fast_Regression; -static PyObject *__pyx_tp_new_7sklearn_12linear_model_8sgd_fast_Regression(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Regression *p; - PyObject *o = __pyx_tp_new_7sklearn_12linear_model_8sgd_fast_LossFunction(t, a, k); +static PyObject *__pyx_tp_new_7scikits_5learn_12linear_model_8sgd_fast_Regression(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Regression *p; + PyObject *o = __pyx_tp_new_7scikits_5learn_12linear_model_8sgd_fast_LossFunction(t, a, k); if (!o) return 0; - p = ((struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Regression *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_LossFunction*)__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_Regression; + p = ((struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Regression *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_LossFunction*)__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Regression; return o; } -static struct PyMethodDef __pyx_methods_7sklearn_12linear_model_8sgd_fast_Regression[] = { - {__Pyx_NAMESTR("loss"), (PyCFunction)__pyx_pf_7sklearn_12linear_model_8sgd_fast_10Regression_loss, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("dloss"), (PyCFunction)__pyx_pf_7sklearn_12linear_model_8sgd_fast_10Regression_dloss, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, +static PyMethodDef __pyx_methods_7scikits_5learn_12linear_model_8sgd_fast_Regression[] = { + {__Pyx_NAMESTR("loss"), (PyCFunction)__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_10Regression_loss, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("dloss"), (PyCFunction)__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_10Regression_1dloss, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, {0, 0, 0, 0} }; @@ -8338,10 +8387,10 @@ static PyNumberMethods __pyx_tp_as_number_Regression = { 0, /*nb_coerce*/ #endif 0, /*nb_int*/ - #if PY_MAJOR_VERSION >= 3 - 0, /*reserved*/ - #else + #if PY_MAJOR_VERSION < 3 0, /*nb_long*/ + #else + 0, /*reserved*/ #endif 0, /*nb_float*/ #if PY_MAJOR_VERSION < 3 @@ -8367,7 +8416,7 @@ static PyNumberMethods __pyx_tp_as_number_Regression = { 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ - #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX) + #if PY_VERSION_HEX >= 0x02050000 0, /*nb_index*/ #endif }; @@ -8412,16 +8461,20 @@ static PyBufferProcs __pyx_tp_as_buffer_Regression = { #endif }; -PyTypeObject __pyx_type_7sklearn_12linear_model_8sgd_fast_Regression = { +static PyTypeObject __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Regression = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("sklearn.linear_model.sgd_fast.Regression"), /*tp_name*/ - sizeof(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Regression), /*tp_basicsize*/ + __Pyx_NAMESTR("scikits.learn.linear_model.sgd_fast.Regression"), /*tp_name*/ + sizeof(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Regression), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_7sklearn_12linear_model_8sgd_fast_LossFunction, /*tp_dealloc*/ + __pyx_tp_dealloc_7scikits_5learn_12linear_model_8sgd_fast_LossFunction, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif 0, /*tp_repr*/ &__pyx_tp_as_number_Regression, /*tp_as_number*/ &__pyx_tp_as_sequence_Regression, /*tp_as_sequence*/ @@ -8432,7 +8485,7 @@ PyTypeObject __pyx_type_7sklearn_12linear_model_8sgd_fast_Regression = { 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_Regression, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ __Pyx_DOCSTR("Base class for loss functions for regression"), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ @@ -8440,7 +8493,7 @@ PyTypeObject __pyx_type_7sklearn_12linear_model_8sgd_fast_Regression = { 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_7sklearn_12linear_model_8sgd_fast_Regression, /*tp_methods*/ + __pyx_methods_7scikits_5learn_12linear_model_8sgd_fast_Regression, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -8450,7 +8503,7 @@ PyTypeObject __pyx_type_7sklearn_12linear_model_8sgd_fast_Regression = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_7sklearn_12linear_model_8sgd_fast_Regression, /*tp_new*/ + __pyx_tp_new_7scikits_5learn_12linear_model_8sgd_fast_Regression, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -8463,20 +8516,20 @@ PyTypeObject __pyx_type_7sklearn_12linear_model_8sgd_fast_Regression = { 0, /*tp_version_tag*/ #endif }; -static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Classification __pyx_vtable_7sklearn_12linear_model_8sgd_fast_Classification; +static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Classification __pyx_vtable_7scikits_5learn_12linear_model_8sgd_fast_Classification; -static PyObject *__pyx_tp_new_7sklearn_12linear_model_8sgd_fast_Classification(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Classification *p; - PyObject *o = __pyx_tp_new_7sklearn_12linear_model_8sgd_fast_LossFunction(t, a, k); +static PyObject *__pyx_tp_new_7scikits_5learn_12linear_model_8sgd_fast_Classification(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Classification *p; + PyObject *o = __pyx_tp_new_7scikits_5learn_12linear_model_8sgd_fast_LossFunction(t, a, k); if (!o) return 0; - p = ((struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Classification *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_LossFunction*)__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_Classification; + p = ((struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Classification *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_LossFunction*)__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Classification; return o; } -static struct PyMethodDef __pyx_methods_7sklearn_12linear_model_8sgd_fast_Classification[] = { - {__Pyx_NAMESTR("loss"), (PyCFunction)__pyx_pf_7sklearn_12linear_model_8sgd_fast_14Classification_loss, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("dloss"), (PyCFunction)__pyx_pf_7sklearn_12linear_model_8sgd_fast_14Classification_dloss, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, +static PyMethodDef __pyx_methods_7scikits_5learn_12linear_model_8sgd_fast_Classification[] = { + {__Pyx_NAMESTR("loss"), (PyCFunction)__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_14Classification_loss, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("dloss"), (PyCFunction)__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_14Classification_1dloss, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, {0, 0, 0, 0} }; @@ -8504,10 +8557,10 @@ static PyNumberMethods __pyx_tp_as_number_Classification = { 0, /*nb_coerce*/ #endif 0, /*nb_int*/ - #if PY_MAJOR_VERSION >= 3 - 0, /*reserved*/ - #else + #if PY_MAJOR_VERSION < 3 0, /*nb_long*/ + #else + 0, /*reserved*/ #endif 0, /*nb_float*/ #if PY_MAJOR_VERSION < 3 @@ -8533,7 +8586,7 @@ static PyNumberMethods __pyx_tp_as_number_Classification = { 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ - #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX) + #if PY_VERSION_HEX >= 0x02050000 0, /*nb_index*/ #endif }; @@ -8578,16 +8631,20 @@ static PyBufferProcs __pyx_tp_as_buffer_Classification = { #endif }; -PyTypeObject __pyx_type_7sklearn_12linear_model_8sgd_fast_Classification = { +static PyTypeObject __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Classification = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("sklearn.linear_model.sgd_fast.Classification"), /*tp_name*/ - sizeof(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Classification), /*tp_basicsize*/ + __Pyx_NAMESTR("scikits.learn.linear_model.sgd_fast.Classification"), /*tp_name*/ + sizeof(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Classification), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_7sklearn_12linear_model_8sgd_fast_LossFunction, /*tp_dealloc*/ + __pyx_tp_dealloc_7scikits_5learn_12linear_model_8sgd_fast_LossFunction, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif 0, /*tp_repr*/ &__pyx_tp_as_number_Classification, /*tp_as_number*/ &__pyx_tp_as_sequence_Classification, /*tp_as_sequence*/ @@ -8598,7 +8655,7 @@ PyTypeObject __pyx_type_7sklearn_12linear_model_8sgd_fast_Classification = { 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_Classification, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ __Pyx_DOCSTR("Base class for loss functions for classification"), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ @@ -8606,7 +8663,7 @@ PyTypeObject __pyx_type_7sklearn_12linear_model_8sgd_fast_Classification = { 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_7sklearn_12linear_model_8sgd_fast_Classification, /*tp_methods*/ + __pyx_methods_7scikits_5learn_12linear_model_8sgd_fast_Classification, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -8616,7 +8673,7 @@ PyTypeObject __pyx_type_7sklearn_12linear_model_8sgd_fast_Classification = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_7sklearn_12linear_model_8sgd_fast_Classification, /*tp_new*/ + __pyx_tp_new_7scikits_5learn_12linear_model_8sgd_fast_Classification, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -8629,21 +8686,21 @@ PyTypeObject __pyx_type_7sklearn_12linear_model_8sgd_fast_Classification = { 0, /*tp_version_tag*/ #endif }; -static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_ModifiedHuber __pyx_vtable_7sklearn_12linear_model_8sgd_fast_ModifiedHuber; +static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber __pyx_vtable_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber; -static PyObject *__pyx_tp_new_7sklearn_12linear_model_8sgd_fast_ModifiedHuber(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_ModifiedHuber *p; - PyObject *o = __pyx_tp_new_7sklearn_12linear_model_8sgd_fast_LossFunction(t, a, k); +static PyObject *__pyx_tp_new_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber *p; + PyObject *o = __pyx_tp_new_7scikits_5learn_12linear_model_8sgd_fast_LossFunction(t, a, k); if (!o) return 0; - p = ((struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_ModifiedHuber *)o); - p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_LossFunction*)__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_ModifiedHuber; + p = ((struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber *)o); + p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_LossFunction*)__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber; return o; } -static struct PyMethodDef __pyx_methods_7sklearn_12linear_model_8sgd_fast_ModifiedHuber[] = { - {__Pyx_NAMESTR("loss"), (PyCFunction)__pyx_pf_7sklearn_12linear_model_8sgd_fast_13ModifiedHuber_loss, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("dloss"), (PyCFunction)__pyx_pf_7sklearn_12linear_model_8sgd_fast_13ModifiedHuber_dloss, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__pyx_pf_7sklearn_12linear_model_8sgd_fast_13ModifiedHuber___reduce__, METH_NOARGS, __Pyx_DOCSTR(0)}, +static PyMethodDef __pyx_methods_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber[] = { + {__Pyx_NAMESTR("loss"), (PyCFunction)__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_13ModifiedHuber_loss, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("dloss"), (PyCFunction)__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_13ModifiedHuber_1dloss, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_13ModifiedHuber_2__reduce__, METH_NOARGS, __Pyx_DOCSTR(0)}, {0, 0, 0, 0} }; @@ -8671,10 +8728,10 @@ static PyNumberMethods __pyx_tp_as_number_ModifiedHuber = { 0, /*nb_coerce*/ #endif 0, /*nb_int*/ - #if PY_MAJOR_VERSION >= 3 - 0, /*reserved*/ - #else + #if PY_MAJOR_VERSION < 3 0, /*nb_long*/ + #else + 0, /*reserved*/ #endif 0, /*nb_float*/ #if PY_MAJOR_VERSION < 3 @@ -8700,7 +8757,7 @@ static PyNumberMethods __pyx_tp_as_number_ModifiedHuber = { 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ - #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX) + #if PY_VERSION_HEX >= 0x02050000 0, /*nb_index*/ #endif }; @@ -8745,16 +8802,20 @@ static PyBufferProcs __pyx_tp_as_buffer_ModifiedHuber = { #endif }; -PyTypeObject __pyx_type_7sklearn_12linear_model_8sgd_fast_ModifiedHuber = { +static PyTypeObject __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("sklearn.linear_model.sgd_fast.ModifiedHuber"), /*tp_name*/ - sizeof(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_ModifiedHuber), /*tp_basicsize*/ + __Pyx_NAMESTR("scikits.learn.linear_model.sgd_fast.ModifiedHuber"), /*tp_name*/ + sizeof(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_7sklearn_12linear_model_8sgd_fast_LossFunction, /*tp_dealloc*/ + __pyx_tp_dealloc_7scikits_5learn_12linear_model_8sgd_fast_LossFunction, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif 0, /*tp_repr*/ &__pyx_tp_as_number_ModifiedHuber, /*tp_as_number*/ &__pyx_tp_as_sequence_ModifiedHuber, /*tp_as_sequence*/ @@ -8765,7 +8826,7 @@ PyTypeObject __pyx_type_7sklearn_12linear_model_8sgd_fast_ModifiedHuber = { 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_ModifiedHuber, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ __Pyx_DOCSTR("Modified Huber loss for binary classification with y in {-1, 1}\n\n This is equivalent to quadratically smoothed SVM with gamma = 2.\n\n See T. Zhang 'Solving Large Scale Linear Prediction Problems Using\n Stochastic Gradient Descent', ICML'04.\n "), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ @@ -8773,7 +8834,7 @@ PyTypeObject __pyx_type_7sklearn_12linear_model_8sgd_fast_ModifiedHuber = { 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_7sklearn_12linear_model_8sgd_fast_ModifiedHuber, /*tp_methods*/ + __pyx_methods_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -8783,7 +8844,7 @@ PyTypeObject __pyx_type_7sklearn_12linear_model_8sgd_fast_ModifiedHuber = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_7sklearn_12linear_model_8sgd_fast_ModifiedHuber, /*tp_new*/ + __pyx_tp_new_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -8796,21 +8857,21 @@ PyTypeObject __pyx_type_7sklearn_12linear_model_8sgd_fast_ModifiedHuber = { 0, /*tp_version_tag*/ #endif }; -static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Hinge __pyx_vtable_7sklearn_12linear_model_8sgd_fast_Hinge; +static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Hinge __pyx_vtable_7scikits_5learn_12linear_model_8sgd_fast_Hinge; -static PyObject *__pyx_tp_new_7sklearn_12linear_model_8sgd_fast_Hinge(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Hinge *p; - PyObject *o = __pyx_tp_new_7sklearn_12linear_model_8sgd_fast_LossFunction(t, a, k); +static PyObject *__pyx_tp_new_7scikits_5learn_12linear_model_8sgd_fast_Hinge(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Hinge *p; + PyObject *o = __pyx_tp_new_7scikits_5learn_12linear_model_8sgd_fast_LossFunction(t, a, k); if (!o) return 0; - p = ((struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Hinge *)o); - p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_LossFunction*)__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_Hinge; + p = ((struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Hinge *)o); + p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_LossFunction*)__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Hinge; return o; } -static struct PyMethodDef __pyx_methods_7sklearn_12linear_model_8sgd_fast_Hinge[] = { - {__Pyx_NAMESTR("loss"), (PyCFunction)__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Hinge_loss, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("dloss"), (PyCFunction)__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Hinge_dloss, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Hinge___reduce__, METH_NOARGS, __Pyx_DOCSTR(0)}, +static PyMethodDef __pyx_methods_7scikits_5learn_12linear_model_8sgd_fast_Hinge[] = { + {__Pyx_NAMESTR("loss"), (PyCFunction)__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Hinge_loss, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("dloss"), (PyCFunction)__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Hinge_1dloss, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Hinge_2__reduce__, METH_NOARGS, __Pyx_DOCSTR(0)}, {0, 0, 0, 0} }; @@ -8838,10 +8899,10 @@ static PyNumberMethods __pyx_tp_as_number_Hinge = { 0, /*nb_coerce*/ #endif 0, /*nb_int*/ - #if PY_MAJOR_VERSION >= 3 - 0, /*reserved*/ - #else + #if PY_MAJOR_VERSION < 3 0, /*nb_long*/ + #else + 0, /*reserved*/ #endif 0, /*nb_float*/ #if PY_MAJOR_VERSION < 3 @@ -8867,7 +8928,7 @@ static PyNumberMethods __pyx_tp_as_number_Hinge = { 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ - #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX) + #if PY_VERSION_HEX >= 0x02050000 0, /*nb_index*/ #endif }; @@ -8912,16 +8973,20 @@ static PyBufferProcs __pyx_tp_as_buffer_Hinge = { #endif }; -PyTypeObject __pyx_type_7sklearn_12linear_model_8sgd_fast_Hinge = { +static PyTypeObject __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Hinge = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("sklearn.linear_model.sgd_fast.Hinge"), /*tp_name*/ - sizeof(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Hinge), /*tp_basicsize*/ + __Pyx_NAMESTR("scikits.learn.linear_model.sgd_fast.Hinge"), /*tp_name*/ + sizeof(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Hinge), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_7sklearn_12linear_model_8sgd_fast_LossFunction, /*tp_dealloc*/ + __pyx_tp_dealloc_7scikits_5learn_12linear_model_8sgd_fast_LossFunction, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif 0, /*tp_repr*/ &__pyx_tp_as_number_Hinge, /*tp_as_number*/ &__pyx_tp_as_sequence_Hinge, /*tp_as_sequence*/ @@ -8932,7 +8997,7 @@ PyTypeObject __pyx_type_7sklearn_12linear_model_8sgd_fast_Hinge = { 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_Hinge, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ __Pyx_DOCSTR("SVM loss for binary classification tasks with y in {-1,1}"), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ @@ -8940,7 +9005,7 @@ PyTypeObject __pyx_type_7sklearn_12linear_model_8sgd_fast_Hinge = { 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_7sklearn_12linear_model_8sgd_fast_Hinge, /*tp_methods*/ + __pyx_methods_7scikits_5learn_12linear_model_8sgd_fast_Hinge, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -8950,7 +9015,7 @@ PyTypeObject __pyx_type_7sklearn_12linear_model_8sgd_fast_Hinge = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_7sklearn_12linear_model_8sgd_fast_Hinge, /*tp_new*/ + __pyx_tp_new_7scikits_5learn_12linear_model_8sgd_fast_Hinge, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -8963,21 +9028,21 @@ PyTypeObject __pyx_type_7sklearn_12linear_model_8sgd_fast_Hinge = { 0, /*tp_version_tag*/ #endif }; -static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Log __pyx_vtable_7sklearn_12linear_model_8sgd_fast_Log; +static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Log __pyx_vtable_7scikits_5learn_12linear_model_8sgd_fast_Log; -static PyObject *__pyx_tp_new_7sklearn_12linear_model_8sgd_fast_Log(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Log *p; - PyObject *o = __pyx_tp_new_7sklearn_12linear_model_8sgd_fast_LossFunction(t, a, k); +static PyObject *__pyx_tp_new_7scikits_5learn_12linear_model_8sgd_fast_Log(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Log *p; + PyObject *o = __pyx_tp_new_7scikits_5learn_12linear_model_8sgd_fast_LossFunction(t, a, k); if (!o) return 0; - p = ((struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Log *)o); - p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_LossFunction*)__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_Log; + p = ((struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Log *)o); + p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_LossFunction*)__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Log; return o; } -static struct PyMethodDef __pyx_methods_7sklearn_12linear_model_8sgd_fast_Log[] = { - {__Pyx_NAMESTR("loss"), (PyCFunction)__pyx_pf_7sklearn_12linear_model_8sgd_fast_3Log_loss, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("dloss"), (PyCFunction)__pyx_pf_7sklearn_12linear_model_8sgd_fast_3Log_dloss, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__pyx_pf_7sklearn_12linear_model_8sgd_fast_3Log___reduce__, METH_NOARGS, __Pyx_DOCSTR(0)}, +static PyMethodDef __pyx_methods_7scikits_5learn_12linear_model_8sgd_fast_Log[] = { + {__Pyx_NAMESTR("loss"), (PyCFunction)__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_3Log_loss, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("dloss"), (PyCFunction)__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_3Log_1dloss, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_3Log_2__reduce__, METH_NOARGS, __Pyx_DOCSTR(0)}, {0, 0, 0, 0} }; @@ -9005,10 +9070,10 @@ static PyNumberMethods __pyx_tp_as_number_Log = { 0, /*nb_coerce*/ #endif 0, /*nb_int*/ - #if PY_MAJOR_VERSION >= 3 - 0, /*reserved*/ - #else + #if PY_MAJOR_VERSION < 3 0, /*nb_long*/ + #else + 0, /*reserved*/ #endif 0, /*nb_float*/ #if PY_MAJOR_VERSION < 3 @@ -9034,7 +9099,7 @@ static PyNumberMethods __pyx_tp_as_number_Log = { 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ - #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX) + #if PY_VERSION_HEX >= 0x02050000 0, /*nb_index*/ #endif }; @@ -9079,16 +9144,20 @@ static PyBufferProcs __pyx_tp_as_buffer_Log = { #endif }; -PyTypeObject __pyx_type_7sklearn_12linear_model_8sgd_fast_Log = { +static PyTypeObject __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Log = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("sklearn.linear_model.sgd_fast.Log"), /*tp_name*/ - sizeof(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Log), /*tp_basicsize*/ + __Pyx_NAMESTR("scikits.learn.linear_model.sgd_fast.Log"), /*tp_name*/ + sizeof(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Log), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_7sklearn_12linear_model_8sgd_fast_LossFunction, /*tp_dealloc*/ + __pyx_tp_dealloc_7scikits_5learn_12linear_model_8sgd_fast_LossFunction, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif 0, /*tp_repr*/ &__pyx_tp_as_number_Log, /*tp_as_number*/ &__pyx_tp_as_sequence_Log, /*tp_as_sequence*/ @@ -9099,7 +9168,7 @@ PyTypeObject __pyx_type_7sklearn_12linear_model_8sgd_fast_Log = { 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_Log, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ __Pyx_DOCSTR("Logistic regression loss for binary classification with y in {-1, 1}"), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ @@ -9107,7 +9176,7 @@ PyTypeObject __pyx_type_7sklearn_12linear_model_8sgd_fast_Log = { 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_7sklearn_12linear_model_8sgd_fast_Log, /*tp_methods*/ + __pyx_methods_7scikits_5learn_12linear_model_8sgd_fast_Log, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -9117,7 +9186,7 @@ PyTypeObject __pyx_type_7sklearn_12linear_model_8sgd_fast_Log = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_7sklearn_12linear_model_8sgd_fast_Log, /*tp_new*/ + __pyx_tp_new_7scikits_5learn_12linear_model_8sgd_fast_Log, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -9130,21 +9199,21 @@ PyTypeObject __pyx_type_7sklearn_12linear_model_8sgd_fast_Log = { 0, /*tp_version_tag*/ #endif }; -static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_SquaredLoss __pyx_vtable_7sklearn_12linear_model_8sgd_fast_SquaredLoss; +static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss __pyx_vtable_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss; -static PyObject *__pyx_tp_new_7sklearn_12linear_model_8sgd_fast_SquaredLoss(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_SquaredLoss *p; - PyObject *o = __pyx_tp_new_7sklearn_12linear_model_8sgd_fast_LossFunction(t, a, k); +static PyObject *__pyx_tp_new_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss *p; + PyObject *o = __pyx_tp_new_7scikits_5learn_12linear_model_8sgd_fast_LossFunction(t, a, k); if (!o) return 0; - p = ((struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_SquaredLoss *)o); - p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_LossFunction*)__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_SquaredLoss; + p = ((struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss *)o); + p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_LossFunction*)__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss; return o; } -static struct PyMethodDef __pyx_methods_7sklearn_12linear_model_8sgd_fast_SquaredLoss[] = { - {__Pyx_NAMESTR("loss"), (PyCFunction)__pyx_pf_7sklearn_12linear_model_8sgd_fast_11SquaredLoss_loss, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("dloss"), (PyCFunction)__pyx_pf_7sklearn_12linear_model_8sgd_fast_11SquaredLoss_dloss, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__pyx_pf_7sklearn_12linear_model_8sgd_fast_11SquaredLoss___reduce__, METH_NOARGS, __Pyx_DOCSTR(0)}, +static PyMethodDef __pyx_methods_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss[] = { + {__Pyx_NAMESTR("loss"), (PyCFunction)__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_11SquaredLoss_loss, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("dloss"), (PyCFunction)__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_11SquaredLoss_1dloss, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_11SquaredLoss_2__reduce__, METH_NOARGS, __Pyx_DOCSTR(0)}, {0, 0, 0, 0} }; @@ -9172,10 +9241,10 @@ static PyNumberMethods __pyx_tp_as_number_SquaredLoss = { 0, /*nb_coerce*/ #endif 0, /*nb_int*/ - #if PY_MAJOR_VERSION >= 3 - 0, /*reserved*/ - #else + #if PY_MAJOR_VERSION < 3 0, /*nb_long*/ + #else + 0, /*reserved*/ #endif 0, /*nb_float*/ #if PY_MAJOR_VERSION < 3 @@ -9201,7 +9270,7 @@ static PyNumberMethods __pyx_tp_as_number_SquaredLoss = { 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ - #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX) + #if PY_VERSION_HEX >= 0x02050000 0, /*nb_index*/ #endif }; @@ -9246,16 +9315,20 @@ static PyBufferProcs __pyx_tp_as_buffer_SquaredLoss = { #endif }; -PyTypeObject __pyx_type_7sklearn_12linear_model_8sgd_fast_SquaredLoss = { +static PyTypeObject __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("sklearn.linear_model.sgd_fast.SquaredLoss"), /*tp_name*/ - sizeof(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_SquaredLoss), /*tp_basicsize*/ + __Pyx_NAMESTR("scikits.learn.linear_model.sgd_fast.SquaredLoss"), /*tp_name*/ + sizeof(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_7sklearn_12linear_model_8sgd_fast_LossFunction, /*tp_dealloc*/ + __pyx_tp_dealloc_7scikits_5learn_12linear_model_8sgd_fast_LossFunction, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif 0, /*tp_repr*/ &__pyx_tp_as_number_SquaredLoss, /*tp_as_number*/ &__pyx_tp_as_sequence_SquaredLoss, /*tp_as_sequence*/ @@ -9266,7 +9339,7 @@ PyTypeObject __pyx_type_7sklearn_12linear_model_8sgd_fast_SquaredLoss = { 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_SquaredLoss, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ __Pyx_DOCSTR("Squared loss traditional used in linear regression."), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ @@ -9274,7 +9347,7 @@ PyTypeObject __pyx_type_7sklearn_12linear_model_8sgd_fast_SquaredLoss = { 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_7sklearn_12linear_model_8sgd_fast_SquaredLoss, /*tp_methods*/ + __pyx_methods_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -9284,7 +9357,7 @@ PyTypeObject __pyx_type_7sklearn_12linear_model_8sgd_fast_SquaredLoss = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_7sklearn_12linear_model_8sgd_fast_SquaredLoss, /*tp_new*/ + __pyx_tp_new_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -9297,21 +9370,21 @@ PyTypeObject __pyx_type_7sklearn_12linear_model_8sgd_fast_SquaredLoss = { 0, /*tp_version_tag*/ #endif }; -static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Huber __pyx_vtable_7sklearn_12linear_model_8sgd_fast_Huber; +static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Huber __pyx_vtable_7scikits_5learn_12linear_model_8sgd_fast_Huber; -static PyObject *__pyx_tp_new_7sklearn_12linear_model_8sgd_fast_Huber(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Huber *p; - PyObject *o = __pyx_tp_new_7sklearn_12linear_model_8sgd_fast_LossFunction(t, a, k); +static PyObject *__pyx_tp_new_7scikits_5learn_12linear_model_8sgd_fast_Huber(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Huber *p; + PyObject *o = __pyx_tp_new_7scikits_5learn_12linear_model_8sgd_fast_LossFunction(t, a, k); if (!o) return 0; - p = ((struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Huber *)o); - p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_LossFunction*)__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_Huber; + p = ((struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Huber *)o); + p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_LossFunction*)__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Huber; return o; } -static struct PyMethodDef __pyx_methods_7sklearn_12linear_model_8sgd_fast_Huber[] = { - {__Pyx_NAMESTR("loss"), (PyCFunction)__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Huber_loss, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("dloss"), (PyCFunction)__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Huber_dloss, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Huber___reduce__, METH_NOARGS, __Pyx_DOCSTR(0)}, +static PyMethodDef __pyx_methods_7scikits_5learn_12linear_model_8sgd_fast_Huber[] = { + {__Pyx_NAMESTR("loss"), (PyCFunction)__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Huber_1loss, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("dloss"), (PyCFunction)__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Huber_2dloss, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Huber_3__reduce__, METH_NOARGS, __Pyx_DOCSTR(0)}, {0, 0, 0, 0} }; @@ -9339,10 +9412,10 @@ static PyNumberMethods __pyx_tp_as_number_Huber = { 0, /*nb_coerce*/ #endif 0, /*nb_int*/ - #if PY_MAJOR_VERSION >= 3 - 0, /*reserved*/ - #else + #if PY_MAJOR_VERSION < 3 0, /*nb_long*/ + #else + 0, /*reserved*/ #endif 0, /*nb_float*/ #if PY_MAJOR_VERSION < 3 @@ -9368,7 +9441,7 @@ static PyNumberMethods __pyx_tp_as_number_Huber = { 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ - #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX) + #if PY_VERSION_HEX >= 0x02050000 0, /*nb_index*/ #endif }; @@ -9413,16 +9486,20 @@ static PyBufferProcs __pyx_tp_as_buffer_Huber = { #endif }; -PyTypeObject __pyx_type_7sklearn_12linear_model_8sgd_fast_Huber = { +static PyTypeObject __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Huber = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("sklearn.linear_model.sgd_fast.Huber"), /*tp_name*/ - sizeof(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Huber), /*tp_basicsize*/ + __Pyx_NAMESTR("scikits.learn.linear_model.sgd_fast.Huber"), /*tp_name*/ + sizeof(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Huber), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_7sklearn_12linear_model_8sgd_fast_LossFunction, /*tp_dealloc*/ + __pyx_tp_dealloc_7scikits_5learn_12linear_model_8sgd_fast_LossFunction, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif 0, /*tp_repr*/ &__pyx_tp_as_number_Huber, /*tp_as_number*/ &__pyx_tp_as_sequence_Huber, /*tp_as_sequence*/ @@ -9433,7 +9510,7 @@ PyTypeObject __pyx_type_7sklearn_12linear_model_8sgd_fast_Huber = { 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_Huber, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ __Pyx_DOCSTR("Huber regression loss\n\n Variant of the SquaredLoss that is robust to outliers (quadratic near zero,\n linear in for large errors).\n\n References\n ----------\n\n http://en.wikipedia.org/wiki/Huber_Loss_Function\n "), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ @@ -9441,7 +9518,7 @@ PyTypeObject __pyx_type_7sklearn_12linear_model_8sgd_fast_Huber = { 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_7sklearn_12linear_model_8sgd_fast_Huber, /*tp_methods*/ + __pyx_methods_7scikits_5learn_12linear_model_8sgd_fast_Huber, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -9449,9 +9526,9 @@ PyTypeObject __pyx_type_7sklearn_12linear_model_8sgd_fast_Huber = { 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - __pyx_pf_7sklearn_12linear_model_8sgd_fast_5Huber___init__, /*tp_init*/ + __pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Huber___init__, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_7sklearn_12linear_model_8sgd_fast_Huber, /*tp_new*/ + __pyx_tp_new_7scikits_5learn_12linear_model_8sgd_fast_Huber, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -9465,13 +9542,10 @@ PyTypeObject __pyx_type_7sklearn_12linear_model_8sgd_fast_Huber = { #endif }; -static struct PyMethodDef __pyx_methods[] = { - {__Pyx_NAMESTR("plain_sgd"), (PyCFunction)__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7sklearn_12linear_model_8sgd_fast_plain_sgd)}, +static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; -static void __pyx_init_filenames(void); /*proto*/ - #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { PyModuleDef_HEAD_INIT, @@ -9489,14 +9563,15 @@ static struct PyModuleDef __pyx_moduledef = { static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0}, {&__pyx_kp_u_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 1, 0, 0}, + {&__pyx_kp_u_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 1, 0, 0}, + {&__pyx_kp_u_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 1, 0, 0}, + {&__pyx_kp_u_16, __pyx_k_16, sizeof(__pyx_k_16), 0, 1, 0, 0}, + {&__pyx_n_s_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 0, 1, 1}, {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0}, {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0}, {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0}, - {&__pyx_kp_u_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 1, 0, 0}, {&__pyx_kp_u_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 1, 0, 0}, - {&__pyx_kp_u_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 1, 0, 0}, {&__pyx_kp_u_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 1, 0, 0}, - {&__pyx_kp_u_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 1, 0, 0}, {&__pyx_n_s__NotImplementedError, __pyx_k__NotImplementedError, sizeof(__pyx_k__NotImplementedError), 0, 0, 1, 1}, {&__pyx_n_s__RandomState, __pyx_k__RandomState, sizeof(__pyx_k__RandomState), 0, 0, 1, 1}, {&__pyx_n_s__RuntimeError, __pyx_k__RuntimeError, sizeof(__pyx_k__RuntimeError), 0, 0, 1, 1}, @@ -9504,6 +9579,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s__X, __pyx_k__X, sizeof(__pyx_k__X), 0, 0, 1, 1}, {&__pyx_n_s__Y, __pyx_k__Y, sizeof(__pyx_k__Y), 0, 0, 1, 1}, {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1}, + {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1}, {&__pyx_n_s__alpha, __pyx_k__alpha, sizeof(__pyx_k__alpha), 0, 0, 1, 1}, {&__pyx_n_s__any, __pyx_k__any, sizeof(__pyx_k__any), 0, 0, 1, 1}, {&__pyx_n_s__arange, __pyx_k__arange, sizeof(__pyx_k__arange), 0, 0, 1, 1}, @@ -9538,6 +9614,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s__order, __pyx_k__order, sizeof(__pyx_k__order), 0, 0, 1, 1}, {&__pyx_n_s__p, __pyx_k__p, sizeof(__pyx_k__p), 0, 0, 1, 1}, {&__pyx_n_s__penalty_type, __pyx_k__penalty_type, sizeof(__pyx_k__penalty_type), 0, 0, 1, 1}, + {&__pyx_n_s__plain_sgd, __pyx_k__plain_sgd, sizeof(__pyx_k__plain_sgd), 0, 0, 1, 1}, {&__pyx_n_s__power_t, __pyx_k__power_t, sizeof(__pyx_k__power_t), 0, 0, 1, 1}, {&__pyx_n_s__random, __pyx_k__random, sizeof(__pyx_k__random), 0, 0, 1, 1}, {&__pyx_n_s__range, __pyx_k__range, sizeof(__pyx_k__range), 0, 0, 1, 1}, @@ -9563,10 +9640,117 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_NotImplementedError = __Pyx_GetName(__pyx_b, __pyx_n_s__NotImplementedError); if (!__pyx_builtin_NotImplementedError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants"); + + /* "scikits/learn/linear_model/sgd_fast.pyx":396 + * if np.any(np.isinf(w)) or np.any(np.isnan(w)) \ + * or np.isnan(intercept) or np.isinf(intercept): + * raise ValueError("floating-point under-/overflow occured.") # <<<<<<<<<<<<<< + * + * w *= wscale + */ + __pyx_k_tuple_5 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_5)); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_4)); + PyTuple_SET_ITEM(__pyx_k_tuple_5, 0, ((PyObject *)__pyx_kp_s_4)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_4)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_5)); + + /* "numpy.pxd":206 + * 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_k_tuple_7 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_7)); + __Pyx_INCREF(((PyObject *)__pyx_kp_u_6)); + PyTuple_SET_ITEM(__pyx_k_tuple_7, 0, ((PyObject *)__pyx_kp_u_6)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_6)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_7)); + + /* "numpy.pxd":210 + * 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_k_tuple_9 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_9)); + __Pyx_INCREF(((PyObject *)__pyx_kp_u_8)); + PyTuple_SET_ITEM(__pyx_k_tuple_9, 0, ((PyObject *)__pyx_kp_u_8)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_8)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_9)); + + /* "numpy.pxd":248 + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' 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_k_tuple_11 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_11)); + __Pyx_INCREF(((PyObject *)__pyx_kp_u_10)); + PyTuple_SET_ITEM(__pyx_k_tuple_11, 0, ((PyObject *)__pyx_kp_u_10)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_10)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_11)); + + /* "numpy.pxd":787 + * + * if (end - f) - (new_offset - offset[0]) < 15: + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + * + * if ((child.byteorder == '>' and little_endian) or + */ + __pyx_k_tuple_14 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_14)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_14)); + __Pyx_INCREF(((PyObject *)__pyx_kp_u_13)); + PyTuple_SET_ITEM(__pyx_k_tuple_14, 0, ((PyObject *)__pyx_kp_u_13)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_13)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_14)); + + /* "numpy.pxd":791 + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_k_tuple_15 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_15)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_15)); + __Pyx_INCREF(((PyObject *)__pyx_kp_u_10)); + PyTuple_SET_ITEM(__pyx_k_tuple_15, 0, ((PyObject *)__pyx_kp_u_10)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_10)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_15)); + + /* "numpy.pxd":811 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_k_tuple_17 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_17)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_17)); + __Pyx_INCREF(((PyObject *)__pyx_kp_u_16)); + PyTuple_SET_ITEM(__pyx_k_tuple_17, 0, ((PyObject *)__pyx_kp_u_16)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_16)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_17)); + __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); return -1; } @@ -9599,12 +9783,10 @@ PyMODINIT_FUNC PyInit_sgd_fast(void) } __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit_sgd_fast(void)", __LINE__, __FILE__); #endif - __pyx_init_filenames(); __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #if PY_MAJOR_VERSION < 3 - __pyx_empty_bytes = PyString_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #ifdef __pyx_binding_PyCFunctionType_USED + if (__pyx_binding_PyCFunctionType_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ @@ -9628,134 +9810,96 @@ PyMODINIT_FUNC PyInit_sgd_fast(void) if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_module_is_main_sklearn__linear_model__sgd_fast) { + if (__pyx_module_is_main_scikits__learn__linear_model__sgd_fast) { if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; } /*--- Builtin init code ---*/ if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Constants init code ---*/ + if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ - __pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_LossFunction = &__pyx_vtable_7sklearn_12linear_model_8sgd_fast_LossFunction; - #if PY_MAJOR_VERSION >= 3 - __pyx_vtable_7sklearn_12linear_model_8sgd_fast_LossFunction.loss = (double (*)(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *, double, double, int __pyx_skip_dispatch))__pyx_f_7sklearn_12linear_model_8sgd_fast_12LossFunction_loss; - __pyx_vtable_7sklearn_12linear_model_8sgd_fast_LossFunction.dloss = (double (*)(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *, double, double, int __pyx_skip_dispatch))__pyx_f_7sklearn_12linear_model_8sgd_fast_12LossFunction_dloss; - #else - *(void(**)(void))&__pyx_vtable_7sklearn_12linear_model_8sgd_fast_LossFunction.loss = (void(*)(void))__pyx_f_7sklearn_12linear_model_8sgd_fast_12LossFunction_loss; - *(void(**)(void))&__pyx_vtable_7sklearn_12linear_model_8sgd_fast_LossFunction.dloss = (void(*)(void))__pyx_f_7sklearn_12linear_model_8sgd_fast_12LossFunction_dloss; - #endif - if (PyType_Ready(&__pyx_type_7sklearn_12linear_model_8sgd_fast_LossFunction) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_7sklearn_12linear_model_8sgd_fast_LossFunction.tp_dict, __pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_LossFunction) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "LossFunction", (PyObject *)&__pyx_type_7sklearn_12linear_model_8sgd_fast_LossFunction) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_7sklearn_12linear_model_8sgd_fast_LossFunction = &__pyx_type_7sklearn_12linear_model_8sgd_fast_LossFunction; - __pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_Regression = &__pyx_vtable_7sklearn_12linear_model_8sgd_fast_Regression; - __pyx_vtable_7sklearn_12linear_model_8sgd_fast_Regression.__pyx_base = *__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_LossFunction; - #if PY_MAJOR_VERSION >= 3 - __pyx_vtable_7sklearn_12linear_model_8sgd_fast_Regression.__pyx_base.loss = (double (*)(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *, double, double, int __pyx_skip_dispatch))__pyx_f_7sklearn_12linear_model_8sgd_fast_10Regression_loss; - __pyx_vtable_7sklearn_12linear_model_8sgd_fast_Regression.__pyx_base.dloss = (double (*)(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *, double, double, int __pyx_skip_dispatch))__pyx_f_7sklearn_12linear_model_8sgd_fast_10Regression_dloss; - #else - *(void(**)(void))&__pyx_vtable_7sklearn_12linear_model_8sgd_fast_Regression.__pyx_base.loss = (void(*)(void))__pyx_f_7sklearn_12linear_model_8sgd_fast_10Regression_loss; - *(void(**)(void))&__pyx_vtable_7sklearn_12linear_model_8sgd_fast_Regression.__pyx_base.dloss = (void(*)(void))__pyx_f_7sklearn_12linear_model_8sgd_fast_10Regression_dloss; - #endif - __pyx_type_7sklearn_12linear_model_8sgd_fast_Regression.tp_base = __pyx_ptype_7sklearn_12linear_model_8sgd_fast_LossFunction; - if (PyType_Ready(&__pyx_type_7sklearn_12linear_model_8sgd_fast_Regression) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_7sklearn_12linear_model_8sgd_fast_Regression.tp_dict, __pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_Regression) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "Regression", (PyObject *)&__pyx_type_7sklearn_12linear_model_8sgd_fast_Regression) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_7sklearn_12linear_model_8sgd_fast_Regression = &__pyx_type_7sklearn_12linear_model_8sgd_fast_Regression; - __pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_Classification = &__pyx_vtable_7sklearn_12linear_model_8sgd_fast_Classification; - __pyx_vtable_7sklearn_12linear_model_8sgd_fast_Classification.__pyx_base = *__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_LossFunction; - #if PY_MAJOR_VERSION >= 3 - __pyx_vtable_7sklearn_12linear_model_8sgd_fast_Classification.__pyx_base.loss = (double (*)(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *, double, double, int __pyx_skip_dispatch))__pyx_f_7sklearn_12linear_model_8sgd_fast_14Classification_loss; - __pyx_vtable_7sklearn_12linear_model_8sgd_fast_Classification.__pyx_base.dloss = (double (*)(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *, double, double, int __pyx_skip_dispatch))__pyx_f_7sklearn_12linear_model_8sgd_fast_14Classification_dloss; - #else - *(void(**)(void))&__pyx_vtable_7sklearn_12linear_model_8sgd_fast_Classification.__pyx_base.loss = (void(*)(void))__pyx_f_7sklearn_12linear_model_8sgd_fast_14Classification_loss; - *(void(**)(void))&__pyx_vtable_7sklearn_12linear_model_8sgd_fast_Classification.__pyx_base.dloss = (void(*)(void))__pyx_f_7sklearn_12linear_model_8sgd_fast_14Classification_dloss; - #endif - __pyx_type_7sklearn_12linear_model_8sgd_fast_Classification.tp_base = __pyx_ptype_7sklearn_12linear_model_8sgd_fast_LossFunction; - if (PyType_Ready(&__pyx_type_7sklearn_12linear_model_8sgd_fast_Classification) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_7sklearn_12linear_model_8sgd_fast_Classification.tp_dict, __pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_Classification) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "Classification", (PyObject *)&__pyx_type_7sklearn_12linear_model_8sgd_fast_Classification) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_7sklearn_12linear_model_8sgd_fast_Classification = &__pyx_type_7sklearn_12linear_model_8sgd_fast_Classification; - __pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_ModifiedHuber = &__pyx_vtable_7sklearn_12linear_model_8sgd_fast_ModifiedHuber; - __pyx_vtable_7sklearn_12linear_model_8sgd_fast_ModifiedHuber.__pyx_base = *__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_Classification; - #if PY_MAJOR_VERSION >= 3 - __pyx_vtable_7sklearn_12linear_model_8sgd_fast_ModifiedHuber.__pyx_base.__pyx_base.loss = (double (*)(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *, double, double, int __pyx_skip_dispatch))__pyx_f_7sklearn_12linear_model_8sgd_fast_13ModifiedHuber_loss; - __pyx_vtable_7sklearn_12linear_model_8sgd_fast_ModifiedHuber.__pyx_base.__pyx_base.dloss = (double (*)(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *, double, double, int __pyx_skip_dispatch))__pyx_f_7sklearn_12linear_model_8sgd_fast_13ModifiedHuber_dloss; - #else - *(void(**)(void))&__pyx_vtable_7sklearn_12linear_model_8sgd_fast_ModifiedHuber.__pyx_base.__pyx_base.loss = (void(*)(void))__pyx_f_7sklearn_12linear_model_8sgd_fast_13ModifiedHuber_loss; - *(void(**)(void))&__pyx_vtable_7sklearn_12linear_model_8sgd_fast_ModifiedHuber.__pyx_base.__pyx_base.dloss = (void(*)(void))__pyx_f_7sklearn_12linear_model_8sgd_fast_13ModifiedHuber_dloss; - #endif - __pyx_type_7sklearn_12linear_model_8sgd_fast_ModifiedHuber.tp_base = __pyx_ptype_7sklearn_12linear_model_8sgd_fast_Classification; - if (PyType_Ready(&__pyx_type_7sklearn_12linear_model_8sgd_fast_ModifiedHuber) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_7sklearn_12linear_model_8sgd_fast_ModifiedHuber.tp_dict, __pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_ModifiedHuber) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "ModifiedHuber", (PyObject *)&__pyx_type_7sklearn_12linear_model_8sgd_fast_ModifiedHuber) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_7sklearn_12linear_model_8sgd_fast_ModifiedHuber = &__pyx_type_7sklearn_12linear_model_8sgd_fast_ModifiedHuber; - __pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_Hinge = &__pyx_vtable_7sklearn_12linear_model_8sgd_fast_Hinge; - __pyx_vtable_7sklearn_12linear_model_8sgd_fast_Hinge.__pyx_base = *__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_Classification; - #if PY_MAJOR_VERSION >= 3 - __pyx_vtable_7sklearn_12linear_model_8sgd_fast_Hinge.__pyx_base.__pyx_base.loss = (double (*)(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *, double, double, int __pyx_skip_dispatch))__pyx_f_7sklearn_12linear_model_8sgd_fast_5Hinge_loss; - __pyx_vtable_7sklearn_12linear_model_8sgd_fast_Hinge.__pyx_base.__pyx_base.dloss = (double (*)(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *, double, double, int __pyx_skip_dispatch))__pyx_f_7sklearn_12linear_model_8sgd_fast_5Hinge_dloss; - #else - *(void(**)(void))&__pyx_vtable_7sklearn_12linear_model_8sgd_fast_Hinge.__pyx_base.__pyx_base.loss = (void(*)(void))__pyx_f_7sklearn_12linear_model_8sgd_fast_5Hinge_loss; - *(void(**)(void))&__pyx_vtable_7sklearn_12linear_model_8sgd_fast_Hinge.__pyx_base.__pyx_base.dloss = (void(*)(void))__pyx_f_7sklearn_12linear_model_8sgd_fast_5Hinge_dloss; - #endif - __pyx_type_7sklearn_12linear_model_8sgd_fast_Hinge.tp_base = __pyx_ptype_7sklearn_12linear_model_8sgd_fast_Classification; - if (PyType_Ready(&__pyx_type_7sklearn_12linear_model_8sgd_fast_Hinge) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_7sklearn_12linear_model_8sgd_fast_Hinge.tp_dict, __pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_Hinge) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "Hinge", (PyObject *)&__pyx_type_7sklearn_12linear_model_8sgd_fast_Hinge) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_7sklearn_12linear_model_8sgd_fast_Hinge = &__pyx_type_7sklearn_12linear_model_8sgd_fast_Hinge; - __pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_Log = &__pyx_vtable_7sklearn_12linear_model_8sgd_fast_Log; - __pyx_vtable_7sklearn_12linear_model_8sgd_fast_Log.__pyx_base = *__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_Classification; - #if PY_MAJOR_VERSION >= 3 - __pyx_vtable_7sklearn_12linear_model_8sgd_fast_Log.__pyx_base.__pyx_base.loss = (double (*)(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *, double, double, int __pyx_skip_dispatch))__pyx_f_7sklearn_12linear_model_8sgd_fast_3Log_loss; - __pyx_vtable_7sklearn_12linear_model_8sgd_fast_Log.__pyx_base.__pyx_base.dloss = (double (*)(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *, double, double, int __pyx_skip_dispatch))__pyx_f_7sklearn_12linear_model_8sgd_fast_3Log_dloss; - #else - *(void(**)(void))&__pyx_vtable_7sklearn_12linear_model_8sgd_fast_Log.__pyx_base.__pyx_base.loss = (void(*)(void))__pyx_f_7sklearn_12linear_model_8sgd_fast_3Log_loss; - *(void(**)(void))&__pyx_vtable_7sklearn_12linear_model_8sgd_fast_Log.__pyx_base.__pyx_base.dloss = (void(*)(void))__pyx_f_7sklearn_12linear_model_8sgd_fast_3Log_dloss; - #endif - __pyx_type_7sklearn_12linear_model_8sgd_fast_Log.tp_base = __pyx_ptype_7sklearn_12linear_model_8sgd_fast_Classification; - if (PyType_Ready(&__pyx_type_7sklearn_12linear_model_8sgd_fast_Log) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_7sklearn_12linear_model_8sgd_fast_Log.tp_dict, __pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_Log) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "Log", (PyObject *)&__pyx_type_7sklearn_12linear_model_8sgd_fast_Log) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_7sklearn_12linear_model_8sgd_fast_Log = &__pyx_type_7sklearn_12linear_model_8sgd_fast_Log; - __pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_SquaredLoss = &__pyx_vtable_7sklearn_12linear_model_8sgd_fast_SquaredLoss; - __pyx_vtable_7sklearn_12linear_model_8sgd_fast_SquaredLoss.__pyx_base = *__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_Regression; - #if PY_MAJOR_VERSION >= 3 - __pyx_vtable_7sklearn_12linear_model_8sgd_fast_SquaredLoss.__pyx_base.__pyx_base.loss = (double (*)(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *, double, double, int __pyx_skip_dispatch))__pyx_f_7sklearn_12linear_model_8sgd_fast_11SquaredLoss_loss; - __pyx_vtable_7sklearn_12linear_model_8sgd_fast_SquaredLoss.__pyx_base.__pyx_base.dloss = (double (*)(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *, double, double, int __pyx_skip_dispatch))__pyx_f_7sklearn_12linear_model_8sgd_fast_11SquaredLoss_dloss; - #else - *(void(**)(void))&__pyx_vtable_7sklearn_12linear_model_8sgd_fast_SquaredLoss.__pyx_base.__pyx_base.loss = (void(*)(void))__pyx_f_7sklearn_12linear_model_8sgd_fast_11SquaredLoss_loss; - *(void(**)(void))&__pyx_vtable_7sklearn_12linear_model_8sgd_fast_SquaredLoss.__pyx_base.__pyx_base.dloss = (void(*)(void))__pyx_f_7sklearn_12linear_model_8sgd_fast_11SquaredLoss_dloss; - #endif - __pyx_type_7sklearn_12linear_model_8sgd_fast_SquaredLoss.tp_base = __pyx_ptype_7sklearn_12linear_model_8sgd_fast_Regression; - if (PyType_Ready(&__pyx_type_7sklearn_12linear_model_8sgd_fast_SquaredLoss) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_7sklearn_12linear_model_8sgd_fast_SquaredLoss.tp_dict, __pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_SquaredLoss) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "SquaredLoss", (PyObject *)&__pyx_type_7sklearn_12linear_model_8sgd_fast_SquaredLoss) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_7sklearn_12linear_model_8sgd_fast_SquaredLoss = &__pyx_type_7sklearn_12linear_model_8sgd_fast_SquaredLoss; - __pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_Huber = &__pyx_vtable_7sklearn_12linear_model_8sgd_fast_Huber; - __pyx_vtable_7sklearn_12linear_model_8sgd_fast_Huber.__pyx_base = *__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_Regression; - #if PY_MAJOR_VERSION >= 3 - __pyx_vtable_7sklearn_12linear_model_8sgd_fast_Huber.__pyx_base.__pyx_base.loss = (double (*)(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *, double, double, int __pyx_skip_dispatch))__pyx_f_7sklearn_12linear_model_8sgd_fast_5Huber_loss; - __pyx_vtable_7sklearn_12linear_model_8sgd_fast_Huber.__pyx_base.__pyx_base.dloss = (double (*)(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *, double, double, int __pyx_skip_dispatch))__pyx_f_7sklearn_12linear_model_8sgd_fast_5Huber_dloss; - #else - *(void(**)(void))&__pyx_vtable_7sklearn_12linear_model_8sgd_fast_Huber.__pyx_base.__pyx_base.loss = (void(*)(void))__pyx_f_7sklearn_12linear_model_8sgd_fast_5Huber_loss; - *(void(**)(void))&__pyx_vtable_7sklearn_12linear_model_8sgd_fast_Huber.__pyx_base.__pyx_base.dloss = (void(*)(void))__pyx_f_7sklearn_12linear_model_8sgd_fast_5Huber_dloss; - #endif - __pyx_type_7sklearn_12linear_model_8sgd_fast_Huber.tp_base = __pyx_ptype_7sklearn_12linear_model_8sgd_fast_Regression; - if (PyType_Ready(&__pyx_type_7sklearn_12linear_model_8sgd_fast_Huber) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_7sklearn_12linear_model_8sgd_fast_Huber.tp_dict, __pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_Huber) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "Huber", (PyObject *)&__pyx_type_7sklearn_12linear_model_8sgd_fast_Huber) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_7sklearn_12linear_model_8sgd_fast_Huber = &__pyx_type_7sklearn_12linear_model_8sgd_fast_Huber; + __pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_LossFunction = &__pyx_vtable_7scikits_5learn_12linear_model_8sgd_fast_LossFunction; + __pyx_vtable_7scikits_5learn_12linear_model_8sgd_fast_LossFunction.loss = (double (*)(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *, double, double, int __pyx_skip_dispatch))__pyx_f_7scikits_5learn_12linear_model_8sgd_fast_12LossFunction_loss; + __pyx_vtable_7scikits_5learn_12linear_model_8sgd_fast_LossFunction.dloss = (double (*)(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *, double, double, int __pyx_skip_dispatch))__pyx_f_7scikits_5learn_12linear_model_8sgd_fast_12LossFunction_dloss; + if (PyType_Ready(&__pyx_type_7scikits_5learn_12linear_model_8sgd_fast_LossFunction) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_7scikits_5learn_12linear_model_8sgd_fast_LossFunction.tp_dict, __pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_LossFunction) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "LossFunction", (PyObject *)&__pyx_type_7scikits_5learn_12linear_model_8sgd_fast_LossFunction) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_LossFunction = &__pyx_type_7scikits_5learn_12linear_model_8sgd_fast_LossFunction; + __pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Regression = &__pyx_vtable_7scikits_5learn_12linear_model_8sgd_fast_Regression; + __pyx_vtable_7scikits_5learn_12linear_model_8sgd_fast_Regression.__pyx_base = *__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_LossFunction; + __pyx_vtable_7scikits_5learn_12linear_model_8sgd_fast_Regression.__pyx_base.loss = (double (*)(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *, double, double, int __pyx_skip_dispatch))__pyx_f_7scikits_5learn_12linear_model_8sgd_fast_10Regression_loss; + __pyx_vtable_7scikits_5learn_12linear_model_8sgd_fast_Regression.__pyx_base.dloss = (double (*)(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *, double, double, int __pyx_skip_dispatch))__pyx_f_7scikits_5learn_12linear_model_8sgd_fast_10Regression_dloss; + __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Regression.tp_base = __pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_LossFunction; + if (PyType_Ready(&__pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Regression) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Regression.tp_dict, __pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Regression) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "Regression", (PyObject *)&__pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Regression) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_Regression = &__pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Regression; + __pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Classification = &__pyx_vtable_7scikits_5learn_12linear_model_8sgd_fast_Classification; + __pyx_vtable_7scikits_5learn_12linear_model_8sgd_fast_Classification.__pyx_base = *__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_LossFunction; + __pyx_vtable_7scikits_5learn_12linear_model_8sgd_fast_Classification.__pyx_base.loss = (double (*)(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *, double, double, int __pyx_skip_dispatch))__pyx_f_7scikits_5learn_12linear_model_8sgd_fast_14Classification_loss; + __pyx_vtable_7scikits_5learn_12linear_model_8sgd_fast_Classification.__pyx_base.dloss = (double (*)(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *, double, double, int __pyx_skip_dispatch))__pyx_f_7scikits_5learn_12linear_model_8sgd_fast_14Classification_dloss; + __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Classification.tp_base = __pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_LossFunction; + if (PyType_Ready(&__pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Classification) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Classification.tp_dict, __pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Classification) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "Classification", (PyObject *)&__pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Classification) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_Classification = &__pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Classification; + __pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber = &__pyx_vtable_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber; + __pyx_vtable_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber.__pyx_base = *__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Classification; + __pyx_vtable_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber.__pyx_base.__pyx_base.loss = (double (*)(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *, double, double, int __pyx_skip_dispatch))__pyx_f_7scikits_5learn_12linear_model_8sgd_fast_13ModifiedHuber_loss; + __pyx_vtable_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber.__pyx_base.__pyx_base.dloss = (double (*)(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *, double, double, int __pyx_skip_dispatch))__pyx_f_7scikits_5learn_12linear_model_8sgd_fast_13ModifiedHuber_dloss; + __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber.tp_base = __pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_Classification; + if (PyType_Ready(&__pyx_type_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber.tp_dict, __pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "ModifiedHuber", (PyObject *)&__pyx_type_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber = &__pyx_type_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber; + __pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Hinge = &__pyx_vtable_7scikits_5learn_12linear_model_8sgd_fast_Hinge; + __pyx_vtable_7scikits_5learn_12linear_model_8sgd_fast_Hinge.__pyx_base = *__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Classification; + __pyx_vtable_7scikits_5learn_12linear_model_8sgd_fast_Hinge.__pyx_base.__pyx_base.loss = (double (*)(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *, double, double, int __pyx_skip_dispatch))__pyx_f_7scikits_5learn_12linear_model_8sgd_fast_5Hinge_loss; + __pyx_vtable_7scikits_5learn_12linear_model_8sgd_fast_Hinge.__pyx_base.__pyx_base.dloss = (double (*)(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *, double, double, int __pyx_skip_dispatch))__pyx_f_7scikits_5learn_12linear_model_8sgd_fast_5Hinge_dloss; + __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Hinge.tp_base = __pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_Classification; + if (PyType_Ready(&__pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Hinge) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Hinge.tp_dict, __pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Hinge) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "Hinge", (PyObject *)&__pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Hinge) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_Hinge = &__pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Hinge; + __pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Log = &__pyx_vtable_7scikits_5learn_12linear_model_8sgd_fast_Log; + __pyx_vtable_7scikits_5learn_12linear_model_8sgd_fast_Log.__pyx_base = *__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Classification; + __pyx_vtable_7scikits_5learn_12linear_model_8sgd_fast_Log.__pyx_base.__pyx_base.loss = (double (*)(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *, double, double, int __pyx_skip_dispatch))__pyx_f_7scikits_5learn_12linear_model_8sgd_fast_3Log_loss; + __pyx_vtable_7scikits_5learn_12linear_model_8sgd_fast_Log.__pyx_base.__pyx_base.dloss = (double (*)(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *, double, double, int __pyx_skip_dispatch))__pyx_f_7scikits_5learn_12linear_model_8sgd_fast_3Log_dloss; + __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Log.tp_base = __pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_Classification; + if (PyType_Ready(&__pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Log) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Log.tp_dict, __pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Log) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "Log", (PyObject *)&__pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Log) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_Log = &__pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Log; + __pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss = &__pyx_vtable_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss; + __pyx_vtable_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss.__pyx_base = *__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Regression; + __pyx_vtable_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss.__pyx_base.__pyx_base.loss = (double (*)(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *, double, double, int __pyx_skip_dispatch))__pyx_f_7scikits_5learn_12linear_model_8sgd_fast_11SquaredLoss_loss; + __pyx_vtable_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss.__pyx_base.__pyx_base.dloss = (double (*)(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *, double, double, int __pyx_skip_dispatch))__pyx_f_7scikits_5learn_12linear_model_8sgd_fast_11SquaredLoss_dloss; + __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss.tp_base = __pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_Regression; + if (PyType_Ready(&__pyx_type_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss.tp_dict, __pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "SquaredLoss", (PyObject *)&__pyx_type_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss = &__pyx_type_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss; + __pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Huber = &__pyx_vtable_7scikits_5learn_12linear_model_8sgd_fast_Huber; + __pyx_vtable_7scikits_5learn_12linear_model_8sgd_fast_Huber.__pyx_base = *__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Regression; + __pyx_vtable_7scikits_5learn_12linear_model_8sgd_fast_Huber.__pyx_base.__pyx_base.loss = (double (*)(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *, double, double, int __pyx_skip_dispatch))__pyx_f_7scikits_5learn_12linear_model_8sgd_fast_5Huber_loss; + __pyx_vtable_7scikits_5learn_12linear_model_8sgd_fast_Huber.__pyx_base.__pyx_base.dloss = (double (*)(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *, double, double, int __pyx_skip_dispatch))__pyx_f_7scikits_5learn_12linear_model_8sgd_fast_5Huber_dloss; + __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Huber.tp_base = __pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_Regression; + if (PyType_Ready(&__pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Huber) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Huber.tp_dict, __pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Huber) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "Huber", (PyObject *)&__pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Huber) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_Huber = &__pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Huber; /*--- Type import code ---*/ - __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Function import code ---*/ /*--- Execution code ---*/ - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":10 + /* "scikits/learn/linear_model/sgd_fast.pyx":10 * # License: BSD Style. * * import numpy as np # <<<<<<<<<<<<<< @@ -9767,7 +9911,7 @@ PyMODINIT_FUNC PyInit_sgd_fast(void) if (PyObject_SetAttr(__pyx_m, __pyx_n_s__np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":11 + /* "scikits/learn/linear_model/sgd_fast.pyx":11 * * import numpy as np * import sys # <<<<<<<<<<<<<< @@ -9779,7 +9923,7 @@ PyMODINIT_FUNC PyInit_sgd_fast(void) if (PyObject_SetAttr(__pyx_m, __pyx_n_s__sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":12 + /* "scikits/learn/linear_model/sgd_fast.pyx":12 * import numpy as np * import sys * from time import time # <<<<<<<<<<<<<< @@ -9800,20 +9944,44 @@ PyMODINIT_FUNC PyInit_sgd_fast(void) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/python_ref.pxd":1 - * cdef extern from "Python.h": # <<<<<<<<<<<<<< - * ctypedef struct PyTypeObject - * ctypedef struct PyObject: + /* "scikits/learn/linear_model/sgd_fast.pyx":214 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def plain_sgd(np.ndarray[np.float64_t, ndim=1, mode='c'] w, # <<<<<<<<<<<<<< + * double intercept, + * LossFunction loss, + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd, NULL, __pyx_n_s_18); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__plain_sgd, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "scikits/learn/linear_model/sgd_fast.pyx":1 + * # encoding: utf-8 # <<<<<<<<<<<<<< + * # cython: cdivision=True + * # cython: boundscheck=False + */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + + /* "numpy.pxd":963 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); if (__pyx_m) { - __Pyx_AddTraceback("init sklearn.linear_model.sgd_fast"); + __Pyx_AddTraceback("init scikits.learn.linear_model.sgd_fast"); Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init sklearn.linear_model.sgd_fast"); + PyErr_SetString(PyExc_ImportError, "init scikits.learn.linear_model.sgd_fast"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); @@ -9824,81 +9992,217 @@ PyMODINIT_FUNC PyInit_sgd_fast(void) #endif } -static const char *__pyx_filenames[] = { - "sgd_fast.pyx", - "numpy.pxd", -}; - /* Runtime support code */ -static void __pyx_init_filenames(void) { - __pyx_f = __pyx_filenames; +static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { + PyObject *result; + result = PyObject_GetAttr(dict, name); + if (!result) + PyErr_SetObject(PyExc_NameError, name); + return result; } -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, - PyObject* kw_name) -{ - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION >= 3 - "%s() got multiple values for keyword argument '%U'", func_name, kw_name); - #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AS_STRING(kw_name)); - #endif +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); } -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) -{ - Py_ssize_t num_expected; - const char *number, *more_or_less; +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; - if (num_found < num_min) { - num_expected = num_min; - more_or_less = "at least"; - } else { - num_expected = num_max; - more_or_less = "at most"; - } - if (exact) { - more_or_less = "exactly"; - } - number = (num_expected == 1) ? "" : "s"; - PyErr_Format(PyExc_TypeError, - #if PY_VERSION_HEX < 0x02050000 - "%s() takes %s %d positional argument%s (%d given)", - #else - "%s() takes %s %zd positional argument%s (%zd given)", - #endif - func_name, more_or_less, num_expected, number, num_found); + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; } -static int __Pyx_ParseOptionalKeywords( - PyObject *kwds, - PyObject **argnames[], - PyObject *kwds2, - PyObject *values[], - Py_ssize_t num_pos_args, - const char* function_name) -{ - PyObject *key = 0, *value = 0; - Py_ssize_t pos = 0; - PyObject*** name; - PyObject*** first_kw_arg = argnames + num_pos_args; - while (PyDict_Next(kwds, &pos, &key, &value)) { - name = first_kw_arg; - while (*name && (**name != key)) name++; - if (*name) { - values[name-argnames] = value; - } else { - #if PY_MAJOR_VERSION < 3 - if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) { +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { + Py_XINCREF(type); + Py_XINCREF(value); + Py_XINCREF(tb); + /* First, check the traceback argument, replacing None with NULL. */ + if (tb == Py_None) { + Py_DECREF(tb); + tb = 0; + } + else if (tb != NULL && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + /* Next, replace a missing value with None */ + if (value == NULL) { + value = Py_None; + Py_INCREF(value); + } + #if PY_VERSION_HEX < 0x02050000 + if (!PyClass_Check(type)) + #else + if (!PyType_Check(type)) + #endif + { + /* Raising an instance. The value should be a dummy. */ + if (value != Py_None) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + /* Normalize to raise <class>, <instance> */ + Py_DECREF(value); + value = type; + #if PY_VERSION_HEX < 0x02050000 + if (PyInstance_Check(type)) { + type = (PyObject*) ((PyInstanceObject*)type)->in_class; + Py_INCREF(type); + } + else { + type = 0; + PyErr_SetString(PyExc_TypeError, + "raise: exception must be an old-style class or instance"); + goto raise_error; + } + #else + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + #endif + } + + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} + +#else /* Python 3+ */ + +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (!PyExceptionClass_Check(type)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + + PyErr_SetObject(type, value); + + if (tb) { + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } + } + +bad: + return; +} +#endif + +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) +{ + Py_ssize_t num_expected; + const char *number, *more_or_less; + + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + number = (num_expected == 1) ? "" : "s"; + PyErr_Format(PyExc_TypeError, + #if PY_VERSION_HEX < 0x02050000 + "%s() takes %s %d positional argument%s (%d given)", + #else + "%s() takes %s %zd positional argument%s (%zd given)", + #endif + func_name, more_or_less, num_expected, number, num_found); +} + +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AS_STRING(kw_name)); + #endif +} + +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + } else { + #if PY_MAJOR_VERSION < 3 + if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) { #else if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) { #endif @@ -9957,6 +10261,26 @@ bad: return -1; } +static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact) +{ + if (!type) { + PyErr_Format(PyExc_SystemError, "Missing type object"); + return 0; + } + if (none_allowed && obj == Py_None) return 1; + else if (exact) { + if (Py_TYPE(obj) == type) return 1; + } + else { + if (PyObject_TypeCheck(obj, type)) return 1; + } + PyErr_Format(PyExc_TypeError, + "Argument '%s' has incorrect type (expected %s, got %s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); + return 0; +} + static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { unsigned int n = 1; return *(unsigned char*)(&n) != 0; @@ -10076,7 +10400,7 @@ static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) { default: { __Pyx_BufFmt_RaiseUnexpectedChar(ch); return 0; - } + } } } @@ -10120,7 +10444,7 @@ static size_t __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) { default: { __Pyx_BufFmt_RaiseUnexpectedChar(ch); return 0; - } + } } } @@ -10157,7 +10481,7 @@ static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { do { __Pyx_StructField* field = ctx->head->field; __Pyx_TypeInfo* type = field->type; - + if (ctx->packmode == '@' || ctx->packmode == '^') { size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex); } else { @@ -10180,7 +10504,7 @@ static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { ctx->head->parent_offset = parent_offset; continue; } - + __Pyx_BufFmt_RaiseExpected(ctx); return -1; } @@ -10194,7 +10518,7 @@ static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { } ctx->fmt_offset += size; - + --ctx->enc_count; /* Consume from buffer string */ /* Done checking, move to next field, pushing or popping struct stack if needed */ @@ -10227,7 +10551,7 @@ static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { } while (ctx->enc_count); ctx->enc_type = 0; ctx->is_complex = 0; - return 0; + return 0; } static int __Pyx_BufFmt_FirstPack(__Pyx_BufFmt_Context* ctx) { @@ -10349,7 +10673,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha return NULL; } } - + } } } @@ -10362,7 +10686,7 @@ static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) { buf->suboffsets = __Pyx_minusones; } -static int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack) { +static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack) { if (obj == Py_None) { __Pyx_ZeroBuffer(buf); return 0; @@ -10420,33 +10744,10 @@ static void __Pyx_RaiseBufferFallbackError(void) { -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyThreadState *tstate = PyThreadState_GET(); - - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -} - -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { - PyThreadState *tstate = PyThreadState_GET(); - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } - static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, #if PY_VERSION_HEX < 0x02050000 @@ -10457,35 +10758,13 @@ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { (index == 1) ? "" : "s"); } -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(void) { - PyErr_SetString(PyExc_ValueError, "too many values to unpack"); -} - -static PyObject *__Pyx_UnpackItem(PyObject *iter, Py_ssize_t index) { - PyObject *item; - if (!(item = PyIter_Next(iter))) { - if (!PyErr_Occurred()) { - __Pyx_RaiseNeedMoreValuesError(index); - } - } - return item; -} - -static int __Pyx_EndUnpack(PyObject *iter) { - PyObject *item; - if ((item = PyIter_Next(iter))) { - Py_DECREF(item); - __Pyx_RaiseTooManyValuesError(); - return -1; - } - else if (!PyErr_Occurred()) - return 0; - else - return -1; -} - -static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + #if PY_VERSION_HEX < 0x02050000 + "too many values to unpack (expected %d)", (int)expected); + #else + "too many values to unpack (expected %zd)", expected); + #endif } static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { @@ -10494,30 +10773,10 @@ static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { } else if (PyTuple_GET_SIZE(t) < index) { __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); } else { - __Pyx_RaiseTooManyValuesError(); + __Pyx_RaiseTooManyValuesError(index); } } -static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact) -{ - if (!type) { - PyErr_Format(PyExc_SystemError, "Missing type object"); - return 0; - } - if (none_allowed && obj == Py_None) return 1; - else if (exact) { - if (Py_TYPE(obj) == type) return 1; - } - else { - if (PyObject_TypeCheck(obj, type)) return 1; - } - PyErr_Format(PyExc_TypeError, - "Argument '%s' has incorrect type (expected %s, got %s)", - name, type->tp_name, Py_TYPE(obj)->tp_name); - return 0; -} - #if PY_MAJOR_VERSION < 3 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { #if PY_VERSION_HEX >= 0x02060000 @@ -10534,7 +10793,7 @@ static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { static void __Pyx_ReleaseBuffer(Py_buffer *view) { PyObject* obj = view->obj; if (obj) { -if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pf_5numpy_7ndarray___releasebuffer__(obj, view); +if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pf_5numpy_7ndarray_1__releasebuffer__(obj, view); Py_DECREF(obj); view->obj = NULL; } @@ -10543,14 +10802,14 @@ if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pf_5numpy_7ndarra #endif static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) { - PyObject *__import__ = 0; + PyObject *py_import = 0; PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; - __import__ = __Pyx_GetAttrString(__pyx_b, "__import__"); - if (!__import__) + py_import = __Pyx_GetAttrString(__pyx_b, "__import__"); + if (!py_import) goto bad; if (from_list) list = from_list; @@ -10566,133 +10825,15 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) { empty_dict = PyDict_New(); if (!empty_dict) goto bad; - module = PyObject_CallFunctionObjArgs(__import__, + module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, NULL); bad: Py_XDECREF(empty_list); - Py_XDECREF(__import__); + Py_XDECREF(py_import); Py_XDECREF(empty_dict); return module; } -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { - PyObject *result; - result = PyObject_GetAttr(dict, name); - if (!result) - PyErr_SetObject(PyExc_NameError, name); - return result; -} - -#if PY_MAJOR_VERSION < 3 -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { - Py_XINCREF(type); - Py_XINCREF(value); - Py_XINCREF(tb); - /* First, check the traceback argument, replacing None with NULL. */ - if (tb == Py_None) { - Py_DECREF(tb); - tb = 0; - } - else if (tb != NULL && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - /* Next, replace a missing value with None */ - if (value == NULL) { - value = Py_None; - Py_INCREF(value); - } - #if PY_VERSION_HEX < 0x02050000 - if (!PyClass_Check(type)) - #else - if (!PyType_Check(type)) - #endif - { - /* Raising an instance. The value should be a dummy. */ - if (value != Py_None) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto raise_error; - } - /* Normalize to raise <class>, <instance> */ - Py_DECREF(value); - value = type; - #if PY_VERSION_HEX < 0x02050000 - if (PyInstance_Check(type)) { - type = (PyObject*) ((PyInstanceObject*)type)->in_class; - Py_INCREF(type); - } - else { - type = 0; - PyErr_SetString(PyExc_TypeError, - "raise: exception must be an old-style class or instance"); - goto raise_error; - } - #else - type = (PyObject*) Py_TYPE(type); - Py_INCREF(type); - if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto raise_error; - } - #endif - } - - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; -} - -#else /* Python 3+ */ - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { - if (tb == Py_None) { - tb = 0; - } else if (tb && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto bad; - } - if (value == Py_None) - value = 0; - - if (PyExceptionInstance_Check(type)) { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto bad; - } - value = type; - type = (PyObject*) Py_TYPE(value); - } else if (!PyExceptionClass_Check(type)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto bad; - } - - PyErr_SetObject(type, value); - - if (tb) { - PyThreadState *tstate = PyThreadState_GET(); - PyObject* tmp_tb = tstate->curexc_traceback; - if (tb != tmp_tb) { - Py_INCREF(tb); - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_tb); - } - } - -bad: - return; -} -#endif - #if PY_MAJOR_VERSION < 3 static PyObject *__Pyx_GetStdout(void) { PyObject *f = PySys_GetObject((char *)"stdout"); @@ -10702,13 +10843,14 @@ static PyObject *__Pyx_GetStdout(void) { return f; } -static int __Pyx_Print(PyObject *arg_tuple, int newline) { - PyObject *f; +static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) { PyObject* v; int i; - if (!(f = __Pyx_GetStdout())) - return -1; + if (!f) { + if (!(f = __Pyx_GetStdout())) + return -1; + } for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) { if (PyFile_SoftSpace(f, 1)) { if (PyFile_WriteString(" ", f) < 0) @@ -10736,22 +10878,38 @@ static int __Pyx_Print(PyObject *arg_tuple, int newline) { #else /* Python 3 has a print function */ -static int __Pyx_Print(PyObject *arg_tuple, int newline) { +static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) { PyObject* kwargs = 0; PyObject* result = 0; PyObject* end_string; - if (!__pyx_print) { + if (unlikely(!__pyx_print)) { __pyx_print = __Pyx_GetAttrString(__pyx_b, "print"); if (!__pyx_print) return -1; } - if (!newline) { - if (!__pyx_print_kwargs) { + if (stream) { + kwargs = PyDict_New(); + if (unlikely(!kwargs)) + return -1; + if (unlikely(PyDict_SetItemString(kwargs, "file", stream) < 0)) + goto bad; + if (!newline) { + end_string = PyUnicode_FromStringAndSize(" ", 1); + if (unlikely(!end_string)) + goto bad; + if (PyDict_SetItemString(kwargs, "end", end_string) < 0) { + Py_DECREF(end_string); + goto bad; + } + Py_DECREF(end_string); + } + } else if (!newline) { + if (unlikely(!__pyx_print_kwargs)) { __pyx_print_kwargs = PyDict_New(); - if (!__pyx_print_kwargs) + if (unlikely(!__pyx_print_kwargs)) return -1; end_string = PyUnicode_FromStringAndSize(" ", 1); - if (!end_string) + if (unlikely(!end_string)) return -1; if (PyDict_SetItemString(__pyx_print_kwargs, "end", end_string) < 0) { Py_DECREF(end_string); @@ -10762,20 +10920,27 @@ static int __Pyx_Print(PyObject *arg_tuple, int newline) { kwargs = __pyx_print_kwargs; } result = PyObject_Call(__pyx_print, arg_tuple, kwargs); + if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs)) + Py_DECREF(kwargs); if (!result) return -1; Py_DECREF(result); return 0; +bad: + if (kwargs != __pyx_print_kwargs) + Py_XDECREF(kwargs); + return -1; } #endif #if PY_MAJOR_VERSION < 3 -static int __Pyx_PrintOne(PyObject *o) { - PyObject *f; - if (!(f = __Pyx_GetStdout())) - return -1; +static int __Pyx_PrintOne(PyObject* f, PyObject *o) { + if (!f) { + if (!(f = __Pyx_GetStdout())) + return -1; + } if (PyFile_SoftSpace(f, 0)) { if (PyFile_WriteString(" ", f) < 0) return -1; @@ -10787,19 +10952,19 @@ static int __Pyx_PrintOne(PyObject *o) { return 0; /* the line below is just to avoid compiler * compiler warnings about unused functions */ - return __Pyx_Print(NULL, 0); + return __Pyx_Print(f, NULL, 0); } #else /* Python 3 has a print function */ -static int __Pyx_PrintOne(PyObject *o) { +static int __Pyx_PrintOne(PyObject* stream, PyObject *o) { int res; PyObject* arg_tuple = PyTuple_New(1); if (unlikely(!arg_tuple)) return -1; Py_INCREF(o); PyTuple_SET_ITEM(arg_tuple, 0, o); - res = __Pyx_Print(arg_tuple, 1); + res = __Pyx_Print(stream, arg_tuple, 1); Py_DECREF(arg_tuple); return res; } @@ -10870,15 +11035,60 @@ static int __Pyx_PrintOne(PyObject *o) { z.imag = -a.imag; return z; } -/* - static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) { -#if HAVE_HYPOT - return hypotf(z.real, z.imag); -#else - return sqrtf(z.real*z.real + z.imag*z.imag); -#endif - } -*/ + #if 1 + static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrtf(z.real*z.real + z.imag*z.imag); + #else + return hypotf(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + float denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(a, a); + case 3: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(z, a); + case 4: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } + r = a.real; + theta = 0; + } else { + r = __Pyx_c_absf(a); + theta = atan2f(a.imag, a.real); + } + lnr = logf(r); + z_r = expf(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cosf(z_theta); + z.imag = z_r * sinf(z_theta); + return z; + } + #endif #endif #if CYTHON_CCOMPLEX @@ -10945,15 +11155,60 @@ static int __Pyx_PrintOne(PyObject *o) { z.imag = -a.imag; return z; } -/* - static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) { -#if HAVE_HYPOT - return hypot(z.real, z.imag); -#else - return sqrt(z.real*z.real + z.imag*z.imag); -#endif - } -*/ + #if 1 + static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrt(z.real*z.real + z.imag*z.imag); + #else + return hypot(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + double denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(a, a); + case 3: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(z, a); + case 4: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } + r = a.real; + theta = 0; + } else { + r = __Pyx_c_abs(a); + theta = atan2(a.imag, a.real); + } + lnr = log(r); + z_r = exp(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cos(z_theta); + z.imag = z_r * sin(z_theta); + return z; + } + #endif #endif static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) { @@ -11127,6 +11382,25 @@ static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) { return (signed int)__Pyx_PyInt_AsSignedLong(x); } +static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) { + const int neg_one = (int)-1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (sizeof(int) < sizeof(long)) { + long val = __Pyx_PyInt_AsLong(x); + if (unlikely(val != (long)(int)val)) { + if (!unlikely(val == -1 && PyErr_Occurred())) { + PyErr_SetString(PyExc_OverflowError, + (is_unsigned && unlikely(val < 0)) ? + "can't convert negative value to int" : + "value too large to convert to int"); + } + return (int)-1; + } + return (int)val; + } + return (int)__Pyx_PyInt_AsLong(x); +} + static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) { const unsigned long neg_one = (unsigned long)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; @@ -11356,10 +11630,10 @@ static void __Pyx_WriteUnraisable(const char *name) { } static int __Pyx_SetVtable(PyObject *dict, void *vtable) { -#if PY_VERSION_HEX < 0x03010000 - PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); -#else +#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); #endif if (!ob) goto bad; @@ -11400,19 +11674,23 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class if (!result) goto bad; if (!PyType_Check(result)) { - PyErr_Format(PyExc_TypeError, + PyErr_Format(PyExc_TypeError, "%s.%s is not a type object", module_name, class_name); goto bad; } if (!strict && ((PyTypeObject *)result)->tp_basicsize > size) { - PyOS_snprintf(warning, sizeof(warning), + PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility", module_name, class_name); + #if PY_VERSION_HEX < 0x02050000 + PyErr_Warn(NULL, warning); + #else PyErr_WarnEx(NULL, warning, 0); + #endif } else if (((PyTypeObject *)result)->tp_basicsize != size) { - PyErr_Format(PyExc_ValueError, + PyErr_Format(PyExc_ValueError, "%s.%s has the wrong size, try recompiling", module_name, class_name); goto bad; @@ -11550,8 +11828,8 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { /* Type Conversion Functions */ static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - if (x == Py_True) return 1; - else if ((x == Py_False) | (x == Py_None)) return 0; + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } diff --git a/sklearn/linear_model/sgd_fast.pxd b/scikits/learn/linear_model/sgd_fast.pxd similarity index 100% rename from sklearn/linear_model/sgd_fast.pxd rename to scikits/learn/linear_model/sgd_fast.pxd diff --git a/sklearn/linear_model/sgd_fast.pyx b/scikits/learn/linear_model/sgd_fast.pyx similarity index 100% rename from sklearn/linear_model/sgd_fast.pyx rename to scikits/learn/linear_model/sgd_fast.pyx diff --git a/sklearn/linear_model/sgd_fast_sparse.c b/scikits/learn/linear_model/sgd_fast_sparse.c similarity index 77% rename from sklearn/linear_model/sgd_fast_sparse.c rename to scikits/learn/linear_model/sgd_fast_sparse.c index b3faa479d76f91390a1c564dc743f7fed60a2795..270190221f2e5390181c3587c2fb4e5f0115d765 100644 --- a/sklearn/linear_model/sgd_fast_sparse.c +++ b/scikits/learn/linear_model/sgd_fast_sparse.c @@ -1,18 +1,39 @@ -/* Generated by Cython 0.12.1 on Fri Sep 2 11:08:35 2011 */ +/* Generated by Cython 0.14.1 on Wed May 11 16:17:27 2011 */ #define PY_SSIZE_T_CLEAN #include "Python.h" -#include "structmember.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #else -#ifndef PY_LONG_LONG - #define PY_LONG_LONG LONG_LONG +#include <stddef.h> /* For offsetof */ +#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 + #if PY_VERSION_HEX < 0x02040000 #define METH_COEXIST 0 #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type) @@ -82,14 +103,43 @@ #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 -#else +#endif + +#if PY_VERSION_HEX < 0x02060000 + #define PyBytesObject PyStringObject #define PyBytes_Type PyString_Type + #define PyBytes_Check PyString_Check #define PyBytes_CheckExact PyString_CheckExact + #define PyBytes_FromString PyString_FromString + #define PyBytes_FromStringAndSize PyString_FromStringAndSize + #define PyBytes_FromFormat PyString_FromFormat + #define PyBytes_DecodeEscape PyString_DecodeEscape + #define PyBytes_AsString PyString_AsString + #define PyBytes_AsStringAndSize PyString_AsStringAndSize + #define PyBytes_Size PyString_Size + #define PyBytes_AS_STRING PyString_AS_STRING + #define PyBytes_GET_SIZE PyString_GET_SIZE + #define PyBytes_Repr PyString_Repr + #define PyBytes_Concat PyString_Concat + #define PyBytes_ConcatAndDel PyString_ConcatAndDel +#endif + +#if PY_VERSION_HEX < 0x02060000 + #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) + #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) #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) @@ -103,30 +153,42 @@ #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask +#endif + +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#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 -#if PY_MAJOR_VERSION >= 3 - #define PyMethod_New(func, self, klass) PyInstanceMethod_New(func) +#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) + #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) + #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) +#else + #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) + #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) #endif -#if !defined(WIN32) && !defined(MS_WINDOWS) - #ifndef __stdcall - #define __stdcall - #endif - #ifndef __cdecl - #define __cdecl - #endif - #ifndef __fastcall - #define __fastcall - #endif -#else - #define _USE_MATH_DEFINES +#if PY_MAJOR_VERSION >= 3 + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #endif #if PY_VERSION_HEX < 0x02050000 @@ -146,113 +208,69 @@ #define __Pyx_NAMESTR(n) (n) #define __Pyx_DOCSTR(n) (n) #endif + #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif + +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif #include <math.h> -#define __PYX_HAVE_API__sklearn__linear_model__sgd_fast_sparse -#include "stdlib.h" +#define __PYX_HAVE_API__scikits__learn__linear_model__sgd_fast_sparse #include "stdio.h" +#include "stdlib.h" #include "numpy/arrayobject.h" #include "numpy/ufuncobject.h" #include "math.h" +#ifdef PYREX_WITHOUT_ASSERTIONS +#define CYTHON_WITHOUT_ASSERTIONS +#endif + + +/* inline attribute */ #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 + #define CYTHON_INLINE #endif #endif +/* unused attribute */ +#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) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif + typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ /* Type Conversion Predeclarations */ -#if PY_MAJOR_VERSION < 3 -#define __Pyx_PyBytes_FromString PyString_FromString -#define __Pyx_PyBytes_FromStringAndSize PyString_FromStringAndSize -#define __Pyx_PyBytes_AsString PyString_AsString -#else -#define __Pyx_PyBytes_FromString PyBytes_FromString -#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize -#define __Pyx_PyBytes_AsString PyBytes_AsString -#endif - -#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s) -#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) __Pyx_PyBytes_AsString(s)) +#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s) +#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) PyBytes_AsString(s)) #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); -#if !defined(T_PYSSIZET) -#if PY_VERSION_HEX < 0x02050000 -#define T_PYSSIZET T_INT -#elif !defined(T_LONGLONG) -#define T_PYSSIZET \ - ((sizeof(Py_ssize_t) == sizeof(int)) ? T_INT : \ - ((sizeof(Py_ssize_t) == sizeof(long)) ? T_LONG : -1)) -#else -#define T_PYSSIZET \ - ((sizeof(Py_ssize_t) == sizeof(int)) ? T_INT : \ - ((sizeof(Py_ssize_t) == sizeof(long)) ? T_LONG : \ - ((sizeof(Py_ssize_t) == sizeof(PY_LONG_LONG)) ? T_LONGLONG : -1))) -#endif -#endif - - -#if !defined(T_ULONGLONG) -#define __Pyx_T_UNSIGNED_INT(x) \ - ((sizeof(x) == sizeof(unsigned char)) ? T_UBYTE : \ - ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \ - ((sizeof(x) == sizeof(unsigned int)) ? T_UINT : \ - ((sizeof(x) == sizeof(unsigned long)) ? T_ULONG : -1)))) -#else -#define __Pyx_T_UNSIGNED_INT(x) \ - ((sizeof(x) == sizeof(unsigned char)) ? T_UBYTE : \ - ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \ - ((sizeof(x) == sizeof(unsigned int)) ? T_UINT : \ - ((sizeof(x) == sizeof(unsigned long)) ? T_ULONG : \ - ((sizeof(x) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1))))) -#endif -#if !defined(T_LONGLONG) -#define __Pyx_T_SIGNED_INT(x) \ - ((sizeof(x) == sizeof(char)) ? T_BYTE : \ - ((sizeof(x) == sizeof(short)) ? T_SHORT : \ - ((sizeof(x) == sizeof(int)) ? T_INT : \ - ((sizeof(x) == sizeof(long)) ? T_LONG : -1)))) -#else -#define __Pyx_T_SIGNED_INT(x) \ - ((sizeof(x) == sizeof(char)) ? T_BYTE : \ - ((sizeof(x) == sizeof(short)) ? T_SHORT : \ - ((sizeof(x) == sizeof(int)) ? T_INT : \ - ((sizeof(x) == sizeof(long)) ? T_LONG : \ - ((sizeof(x) == sizeof(PY_LONG_LONG)) ? T_LONGLONG : -1))))) -#endif - -#define __Pyx_T_FLOATING(x) \ - ((sizeof(x) == sizeof(float)) ? T_FLOAT : \ - ((sizeof(x) == sizeof(double)) ? T_DOUBLE : -1)) - -#if !defined(T_SIZET) -#if !defined(T_ULONGLONG) -#define T_SIZET \ - ((sizeof(size_t) == sizeof(unsigned int)) ? T_UINT : \ - ((sizeof(size_t) == sizeof(unsigned long)) ? T_ULONG : -1)) -#else -#define T_SIZET \ - ((sizeof(size_t) == sizeof(unsigned int)) ? T_UINT : \ - ((sizeof(size_t) == sizeof(unsigned long)) ? T_ULONG : \ - ((sizeof(size_t) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1))) -#endif -#endif - static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); @@ -262,7 +280,7 @@ static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); #ifdef __GNUC__ /* Test for GCC > 2.95 */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) +#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* __GNUC__ > 2 ... */ @@ -282,7 +300,6 @@ static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; -static const char **__pyx_f; #if !defined(CYTHON_CCOMPLEX) @@ -308,6 +325,12 @@ static const char **__pyx_f; #define _Complex_I 1.0fj #endif +static const char *__pyx_f[] = { + "sgd_fast_sparse.pyx", + "numpy.pxd", + "sgd_fast.pxd", +}; + typedef npy_int8 __pyx_t_5numpy_int8_t; typedef npy_int16 __pyx_t_5numpy_int16_t; @@ -346,9 +369,9 @@ typedef npy_double __pyx_t_5numpy_double_t; typedef npy_longdouble __pyx_t_5numpy_longdouble_t; -typedef __pyx_t_5numpy_float64_t __pyx_t_7sklearn_12linear_model_8sgd_fast_DOUBLE; +typedef __pyx_t_5numpy_float64_t __pyx_t_7scikits_5learn_12linear_model_8sgd_fast_DOUBLE; -typedef __pyx_t_5numpy_int32_t __pyx_t_7sklearn_12linear_model_8sgd_fast_INTEGER; +typedef __pyx_t_5numpy_int32_t __pyx_t_7scikits_5learn_12linear_model_8sgd_fast_INTEGER; #if CYTHON_CCOMPLEX #ifdef __cplusplus @@ -380,7 +403,7 @@ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; typedef npy_cdouble __pyx_t_5numpy_complex_t; -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pxd":20 +/* "sgd_fast.pxd":20 * # ----------------------------------------- * * cdef class LossFunction: # <<<<<<<<<<<<<< @@ -388,12 +411,12 @@ typedef npy_cdouble __pyx_t_5numpy_complex_t; * cpdef double dloss(self, double p, double y) */ -struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction { +struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction { PyObject_HEAD - struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_LossFunction *__pyx_vtab; + struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *__pyx_vtab; }; -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pxd":24 +/* "sgd_fast.pxd":24 * cpdef double dloss(self, double p, double y) * * cdef class Regression(LossFunction): # <<<<<<<<<<<<<< @@ -401,24 +424,23 @@ struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction { * cpdef double dloss(self,double p, double y) */ -struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Regression { - struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction __pyx_base; +struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Regression { + struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction __pyx_base; }; -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pxd":48 +/* "sgd_fast.pxd":44 * cpdef double dloss(self, double p, double y) * - * cdef class Huber(Regression): # <<<<<<<<<<<<<< - * cdef double c + * cdef class SquaredLoss(Regression): # <<<<<<<<<<<<<< * cpdef double loss(self, double p, double y) + * cpdef double dloss(self, double p, double y) */ -struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Huber { - struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Regression __pyx_base; - double c; +struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss { + struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Regression __pyx_base; }; -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pxd":28 +/* "sgd_fast.pxd":28 * cpdef double dloss(self,double p, double y) * * cdef class Classification(LossFunction): # <<<<<<<<<<<<<< @@ -426,35 +448,36 @@ struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Huber { * cpdef double dloss(self, double p, double y) */ -struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Classification { - struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction __pyx_base; +struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Classification { + struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction __pyx_base; }; -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pxd":40 +/* "sgd_fast.pxd":36 * cpdef double dloss(self, double p, double y) * - * cdef class Log(Classification): # <<<<<<<<<<<<<< + * cdef class Hinge(Classification): # <<<<<<<<<<<<<< * cpdef double loss(self, double p, double y) * cpdef double dloss(self, double p, double y) */ -struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Log { - struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Classification __pyx_base; +struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Hinge { + struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Classification __pyx_base; }; -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pxd":36 +/* "sgd_fast.pxd":48 * cpdef double dloss(self, double p, double y) * - * cdef class Hinge(Classification): # <<<<<<<<<<<<<< + * cdef class Huber(Regression): # <<<<<<<<<<<<<< + * cdef double c * cpdef double loss(self, double p, double y) - * cpdef double dloss(self, double p, double y) */ -struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Hinge { - struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Classification __pyx_base; +struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Huber { + struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Regression __pyx_base; + double c; }; -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pxd":32 +/* "sgd_fast.pxd":32 * cpdef double dloss(self, double p, double y) * * cdef class ModifiedHuber(Classification): # <<<<<<<<<<<<<< @@ -462,24 +485,24 @@ struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Hinge { * cpdef double dloss(self, double p, double y) */ -struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_ModifiedHuber { - struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Classification __pyx_base; +struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber { + struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Classification __pyx_base; }; -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pxd":44 +/* "sgd_fast.pxd":40 * cpdef double dloss(self, double p, double y) * - * cdef class SquaredLoss(Regression): # <<<<<<<<<<<<<< + * cdef class Log(Classification): # <<<<<<<<<<<<<< * cpdef double loss(self, double p, double y) * cpdef double dloss(self, double p, double y) */ -struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_SquaredLoss { - struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Regression __pyx_base; +struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Log { + struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Classification __pyx_base; }; -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pxd":20 +/* "sgd_fast.pxd":20 * # ----------------------------------------- * * cdef class LossFunction: # <<<<<<<<<<<<<< @@ -487,14 +510,14 @@ struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_SquaredLoss { * cpdef double dloss(self, double p, double y) */ -struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_LossFunction { - double (*loss)(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *, double, double, int __pyx_skip_dispatch); - double (*dloss)(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *, double, double, int __pyx_skip_dispatch); +struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_LossFunction { + double (*loss)(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *, double, double, int __pyx_skip_dispatch); + double (*dloss)(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *, double, double, int __pyx_skip_dispatch); }; -static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_LossFunction *__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_LossFunction; +static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_LossFunction; -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pxd":24 +/* "sgd_fast.pxd":24 * cpdef double dloss(self, double p, double y) * * cdef class Regression(LossFunction): # <<<<<<<<<<<<<< @@ -502,27 +525,27 @@ static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_LossFunction *_ * cpdef double dloss(self,double p, double y) */ -struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Regression { - struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_LossFunction __pyx_base; +struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Regression { + struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_LossFunction __pyx_base; }; -static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Regression *__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_Regression; +static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Regression *__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Regression; -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pxd":44 +/* "sgd_fast.pxd":48 * cpdef double dloss(self, double p, double y) * - * cdef class SquaredLoss(Regression): # <<<<<<<<<<<<<< + * cdef class Huber(Regression): # <<<<<<<<<<<<<< + * cdef double c * cpdef double loss(self, double p, double y) - * cpdef double dloss(self, double p, double y) */ -struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_SquaredLoss { - struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Regression __pyx_base; +struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Huber { + struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Regression __pyx_base; }; -static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_SquaredLoss *__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_SquaredLoss; +static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Huber *__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Huber; -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pxd":28 +/* "sgd_fast.pxd":28 * cpdef double dloss(self,double p, double y) * * cdef class Classification(LossFunction): # <<<<<<<<<<<<<< @@ -530,27 +553,27 @@ static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_SquaredLoss *__ * cpdef double dloss(self, double p, double y) */ -struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Classification { - struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_LossFunction __pyx_base; +struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Classification { + struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_LossFunction __pyx_base; }; -static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Classification *__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_Classification; +static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Classification *__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Classification; -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pxd":32 +/* "sgd_fast.pxd":36 * cpdef double dloss(self, double p, double y) * - * cdef class ModifiedHuber(Classification): # <<<<<<<<<<<<<< + * cdef class Hinge(Classification): # <<<<<<<<<<<<<< * cpdef double loss(self, double p, double y) * cpdef double dloss(self, double p, double y) */ -struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_ModifiedHuber { - struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Classification __pyx_base; +struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Hinge { + struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Classification __pyx_base; }; -static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_ModifiedHuber *__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_ModifiedHuber; +static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Hinge *__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Hinge; -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pxd":40 +/* "sgd_fast.pxd":40 * cpdef double dloss(self, double p, double y) * * cdef class Log(Classification): # <<<<<<<<<<<<<< @@ -558,38 +581,38 @@ static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_ModifiedHuber * * cpdef double dloss(self, double p, double y) */ -struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Log { - struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Classification __pyx_base; +struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Log { + struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Classification __pyx_base; }; -static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Log *__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_Log; +static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Log *__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Log; -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pxd":48 +/* "sgd_fast.pxd":32 * cpdef double dloss(self, double p, double y) * - * cdef class Huber(Regression): # <<<<<<<<<<<<<< - * cdef double c + * cdef class ModifiedHuber(Classification): # <<<<<<<<<<<<<< * cpdef double loss(self, double p, double y) + * cpdef double dloss(self, double p, double y) */ -struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Huber { - struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Regression __pyx_base; +struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber { + struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Classification __pyx_base; }; -static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Huber *__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_Huber; +static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber *__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber; -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pxd":36 +/* "sgd_fast.pxd":44 * cpdef double dloss(self, double p, double y) * - * cdef class Hinge(Classification): # <<<<<<<<<<<<<< + * cdef class SquaredLoss(Regression): # <<<<<<<<<<<<<< * cpdef double loss(self, double p, double y) * cpdef double dloss(self, double p, double y) */ -struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Hinge { - struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Classification __pyx_base; +struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss { + struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Regression __pyx_base; }; -static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Hinge *__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_Hinge; +static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss *__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss; #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 @@ -637,14 +660,19 @@ static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Hinge *__pyx_vt #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0) -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, PyObject* kw_name); /*proto*/ +static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ 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); /*proto*/ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, PyObject* kw_name); /*proto*/ + static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/ +static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact); /*proto*/ + /* Run-time type information about structs used with buffers */ struct __Pyx_StructField_; @@ -667,8 +695,8 @@ typedef struct { } __Pyx_BufFmt_StackElem; +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); -static int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ @@ -684,11 +712,11 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j } -#define __Pyx_GetItemInt_List(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_List_Fast(o, i, size <= sizeof(long)) : \ +#define __Pyx_GetItemInt_List(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \ + __Pyx_GetItemInt_List_Fast(o, i) : \ __Pyx_GetItemInt_Generic(o, to_py_func(i))) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int fits_long) { +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i) { if (likely(o != Py_None)) { if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, i); @@ -701,14 +729,14 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_ return r; } } - return __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i)); + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } -#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_Tuple_Fast(o, i, size <= sizeof(long)) : \ +#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \ + __Pyx_GetItemInt_Tuple_Fast(o, i) : \ __Pyx_GetItemInt_Generic(o, to_py_func(i))) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int fits_long) { +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i) { if (likely(o != Py_None)) { if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, i); @@ -721,15 +749,15 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize return r; } } - return __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i)); + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } -#define __Pyx_GetItemInt(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_Fast(o, i, size <= sizeof(long)) : \ +#define __Pyx_GetItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \ + __Pyx_GetItemInt_Fast(o, i) : \ __Pyx_GetItemInt_Generic(o, to_py_func(i))) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int fits_long) { +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) { PyObject *r; if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) { r = PyList_GET_ITEM(o, i); @@ -743,7 +771,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, r = PySequence_GetItem(o, i); } else { - r = __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i)); + r = __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } return r; } @@ -751,19 +779,15 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ -static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(void); +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); -static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); /*proto*/ -static int __Pyx_EndUnpack(PyObject *); /*proto*/ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); -static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /*proto*/ - -static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact); /*proto*/ #if PY_MAJOR_VERSION < 3 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); static void __Pyx_ReleaseBuffer(Py_buffer *view); @@ -777,17 +801,13 @@ Py_ssize_t __Pyx_minusones[] = {-1}; static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ - -static int __Pyx_Print(PyObject *, int); /*proto*/ +static int __Pyx_Print(PyObject*, PyObject *, int); /*proto*/ #if PY_MAJOR_VERSION >= 3 static PyObject* __pyx_print = 0; static PyObject* __pyx_print_kwargs = 0; #endif -static int __Pyx_PrintOne(PyObject *o); /*proto*/ - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static int __Pyx_PrintOne(PyObject* stream, PyObject *o); /*proto*/ #if CYTHON_CCOMPLEX #ifdef __cplusplus @@ -822,11 +842,17 @@ static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(floa #ifdef __cplusplus #define __Pyx_c_is_zerof(z) ((z)==(float)0) #define __Pyx_c_conjf(z) (::std::conj(z)) - /*#define __Pyx_c_absf(z) (::std::abs(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)) - /*#define __Pyx_c_absf(z) (cabsf(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); @@ -837,7 +863,10 @@ static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(floa 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); - /*static CYTHON_INLINE float __Pyx_c_absf(__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); @@ -852,11 +881,17 @@ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(do #ifdef __cplusplus #define __Pyx_c_is_zero(z) ((z)==(double)0) #define __Pyx_c_conj(z) (::std::conj(z)) - /*#define __Pyx_c_abs(z) (::std::abs(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)) - /*#define __Pyx_c_abs(z) (cabs(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); @@ -867,7 +902,10 @@ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(do 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); - /*static CYTHON_INLINE double __Pyx_c_abs(__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 CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *); @@ -888,6 +926,8 @@ static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *); static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *); +static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *); + static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *); static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *); @@ -904,18 +944,20 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class static PyObject *__Pyx_ImportModule(const char *name); /*proto*/ -static int __Pyx_GetVtable(PyObject *dict, void *vtabptr); /*proto*/ +static void* __Pyx_GetVtable(PyObject *dict); /*proto*/ static void __Pyx_AddTraceback(const char *funcname); /*proto*/ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ -/* Module declarations from python_buffer */ +/* Module declarations from cpython.buffer */ + +/* Module declarations from cpython.ref */ -/* Module declarations from python_ref */ +/* Module declarations from libc.stdio */ -/* Module declarations from stdlib */ +/* Module declarations from cpython.object */ -/* Module declarations from stdio */ +/* Module declarations from libc.stdlib */ /* Module declarations from numpy */ @@ -936,29 +978,29 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *, PyObjec static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *); /*proto*/ /* Module declarations from cython */ -/* Module declarations from sklearn.linear_model.sgd_fast */ - -static PyTypeObject *__pyx_ptype_7sklearn_12linear_model_8sgd_fast_LossFunction = 0; -static PyTypeObject *__pyx_ptype_7sklearn_12linear_model_8sgd_fast_Regression = 0; -static PyTypeObject *__pyx_ptype_7sklearn_12linear_model_8sgd_fast_Classification = 0; -static PyTypeObject *__pyx_ptype_7sklearn_12linear_model_8sgd_fast_ModifiedHuber = 0; -static PyTypeObject *__pyx_ptype_7sklearn_12linear_model_8sgd_fast_Hinge = 0; -static PyTypeObject *__pyx_ptype_7sklearn_12linear_model_8sgd_fast_Log = 0; -static PyTypeObject *__pyx_ptype_7sklearn_12linear_model_8sgd_fast_SquaredLoss = 0; -static PyTypeObject *__pyx_ptype_7sklearn_12linear_model_8sgd_fast_Huber = 0; -/* Module declarations from sklearn.linear_model.sgd_fast_sparse */ - -static CYTHON_INLINE double __pyx_f_7sklearn_12linear_model_15sgd_fast_sparse_max(double, double); /*proto*/ -static CYTHON_INLINE double __pyx_f_7sklearn_12linear_model_15sgd_fast_sparse_min(double, double); /*proto*/ -static double __pyx_f_7sklearn_12linear_model_15sgd_fast_sparse_dot(double *, double *, int *, int, int); /*proto*/ -static double __pyx_f_7sklearn_12linear_model_15sgd_fast_sparse_add(double *, double, double *, int *, int, int, double); /*proto*/ -static void __pyx_f_7sklearn_12linear_model_15sgd_fast_sparse_l1penalty(double *, double, double *, int *, int, int, double); /*proto*/ +/* Module declarations from scikits.learn.linear_model.sgd_fast */ + +static PyTypeObject *__pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_LossFunction = 0; +static PyTypeObject *__pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_Regression = 0; +static PyTypeObject *__pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_Classification = 0; +static PyTypeObject *__pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber = 0; +static PyTypeObject *__pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_Hinge = 0; +static PyTypeObject *__pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_Log = 0; +static PyTypeObject *__pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss = 0; +static PyTypeObject *__pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_Huber = 0; +/* Module declarations from scikits.learn.linear_model.sgd_fast_sparse */ + +static CYTHON_INLINE double __pyx_f_7scikits_5learn_12linear_model_15sgd_fast_sparse_max(double, double); /*proto*/ +static CYTHON_INLINE double __pyx_f_7scikits_5learn_12linear_model_15sgd_fast_sparse_min(double, double); /*proto*/ +static double __pyx_f_7scikits_5learn_12linear_model_15sgd_fast_sparse_dot(double *, double *, int *, int, int); /*proto*/ +static double __pyx_f_7scikits_5learn_12linear_model_15sgd_fast_sparse_add(double *, double, double *, int *, int, int, double); /*proto*/ +static void __pyx_f_7scikits_5learn_12linear_model_15sgd_fast_sparse_l1penalty(double *, double, double *, int *, int, int, double); /*proto*/ static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), 'R' }; static __Pyx_TypeInfo __Pyx_TypeInfo_int = { "int", NULL, sizeof(int), 'I' }; -#define __Pyx_MODULE_NAME "sklearn.linear_model.sgd_fast_sparse" -int __pyx_module_is_main_sklearn__linear_model__sgd_fast_sparse = 0; +#define __Pyx_MODULE_NAME "scikits.learn.linear_model.sgd_fast_sparse" +static int __pyx_module_is_main_scikits__learn__linear_model__sgd_fast_sparse = 0; -/* Implementation of sklearn.linear_model.sgd_fast_sparse */ +/* Implementation of scikits.learn.linear_model.sgd_fast_sparse */ static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_RuntimeError; @@ -966,13 +1008,13 @@ static char __pyx_k_1[] = "-- Epoch %d"; static char __pyx_k_2[] = "Norm: %.2f, NNZs: %d, Bias: %.6f, T: %d, Avg. loss: %.6f"; static char __pyx_k_3[] = "Total training time: %.2f seconds."; static char __pyx_k_4[] = "floating-point under-/overflow occured."; -static char __pyx_k_5[] = "ndarray is not C contiguous"; -static char __pyx_k_6[] = "ndarray is not Fortran contiguous"; -static char __pyx_k_7[] = "Non-native byte order not supported"; -static char __pyx_k_8[] = "unknown dtype code in numpy.pxd (%d)"; -static char __pyx_k_9[] = "Format string allocated too short, see comment in numpy.pxd"; -static char __pyx_k_10[] = "Format string allocated too short."; -static char __pyx_k_11[] = "plain_sgd (line 34)"; +static char __pyx_k_6[] = "ndarray is not C contiguous"; +static char __pyx_k_8[] = "ndarray is not Fortran contiguous"; +static char __pyx_k_10[] = "Non-native byte order not supported"; +static char __pyx_k_12[] = "unknown dtype code in numpy.pxd (%d)"; +static char __pyx_k_13[] = "Format string allocated too short, see comment in numpy.pxd"; +static char __pyx_k_16[] = "Format string allocated too short."; +static char __pyx_k_18[] = "scikits.learn.linear_model.sgd_fast_sparse"; static char __pyx_k__B[] = "B"; static char __pyx_k__H[] = "H"; static char __pyx_k__I[] = "I"; @@ -1054,15 +1096,15 @@ static char __pyx_k__learning_rate[] = "learning_rate"; static char __pyx_k__sample_weight[] = "sample_weight"; static PyObject *__pyx_kp_s_1; static PyObject *__pyx_kp_u_10; -static PyObject *__pyx_kp_u_11; +static PyObject *__pyx_kp_u_12; +static PyObject *__pyx_kp_u_13; +static PyObject *__pyx_kp_u_16; +static PyObject *__pyx_n_s_18; static PyObject *__pyx_kp_s_2; static PyObject *__pyx_kp_s_3; static PyObject *__pyx_kp_s_4; -static PyObject *__pyx_kp_u_5; static PyObject *__pyx_kp_u_6; -static PyObject *__pyx_kp_u_7; static PyObject *__pyx_kp_u_8; -static PyObject *__pyx_kp_u_9; static PyObject *__pyx_n_s__RandomState; static PyObject *__pyx_n_s__RuntimeError; static PyObject *__pyx_n_s__ValueError; @@ -1126,8 +1168,15 @@ static PyObject *__pyx_n_s__weight_neg; static PyObject *__pyx_n_s__weight_pos; static PyObject *__pyx_n_s__zeros; static PyObject *__pyx_int_15; - -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":34 +static PyObject *__pyx_k_tuple_5; +static PyObject *__pyx_k_tuple_7; +static PyObject *__pyx_k_tuple_9; +static PyObject *__pyx_k_tuple_11; +static PyObject *__pyx_k_tuple_14; +static PyObject *__pyx_k_tuple_15; +static PyObject *__pyx_k_tuple_17; + +/* "scikits/learn/linear_model/sgd_fast_sparse.pyx":34 * @cython.wraparound(False) * @cython.cdivision(True) * def plain_sgd(np.ndarray[double, ndim=1] w, # <<<<<<<<<<<<<< @@ -1135,12 +1184,13 @@ static PyObject *__pyx_int_15; * LossFunction loss, */ -static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd[] = "Cython impl. of SGD with different loss functions and penalties\n\n This representation assumes X represented using the Compressed Sparse Row\n representation of scipy.sparse.\n\n Parameters\n ----------\n w : ndarray[double, ndim=1]\n The allocated coef_ vector.\n intercept : double\n The initial intercept\n loss : LossFunction\n A concrete LossFunction object.\n penalty_type : int\n The penalty 2 for L2, 1 for L1, and 3 for Elastic-Net.\n alpha : float\n The regularization parameter.\n rho : float\n The elastic net hyperparameter.\n X : csr_matrix[double, ndim=2]\n The dataset as a Compressed Sparse Row matrix\n (see scipy.sparse.csr_matrix).\n Y : ndarray[double, ndim=1]\n The labels.\n n_iter : int\n The number of iterations (epochs).\n fit_intercept : int\n Whether or not to fit the intercept (1 or 0).\n verbose : int\n Print verbose output; 0 for quite.\n shuffle : int\n Whether to shuffle the training data before each epoch.\n weight_pos : float\n The weight of the positive class.\n weight_neg : float\n The weight of the negative class.\n seed : int\n The seed of the pseudo random number generator to use when\n shuffling the data\n sample_weight : array, shape = [n_samples]\n The importance weight of each sample.\n learning_rate : int\n The learning rate:\n (1) constant, eta = eta0\n (2) optimal, eta = 1.0/(t+t0)\n (3) inverse scaling, eta = eta0 / pow(t, power_t)\n eta0 : double\n The initial learning rate.\n power_t : double\n The exponent for inverse scaling learning rate.\n\n Returns\n -------\n w : array, shape [n_features]\n The fitted weight vector.\n intercept : float\n The fitted intercept term.\n "; -static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain_sgd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain_sgd[] = "Cython impl. of SGD with different loss functions and penalties\n\n This representation assumes X represented using the Compressed Sparse Row\n representation of scipy.sparse.\n\n Parameters\n ----------\n w : ndarray[double, ndim=1]\n The allocated coef_ vector.\n intercept : double\n The initial intercept\n loss : LossFunction\n A concrete LossFunction object.\n penalty_type : int\n The penalty 2 for L2, 1 for L1, and 3 for Elastic-Net.\n alpha : float\n The regularization parameter.\n rho : float\n The elastic net hyperparameter.\n X : csr_matrix[double, ndim=2]\n The dataset as a Compressed Sparse Row matrix\n (see scipy.sparse.csr_matrix).\n Y : ndarray[double, ndim=1]\n The labels.\n n_iter : int\n The number of iterations (epochs).\n fit_intercept : int\n Whether or not to fit the intercept (1 or 0).\n verbose : int\n Print verbose output; 0 for quite.\n shuffle : int\n Whether to shuffle the training data before each epoch.\n weight_pos : float\n The weight of the positive class.\n weight_neg : float\n The weight of the negative class.\n seed : int\n The seed of the pseudo random number generator to use when\n shuffling the data\n sample_weight : array, shape = [n_samples]\n The importance weight of each sample.\n learning_rate : int\n The learning rate:\n (1) constant, eta = eta0\n (2) optimal, eta = 1.0/(t+t0)\n (3) inverse scaling, eta = eta0 / pow(t, power_t)\n eta0 : double\n The initial learning rate.\n power_t : double\n The exponent for inverse scaling learning rate.\n\n Returns\n -------\n w : array, shape [n_features]\n The fitted weight vector.\n intercept : float\n The fitted intercept term.\n "; +static PyMethodDef __pyx_mdef_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain_sgd = {__Pyx_NAMESTR("plain_sgd"), (PyCFunction)__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain_sgd, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain_sgd)}; +static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain_sgd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyArrayObject *__pyx_v_w = 0; double __pyx_v_intercept; - struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *__pyx_v_loss = 0; + struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *__pyx_v_loss = 0; int __pyx_v_penalty_type; double __pyx_v_alpha; double __pyx_v_rho; @@ -1226,9 +1276,9 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; - int __pyx_t_13; - unsigned int __pyx_t_14; - PyArrayObject *__pyx_t_15 = NULL; + unsigned int __pyx_t_13; + PyArrayObject *__pyx_t_14 = NULL; + int __pyx_t_15; double __pyx_t_16; PyObject *__pyx_t_17 = NULL; int __pyx_t_18; @@ -1397,7 +1447,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py } __pyx_v_w = ((PyArrayObject *)values[0]); __pyx_v_intercept = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_intercept == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_loss = ((struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *)values[2]); + __pyx_v_loss = ((struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *)values[2]); __pyx_v_penalty_type = __Pyx_PyInt_AsInt(values[3]); if (unlikely((__pyx_v_penalty_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_alpha = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_alpha == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_rho = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_rho == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L3_error;} @@ -1421,7 +1471,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py } else { __pyx_v_w = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 0)); __pyx_v_intercept = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_intercept == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_loss = ((struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *)PyTuple_GET_ITEM(__pyx_args, 2)); + __pyx_v_loss = ((struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *)PyTuple_GET_ITEM(__pyx_args, 2)); __pyx_v_penalty_type = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 3)); if (unlikely((__pyx_v_penalty_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_alpha = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 4)); if (unlikely((__pyx_v_alpha == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_rho = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 5)); if (unlikely((__pyx_v_rho == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L3_error;} @@ -1445,16 +1495,11 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("plain_sgd", 1, 21, 21, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("sklearn.linear_model.sgd_fast_sparse.plain_sgd"); + __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast_sparse.plain_sgd"); + __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_INCREF((PyObject *)__pyx_v_w); - __Pyx_INCREF((PyObject *)__pyx_v_loss); - __Pyx_INCREF((PyObject *)__pyx_v_X_data); - __Pyx_INCREF((PyObject *)__pyx_v_X_indices); - __Pyx_INCREF((PyObject *)__pyx_v_X_indptr); - __Pyx_INCREF((PyObject *)__pyx_v_Y); - __Pyx_INCREF((PyObject *)__pyx_v_sample_weight); __pyx_v_t_start = Py_None; __Pyx_INCREF(Py_None); __pyx_bstruct_index.buf = NULL; __pyx_bstruct_q.buf = NULL; @@ -1465,7 +1510,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py __pyx_bstruct_Y.buf = NULL; __pyx_bstruct_sample_weight.buf = NULL; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_w), __pyx_ptype_5numpy_ndarray, 1, "w", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loss), __pyx_ptype_7sklearn_12linear_model_8sgd_fast_LossFunction, 1, "loss", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loss), __pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_LossFunction, 1, "loss", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_X_data), __pyx_ptype_5numpy_ndarray, 1, "X_data", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_X_indices), __pyx_ptype_5numpy_ndarray, 1, "X_indices", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_X_indptr), __pyx_ptype_5numpy_ndarray, 1, "X_indptr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -1508,7 +1553,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py __pyx_bstride_0_sample_weight = __pyx_bstruct_sample_weight.strides[0]; __pyx_bshape_0_sample_weight = __pyx_bstruct_sample_weight.shape[0]; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":108 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":108 * """ * # get the data information into easy vars * cdef unsigned int n_samples = Y.shape[0] # <<<<<<<<<<<<<< @@ -1517,7 +1562,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py */ __pyx_v_n_samples = (__pyx_v_Y->dimensions[0]); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":109 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":109 * # get the data information into easy vars * cdef unsigned int n_samples = Y.shape[0] * cdef unsigned int n_features = w.shape[0] # <<<<<<<<<<<<<< @@ -1526,7 +1571,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py */ __pyx_v_n_features = (__pyx_v_w->dimensions[0]); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":111 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":111 * cdef unsigned int n_features = w.shape[0] * * cdef double *w_data_ptr = <double *>w.data # <<<<<<<<<<<<<< @@ -1535,7 +1580,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py */ __pyx_v_w_data_ptr = ((double *)__pyx_v_w->data); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":112 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":112 * * cdef double *w_data_ptr = <double *>w.data * cdef double *X_data_ptr = <double *>X_data.data # <<<<<<<<<<<<<< @@ -1544,7 +1589,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py */ __pyx_v_X_data_ptr = ((double *)__pyx_v_X_data->data); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":113 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":113 * cdef double *w_data_ptr = <double *>w.data * cdef double *X_data_ptr = <double *>X_data.data * cdef int *X_indptr_ptr = <int *>X_indptr.data # <<<<<<<<<<<<<< @@ -1553,7 +1598,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py */ __pyx_v_X_indptr_ptr = ((int *)__pyx_v_X_indptr->data); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":114 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":114 * cdef double *X_data_ptr = <double *>X_data.data * cdef int *X_indptr_ptr = <int *>X_indptr.data * cdef int *X_indices_ptr = <int *>X_indices.data # <<<<<<<<<<<<<< @@ -1562,7 +1607,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py */ __pyx_v_X_indices_ptr = ((int *)__pyx_v_X_indices->data); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":115 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":115 * cdef int *X_indptr_ptr = <int *>X_indptr.data * cdef int *X_indices_ptr = <int *>X_indices.data * cdef double *Y_data_ptr = <double *>Y.data # <<<<<<<<<<<<<< @@ -1571,7 +1616,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py */ __pyx_v_Y_data_ptr = ((double *)__pyx_v_Y->data); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":117 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":117 * cdef double *Y_data_ptr = <double *>Y.data * * cdef double *sample_weight_data = <double *>sample_weight.data # <<<<<<<<<<<<<< @@ -1580,7 +1625,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py */ __pyx_v_sample_weight_data = ((double *)__pyx_v_sample_weight->data); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":119 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":119 * cdef double *sample_weight_data = <double *>sample_weight.data * * cdef np.ndarray[int, ndim=1, mode="c"] index = np.arange(n_samples, # <<<<<<<<<<<<<< @@ -1595,14 +1640,14 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_v_n_samples); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":120 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":120 * * cdef np.ndarray[int, ndim=1, mode="c"] index = np.arange(n_samples, * dtype=np.int32) # <<<<<<<<<<<<<< @@ -1616,10 +1661,10 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); @@ -1636,7 +1681,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py __pyx_v_index = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":121 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":121 * cdef np.ndarray[int, ndim=1, mode="c"] index = np.arange(n_samples, * dtype=np.int32) * cdef int *index_data_ptr = <int *>index.data # <<<<<<<<<<<<<< @@ -1645,7 +1690,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py */ __pyx_v_index_data_ptr = ((int *)__pyx_v_index->data); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":122 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":122 * dtype=np.int32) * cdef int *index_data_ptr = <int *>index.data * cdef int offset = 0 # <<<<<<<<<<<<<< @@ -1654,7 +1699,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py */ __pyx_v_offset = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":123 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":123 * cdef int *index_data_ptr = <int *>index.data * cdef int offset = 0 * cdef int xnnz = 0 # <<<<<<<<<<<<<< @@ -1663,7 +1708,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py */ __pyx_v_xnnz = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":124 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":124 * cdef int offset = 0 * cdef int xnnz = 0 * cdef double wscale = 1.0 # <<<<<<<<<<<<<< @@ -1672,7 +1717,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py */ __pyx_v_wscale = 1.0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":125 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":125 * cdef int xnnz = 0 * cdef double wscale = 1.0 * cdef double eta = 0.0 # <<<<<<<<<<<<<< @@ -1681,7 +1726,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py */ __pyx_v_eta = 0.0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":126 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":126 * cdef double wscale = 1.0 * cdef double eta = 0.0 * cdef double p = 0.0 # <<<<<<<<<<<<<< @@ -1690,7 +1735,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py */ __pyx_v_p = 0.0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":127 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":127 * cdef double eta = 0.0 * cdef double p = 0.0 * cdef double update = 0.0 # <<<<<<<<<<<<<< @@ -1699,7 +1744,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py */ __pyx_v_update = 0.0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":128 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":128 * cdef double p = 0.0 * cdef double update = 0.0 * cdef double sumloss = 0.0 # <<<<<<<<<<<<<< @@ -1708,7 +1753,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py */ __pyx_v_sumloss = 0.0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":129 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":129 * cdef double update = 0.0 * cdef double sumloss = 0.0 * cdef double wnorm = 0.0 # <<<<<<<<<<<<<< @@ -1717,7 +1762,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py */ __pyx_v_wnorm = 0.0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":130 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":130 * cdef double sumloss = 0.0 * cdef double wnorm = 0.0 * cdef double t = 0.0 # <<<<<<<<<<<<<< @@ -1726,7 +1771,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py */ __pyx_v_t = 0.0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":131 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":131 * cdef double wnorm = 0.0 * cdef double t = 0.0 * cdef double y = 0.0 # <<<<<<<<<<<<<< @@ -1735,7 +1780,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py */ __pyx_v_y = 0.0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":132 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":132 * cdef double t = 0.0 * cdef double y = 0.0 * cdef double class_weight = 1.0 # <<<<<<<<<<<<<< @@ -1744,7 +1789,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py */ __pyx_v_class_weight = 1.0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":133 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":133 * cdef double y = 0.0 * cdef double class_weight = 1.0 * cdef unsigned int count = 0 # <<<<<<<<<<<<<< @@ -1753,7 +1798,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py */ __pyx_v_count = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":134 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":134 * cdef double class_weight = 1.0 * cdef unsigned int count = 0 * cdef unsigned int epoch = 0 # <<<<<<<<<<<<<< @@ -1762,7 +1807,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py */ __pyx_v_epoch = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":135 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":135 * cdef unsigned int count = 0 * cdef unsigned int epoch = 0 * cdef unsigned int i = 0 # <<<<<<<<<<<<<< @@ -1771,7 +1816,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py */ __pyx_v_i = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":136 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":136 * cdef unsigned int epoch = 0 * cdef unsigned int i = 0 * cdef int sample_idx = 0 # <<<<<<<<<<<<<< @@ -1780,7 +1825,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py */ __pyx_v_sample_idx = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":137 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":137 * cdef unsigned int i = 0 * cdef int sample_idx = 0 * cdef np.ndarray[double, ndim=1, mode="c"] q = None # <<<<<<<<<<<<<< @@ -1801,7 +1846,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py __Pyx_INCREF(Py_None); __pyx_v_q = ((PyArrayObject *)Py_None); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":139 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":139 * cdef np.ndarray[double, ndim=1, mode="c"] q = None * cdef double *q_data_ptr * if penalty_type != L2: # <<<<<<<<<<<<<< @@ -1811,7 +1856,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py __pyx_t_8 = (__pyx_v_penalty_type != 2); if (__pyx_t_8) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":140 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":140 * cdef double *q_data_ptr * if penalty_type != L2: * q = np.zeros((n_features,), dtype=np.float64, order="c") # <<<<<<<<<<<<<< @@ -1826,14 +1871,14 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py __pyx_t_5 = PyLong_FromUnsignedLong(__pyx_v_n_features); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __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_GOTREF(((PyObject *)__pyx_t_5)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_3)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); @@ -1845,10 +1890,10 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__order), ((PyObject *)__pyx_n_s__c)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_1, __pyx_t_5, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = ((PyArrayObject *)__pyx_t_4); @@ -1874,7 +1919,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py __pyx_v_q = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":141 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":141 * if penalty_type != L2: * q = np.zeros((n_features,), dtype=np.float64, order="c") * q_data_ptr = <double *> q.data # <<<<<<<<<<<<<< @@ -1886,7 +1931,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py } __pyx_L6:; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":142 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":142 * q = np.zeros((n_features,), dtype=np.float64, order="c") * q_data_ptr = <double *> q.data * cdef double u = 0.0 # <<<<<<<<<<<<<< @@ -1895,7 +1940,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py */ __pyx_v_u = 0.0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":143 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":143 * q_data_ptr = <double *> q.data * cdef double u = 0.0 * cdef double typw = sqrt(1.0 / sqrt(alpha)) # <<<<<<<<<<<<<< @@ -1904,7 +1949,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py */ __pyx_v_typw = sqrt((1.0 / sqrt(__pyx_v_alpha))); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":145 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":145 * cdef double typw = sqrt(1.0 / sqrt(alpha)) * * if learning_rate == OPTIMAL: # <<<<<<<<<<<<<< @@ -1914,19 +1959,19 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py __pyx_t_8 = (__pyx_v_learning_rate == 2); if (__pyx_t_8) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":147 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":147 * if learning_rate == OPTIMAL: * # computing eta0, the initial learning rate * eta0 = typw / max(1.0, loss.dloss(-typw, 1.0)) # <<<<<<<<<<<<<< * else: * eta = eta0 */ - __pyx_v_eta0 = (__pyx_v_typw / __pyx_f_7sklearn_12linear_model_15sgd_fast_sparse_max(1.0, ((struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_LossFunction *)__pyx_v_loss->__pyx_vtab)->dloss(__pyx_v_loss, (-__pyx_v_typw), 1.0, 0))); + __pyx_v_eta0 = (__pyx_v_typw / __pyx_f_7scikits_5learn_12linear_model_15sgd_fast_sparse_max(1.0, ((struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *)__pyx_v_loss->__pyx_vtab)->dloss(__pyx_v_loss, (-__pyx_v_typw), 1.0, 0))); goto __pyx_L7; } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":149 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":149 * eta0 = typw / max(1.0, loss.dloss(-typw, 1.0)) * else: * eta = eta0 # <<<<<<<<<<<<<< @@ -1937,7 +1982,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py } __pyx_L7:; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":151 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":151 * eta = eta0 * * if learning_rate == OPTIMAL: # <<<<<<<<<<<<<< @@ -1947,7 +1992,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py __pyx_t_8 = (__pyx_v_learning_rate == 2); if (__pyx_t_8) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":153 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":153 * if learning_rate == OPTIMAL: * # initialize t such that eta at first example equals eta0 * t = 1.0 / (eta0 * alpha) # <<<<<<<<<<<<<< @@ -1959,7 +2004,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":155 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":155 * t = 1.0 / (eta0 * alpha) * else: * t = 1.0 # <<<<<<<<<<<<<< @@ -1970,7 +2015,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py } __pyx_L8:; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":157 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":157 * t = 1.0 * * t_start = time() # <<<<<<<<<<<<<< @@ -1986,7 +2031,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py __pyx_v_t_start = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":158 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":158 * * t_start = time() * for epoch from 0 <= epoch < n_iter: # <<<<<<<<<<<<<< @@ -1996,7 +2041,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py __pyx_t_9 = __pyx_v_n_iter; for (__pyx_v_epoch = 0; __pyx_v_epoch < __pyx_t_9; __pyx_v_epoch++) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":159 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":159 * t_start = time() * for epoch from 0 <= epoch < n_iter: * if verbose > 0: # <<<<<<<<<<<<<< @@ -2006,35 +2051,34 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py __pyx_t_8 = (__pyx_v_verbose > 0); if (__pyx_t_8) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":160 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":160 * for epoch from 0 <= epoch < n_iter: * if verbose > 0: * print("-- Epoch %d" % (epoch + 1)) # <<<<<<<<<<<<<< * if shuffle: * np.random.RandomState(seed).shuffle(index) */ - __pyx_t_3 = PyLong_FromUnsignedLong((__pyx_v_epoch + 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong((__pyx_v_epoch + 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_1), __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_PrintOne(__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_PrintOne(0, ((PyObject *)__pyx_t_4)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; goto __pyx_L11; } __pyx_L11:; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":161 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":161 * if verbose > 0: * print("-- Epoch %d" % (epoch + 1)) * if shuffle: # <<<<<<<<<<<<<< * np.random.RandomState(seed).shuffle(index) * for i from 0 <= i < n_samples: */ - __pyx_t_13 = __pyx_v_shuffle; - if (__pyx_t_13) { + if (__pyx_v_shuffle) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":162 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":162 * print("-- Epoch %d" % (epoch + 1)) * if shuffle: * np.random.RandomState(seed).shuffle(index) # <<<<<<<<<<<<<< @@ -2052,42 +2096,42 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py __pyx_t_3 = PyInt_FromLong(__pyx_v_seed); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__shuffle); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __Pyx_INCREF(((PyObject *)__pyx_v_index)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_index)); __Pyx_GIVEREF(((PyObject *)__pyx_v_index)); - __pyx_t_4 = PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L12; } __pyx_L12:; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":163 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":163 * if shuffle: * np.random.RandomState(seed).shuffle(index) * for i from 0 <= i < n_samples: # <<<<<<<<<<<<<< * sample_idx = index_data_ptr[i] * offset = X_indptr_ptr[sample_idx] */ - __pyx_t_14 = __pyx_v_n_samples; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_14; __pyx_v_i++) { + __pyx_t_13 = __pyx_v_n_samples; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_13; __pyx_v_i++) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":164 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":164 * np.random.RandomState(seed).shuffle(index) * for i from 0 <= i < n_samples: * sample_idx = index_data_ptr[i] # <<<<<<<<<<<<<< @@ -2096,7 +2140,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py */ __pyx_v_sample_idx = (__pyx_v_index_data_ptr[__pyx_v_i]); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":165 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":165 * for i from 0 <= i < n_samples: * sample_idx = index_data_ptr[i] * offset = X_indptr_ptr[sample_idx] # <<<<<<<<<<<<<< @@ -2105,7 +2149,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py */ __pyx_v_offset = (__pyx_v_X_indptr_ptr[__pyx_v_sample_idx]); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":166 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":166 * sample_idx = index_data_ptr[i] * offset = X_indptr_ptr[sample_idx] * xnnz = X_indptr_ptr[sample_idx + 1] - offset # <<<<<<<<<<<<<< @@ -2114,7 +2158,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py */ __pyx_v_xnnz = ((__pyx_v_X_indptr_ptr[(__pyx_v_sample_idx + 1)]) - __pyx_v_offset); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":167 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":167 * offset = X_indptr_ptr[sample_idx] * xnnz = X_indptr_ptr[sample_idx + 1] - offset * y = Y_data_ptr[sample_idx] # <<<<<<<<<<<<<< @@ -2123,17 +2167,25 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py */ __pyx_v_y = (__pyx_v_Y_data_ptr[__pyx_v_sample_idx]); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":168 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":170 + * if learning_rate == OPTIMAL: + * eta = 1.0 / (alpha * t) + * elif learning_rate == INVSCALING: # <<<<<<<<<<<<<< + * eta = eta0 / pow(t, power_t) + * p = (dot(w_data_ptr, X_data_ptr, X_indices_ptr, + */ + switch (__pyx_v_learning_rate) { + + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":168 * xnnz = X_indptr_ptr[sample_idx + 1] - offset * y = Y_data_ptr[sample_idx] * if learning_rate == OPTIMAL: # <<<<<<<<<<<<<< * eta = 1.0 / (alpha * t) * elif learning_rate == INVSCALING: */ - switch (__pyx_v_learning_rate) { case 2: - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":169 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":169 * y = Y_data_ptr[sample_idx] * if learning_rate == OPTIMAL: * eta = 1.0 / (alpha * t) # <<<<<<<<<<<<<< @@ -2143,7 +2195,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py __pyx_v_eta = (1.0 / (__pyx_v_alpha * __pyx_v_t)); break; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":170 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":170 * if learning_rate == OPTIMAL: * eta = 1.0 / (alpha * t) * elif learning_rate == INVSCALING: # <<<<<<<<<<<<<< @@ -2152,7 +2204,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py */ case 3: - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":171 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":171 * eta = 1.0 / (alpha * t) * elif learning_rate == INVSCALING: * eta = eta0 / pow(t, power_t) # <<<<<<<<<<<<<< @@ -2163,35 +2215,35 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py break; } - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":173 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":173 * eta = eta0 / pow(t, power_t) * p = (dot(w_data_ptr, X_data_ptr, X_indices_ptr, * offset, xnnz) * wscale) + intercept # <<<<<<<<<<<<<< * sumloss += loss.loss(p, y) * if y > 0: */ - __pyx_v_p = ((__pyx_f_7sklearn_12linear_model_15sgd_fast_sparse_dot(__pyx_v_w_data_ptr, __pyx_v_X_data_ptr, __pyx_v_X_indices_ptr, __pyx_v_offset, __pyx_v_xnnz) * __pyx_v_wscale) + __pyx_v_intercept); + __pyx_v_p = ((__pyx_f_7scikits_5learn_12linear_model_15sgd_fast_sparse_dot(__pyx_v_w_data_ptr, __pyx_v_X_data_ptr, __pyx_v_X_indices_ptr, __pyx_v_offset, __pyx_v_xnnz) * __pyx_v_wscale) + __pyx_v_intercept); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":174 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":174 * p = (dot(w_data_ptr, X_data_ptr, X_indices_ptr, * offset, xnnz) * wscale) + intercept * sumloss += loss.loss(p, y) # <<<<<<<<<<<<<< * if y > 0: * class_weight = weight_pos */ - __pyx_v_sumloss += ((struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_LossFunction *)__pyx_v_loss->__pyx_vtab)->loss(__pyx_v_loss, __pyx_v_p, __pyx_v_y, 0); + __pyx_v_sumloss = (__pyx_v_sumloss + ((struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *)__pyx_v_loss->__pyx_vtab)->loss(__pyx_v_loss, __pyx_v_p, __pyx_v_y, 0)); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":175 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":175 * offset, xnnz) * wscale) + intercept * sumloss += loss.loss(p, y) * if y > 0: # <<<<<<<<<<<<<< * class_weight = weight_pos * else: */ - __pyx_t_8 = (__pyx_v_y > 0); + __pyx_t_8 = (__pyx_v_y > 0.0); if (__pyx_t_8) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":176 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":176 * sumloss += loss.loss(p, y) * if y > 0: * class_weight = weight_pos # <<<<<<<<<<<<<< @@ -2203,7 +2255,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":178 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":178 * class_weight = weight_pos * else: * class_weight = weight_neg # <<<<<<<<<<<<<< @@ -2214,16 +2266,16 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py } __pyx_L15:; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":180 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":180 * class_weight = weight_neg * update = eta * loss.dloss(p, y) * class_weight * \ * sample_weight_data[sample_idx] # <<<<<<<<<<<<<< * if update != 0.0: * add(w_data_ptr, wscale, X_data_ptr, X_indices_ptr, */ - __pyx_v_update = (((__pyx_v_eta * ((struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_LossFunction *)__pyx_v_loss->__pyx_vtab)->dloss(__pyx_v_loss, __pyx_v_p, __pyx_v_y, 0)) * __pyx_v_class_weight) * (__pyx_v_sample_weight_data[__pyx_v_sample_idx])); + __pyx_v_update = (((__pyx_v_eta * ((struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *)__pyx_v_loss->__pyx_vtab)->dloss(__pyx_v_loss, __pyx_v_p, __pyx_v_y, 0)) * __pyx_v_class_weight) * (__pyx_v_sample_weight_data[__pyx_v_sample_idx])); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":181 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":181 * update = eta * loss.dloss(p, y) * class_weight * \ * sample_weight_data[sample_idx] * if update != 0.0: # <<<<<<<<<<<<<< @@ -2233,16 +2285,16 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py __pyx_t_8 = (__pyx_v_update != 0.0); if (__pyx_t_8) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":183 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":183 * if update != 0.0: * add(w_data_ptr, wscale, X_data_ptr, X_indices_ptr, * offset, xnnz, -update) # <<<<<<<<<<<<<< * if fit_intercept == 1: * intercept -= update * 0.01 */ - __pyx_f_7sklearn_12linear_model_15sgd_fast_sparse_add(__pyx_v_w_data_ptr, __pyx_v_wscale, __pyx_v_X_data_ptr, __pyx_v_X_indices_ptr, __pyx_v_offset, __pyx_v_xnnz, (-__pyx_v_update)); + __pyx_f_7scikits_5learn_12linear_model_15sgd_fast_sparse_add(__pyx_v_w_data_ptr, __pyx_v_wscale, __pyx_v_X_data_ptr, __pyx_v_X_indices_ptr, __pyx_v_offset, __pyx_v_xnnz, (-__pyx_v_update)); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":184 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":184 * add(w_data_ptr, wscale, X_data_ptr, X_indices_ptr, * offset, xnnz, -update) * if fit_intercept == 1: # <<<<<<<<<<<<<< @@ -2252,14 +2304,14 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py __pyx_t_8 = (__pyx_v_fit_intercept == 1); if (__pyx_t_8) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":185 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":185 * offset, xnnz, -update) * if fit_intercept == 1: * intercept -= update * 0.01 # <<<<<<<<<<<<<< * if penalty_type != L1: * wscale *= (1.0 - (rho * eta * alpha)) */ - __pyx_v_intercept -= (__pyx_v_update * 0.01); + __pyx_v_intercept = (__pyx_v_intercept - (__pyx_v_update * 0.01)); goto __pyx_L17; } __pyx_L17:; @@ -2267,7 +2319,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py } __pyx_L16:; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":186 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":186 * if fit_intercept == 1: * intercept -= update * 0.01 * if penalty_type != L1: # <<<<<<<<<<<<<< @@ -2277,26 +2329,26 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py __pyx_t_8 = (__pyx_v_penalty_type != 1); if (__pyx_t_8) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":187 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":187 * intercept -= update * 0.01 * if penalty_type != L1: * wscale *= (1.0 - (rho * eta * alpha)) # <<<<<<<<<<<<<< * if wscale < 1e-9: * w *= wscale */ - __pyx_v_wscale *= (1.0 - ((__pyx_v_rho * __pyx_v_eta) * __pyx_v_alpha)); + __pyx_v_wscale = (__pyx_v_wscale * (1.0 - ((__pyx_v_rho * __pyx_v_eta) * __pyx_v_alpha))); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":188 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":188 * if penalty_type != L1: * wscale *= (1.0 - (rho * eta * alpha)) * if wscale < 1e-9: # <<<<<<<<<<<<<< * w *= wscale * wscale = 1.0 */ - __pyx_t_8 = (__pyx_v_wscale < 1.0000000000000001e-09); + __pyx_t_8 = (__pyx_v_wscale < 1e-9); if (__pyx_t_8) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":189 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":189 * wscale *= (1.0 - (rho * eta * alpha)) * if wscale < 1e-9: * w *= wscale # <<<<<<<<<<<<<< @@ -2307,14 +2359,14 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyNumber_InPlaceMultiply(((PyObject *)__pyx_v_w), __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_15 = ((PyArrayObject *)__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_w); - __pyx_t_13 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_w, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); - if (unlikely(__pyx_t_13 < 0)) { + __pyx_t_15 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_w, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_15 < 0)) { PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_w, (PyObject*)__pyx_v_w, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); @@ -2325,14 +2377,14 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py } __pyx_bstride_0_w = __pyx_bstruct_w.strides[0]; __pyx_bshape_0_w = __pyx_bstruct_w.shape[0]; - if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_15 = 0; + __pyx_t_14 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_w)); __pyx_v_w = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":190 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":190 * if wscale < 1e-9: * w *= wscale * wscale = 1.0 # <<<<<<<<<<<<<< @@ -2347,7 +2399,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py } __pyx_L18:; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":191 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":191 * w *= wscale * wscale = 1.0 * if penalty_type == L1 or penalty_type == ELASTICNET: # <<<<<<<<<<<<<< @@ -2358,46 +2410,46 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py case 1: case 3: - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":192 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":192 * wscale = 1.0 * if penalty_type == L1 or penalty_type == ELASTICNET: * u += ((1.0 - rho) * eta * alpha) # <<<<<<<<<<<<<< * l1penalty(w_data_ptr, wscale, q_data_ptr, * X_indices_ptr, offset, xnnz, u) */ - __pyx_v_u += (((1.0 - __pyx_v_rho) * __pyx_v_eta) * __pyx_v_alpha); + __pyx_v_u = (__pyx_v_u + (((1.0 - __pyx_v_rho) * __pyx_v_eta) * __pyx_v_alpha)); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":194 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":194 * u += ((1.0 - rho) * eta * alpha) * l1penalty(w_data_ptr, wscale, q_data_ptr, * X_indices_ptr, offset, xnnz, u) # <<<<<<<<<<<<<< * t += 1 * count += 1 */ - __pyx_f_7sklearn_12linear_model_15sgd_fast_sparse_l1penalty(__pyx_v_w_data_ptr, __pyx_v_wscale, __pyx_v_q_data_ptr, __pyx_v_X_indices_ptr, __pyx_v_offset, __pyx_v_xnnz, __pyx_v_u); + __pyx_f_7scikits_5learn_12linear_model_15sgd_fast_sparse_l1penalty(__pyx_v_w_data_ptr, __pyx_v_wscale, __pyx_v_q_data_ptr, __pyx_v_X_indices_ptr, __pyx_v_offset, __pyx_v_xnnz, __pyx_v_u); break; } - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":195 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":195 * l1penalty(w_data_ptr, wscale, q_data_ptr, * X_indices_ptr, offset, xnnz, u) * t += 1 # <<<<<<<<<<<<<< * count += 1 * */ - __pyx_v_t += 1; + __pyx_v_t = (__pyx_v_t + 1.0); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":196 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":196 * X_indices_ptr, offset, xnnz, u) * t += 1 * count += 1 # <<<<<<<<<<<<<< * * # report epoche information */ - __pyx_v_count += 1; + __pyx_v_count = (__pyx_v_count + 1); } - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":199 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":199 * * # report epoche information * if verbose > 0: # <<<<<<<<<<<<<< @@ -2407,7 +2459,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py __pyx_t_8 = (__pyx_v_verbose > 0); if (__pyx_t_8) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":200 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":200 * # report epoche information * if verbose > 0: * wnorm = sqrt(np.dot(w, w) * wscale * wscale) # <<<<<<<<<<<<<< @@ -2420,17 +2472,17 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __Pyx_INCREF(((PyObject *)__pyx_v_w)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_w)); __Pyx_GIVEREF(((PyObject *)__pyx_v_w)); __Pyx_INCREF(((PyObject *)__pyx_v_w)); PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_w)); __Pyx_GIVEREF(((PyObject *)__pyx_v_w)); - __pyx_t_5 = PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __pyx_t_3 = PyFloat_FromDouble(__pyx_v_wscale); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyNumber_Multiply(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -2447,7 +2499,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_wnorm = sqrt(__pyx_t_16); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":202 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":202 * wnorm = sqrt(np.dot(w, w) * wscale * wscale) * print("Norm: %.2f, NNZs: %d, "\ * "Bias: %.6f, T: %d, Avg. loss: %.6f" % (wnorm, # <<<<<<<<<<<<<< @@ -2457,7 +2509,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py __pyx_t_5 = PyFloat_FromDouble(__pyx_v_wnorm); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":203 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":203 * print("Norm: %.2f, NNZs: %d, "\ * "Bias: %.6f, T: %d, Avg. loss: %.6f" % (wnorm, * w.nonzero()[0].shape[0], # <<<<<<<<<<<<<< @@ -2479,7 +2531,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":204 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":204 * "Bias: %.6f, T: %d, Avg. loss: %.6f" % (wnorm, * w.nonzero()[0].shape[0], * intercept, count, # <<<<<<<<<<<<<< @@ -2491,7 +2543,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_v_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":205 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":205 * w.nonzero()[0].shape[0], * intercept, count, * sumloss / count)) # <<<<<<<<<<<<<< @@ -2501,7 +2553,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py __pyx_t_2 = PyFloat_FromDouble((__pyx_v_sumloss / __pyx_v_count)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_17 = PyTuple_New(5); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_17); + __Pyx_GOTREF(((PyObject *)__pyx_t_17)); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_3); @@ -2517,13 +2569,13 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py __pyx_t_4 = 0; __pyx_t_1 = 0; __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_2), __pyx_t_17); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - if (__Pyx_PrintOne(__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_2), ((PyObject *)__pyx_t_17)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0; + if (__Pyx_PrintOne(0, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":206 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":206 * intercept, count, * sumloss / count)) * print("Total training time: %.2f seconds." % (time() - t_start)) # <<<<<<<<<<<<<< @@ -2539,15 +2591,15 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __pyx_t_17 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_3), __pyx_t_2); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_17); + __Pyx_GOTREF(((PyObject *)__pyx_t_17)); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_PrintOne(__pyx_t_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + if (__Pyx_PrintOne(0, ((PyObject *)__pyx_t_17)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0; goto __pyx_L20; } __pyx_L20:; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":209 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":209 * * # floating-point under-/overflow check. * if np.any(np.isinf(w)) or np.any(np.isnan(w)) \ # <<<<<<<<<<<<<< @@ -2565,28 +2617,28 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_17); + __Pyx_GOTREF(((PyObject *)__pyx_t_17)); __Pyx_INCREF(((PyObject *)__pyx_v_w)); PyTuple_SET_ITEM(__pyx_t_17, 0, ((PyObject *)__pyx_v_w)); __Pyx_GIVEREF(((PyObject *)__pyx_v_w)); - __pyx_t_4 = PyObject_Call(__pyx_t_1, __pyx_t_17, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_17), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0; __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_17); + __Pyx_GOTREF(((PyObject *)__pyx_t_17)); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_2, __pyx_t_17, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_17), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __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_17); __pyx_t_17 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_8) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":210 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":210 * # floating-point under-/overflow check. * if np.any(np.isinf(w)) or np.any(np.isnan(w)) \ * or np.isnan(intercept) or np.isinf(intercept): # <<<<<<<<<<<<<< @@ -2599,7 +2651,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":209 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":209 * * # floating-point under-/overflow check. * if np.any(np.isinf(w)) or np.any(np.isnan(w)) \ # <<<<<<<<<<<<<< @@ -2612,28 +2664,28 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py __Pyx_GOTREF(__pyx_t_2); __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 = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); __Pyx_INCREF(((PyObject *)__pyx_v_w)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_w)); __Pyx_GIVEREF(((PyObject *)__pyx_v_w)); - __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __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_DECREF(((PyObject *)__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 = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_17, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_17, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_18 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_18) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":210 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":210 * # floating-point under-/overflow check. * if np.any(np.isinf(w)) or np.any(np.isnan(w)) \ * or np.isnan(intercept) or np.isinf(intercept): # <<<<<<<<<<<<<< @@ -2648,14 +2700,14 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py __pyx_t_1 = PyFloat_FromDouble(__pyx_v_intercept); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_17); + __Pyx_GOTREF(((PyObject *)__pyx_t_17)); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_4, __pyx_t_17, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_17), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __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_17); __pyx_t_17 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0; __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_19) { @@ -2667,14 +2719,14 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py __pyx_t_1 = PyFloat_FromDouble(__pyx_v_intercept); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_17, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_17, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_20 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_21 = __pyx_t_20; @@ -2691,47 +2743,41 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py } if (__pyx_t_18) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":211 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":211 * if np.any(np.isinf(w)) or np.any(np.isnan(w)) \ * or np.isnan(intercept) or np.isinf(intercept): * raise ValueError("floating-point under-/overflow occured.") # <<<<<<<<<<<<<< * * w *= wscale */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_4)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_4)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_4)); - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_1, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L21; } __pyx_L21:; } - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":213 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":213 * raise ValueError("floating-point under-/overflow occured.") * * w *= wscale # <<<<<<<<<<<<<< * return w, intercept * */ - __pyx_t_4 = PyFloat_FromDouble(__pyx_v_wscale); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyNumber_InPlaceMultiply(((PyObject *)__pyx_v_w), __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_wscale); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_15 = ((PyArrayObject *)__pyx_t_1); + __pyx_t_4 = PyNumber_InPlaceMultiply(((PyObject *)__pyx_v_w), __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_w); - __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_w, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_w, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); if (unlikely(__pyx_t_9 < 0)) { PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_w, (PyObject*)__pyx_v_w, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { @@ -2745,12 +2791,12 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py __pyx_bshape_0_w = __pyx_bstruct_w.shape[0]; if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_15 = 0; + __pyx_t_14 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_w)); - __pyx_v_w = ((PyArrayObject *)__pyx_t_1); - __pyx_t_1 = 0; + __pyx_v_w = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":214 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":214 * * w *= wscale * return w, intercept # <<<<<<<<<<<<<< @@ -2758,18 +2804,18 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_intercept); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyFloat_FromDouble(__pyx_v_intercept); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_INCREF(((PyObject *)__pyx_v_w)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_w)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_w)); __Pyx_GIVEREF(((PyObject *)__pyx_v_w)); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; - __pyx_r = __pyx_t_4; + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = ((PyObject *)__pyx_t_1); + __pyx_t_1 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -2792,7 +2838,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py __Pyx_SafeReleaseBuffer(&__pyx_bstruct_q); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_w); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("sklearn.linear_model.sgd_fast_sparse.plain_sgd"); + __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast_sparse.plain_sgd"); __pyx_r = NULL; goto __pyx_L2; __pyx_L0:; @@ -2809,18 +2855,12 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py __Pyx_XDECREF((PyObject *)__pyx_v_q); __Pyx_DECREF(__pyx_v_t_start); __Pyx_DECREF((PyObject *)__pyx_v_w); - __Pyx_DECREF((PyObject *)__pyx_v_loss); - __Pyx_DECREF((PyObject *)__pyx_v_X_data); - __Pyx_DECREF((PyObject *)__pyx_v_X_indices); - __Pyx_DECREF((PyObject *)__pyx_v_X_indptr); - __Pyx_DECREF((PyObject *)__pyx_v_Y); - __Pyx_DECREF((PyObject *)__pyx_v_sample_weight); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":217 +/* "scikits/learn/linear_model/sgd_fast_sparse.pyx":217 * * * cdef inline double max(double a, double b): # <<<<<<<<<<<<<< @@ -2828,12 +2868,12 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd(Py * */ -static CYTHON_INLINE double __pyx_f_7sklearn_12linear_model_15sgd_fast_sparse_max(double __pyx_v_a, double __pyx_v_b) { +static CYTHON_INLINE double __pyx_f_7scikits_5learn_12linear_model_15sgd_fast_sparse_max(double __pyx_v_a, double __pyx_v_b) { double __pyx_r; double __pyx_t_1; __Pyx_RefNannySetupContext("max"); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":218 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":218 * * cdef inline double max(double a, double b): * return a if a >= b else b # <<<<<<<<<<<<<< @@ -2854,7 +2894,7 @@ static CYTHON_INLINE double __pyx_f_7sklearn_12linear_model_15sgd_fast_sparse_ma return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":221 +/* "scikits/learn/linear_model/sgd_fast_sparse.pyx":221 * * * cdef inline double min(double a, double b): # <<<<<<<<<<<<<< @@ -2862,12 +2902,12 @@ static CYTHON_INLINE double __pyx_f_7sklearn_12linear_model_15sgd_fast_sparse_ma * */ -static CYTHON_INLINE double __pyx_f_7sklearn_12linear_model_15sgd_fast_sparse_min(double __pyx_v_a, double __pyx_v_b) { +static CYTHON_INLINE double __pyx_f_7scikits_5learn_12linear_model_15sgd_fast_sparse_min(double __pyx_v_a, double __pyx_v_b) { double __pyx_r; double __pyx_t_1; __Pyx_RefNannySetupContext("min"); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":222 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":222 * * cdef inline double min(double a, double b): * return a if a <= b else b # <<<<<<<<<<<<<< @@ -2888,7 +2928,7 @@ static CYTHON_INLINE double __pyx_f_7sklearn_12linear_model_15sgd_fast_sparse_mi return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":225 +/* "scikits/learn/linear_model/sgd_fast_sparse.pyx":225 * * * cdef double dot(double *w_data_ptr, double *X_data_ptr, int *X_indices_ptr, # <<<<<<<<<<<<<< @@ -2896,14 +2936,14 @@ static CYTHON_INLINE double __pyx_f_7sklearn_12linear_model_15sgd_fast_sparse_mi * cdef double sum = 0.0 */ -static double __pyx_f_7sklearn_12linear_model_15sgd_fast_sparse_dot(double *__pyx_v_w_data_ptr, double *__pyx_v_X_data_ptr, int *__pyx_v_X_indices_ptr, int __pyx_v_offset, int __pyx_v_xnnz) { +static double __pyx_f_7scikits_5learn_12linear_model_15sgd_fast_sparse_dot(double *__pyx_v_w_data_ptr, double *__pyx_v_X_data_ptr, int *__pyx_v_X_indices_ptr, int __pyx_v_offset, int __pyx_v_xnnz) { double __pyx_v_sum; int __pyx_v_j; double __pyx_r; int __pyx_t_1; __Pyx_RefNannySetupContext("dot"); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":227 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":227 * cdef double dot(double *w_data_ptr, double *X_data_ptr, int *X_indices_ptr, * int offset, int xnnz): * cdef double sum = 0.0 # <<<<<<<<<<<<<< @@ -2912,7 +2952,7 @@ static double __pyx_f_7sklearn_12linear_model_15sgd_fast_sparse_dot(double *__p */ __pyx_v_sum = 0.0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":229 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":229 * cdef double sum = 0.0 * cdef int j * for j from 0 <= j < xnnz: # <<<<<<<<<<<<<< @@ -2922,17 +2962,17 @@ static double __pyx_f_7sklearn_12linear_model_15sgd_fast_sparse_dot(double *__p __pyx_t_1 = __pyx_v_xnnz; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_1; __pyx_v_j++) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":230 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":230 * cdef int j * for j from 0 <= j < xnnz: * sum += w_data_ptr[X_indices_ptr[offset + j]] * X_data_ptr[offset + j] # <<<<<<<<<<<<<< * return sum * */ - __pyx_v_sum += ((__pyx_v_w_data_ptr[(__pyx_v_X_indices_ptr[(__pyx_v_offset + __pyx_v_j)])]) * (__pyx_v_X_data_ptr[(__pyx_v_offset + __pyx_v_j)])); + __pyx_v_sum = (__pyx_v_sum + ((__pyx_v_w_data_ptr[(__pyx_v_X_indices_ptr[(__pyx_v_offset + __pyx_v_j)])]) * (__pyx_v_X_data_ptr[(__pyx_v_offset + __pyx_v_j)]))); } - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":231 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":231 * for j from 0 <= j < xnnz: * sum += w_data_ptr[X_indices_ptr[offset + j]] * X_data_ptr[offset + j] * return sum # <<<<<<<<<<<<<< @@ -2948,7 +2988,7 @@ static double __pyx_f_7sklearn_12linear_model_15sgd_fast_sparse_dot(double *__p return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":234 +/* "scikits/learn/linear_model/sgd_fast_sparse.pyx":234 * * * cdef double add(double *w_data_ptr, double wscale, double *X_data_ptr, # <<<<<<<<<<<<<< @@ -2956,7 +2996,7 @@ static double __pyx_f_7sklearn_12linear_model_15sgd_fast_sparse_dot(double *__p * """Scales example x by constant c and adds it to the weight vector w""" */ -static double __pyx_f_7sklearn_12linear_model_15sgd_fast_sparse_add(double *__pyx_v_w_data_ptr, double __pyx_v_wscale, double *__pyx_v_X_data_ptr, int *__pyx_v_X_indices_ptr, int __pyx_v_offset, int __pyx_v_xnnz, double __pyx_v_c) { +static double __pyx_f_7scikits_5learn_12linear_model_15sgd_fast_sparse_add(double *__pyx_v_w_data_ptr, double __pyx_v_wscale, double *__pyx_v_X_data_ptr, int *__pyx_v_X_indices_ptr, int __pyx_v_offset, int __pyx_v_xnnz, double __pyx_v_c) { int __pyx_v_j; int __pyx_v_idx; double __pyx_v_val; @@ -2964,9 +3004,10 @@ static double __pyx_f_7sklearn_12linear_model_15sgd_fast_sparse_add(double *__p double __pyx_v_xsqnorm; double __pyx_r; int __pyx_t_1; + int __pyx_t_2; __Pyx_RefNannySetupContext("add"); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":240 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":240 * cdef int idx * cdef double val * cdef double innerprod = 0.0 # <<<<<<<<<<<<<< @@ -2975,7 +3016,7 @@ static double __pyx_f_7sklearn_12linear_model_15sgd_fast_sparse_add(double *__p */ __pyx_v_innerprod = 0.0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":241 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":241 * cdef double val * cdef double innerprod = 0.0 * cdef double xsqnorm = 0.0 # <<<<<<<<<<<<<< @@ -2984,7 +3025,7 @@ static double __pyx_f_7sklearn_12linear_model_15sgd_fast_sparse_add(double *__p */ __pyx_v_xsqnorm = 0.0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":242 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":242 * cdef double innerprod = 0.0 * cdef double xsqnorm = 0.0 * for j from 0 <= j < xnnz: # <<<<<<<<<<<<<< @@ -2994,7 +3035,7 @@ static double __pyx_f_7sklearn_12linear_model_15sgd_fast_sparse_add(double *__p __pyx_t_1 = __pyx_v_xnnz; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_1; __pyx_v_j++) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":243 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":243 * cdef double xsqnorm = 0.0 * for j from 0 <= j < xnnz: * idx = X_indices_ptr[offset + j] # <<<<<<<<<<<<<< @@ -3003,7 +3044,7 @@ static double __pyx_f_7sklearn_12linear_model_15sgd_fast_sparse_add(double *__p */ __pyx_v_idx = (__pyx_v_X_indices_ptr[(__pyx_v_offset + __pyx_v_j)]); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":244 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":244 * for j from 0 <= j < xnnz: * idx = X_indices_ptr[offset + j] * val = X_data_ptr[offset + j] # <<<<<<<<<<<<<< @@ -3012,35 +3053,36 @@ static double __pyx_f_7sklearn_12linear_model_15sgd_fast_sparse_add(double *__p */ __pyx_v_val = (__pyx_v_X_data_ptr[(__pyx_v_offset + __pyx_v_j)]); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":245 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":245 * idx = X_indices_ptr[offset + j] * val = X_data_ptr[offset + j] * innerprod += (w_data_ptr[idx] * val) # <<<<<<<<<<<<<< * xsqnorm += (val * val) * w_data_ptr[idx] += val * (c / wscale) */ - __pyx_v_innerprod += ((__pyx_v_w_data_ptr[__pyx_v_idx]) * __pyx_v_val); + __pyx_v_innerprod = (__pyx_v_innerprod + ((__pyx_v_w_data_ptr[__pyx_v_idx]) * __pyx_v_val)); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":246 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":246 * val = X_data_ptr[offset + j] * innerprod += (w_data_ptr[idx] * val) * xsqnorm += (val * val) # <<<<<<<<<<<<<< * w_data_ptr[idx] += val * (c / wscale) * return (xsqnorm * c * c) + (2.0 * innerprod * wscale * c) */ - __pyx_v_xsqnorm += (__pyx_v_val * __pyx_v_val); + __pyx_v_xsqnorm = (__pyx_v_xsqnorm + (__pyx_v_val * __pyx_v_val)); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":247 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":247 * innerprod += (w_data_ptr[idx] * val) * xsqnorm += (val * val) * w_data_ptr[idx] += val * (c / wscale) # <<<<<<<<<<<<<< * return (xsqnorm * c * c) + (2.0 * innerprod * wscale * c) * */ - (__pyx_v_w_data_ptr[__pyx_v_idx]) += (__pyx_v_val * (__pyx_v_c / __pyx_v_wscale)); + __pyx_t_2 = __pyx_v_idx; + (__pyx_v_w_data_ptr[__pyx_t_2]) = ((__pyx_v_w_data_ptr[__pyx_t_2]) + (__pyx_v_val * (__pyx_v_c / __pyx_v_wscale))); } - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":248 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":248 * xsqnorm += (val * val) * w_data_ptr[idx] += val * (c / wscale) * return (xsqnorm * c * c) + (2.0 * innerprod * wscale * c) # <<<<<<<<<<<<<< @@ -3056,7 +3098,7 @@ static double __pyx_f_7sklearn_12linear_model_15sgd_fast_sparse_add(double *__p return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":251 +/* "scikits/learn/linear_model/sgd_fast_sparse.pyx":251 * * * cdef void l1penalty(double *w_data_ptr, double wscale, double *q_data_ptr, # <<<<<<<<<<<<<< @@ -3064,15 +3106,16 @@ static double __pyx_f_7sklearn_12linear_model_15sgd_fast_sparse_add(double *__p * """Apply the L1 penalty to each updated feature */ -static void __pyx_f_7sklearn_12linear_model_15sgd_fast_sparse_l1penalty(double *__pyx_v_w_data_ptr, double __pyx_v_wscale, double *__pyx_v_q_data_ptr, int *__pyx_v_X_indices_ptr, int __pyx_v_offset, int __pyx_v_xnnz, double __pyx_v_u) { +static void __pyx_f_7scikits_5learn_12linear_model_15sgd_fast_sparse_l1penalty(double *__pyx_v_w_data_ptr, double __pyx_v_wscale, double *__pyx_v_q_data_ptr, int *__pyx_v_X_indices_ptr, int __pyx_v_offset, int __pyx_v_xnnz, double __pyx_v_u) { double __pyx_v_z; int __pyx_v_j; int __pyx_v_idx; int __pyx_t_1; int __pyx_t_2; + int __pyx_t_3; __Pyx_RefNannySetupContext("l1penalty"); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":258 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":258 * [Tsuruoka, Y., Tsujii, J., and Ananiadou, S., 2009]. * """ * cdef double z = 0.0 # <<<<<<<<<<<<<< @@ -3081,7 +3124,7 @@ static void __pyx_f_7sklearn_12linear_model_15sgd_fast_sparse_l1penalty(double */ __pyx_v_z = 0.0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":259 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":259 * """ * cdef double z = 0.0 * cdef int j = 0 # <<<<<<<<<<<<<< @@ -3090,7 +3133,7 @@ static void __pyx_f_7sklearn_12linear_model_15sgd_fast_sparse_l1penalty(double */ __pyx_v_j = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":260 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":260 * cdef double z = 0.0 * cdef int j = 0 * cdef int idx = 0 # <<<<<<<<<<<<<< @@ -3099,7 +3142,7 @@ static void __pyx_f_7sklearn_12linear_model_15sgd_fast_sparse_l1penalty(double */ __pyx_v_idx = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":261 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":261 * cdef int j = 0 * cdef int idx = 0 * for j from 0 <= j < xnnz: # <<<<<<<<<<<<<< @@ -3109,7 +3152,7 @@ static void __pyx_f_7sklearn_12linear_model_15sgd_fast_sparse_l1penalty(double __pyx_t_1 = __pyx_v_xnnz; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_1; __pyx_v_j++) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":262 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":262 * cdef int idx = 0 * for j from 0 <= j < xnnz: * idx = X_indices_ptr[offset + j] # <<<<<<<<<<<<<< @@ -3118,7 +3161,7 @@ static void __pyx_f_7sklearn_12linear_model_15sgd_fast_sparse_l1penalty(double */ __pyx_v_idx = (__pyx_v_X_indices_ptr[(__pyx_v_offset + __pyx_v_j)]); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":263 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":263 * for j from 0 <= j < xnnz: * idx = X_indices_ptr[offset + j] * z = w_data_ptr[idx] # <<<<<<<<<<<<<< @@ -3127,7 +3170,7 @@ static void __pyx_f_7sklearn_12linear_model_15sgd_fast_sparse_l1penalty(double */ __pyx_v_z = (__pyx_v_w_data_ptr[__pyx_v_idx]); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":264 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":264 * idx = X_indices_ptr[offset + j] * z = w_data_ptr[idx] * if (wscale * w_data_ptr[idx]) > 0.0: # <<<<<<<<<<<<<< @@ -3137,18 +3180,18 @@ static void __pyx_f_7sklearn_12linear_model_15sgd_fast_sparse_l1penalty(double __pyx_t_2 = ((__pyx_v_wscale * (__pyx_v_w_data_ptr[__pyx_v_idx])) > 0.0); if (__pyx_t_2) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":265 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":265 * z = w_data_ptr[idx] * if (wscale * w_data_ptr[idx]) > 0.0: * w_data_ptr[idx] = max( # <<<<<<<<<<<<<< * 0.0, w_data_ptr[idx] - ((u + q_data_ptr[idx]) / wscale)) * */ - (__pyx_v_w_data_ptr[__pyx_v_idx]) = __pyx_f_7sklearn_12linear_model_15sgd_fast_sparse_max(0.0, ((__pyx_v_w_data_ptr[__pyx_v_idx]) - ((__pyx_v_u + (__pyx_v_q_data_ptr[__pyx_v_idx])) / __pyx_v_wscale))); + (__pyx_v_w_data_ptr[__pyx_v_idx]) = __pyx_f_7scikits_5learn_12linear_model_15sgd_fast_sparse_max(0.0, ((__pyx_v_w_data_ptr[__pyx_v_idx]) - ((__pyx_v_u + (__pyx_v_q_data_ptr[__pyx_v_idx])) / __pyx_v_wscale))); goto __pyx_L5; } - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":268 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":268 * 0.0, w_data_ptr[idx] - ((u + q_data_ptr[idx]) / wscale)) * * elif (wscale * w_data_ptr[idx]) < 0.0: # <<<<<<<<<<<<<< @@ -3158,30 +3201,31 @@ static void __pyx_f_7sklearn_12linear_model_15sgd_fast_sparse_l1penalty(double __pyx_t_2 = ((__pyx_v_wscale * (__pyx_v_w_data_ptr[__pyx_v_idx])) < 0.0); if (__pyx_t_2) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":269 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":269 * * elif (wscale * w_data_ptr[idx]) < 0.0: * w_data_ptr[idx] = min( # <<<<<<<<<<<<<< * 0.0, w_data_ptr[idx] + ((u - q_data_ptr[idx]) / wscale)) * */ - (__pyx_v_w_data_ptr[__pyx_v_idx]) = __pyx_f_7sklearn_12linear_model_15sgd_fast_sparse_min(0.0, ((__pyx_v_w_data_ptr[__pyx_v_idx]) + ((__pyx_v_u - (__pyx_v_q_data_ptr[__pyx_v_idx])) / __pyx_v_wscale))); + (__pyx_v_w_data_ptr[__pyx_v_idx]) = __pyx_f_7scikits_5learn_12linear_model_15sgd_fast_sparse_min(0.0, ((__pyx_v_w_data_ptr[__pyx_v_idx]) + ((__pyx_v_u - (__pyx_v_q_data_ptr[__pyx_v_idx])) / __pyx_v_wscale))); goto __pyx_L5; } __pyx_L5:; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":272 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":272 * 0.0, w_data_ptr[idx] + ((u - q_data_ptr[idx]) / wscale)) * * q_data_ptr[idx] += (wscale * (w_data_ptr[idx] - z)) # <<<<<<<<<<<<<< */ - (__pyx_v_q_data_ptr[__pyx_v_idx]) += (__pyx_v_wscale * ((__pyx_v_w_data_ptr[__pyx_v_idx]) - __pyx_v_z)); + __pyx_t_3 = __pyx_v_idx; + (__pyx_v_q_data_ptr[__pyx_t_3]) = ((__pyx_v_q_data_ptr[__pyx_t_3]) + (__pyx_v_wscale * ((__pyx_v_w_data_ptr[__pyx_v_idx]) - __pyx_v_z))); } __Pyx_RefNannyFinishContext(); } -/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":187 +/* "numpy.pxd":188 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -3189,8 +3233,8 @@ static void __pyx_f_7sklearn_12linear_model_15sgd_fast_sparse_l1penalty(double * # requirements, and does not yet fullfill the PEP. */ -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { +static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__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; @@ -3202,22 +3246,21 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf int __pyx_v_offset; int __pyx_v_hasfields; int __pyx_r; - int __pyx_t_1; + PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; + int __pyx_t_4; + int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; - int __pyx_t_8; + PyObject *__pyx_t_8 = NULL; char *__pyx_t_9; __Pyx_RefNannySetupContext("__getbuffer__"); if (__pyx_v_info == NULL) return 0; __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(__pyx_v_info->obj); - __Pyx_INCREF((PyObject *)__pyx_v_self); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":193 + /* "numpy.pxd":194 * # of flags * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -3226,7 +3269,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ __pyx_v_endian_detector = 1; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":194 + /* "numpy.pxd":195 * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -3235,26 +3278,29 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":196 + /* "numpy.pxd":197 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) * * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< * * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - __pyx_v_ndim = PyArray_NDIM(((PyArrayObject *)__pyx_v_self)); + __pyx_t_1 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_ndim = PyArray_NDIM(((PyArrayObject *)__pyx_t_1)); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":198 + /* "numpy.pxd":199 * 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))); - if (__pyx_t_1) { + __pyx_t_2 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); + if (__pyx_t_2) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":199 + /* "numpy.pxd":200 * * if sizeof(npy_intp) != sizeof(Py_ssize_t): * copy_shape = 1 # <<<<<<<<<<<<<< @@ -3266,7 +3312,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf } /*else*/ { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":201 + /* "numpy.pxd":202 * copy_shape = 1 * else: * copy_shape = 0 # <<<<<<<<<<<<<< @@ -3277,108 +3323,105 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf } __pyx_L5:; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":203 + /* "numpy.pxd":204 * 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_1 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS); - if (__pyx_t_1) { + __pyx_t_2 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS); + if (__pyx_t_2) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":204 + /* "numpy.pxd":205 * * 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(((PyArrayObject *)__pyx_v_self), NPY_C_CONTIGUOUS)); - __pyx_t_3 = __pyx_t_2; + __pyx_t_1 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_t_1), NPY_C_CONTIGUOUS)); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __pyx_t_3; } else { - __pyx_t_3 = __pyx_t_1; + __pyx_t_4 = __pyx_t_2; } - if (__pyx_t_3) { + if (__pyx_t_4) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":205 + /* "numpy.pxd":206 * 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_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(((PyObject *)__pyx_kp_u_5)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_u_5)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_5)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_7), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":207 + /* "numpy.pxd":208 * 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_3 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS); - if (__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS); + if (__pyx_t_4) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":208 + /* "numpy.pxd":209 * * 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_1 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_v_self), NPY_F_CONTIGUOUS)); - __pyx_t_2 = __pyx_t_1; + __pyx_t_1 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_t_1), NPY_F_CONTIGUOUS)); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __pyx_t_2; } else { - __pyx_t_2 = __pyx_t_3; + __pyx_t_3 = __pyx_t_4; } - if (__pyx_t_2) { + if (__pyx_t_3) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":209 + /* "numpy.pxd":210 * 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_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_INCREF(((PyObject *)__pyx_kp_u_6)); - PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_u_6)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_6)); - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_9), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L7; } __pyx_L7:; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":211 + /* "numpy.pxd":212 * 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(((PyArrayObject *)__pyx_v_self)); + __pyx_t_1 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_info->buf = PyArray_DATA(((PyArrayObject *)__pyx_t_1)); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":212 + /* "numpy.pxd":213 * * info.buf = PyArray_DATA(self) * info.ndim = ndim # <<<<<<<<<<<<<< @@ -3387,17 +3430,16 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ __pyx_v_info->ndim = __pyx_v_ndim; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":213 + /* "numpy.pxd":214 * 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_6 = __pyx_v_copy_shape; - if (__pyx_t_6) { + if (__pyx_v_copy_shape) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":216 + /* "numpy.pxd":217 * # Allocate new buffer for strides and shape info. This is allocated * # as one block, strides first. * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< @@ -3406,7 +3448,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * __pyx_v_ndim) * 2))); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":217 + /* "numpy.pxd":218 * # as one block, strides first. * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) * info.shape = info.strides + ndim # <<<<<<<<<<<<<< @@ -3415,60 +3457,72 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":218 + /* "numpy.pxd":219 * info.strides = <Py_ssize_t*>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_6 = __pyx_v_ndim; - for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { - __pyx_v_i = __pyx_t_7; + __pyx_t_5 = __pyx_v_ndim; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":219 + /* "numpy.pxd":220 * 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(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]); + __pyx_t_1 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_1); + (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(((PyArrayObject *)__pyx_t_1))[__pyx_v_i]); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":220 + /* "numpy.pxd":221 * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< * else: * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) */ - (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]); + __pyx_t_1 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_1); + (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(((PyArrayObject *)__pyx_t_1))[__pyx_v_i]); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } goto __pyx_L8; } /*else*/ { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":222 + /* "numpy.pxd":223 * info.shape[i] = PyArray_DIMS(self)[i] * else: * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) # <<<<<<<<<<<<<< * info.shape = <Py_ssize_t*>PyArray_DIMS(self) * info.suboffsets = NULL */ - __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(((PyArrayObject *)__pyx_v_self))); + __pyx_t_1 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(((PyArrayObject *)__pyx_t_1))); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":223 + /* "numpy.pxd":224 * else: * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) * info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<< * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) */ - __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(((PyArrayObject *)__pyx_v_self))); + __pyx_t_1 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(((PyArrayObject *)__pyx_t_1))); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L8:; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":224 + /* "numpy.pxd":225 * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) * info.shape = <Py_ssize_t*>PyArray_DIMS(self) * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -3477,25 +3531,31 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ __pyx_v_info->suboffsets = NULL; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":225 + /* "numpy.pxd":226 * info.shape = <Py_ssize_t*>PyArray_DIMS(self) * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< * info.readonly = not PyArray_ISWRITEABLE(self) * */ - __pyx_v_info->itemsize = PyArray_ITEMSIZE(((PyArrayObject *)__pyx_v_self)); + __pyx_t_1 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_info->itemsize = PyArray_ITEMSIZE(((PyArrayObject *)__pyx_t_1)); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":226 + /* "numpy.pxd":227 * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< * * cdef int t */ - __pyx_v_info->readonly = (!PyArray_ISWRITEABLE(((PyArrayObject *)__pyx_v_self))); + __pyx_t_1 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_info->readonly = (!PyArray_ISWRITEABLE(((PyArrayObject *)__pyx_t_1))); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":229 + /* "numpy.pxd":230 * * cdef int t * cdef char* f = NULL # <<<<<<<<<<<<<< @@ -3504,7 +3564,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ __pyx_v_f = NULL; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":230 + /* "numpy.pxd":231 * cdef int t * cdef char* f = NULL * cdef dtype descr = self.descr # <<<<<<<<<<<<<< @@ -3514,7 +3574,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_self)->descr)); __pyx_v_descr = ((PyArrayObject *)__pyx_v_self)->descr; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":234 + /* "numpy.pxd":235 * cdef int offset * * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< @@ -3523,23 +3583,23 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":236 + /* "numpy.pxd":237 * 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); - if (__pyx_t_2) { - __pyx_t_3 = (!__pyx_v_copy_shape); - __pyx_t_1 = __pyx_t_3; + __pyx_t_3 = (!__pyx_v_hasfields); + if (__pyx_t_3) { + __pyx_t_4 = (!__pyx_v_copy_shape); + __pyx_t_2 = __pyx_t_4; } else { - __pyx_t_1 = __pyx_t_2; + __pyx_t_2 = __pyx_t_3; } - if (__pyx_t_1) { + if (__pyx_t_2) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":238 + /* "numpy.pxd":239 * if not hasfields and not copy_shape: * # do not call releasebuffer * info.obj = None # <<<<<<<<<<<<<< @@ -3555,7 +3615,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf } /*else*/ { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":241 + /* "numpy.pxd":242 * else: * # need to call releasebuffer * info.obj = self # <<<<<<<<<<<<<< @@ -3570,17 +3630,17 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf } __pyx_L11:; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":243 + /* "numpy.pxd":244 * info.obj = self * * if not hasfields: # <<<<<<<<<<<<<< * t = descr.type_num * if ((descr.byteorder == '>' and little_endian) or */ - __pyx_t_1 = (!__pyx_v_hasfields); - if (__pyx_t_1) { + __pyx_t_2 = (!__pyx_v_hasfields); + if (__pyx_t_2) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":244 + /* "numpy.pxd":245 * * if not hasfields: * t = descr.type_num # <<<<<<<<<<<<<< @@ -3589,312 +3649,306 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ __pyx_v_t = __pyx_v_descr->type_num; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":245 + /* "numpy.pxd":246 * if not hasfields: * t = descr.type_num * if ((descr.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< * (descr.byteorder == '<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") */ - __pyx_t_1 = (__pyx_v_descr->byteorder == '>'); - if (__pyx_t_1) { - __pyx_t_2 = __pyx_v_little_endian; + __pyx_t_2 = (__pyx_v_descr->byteorder == '>'); + if (__pyx_t_2) { + __pyx_t_3 = __pyx_v_little_endian; } else { - __pyx_t_2 = __pyx_t_1; + __pyx_t_3 = __pyx_t_2; } - if (!__pyx_t_2) { + if (!__pyx_t_3) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":246 + /* "numpy.pxd":247 * t = descr.type_num * if ((descr.byteorder == '>' and little_endian) or * (descr.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" */ - __pyx_t_1 = (__pyx_v_descr->byteorder == '<'); - if (__pyx_t_1) { - __pyx_t_3 = (!__pyx_v_little_endian); - __pyx_t_8 = __pyx_t_3; + __pyx_t_2 = (__pyx_v_descr->byteorder == '<'); + if (__pyx_t_2) { + __pyx_t_4 = (!__pyx_v_little_endian); + __pyx_t_7 = __pyx_t_4; } else { - __pyx_t_8 = __pyx_t_1; + __pyx_t_7 = __pyx_t_2; } - __pyx_t_1 = __pyx_t_8; + __pyx_t_2 = __pyx_t_7; } else { - __pyx_t_1 = __pyx_t_2; + __pyx_t_2 = __pyx_t_3; } - if (__pyx_t_1) { + if (__pyx_t_2) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":247 + /* "numpy.pxd":248 * if ((descr.byteorder == '>' and little_endian) or * (descr.byteorder == '<' 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_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(((PyObject *)__pyx_kp_u_7)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_u_7)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_7)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_11), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L13; } __pyx_L13:; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":248 + /* "numpy.pxd":249 * (descr.byteorder == '<' 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_BYTE); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_BYTE); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__b; goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":249 + /* "numpy.pxd":250 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_UBYTE); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_UBYTE); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__B; goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":250 + /* "numpy.pxd":251 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_SHORT); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_SHORT); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__h; goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":251 + /* "numpy.pxd":252 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_USHORT); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_USHORT); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__H; goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":252 + /* "numpy.pxd":253 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_INT); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_INT); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__i; goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":253 + /* "numpy.pxd":254 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_UINT); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_UINT); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__I; goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":254 + /* "numpy.pxd":255 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_LONG); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_LONG); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__l; goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":255 + /* "numpy.pxd":256 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_ULONG); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_ULONG); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__L; goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":256 + /* "numpy.pxd":257 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_LONGLONG); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_LONGLONG); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__q; goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":257 + /* "numpy.pxd":258 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_ULONGLONG); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_ULONGLONG); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__Q; goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":258 + /* "numpy.pxd":259 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_FLOAT); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_FLOAT); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__f; goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":259 + /* "numpy.pxd":260 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_DOUBLE); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_DOUBLE); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__d; goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":260 + /* "numpy.pxd":261 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_LONGDOUBLE); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_LONGDOUBLE); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__g; goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":261 + /* "numpy.pxd":262 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_CFLOAT); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_CFLOAT); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__Zf; goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":262 + /* "numpy.pxd":263 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_CDOUBLE); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_CDOUBLE); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__Zd; goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":263 + /* "numpy.pxd":264 * 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: */ - __pyx_t_1 = (__pyx_v_t == NPY_CLONGDOUBLE); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_CLONGDOUBLE); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__Zg; goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":264 + /* "numpy.pxd":265 * 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) */ - __pyx_t_1 = (__pyx_v_t == NPY_OBJECT); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_OBJECT); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__O; goto __pyx_L14; } /*else*/ { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":266 + /* "numpy.pxd":267 * elif t == NPY_OBJECT: f = "O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< * info.format = f * return */ - __pyx_t_5 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_8), __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __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 = 0; - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_12), __pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_8)); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_8)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_8)); + __pyx_t_8 = 0; + __pyx_t_8 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_8, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L14:; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":267 + /* "numpy.pxd":268 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f # <<<<<<<<<<<<<< @@ -3903,7 +3957,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ __pyx_v_info->format = __pyx_v_f; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":268 + /* "numpy.pxd":269 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f * return # <<<<<<<<<<<<<< @@ -3916,7 +3970,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf } /*else*/ { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":270 + /* "numpy.pxd":271 * return * else: * info.format = <char*>stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< @@ -3925,7 +3979,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ __pyx_v_info->format = ((char *)malloc(255)); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":271 + /* "numpy.pxd":272 * else: * info.format = <char*>stdlib.malloc(_buffer_format_string_len) * info.format[0] = '^' # Native data types, manual alignment # <<<<<<<<<<<<<< @@ -3934,7 +3988,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ (__pyx_v_info->format[0]) = '^'; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":272 + /* "numpy.pxd":273 * info.format = <char*>stdlib.malloc(_buffer_format_string_len) * info.format[0] = '^' # Native data types, manual alignment * offset = 0 # <<<<<<<<<<<<<< @@ -3943,17 +3997,17 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ __pyx_v_offset = 0; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":275 + /* "numpy.pxd":276 * f = _util_dtypestring(descr, info.format + 1, * info.format + _buffer_format_string_len, * &offset) # <<<<<<<<<<<<<< * f[0] = 0 # Terminate format string * */ - __pyx_t_9 = __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_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __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_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_f = __pyx_t_9; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":276 + /* "numpy.pxd":277 * info.format + _buffer_format_string_len, * &offset) * f[0] = 0 # Terminate format string # <<<<<<<<<<<<<< @@ -3967,8 +4021,8 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("numpy.ndarray.__getbuffer__"); __pyx_r = -1; __Pyx_GOTREF(__pyx_v_info->obj); @@ -3981,12 +4035,11 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf } __pyx_L2:; __Pyx_XDECREF((PyObject *)__pyx_v_descr); - __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":278 +/* "numpy.pxd":279 * f[0] = 0 # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -3994,23 +4047,26 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf * stdlib.free(info.format) */ -static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ -static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { - int __pyx_t_1; +static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray_1__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ +static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray_1__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; __Pyx_RefNannySetupContext("__releasebuffer__"); - __Pyx_INCREF((PyObject *)__pyx_v_self); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":279 + /* "numpy.pxd":280 * * 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(((PyArrayObject *)__pyx_v_self)); - if (__pyx_t_1) { + __pyx_t_1 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = PyArray_HASFIELDS(((PyArrayObject *)__pyx_t_1)); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":280 + /* "numpy.pxd":281 * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): * stdlib.free(info.format) # <<<<<<<<<<<<<< @@ -4022,17 +4078,17 @@ static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, P } __pyx_L5:; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":281 + /* "numpy.pxd":282 * 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))); - if (__pyx_t_1) { + __pyx_t_2 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); + if (__pyx_t_2) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":282 + /* "numpy.pxd":283 * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): * stdlib.free(info.strides) # <<<<<<<<<<<<<< @@ -4044,11 +4100,10 @@ static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, P } __pyx_L6:; - __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_RefNannyFinishContext(); } -/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":755 +/* "numpy.pxd":756 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -4061,7 +4116,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1"); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":756 + /* "numpy.pxd":757 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<< @@ -4069,7 +4124,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ * 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 = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -4087,7 +4142,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":758 +/* "numpy.pxd":759 * return PyArray_MultiIterNew(1, <void*>a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -4100,7 +4155,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2"); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":759 + /* "numpy.pxd":760 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<< @@ -4108,7 +4163,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ * 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 = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -4126,7 +4181,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":761 +/* "numpy.pxd":762 * return PyArray_MultiIterNew(2, <void*>a, <void*>b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -4139,7 +4194,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3"); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":762 + /* "numpy.pxd":763 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<< @@ -4147,7 +4202,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ * 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 = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -4165,7 +4220,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":764 +/* "numpy.pxd":765 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -4178,7 +4233,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4"); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":765 + /* "numpy.pxd":766 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<< @@ -4186,7 +4241,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ * 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 = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -4204,7 +4259,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":767 +/* "numpy.pxd":768 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -4217,7 +4272,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5"); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":768 + /* "numpy.pxd":769 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<< @@ -4225,7 +4280,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ * 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 = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -4243,7 +4298,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":770 +/* "numpy.pxd":771 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -4269,16 +4324,16 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx int __pyx_t_7; int __pyx_t_8; int __pyx_t_9; - char *__pyx_t_10; + long __pyx_t_10; + char *__pyx_t_11; __Pyx_RefNannySetupContext("_util_dtypestring"); - __Pyx_INCREF((PyObject *)__pyx_v_descr); __pyx_v_child = ((PyArray_Descr *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_fields = ((PyObject *)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_fields = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); __pyx_v_childname = Py_None; __Pyx_INCREF(Py_None); __pyx_v_new_offset = Py_None; __Pyx_INCREF(Py_None); __pyx_v_t = Py_None; __Pyx_INCREF(Py_None); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":777 + /* "numpy.pxd":778 * cdef int delta_offset * cdef tuple i * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -4287,7 +4342,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_endian_detector = 1; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":778 + /* "numpy.pxd":779 * cdef tuple i * cdef int endian_detector = 1 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -4296,18 +4351,17 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":781 + /* "numpy.pxd":782 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< * fields = descr.fields[childname] * child, new_offset = fields */ - if (likely(((PyObject *)__pyx_v_descr->names) != Py_None)) { - __pyx_t_1 = 0; __pyx_t_2 = ((PyObject *)__pyx_v_descr->names); __Pyx_INCREF(__pyx_t_2); - } else { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_v_descr->names == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = 0; __pyx_t_2 = ((PyObject *)__pyx_v_descr->names); __Pyx_INCREF(__pyx_t_2); for (;;) { if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break; __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; @@ -4315,21 +4369,21 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_v_childname = __pyx_t_3; __pyx_t_3 = 0; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":782 + /* "numpy.pxd":783 * * for childname in descr.names: * fields = descr.fields[childname] # <<<<<<<<<<<<<< * child, new_offset = fields * */ - __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (!__pyx_t_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (!__pyx_t_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_fields)); - __pyx_v_fields = ((PyObject *)__pyx_t_3); + __pyx_v_fields = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":783 + /* "numpy.pxd":784 * for childname in descr.names: * fields = descr.fields[childname] * child, new_offset = fields # <<<<<<<<<<<<<< @@ -4339,7 +4393,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx if (likely(((PyObject *)__pyx_v_fields) != Py_None) && likely(PyTuple_GET_SIZE(((PyObject *)__pyx_v_fields)) == 2)) { PyObject* tuple = ((PyObject *)__pyx_v_fields); __pyx_t_3 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_4); __Pyx_DECREF(((PyObject *)__pyx_v_child)); __pyx_v_child = ((PyArray_Descr *)__pyx_t_3); @@ -4349,57 +4403,51 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_4 = 0; } else { __Pyx_UnpackTupleError(((PyObject *)__pyx_v_fields), 2); - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":785 + /* "numpy.pxd":786 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * */ - __pyx_t_4 = PyInt_FromLong((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":786 + /* "numpy.pxd":787 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< * * if ((child.byteorder == '>' and little_endian) or */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_14), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_INCREF(((PyObject *)__pyx_kp_u_9)); - PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_u_9)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_9)); - __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L5; } __pyx_L5:; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":788 + /* "numpy.pxd":789 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< @@ -4414,7 +4462,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } if (!__pyx_t_7) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":789 + /* "numpy.pxd":790 * * if ((child.byteorder == '>' and little_endian) or * (child.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< @@ -4434,29 +4482,23 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } if (__pyx_t_6) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":790 + /* "numpy.pxd":791 * if ((child.byteorder == '>' and little_endian) or * (child.byteorder == '<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(((PyObject *)__pyx_kp_u_7)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_u_7)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_7)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_15), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":800 + /* "numpy.pxd":801 * * # Output padding bytes * while offset[0] < new_offset: # <<<<<<<<<<<<<< @@ -4464,16 +4506,16 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx * f += 1 */ while (1) { - __pyx_t_5 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_6) break; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":801 + /* "numpy.pxd":802 * # Output padding bytes * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< @@ -4482,35 +4524,37 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ (__pyx_v_f[0]) = 120; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":802 + /* "numpy.pxd":803 * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte * f += 1 # <<<<<<<<<<<<<< * offset[0] += 1 * */ - __pyx_v_f += 1; + __pyx_v_f = (__pyx_v_f + 1); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":803 + /* "numpy.pxd":804 * f[0] = 120 # "x"; pad byte * f += 1 * offset[0] += 1 # <<<<<<<<<<<<<< * * offset[0] += child.itemsize */ - (__pyx_v_offset[0]) += 1; + __pyx_t_10 = 0; + (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + 1); } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":805 + /* "numpy.pxd":806 * offset[0] += 1 * * offset[0] += child.itemsize # <<<<<<<<<<<<<< * * if not PyDataType_HASFIELDS(child): */ - (__pyx_v_offset[0]) += __pyx_v_child->elsize; + __pyx_t_10 = 0; + (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + __pyx_v_child->elsize); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":807 + /* "numpy.pxd":808 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -4520,20 +4564,20 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = (!PyDataType_HASFIELDS(__pyx_v_child)); if (__pyx_t_6) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":808 + /* "numpy.pxd":809 * * if not PyDataType_HASFIELDS(child): * t = child.type_num # <<<<<<<<<<<<<< * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") */ - __pyx_t_3 = PyInt_FromLong(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_v_t); __pyx_v_t = __pyx_t_3; __pyx_t_3 = 0; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":809 + /* "numpy.pxd":810 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -4543,408 +4587,402 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = ((__pyx_v_end - __pyx_v_f) < 5); if (__pyx_t_6) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":810 + /* "numpy.pxd":811 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_17), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(((PyObject *)__pyx_kp_u_10)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_u_10)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_10)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L10; } __pyx_L10:; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":813 + /* "numpy.pxd":814 * * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" */ - __pyx_t_5 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 98; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":814 + /* "numpy.pxd":815 * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" */ - __pyx_t_3 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 66; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":815 + /* "numpy.pxd":816 * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" */ - __pyx_t_5 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 104; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":816 + /* "numpy.pxd":817 * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" */ - __pyx_t_3 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 72; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":817 + /* "numpy.pxd":818 * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" */ - __pyx_t_5 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 105; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":818 + /* "numpy.pxd":819 * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" */ - __pyx_t_3 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 73; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":819 + /* "numpy.pxd":820 * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" */ - __pyx_t_5 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 108; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":820 + /* "numpy.pxd":821 * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" */ - __pyx_t_3 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 76; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":821 + /* "numpy.pxd":822 * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" */ - __pyx_t_5 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 113; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":822 + /* "numpy.pxd":823 * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" */ - __pyx_t_3 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 81; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":823 + /* "numpy.pxd":824 * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" */ - __pyx_t_5 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 102; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":824 + /* "numpy.pxd":825 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf */ - __pyx_t_3 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 100; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":825 + /* "numpy.pxd":826 * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd */ - __pyx_t_5 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 103; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":826 + /* "numpy.pxd":827 * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg */ - __pyx_t_3 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; (__pyx_v_f[1]) = 102; - __pyx_v_f += 1; + __pyx_v_f = (__pyx_v_f + 1); goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":827 + /* "numpy.pxd":828 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg * elif t == NPY_OBJECT: f[0] = 79 #"O" */ - __pyx_t_5 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; (__pyx_v_f[1]) = 100; - __pyx_v_f += 1; + __pyx_v_f = (__pyx_v_f + 1); goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":828 + /* "numpy.pxd":829 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: */ - __pyx_t_3 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; (__pyx_v_f[1]) = 103; - __pyx_v_f += 1; + __pyx_v_f = (__pyx_v_f + 1); goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":829 + /* "numpy.pxd":830 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) */ - __pyx_t_5 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 79; goto __pyx_L11; } /*else*/ { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":831 + /* "numpy.pxd":832 * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< * f += 1 * else: */ - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_8), __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_12), __pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_5)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_5)); + __pyx_t_5 = 0; + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __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 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L11:; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":832 + /* "numpy.pxd":833 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * f += 1 # <<<<<<<<<<<<<< * else: * # Cython ignores struct boundary information ("T{...}"), */ - __pyx_v_f += 1; + __pyx_v_f = (__pyx_v_f + 1); goto __pyx_L9; } /*else*/ { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":836 + /* "numpy.pxd":837 * # Cython ignores struct boundary information ("T{...}"), * # so don't output it * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< * return f * */ - __pyx_t_10 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_f = __pyx_t_10; + __pyx_t_11 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_f = __pyx_t_11; } __pyx_L9:; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":837 + /* "numpy.pxd":838 * # so don't output it * f = _util_dtypestring(child, f, end, offset) * return f # <<<<<<<<<<<<<< @@ -4969,12 +5007,11 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_v_childname); __Pyx_DECREF(__pyx_v_new_offset); __Pyx_DECREF(__pyx_v_t); - __Pyx_DECREF((PyObject *)__pyx_v_descr); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":952 +/* "numpy.pxd":953 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -4985,11 +5022,10 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { PyObject *__pyx_v_baseptr; int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("set_array_base"); - __Pyx_INCREF((PyObject *)__pyx_v_arr); - __Pyx_INCREF(__pyx_v_base); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":954 + /* "numpy.pxd":955 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -4999,7 +5035,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __pyx_t_1 = (__pyx_v_base == Py_None); if (__pyx_t_1) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":955 + /* "numpy.pxd":956 * cdef PyObject* baseptr * if base is None: * baseptr = NULL # <<<<<<<<<<<<<< @@ -5011,16 +5047,19 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } /*else*/ { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":957 + /* "numpy.pxd":958 * baseptr = NULL * else: * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< * baseptr = <PyObject*>base * Py_XDECREF(arr.base) */ - Py_INCREF(__pyx_v_base); + __pyx_t_2 = __pyx_v_base; + __Pyx_INCREF(__pyx_t_2); + Py_INCREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":958 + /* "numpy.pxd":959 * else: * Py_INCREF(base) # important to do this before decref below! * baseptr = <PyObject*>base # <<<<<<<<<<<<<< @@ -5031,7 +5070,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } __pyx_L3:; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":959 + /* "numpy.pxd":960 * Py_INCREF(base) # important to do this before decref below! * baseptr = <PyObject*>base * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< @@ -5040,7 +5079,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_XDECREF(__pyx_v_arr->base); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":960 + /* "numpy.pxd":961 * baseptr = <PyObject*>base * Py_XDECREF(arr.base) * arr.base = baseptr # <<<<<<<<<<<<<< @@ -5049,12 +5088,10 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ __pyx_v_arr->base = __pyx_v_baseptr; - __Pyx_DECREF((PyObject *)__pyx_v_arr); - __Pyx_DECREF(__pyx_v_base); __Pyx_RefNannyFinishContext(); } -/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":962 +/* "numpy.pxd":963 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -5066,9 +5103,8 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py PyObject *__pyx_r = NULL; int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base"); - __Pyx_INCREF((PyObject *)__pyx_v_arr); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":963 + /* "numpy.pxd":964 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -5078,7 +5114,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_t_1 = (__pyx_v_arr->base == NULL); if (__pyx_t_1) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":964 + /* "numpy.pxd":965 * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: * return None # <<<<<<<<<<<<<< @@ -5093,7 +5129,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py } /*else*/ { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":966 + /* "numpy.pxd":967 * return None * else: * return <object>arr.base # <<<<<<<<<<<<<< @@ -5107,19 +5143,15 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = Py_None; __Pyx_INCREF(Py_None); __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_arr); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static struct PyMethodDef __pyx_methods[] = { - {__Pyx_NAMESTR("plain_sgd"), (PyCFunction)__pyx_pf_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7sklearn_12linear_model_15sgd_fast_sparse_plain_sgd)}, +static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; -static void __pyx_init_filenames(void); /*proto*/ - #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { PyModuleDef_HEAD_INIT, @@ -5137,15 +5169,15 @@ static struct PyModuleDef __pyx_moduledef = { static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0}, {&__pyx_kp_u_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 1, 0, 0}, - {&__pyx_kp_u_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 1, 0, 0}, + {&__pyx_kp_u_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 1, 0, 0}, + {&__pyx_kp_u_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 1, 0, 0}, + {&__pyx_kp_u_16, __pyx_k_16, sizeof(__pyx_k_16), 0, 1, 0, 0}, + {&__pyx_n_s_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 0, 1, 1}, {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0}, {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0}, {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0}, - {&__pyx_kp_u_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 1, 0, 0}, {&__pyx_kp_u_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 1, 0, 0}, - {&__pyx_kp_u_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 1, 0, 0}, {&__pyx_kp_u_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 1, 0, 0}, - {&__pyx_kp_u_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 1, 0, 0}, {&__pyx_n_s__RandomState, __pyx_k__RandomState, sizeof(__pyx_k__RandomState), 0, 0, 1, 1}, {&__pyx_n_s__RuntimeError, __pyx_k__RuntimeError, sizeof(__pyx_k__RuntimeError), 0, 0, 1, 1}, {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1}, @@ -5212,10 +5244,117 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { }; static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants"); + + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":211 + * if np.any(np.isinf(w)) or np.any(np.isnan(w)) \ + * or np.isnan(intercept) or np.isinf(intercept): + * raise ValueError("floating-point under-/overflow occured.") # <<<<<<<<<<<<<< + * + * w *= wscale + */ + __pyx_k_tuple_5 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_5)); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_4)); + PyTuple_SET_ITEM(__pyx_k_tuple_5, 0, ((PyObject *)__pyx_kp_s_4)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_4)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_5)); + + /* "numpy.pxd":206 + * 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_k_tuple_7 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_7)); + __Pyx_INCREF(((PyObject *)__pyx_kp_u_6)); + PyTuple_SET_ITEM(__pyx_k_tuple_7, 0, ((PyObject *)__pyx_kp_u_6)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_6)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_7)); + + /* "numpy.pxd":210 + * 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_k_tuple_9 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_9)); + __Pyx_INCREF(((PyObject *)__pyx_kp_u_8)); + PyTuple_SET_ITEM(__pyx_k_tuple_9, 0, ((PyObject *)__pyx_kp_u_8)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_8)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_9)); + + /* "numpy.pxd":248 + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' 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_k_tuple_11 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_11)); + __Pyx_INCREF(((PyObject *)__pyx_kp_u_10)); + PyTuple_SET_ITEM(__pyx_k_tuple_11, 0, ((PyObject *)__pyx_kp_u_10)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_10)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_11)); + + /* "numpy.pxd":787 + * + * if (end - f) - (new_offset - offset[0]) < 15: + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + * + * if ((child.byteorder == '>' and little_endian) or + */ + __pyx_k_tuple_14 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_14)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_14)); + __Pyx_INCREF(((PyObject *)__pyx_kp_u_13)); + PyTuple_SET_ITEM(__pyx_k_tuple_14, 0, ((PyObject *)__pyx_kp_u_13)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_13)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_14)); + + /* "numpy.pxd":791 + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_k_tuple_15 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_15)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_15)); + __Pyx_INCREF(((PyObject *)__pyx_kp_u_10)); + PyTuple_SET_ITEM(__pyx_k_tuple_15, 0, ((PyObject *)__pyx_kp_u_10)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_10)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_15)); + + /* "numpy.pxd":811 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_k_tuple_17 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_17)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_17)); + __Pyx_INCREF(((PyObject *)__pyx_kp_u_16)); + PyTuple_SET_ITEM(__pyx_k_tuple_17, 0, ((PyObject *)__pyx_kp_u_16)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_16)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_17)); + __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); return -1; } @@ -5237,7 +5376,6 @@ PyMODINIT_FUNC PyInit_sgd_fast_sparse(void) { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; #if CYTHON_REFNANNY void* __pyx_refnanny = NULL; __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); @@ -5249,12 +5387,10 @@ PyMODINIT_FUNC PyInit_sgd_fast_sparse(void) } __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit_sgd_fast_sparse(void)", __LINE__, __FILE__); #endif - __pyx_init_filenames(); __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #if PY_MAJOR_VERSION < 3 - __pyx_empty_bytes = PyString_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #ifdef __pyx_binding_PyCFunctionType_USED + if (__pyx_binding_PyCFunctionType_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ @@ -5278,40 +5414,42 @@ PyMODINIT_FUNC PyInit_sgd_fast_sparse(void) if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_module_is_main_sklearn__linear_model__sgd_fast_sparse) { + if (__pyx_module_is_main_scikits__learn__linear_model__sgd_fast_sparse) { if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; } /*--- Builtin init code ---*/ if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Constants init code ---*/ + if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ /*--- Type import code ---*/ - __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_7sklearn_12linear_model_8sgd_fast_LossFunction = __Pyx_ImportType("sklearn.linear_model.sgd_fast", "LossFunction", sizeof(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction), 1); if (unlikely(!__pyx_ptype_7sklearn_12linear_model_8sgd_fast_LossFunction)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_GetVtable(__pyx_ptype_7sklearn_12linear_model_8sgd_fast_LossFunction->tp_dict, &__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_LossFunction) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_7sklearn_12linear_model_8sgd_fast_Regression = __Pyx_ImportType("sklearn.linear_model.sgd_fast", "Regression", sizeof(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Regression), 1); if (unlikely(!__pyx_ptype_7sklearn_12linear_model_8sgd_fast_Regression)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_GetVtable(__pyx_ptype_7sklearn_12linear_model_8sgd_fast_Regression->tp_dict, &__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_Regression) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_7sklearn_12linear_model_8sgd_fast_Classification = __Pyx_ImportType("sklearn.linear_model.sgd_fast", "Classification", sizeof(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Classification), 1); if (unlikely(!__pyx_ptype_7sklearn_12linear_model_8sgd_fast_Classification)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_GetVtable(__pyx_ptype_7sklearn_12linear_model_8sgd_fast_Classification->tp_dict, &__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_Classification) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_7sklearn_12linear_model_8sgd_fast_ModifiedHuber = __Pyx_ImportType("sklearn.linear_model.sgd_fast", "ModifiedHuber", sizeof(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_ModifiedHuber), 1); if (unlikely(!__pyx_ptype_7sklearn_12linear_model_8sgd_fast_ModifiedHuber)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_GetVtable(__pyx_ptype_7sklearn_12linear_model_8sgd_fast_ModifiedHuber->tp_dict, &__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_ModifiedHuber) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_7sklearn_12linear_model_8sgd_fast_Hinge = __Pyx_ImportType("sklearn.linear_model.sgd_fast", "Hinge", sizeof(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Hinge), 1); if (unlikely(!__pyx_ptype_7sklearn_12linear_model_8sgd_fast_Hinge)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_GetVtable(__pyx_ptype_7sklearn_12linear_model_8sgd_fast_Hinge->tp_dict, &__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_Hinge) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_7sklearn_12linear_model_8sgd_fast_Log = __Pyx_ImportType("sklearn.linear_model.sgd_fast", "Log", sizeof(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Log), 1); if (unlikely(!__pyx_ptype_7sklearn_12linear_model_8sgd_fast_Log)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_GetVtable(__pyx_ptype_7sklearn_12linear_model_8sgd_fast_Log->tp_dict, &__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_Log) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_7sklearn_12linear_model_8sgd_fast_SquaredLoss = __Pyx_ImportType("sklearn.linear_model.sgd_fast", "SquaredLoss", sizeof(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_SquaredLoss), 1); if (unlikely(!__pyx_ptype_7sklearn_12linear_model_8sgd_fast_SquaredLoss)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_GetVtable(__pyx_ptype_7sklearn_12linear_model_8sgd_fast_SquaredLoss->tp_dict, &__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_SquaredLoss) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_7sklearn_12linear_model_8sgd_fast_Huber = __Pyx_ImportType("sklearn.linear_model.sgd_fast", "Huber", sizeof(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Huber), 1); if (unlikely(!__pyx_ptype_7sklearn_12linear_model_8sgd_fast_Huber)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_GetVtable(__pyx_ptype_7sklearn_12linear_model_8sgd_fast_Huber->tp_dict, &__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_Huber) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_LossFunction = __Pyx_ImportType("scikits.learn.linear_model.sgd_fast", "LossFunction", sizeof(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction), 1); if (unlikely(!__pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_LossFunction)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_LossFunction = (struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_LossFunction*)__Pyx_GetVtable(__pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_LossFunction->tp_dict); if (unlikely(!__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_LossFunction)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_Regression = __Pyx_ImportType("scikits.learn.linear_model.sgd_fast", "Regression", sizeof(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Regression), 1); if (unlikely(!__pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_Regression)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Regression = (struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Regression*)__Pyx_GetVtable(__pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_Regression->tp_dict); if (unlikely(!__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Regression)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_Classification = __Pyx_ImportType("scikits.learn.linear_model.sgd_fast", "Classification", sizeof(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Classification), 1); if (unlikely(!__pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_Classification)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Classification = (struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Classification*)__Pyx_GetVtable(__pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_Classification->tp_dict); if (unlikely(!__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Classification)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber = __Pyx_ImportType("scikits.learn.linear_model.sgd_fast", "ModifiedHuber", sizeof(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber), 1); if (unlikely(!__pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber = (struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber*)__Pyx_GetVtable(__pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber->tp_dict); if (unlikely(!__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_Hinge = __Pyx_ImportType("scikits.learn.linear_model.sgd_fast", "Hinge", sizeof(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Hinge), 1); if (unlikely(!__pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_Hinge)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Hinge = (struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Hinge*)__Pyx_GetVtable(__pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_Hinge->tp_dict); if (unlikely(!__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Hinge)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_Log = __Pyx_ImportType("scikits.learn.linear_model.sgd_fast", "Log", sizeof(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Log), 1); if (unlikely(!__pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_Log)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Log = (struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Log*)__Pyx_GetVtable(__pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_Log->tp_dict); if (unlikely(!__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Log)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss = __Pyx_ImportType("scikits.learn.linear_model.sgd_fast", "SquaredLoss", sizeof(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss), 1); if (unlikely(!__pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss = (struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss*)__Pyx_GetVtable(__pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss->tp_dict); if (unlikely(!__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_Huber = __Pyx_ImportType("scikits.learn.linear_model.sgd_fast", "Huber", sizeof(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Huber), 1); if (unlikely(!__pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_Huber)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Huber = (struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Huber*)__Pyx_GetVtable(__pyx_ptype_7scikits_5learn_12linear_model_8sgd_fast_Huber->tp_dict); if (unlikely(!__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Huber)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Function import code ---*/ /*--- Execution code ---*/ - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":10 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":10 * # License: BSD Style. * * import numpy as np # <<<<<<<<<<<<<< @@ -5323,7 +5461,7 @@ PyMODINIT_FUNC PyInit_sgd_fast_sparse(void) if (PyObject_SetAttr(__pyx_m, __pyx_n_s__np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":11 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":11 * * import numpy as np * import sys # <<<<<<<<<<<<<< @@ -5335,7 +5473,7 @@ PyMODINIT_FUNC PyInit_sgd_fast_sparse(void) if (PyObject_SetAttr(__pyx_m, __pyx_n_s__sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":12 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":12 * import numpy as np * import sys * from time import time # <<<<<<<<<<<<<< @@ -5356,24 +5494,29 @@ PyMODINIT_FUNC PyInit_sgd_fast_sparse(void) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":1 + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":34 + * @cython.wraparound(False) + * @cython.cdivision(True) + * def plain_sgd(np.ndarray[double, ndim=1] w, # <<<<<<<<<<<<<< + * double intercept, + * LossFunction loss, + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain_sgd, NULL, __pyx_n_s_18); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__plain_sgd, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":1 * # encoding: utf-8 # <<<<<<<<<<<<<< * # cython: cdivision=True * # cython: boundscheck=False */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __pyx_t_1 = PyObject_GetAttr(__pyx_m, __pyx_n_s__plain_sgd); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_1, "__doc__"); - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_kp_u_11), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":962 + /* "numpy.pxd":963 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -5384,12 +5527,11 @@ PyMODINIT_FUNC PyInit_sgd_fast_sparse(void) __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); if (__pyx_m) { - __Pyx_AddTraceback("init sklearn.linear_model.sgd_fast_sparse"); + __Pyx_AddTraceback("init scikits.learn.linear_model.sgd_fast_sparse"); Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init sklearn.linear_model.sgd_fast_sparse"); + PyErr_SetString(PyExc_ImportError, "init scikits.learn.linear_model.sgd_fast_sparse"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); @@ -5400,29 +5542,14 @@ PyMODINIT_FUNC PyInit_sgd_fast_sparse(void) #endif } -static const char *__pyx_filenames[] = { - "sgd_fast_sparse.pyx", - "numpy.pxd", - "sgd_fast.pxd", -}; - /* Runtime support code */ -static void __pyx_init_filenames(void) { - __pyx_f = __pyx_filenames; -} - -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, - PyObject* kw_name) -{ - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION >= 3 - "%s() got multiple values for keyword argument '%U'", func_name, kw_name); - #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AS_STRING(kw_name)); - #endif +static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { + PyObject *result; + result = PyObject_GetAttr(dict, name); + if (!result) + PyErr_SetObject(PyExc_NameError, name); + return result; } static void __Pyx_RaiseArgtupleInvalid( @@ -5455,6 +5582,19 @@ static void __Pyx_RaiseArgtupleInvalid( func_name, more_or_less, num_expected, number, num_found); } +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AS_STRING(kw_name)); + #endif +} + static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], @@ -5534,6 +5674,26 @@ bad: return -1; } +static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact) +{ + if (!type) { + PyErr_Format(PyExc_SystemError, "Missing type object"); + return 0; + } + if (none_allowed && obj == Py_None) return 1; + else if (exact) { + if (Py_TYPE(obj) == type) return 1; + } + else { + if (PyObject_TypeCheck(obj, type)) return 1; + } + PyErr_Format(PyExc_TypeError, + "Argument '%s' has incorrect type (expected %s, got %s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); + return 0; +} + static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { unsigned int n = 1; return *(unsigned char*)(&n) != 0; @@ -5653,7 +5813,7 @@ static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) { default: { __Pyx_BufFmt_RaiseUnexpectedChar(ch); return 0; - } + } } } @@ -5697,7 +5857,7 @@ static size_t __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) { default: { __Pyx_BufFmt_RaiseUnexpectedChar(ch); return 0; - } + } } } @@ -5734,7 +5894,7 @@ static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { do { __Pyx_StructField* field = ctx->head->field; __Pyx_TypeInfo* type = field->type; - + if (ctx->packmode == '@' || ctx->packmode == '^') { size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex); } else { @@ -5757,7 +5917,7 @@ static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { ctx->head->parent_offset = parent_offset; continue; } - + __Pyx_BufFmt_RaiseExpected(ctx); return -1; } @@ -5771,7 +5931,7 @@ static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { } ctx->fmt_offset += size; - + --ctx->enc_count; /* Consume from buffer string */ /* Done checking, move to next field, pushing or popping struct stack if needed */ @@ -5804,7 +5964,7 @@ static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { } while (ctx->enc_count); ctx->enc_type = 0; ctx->is_complex = 0; - return 0; + return 0; } static int __Pyx_BufFmt_FirstPack(__Pyx_BufFmt_Context* ctx) { @@ -5926,7 +6086,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha return NULL; } } - + } } } @@ -5939,7 +6099,7 @@ static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) { buf->suboffsets = __Pyx_minusones; } -static int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack) { +static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack) { if (obj == Py_None) { __Pyx_ZeroBuffer(buf); return 0; @@ -6024,75 +6184,147 @@ static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyOb } -static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { - PyErr_Format(PyExc_ValueError, +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { + Py_XINCREF(type); + Py_XINCREF(value); + Py_XINCREF(tb); + /* First, check the traceback argument, replacing None with NULL. */ + if (tb == Py_None) { + Py_DECREF(tb); + tb = 0; + } + else if (tb != NULL && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + /* Next, replace a missing value with None */ + if (value == NULL) { + value = Py_None; + Py_INCREF(value); + } + #if PY_VERSION_HEX < 0x02050000 + if (!PyClass_Check(type)) + #else + if (!PyType_Check(type)) + #endif + { + /* Raising an instance. The value should be a dummy. */ + if (value != Py_None) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + /* Normalize to raise <class>, <instance> */ + Py_DECREF(value); + value = type; #if PY_VERSION_HEX < 0x02050000 - "need more than %d value%s to unpack", (int)index, + if (PyInstance_Check(type)) { + type = (PyObject*) ((PyInstanceObject*)type)->in_class; + Py_INCREF(type); + } + else { + type = 0; + PyErr_SetString(PyExc_TypeError, + "raise: exception must be an old-style class or instance"); + goto raise_error; + } #else - "need more than %zd value%s to unpack", index, + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } #endif - (index == 1) ? "" : "s"); -} + } -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(void) { - PyErr_SetString(PyExc_ValueError, "too many values to unpack"); + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; } -static PyObject *__Pyx_UnpackItem(PyObject *iter, Py_ssize_t index) { - PyObject *item; - if (!(item = PyIter_Next(iter))) { - if (!PyErr_Occurred()) { - __Pyx_RaiseNeedMoreValuesError(index); +#else /* Python 3+ */ + +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (!PyExceptionClass_Check(type)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; } - return item; -} -static int __Pyx_EndUnpack(PyObject *iter) { - PyObject *item; - if ((item = PyIter_Next(iter))) { - Py_DECREF(item); - __Pyx_RaiseTooManyValuesError(); - return -1; + PyErr_SetObject(type, value); + + if (tb) { + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } } - else if (!PyErr_Occurred()) - return 0; - else - return -1; + +bad: + return; } +#endif static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + #if PY_VERSION_HEX < 0x02050000 + "need more than %d value%s to unpack", (int)index, + #else + "need more than %zd value%s to unpack", index, + #endif + (index == 1) ? "" : "s"); +} + +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + #if PY_VERSION_HEX < 0x02050000 + "too many values to unpack (expected %d)", (int)expected); + #else + "too many values to unpack (expected %zd)", expected); + #endif +} + static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { if (t == Py_None) { __Pyx_RaiseNoneNotIterableError(); } else if (PyTuple_GET_SIZE(t) < index) { __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); } else { - __Pyx_RaiseTooManyValuesError(); - } -} - -static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact) -{ - if (!type) { - PyErr_Format(PyExc_SystemError, "Missing type object"); - return 0; + __Pyx_RaiseTooManyValuesError(index); } - if (none_allowed && obj == Py_None) return 1; - else if (exact) { - if (Py_TYPE(obj) == type) return 1; - } - else { - if (PyObject_TypeCheck(obj, type)) return 1; - } - PyErr_Format(PyExc_TypeError, - "Argument '%s' has incorrect type (expected %s, got %s)", - name, type->tp_name, Py_TYPE(obj)->tp_name); - return 0; } #if PY_MAJOR_VERSION < 3 @@ -6111,7 +6343,7 @@ static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { static void __Pyx_ReleaseBuffer(Py_buffer *view) { PyObject* obj = view->obj; if (obj) { -if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pf_5numpy_7ndarray___releasebuffer__(obj, view); +if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pf_5numpy_7ndarray_1__releasebuffer__(obj, view); Py_DECREF(obj); view->obj = NULL; } @@ -6120,14 +6352,14 @@ if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pf_5numpy_7ndarra #endif static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) { - PyObject *__import__ = 0; + PyObject *py_import = 0; PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; - __import__ = __Pyx_GetAttrString(__pyx_b, "__import__"); - if (!__import__) + py_import = __Pyx_GetAttrString(__pyx_b, "__import__"); + if (!py_import) goto bad; if (from_list) list = from_list; @@ -6143,23 +6375,15 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) { empty_dict = PyDict_New(); if (!empty_dict) goto bad; - module = PyObject_CallFunctionObjArgs(__import__, + module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, NULL); bad: Py_XDECREF(empty_list); - Py_XDECREF(__import__); + Py_XDECREF(py_import); Py_XDECREF(empty_dict); return module; } -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { - PyObject *result; - result = PyObject_GetAttr(dict, name); - if (!result) - PyErr_SetObject(PyExc_NameError, name); - return result; -} - #if PY_MAJOR_VERSION < 3 static PyObject *__Pyx_GetStdout(void) { PyObject *f = PySys_GetObject((char *)"stdout"); @@ -6169,13 +6393,14 @@ static PyObject *__Pyx_GetStdout(void) { return f; } -static int __Pyx_Print(PyObject *arg_tuple, int newline) { - PyObject *f; +static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) { PyObject* v; int i; - if (!(f = __Pyx_GetStdout())) - return -1; + if (!f) { + if (!(f = __Pyx_GetStdout())) + return -1; + } for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) { if (PyFile_SoftSpace(f, 1)) { if (PyFile_WriteString(" ", f) < 0) @@ -6203,22 +6428,38 @@ static int __Pyx_Print(PyObject *arg_tuple, int newline) { #else /* Python 3 has a print function */ -static int __Pyx_Print(PyObject *arg_tuple, int newline) { +static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) { PyObject* kwargs = 0; PyObject* result = 0; PyObject* end_string; - if (!__pyx_print) { + if (unlikely(!__pyx_print)) { __pyx_print = __Pyx_GetAttrString(__pyx_b, "print"); if (!__pyx_print) return -1; } - if (!newline) { - if (!__pyx_print_kwargs) { + if (stream) { + kwargs = PyDict_New(); + if (unlikely(!kwargs)) + return -1; + if (unlikely(PyDict_SetItemString(kwargs, "file", stream) < 0)) + goto bad; + if (!newline) { + end_string = PyUnicode_FromStringAndSize(" ", 1); + if (unlikely(!end_string)) + goto bad; + if (PyDict_SetItemString(kwargs, "end", end_string) < 0) { + Py_DECREF(end_string); + goto bad; + } + Py_DECREF(end_string); + } + } else if (!newline) { + if (unlikely(!__pyx_print_kwargs)) { __pyx_print_kwargs = PyDict_New(); - if (!__pyx_print_kwargs) + if (unlikely(!__pyx_print_kwargs)) return -1; end_string = PyUnicode_FromStringAndSize(" ", 1); - if (!end_string) + if (unlikely(!end_string)) return -1; if (PyDict_SetItemString(__pyx_print_kwargs, "end", end_string) < 0) { Py_DECREF(end_string); @@ -6229,20 +6470,27 @@ static int __Pyx_Print(PyObject *arg_tuple, int newline) { kwargs = __pyx_print_kwargs; } result = PyObject_Call(__pyx_print, arg_tuple, kwargs); + if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs)) + Py_DECREF(kwargs); if (!result) return -1; Py_DECREF(result); return 0; +bad: + if (kwargs != __pyx_print_kwargs) + Py_XDECREF(kwargs); + return -1; } #endif #if PY_MAJOR_VERSION < 3 -static int __Pyx_PrintOne(PyObject *o) { - PyObject *f; - if (!(f = __Pyx_GetStdout())) - return -1; +static int __Pyx_PrintOne(PyObject* f, PyObject *o) { + if (!f) { + if (!(f = __Pyx_GetStdout())) + return -1; + } if (PyFile_SoftSpace(f, 0)) { if (PyFile_WriteString(" ", f) < 0) return -1; @@ -6254,135 +6502,25 @@ static int __Pyx_PrintOne(PyObject *o) { return 0; /* the line below is just to avoid compiler * compiler warnings about unused functions */ - return __Pyx_Print(NULL, 0); + return __Pyx_Print(f, NULL, 0); } #else /* Python 3 has a print function */ -static int __Pyx_PrintOne(PyObject *o) { +static int __Pyx_PrintOne(PyObject* stream, PyObject *o) { int res; PyObject* arg_tuple = PyTuple_New(1); if (unlikely(!arg_tuple)) return -1; Py_INCREF(o); PyTuple_SET_ITEM(arg_tuple, 0, o); - res = __Pyx_Print(arg_tuple, 1); + res = __Pyx_Print(stream, arg_tuple, 1); Py_DECREF(arg_tuple); return res; } #endif -#if PY_MAJOR_VERSION < 3 -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { - Py_XINCREF(type); - Py_XINCREF(value); - Py_XINCREF(tb); - /* First, check the traceback argument, replacing None with NULL. */ - if (tb == Py_None) { - Py_DECREF(tb); - tb = 0; - } - else if (tb != NULL && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - /* Next, replace a missing value with None */ - if (value == NULL) { - value = Py_None; - Py_INCREF(value); - } - #if PY_VERSION_HEX < 0x02050000 - if (!PyClass_Check(type)) - #else - if (!PyType_Check(type)) - #endif - { - /* Raising an instance. The value should be a dummy. */ - if (value != Py_None) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto raise_error; - } - /* Normalize to raise <class>, <instance> */ - Py_DECREF(value); - value = type; - #if PY_VERSION_HEX < 0x02050000 - if (PyInstance_Check(type)) { - type = (PyObject*) ((PyInstanceObject*)type)->in_class; - Py_INCREF(type); - } - else { - type = 0; - PyErr_SetString(PyExc_TypeError, - "raise: exception must be an old-style class or instance"); - goto raise_error; - } - #else - type = (PyObject*) Py_TYPE(type); - Py_INCREF(type); - if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto raise_error; - } - #endif - } - - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; -} - -#else /* Python 3+ */ - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { - if (tb == Py_None) { - tb = 0; - } else if (tb && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto bad; - } - if (value == Py_None) - value = 0; - - if (PyExceptionInstance_Check(type)) { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto bad; - } - value = type; - type = (PyObject*) Py_TYPE(value); - } else if (!PyExceptionClass_Check(type)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto bad; - } - - PyErr_SetObject(type, value); - - if (tb) { - PyThreadState *tstate = PyThreadState_GET(); - PyObject* tmp_tb = tstate->curexc_traceback; - if (tb != tmp_tb) { - Py_INCREF(tb); - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_tb); - } - } - -bad: - return; -} -#endif - #if CYTHON_CCOMPLEX #ifdef __cplusplus static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { @@ -6447,15 +6585,60 @@ bad: z.imag = -a.imag; return z; } -/* - static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) { -#if HAVE_HYPOT - return hypotf(z.real, z.imag); -#else - return sqrtf(z.real*z.real + z.imag*z.imag); -#endif - } -*/ + #if 1 + static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrtf(z.real*z.real + z.imag*z.imag); + #else + return hypotf(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + float denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(a, a); + case 3: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(z, a); + case 4: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } + r = a.real; + theta = 0; + } else { + r = __Pyx_c_absf(a); + theta = atan2f(a.imag, a.real); + } + lnr = logf(r); + z_r = expf(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cosf(z_theta); + z.imag = z_r * sinf(z_theta); + return z; + } + #endif #endif #if CYTHON_CCOMPLEX @@ -6522,15 +6705,60 @@ bad: z.imag = -a.imag; return z; } -/* - static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) { -#if HAVE_HYPOT - return hypot(z.real, z.imag); -#else - return sqrt(z.real*z.real + z.imag*z.imag); -#endif - } -*/ + #if 1 + static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrt(z.real*z.real + z.imag*z.imag); + #else + return hypot(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + double denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(a, a); + case 3: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(z, a); + case 4: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } + r = a.real; + theta = 0; + } else { + r = __Pyx_c_abs(a); + theta = atan2(a.imag, a.real); + } + lnr = log(r); + z_r = exp(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cos(z_theta); + z.imag = z_r * sin(z_theta); + return z; + } + #endif #endif static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) { @@ -6704,6 +6932,25 @@ static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) { return (signed int)__Pyx_PyInt_AsSignedLong(x); } +static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) { + const int neg_one = (int)-1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (sizeof(int) < sizeof(long)) { + long val = __Pyx_PyInt_AsLong(x); + if (unlikely(val != (long)(int)val)) { + if (!unlikely(val == -1 && PyErr_Occurred())) { + PyErr_SetString(PyExc_OverflowError, + (is_unsigned && unlikely(val < 0)) ? + "can't convert negative value to int" : + "value too large to convert to int"); + } + return (int)-1; + } + return (int)val; + } + return (int)__Pyx_PyInt_AsLong(x); +} + static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) { const unsigned long neg_one = (unsigned long)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; @@ -6942,19 +7189,23 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class if (!result) goto bad; if (!PyType_Check(result)) { - PyErr_Format(PyExc_TypeError, + PyErr_Format(PyExc_TypeError, "%s.%s is not a type object", module_name, class_name); goto bad; } if (!strict && ((PyTypeObject *)result)->tp_basicsize > size) { - PyOS_snprintf(warning, sizeof(warning), + PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility", module_name, class_name); + #if PY_VERSION_HEX < 0x02050000 + PyErr_Warn(NULL, warning); + #else PyErr_WarnEx(NULL, warning, 0); + #endif } else if (((PyTypeObject *)result)->tp_basicsize != size) { - PyErr_Format(PyExc_ValueError, + PyErr_Format(PyExc_ValueError, "%s.%s has the wrong size, try recompiling", module_name, class_name); goto bad; @@ -6989,22 +7240,23 @@ bad: } #endif -static int __Pyx_GetVtable(PyObject *dict, void *vtabptr) { +static void* __Pyx_GetVtable(PyObject *dict) { + void* ptr; PyObject *ob = PyMapping_GetItemString(dict, (char *)"__pyx_vtable__"); if (!ob) goto bad; -#if PY_VERSION_HEX < 0x03010000 - *(void **)vtabptr = PyCObject_AsVoidPtr(ob); +#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) + ptr = PyCapsule_GetPointer(ob, 0); #else - *(void **)vtabptr = PyCapsule_GetPointer(ob, 0); + ptr = PyCObject_AsVoidPtr(ob); #endif - if (!*(void **)vtabptr) - goto bad; + if (!ptr && !PyErr_Occurred()) + PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); - return 0; + return ptr; bad: Py_XDECREF(ob); - return -1; + return NULL; } #include "compile.h" @@ -7110,8 +7362,8 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { /* Type Conversion Functions */ static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - if (x == Py_True) return 1; - else if ((x == Py_False) | (x == Py_None)) return 0; + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } diff --git a/sklearn/linear_model/sgd_fast_sparse.pyx b/scikits/learn/linear_model/sgd_fast_sparse.pyx similarity index 100% rename from sklearn/linear_model/sgd_fast_sparse.pyx rename to scikits/learn/linear_model/sgd_fast_sparse.pyx diff --git a/sklearn/linear_model/sparse/__init__.py b/scikits/learn/linear_model/sparse/__init__.py similarity index 60% rename from sklearn/linear_model/sparse/__init__.py rename to scikits/learn/linear_model/sparse/__init__.py index 734af9c9d83192820ac776ec254e44dc905ab1d0..3037853e51afc156b7f03e0c4898f12c4fae0aee 100644 --- a/sklearn/linear_model/sparse/__init__.py +++ b/scikits/learn/linear_model/sparse/__init__.py @@ -1,6 +1,6 @@ """ -:mod:`sklearn.linear_model.sparse` is the sparse counterpart -of :mod:`sklearn.linear_model`. +:mod:`scikits.learn.linear_model.sparse` is the sparse counterpart +of :mod:`scikits.learn.linear_model`. """ diff --git a/sklearn/linear_model/sparse/base.py b/scikits/learn/linear_model/sparse/base.py similarity index 100% rename from sklearn/linear_model/sparse/base.py rename to scikits/learn/linear_model/sparse/base.py diff --git a/sklearn/linear_model/sparse/coordinate_descent.py b/scikits/learn/linear_model/sparse/coordinate_descent.py similarity index 100% rename from sklearn/linear_model/sparse/coordinate_descent.py rename to scikits/learn/linear_model/sparse/coordinate_descent.py diff --git a/sklearn/linear_model/sparse/logistic.py b/scikits/learn/linear_model/sparse/logistic.py similarity index 98% rename from sklearn/linear_model/sparse/logistic.py rename to scikits/learn/linear_model/sparse/logistic.py index 74e14e8b3e497e8a553e03b4dbe0bb2fd87e5e87..6f01d7caca9bb58f3dd8654f22e4661032dc7c91 100644 --- a/sklearn/linear_model/sparse/logistic.py +++ b/scikits/learn/linear_model/sparse/logistic.py @@ -1,7 +1,7 @@ """ Sparse Logistic Regression module -This module has the same API as sklearn.linear_model.logistic, but is +This module has the same API as scikits.learn.linear_model.logistic, but is designed to handle efficiently data in sparse matrix format. """ diff --git a/sklearn/linear_model/sparse/setup.py b/scikits/learn/linear_model/sparse/setup.py similarity index 100% rename from sklearn/linear_model/sparse/setup.py rename to scikits/learn/linear_model/sparse/setup.py diff --git a/sklearn/linear_model/sparse/src/cd_fast_sparse.c b/scikits/learn/linear_model/sparse/src/cd_fast_sparse.c similarity index 86% rename from sklearn/linear_model/sparse/src/cd_fast_sparse.c rename to scikits/learn/linear_model/sparse/src/cd_fast_sparse.c index b50fee79ab19de63bea9ee213805da8740fd26e1..29f3bb5629cee7aed64cfee60b6b7d748437be9a 100644 --- a/sklearn/linear_model/sparse/src/cd_fast_sparse.c +++ b/scikits/learn/linear_model/sparse/src/cd_fast_sparse.c @@ -1,39 +1,18 @@ -/* Generated by Cython 0.13 on Fri Sep 2 11:30:08 2011 */ +/* Generated by Cython 0.12.1 on Tue Sep 14 09:45:11 2010 */ #define PY_SSIZE_T_CLEAN #include "Python.h" +#include "structmember.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #else -#include <stddef.h> /* For offsetof */ -#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 +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif - -#ifndef PY_LONG_LONG - #define PY_LONG_LONG LONG_LONG -#endif - #if PY_VERSION_HEX < 0x02040000 #define METH_COEXIST 0 #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type) @@ -103,35 +82,11 @@ #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_VERSION_HEX < 0x02060000 - #define PyBytesObject PyStringObject +#else #define PyBytes_Type PyString_Type - #define PyBytes_Check PyString_Check #define PyBytes_CheckExact PyString_CheckExact - #define PyBytes_FromString PyString_FromString - #define PyBytes_FromStringAndSize PyString_FromStringAndSize - #define PyBytes_FromFormat PyString_FromFormat - #define PyBytes_DecodeEscape PyString_DecodeEscape - #define PyBytes_AsString PyString_AsString - #define PyBytes_AsStringAndSize PyString_AsStringAndSize - #define PyBytes_Size PyString_Size - #define PyBytes_AS_STRING PyString_AS_STRING - #define PyBytes_GET_SIZE PyString_GET_SIZE - #define PyBytes_Repr PyString_Repr - #define PyBytes_Concat PyString_Concat - #define PyBytes_ConcatAndDel PyString_ConcatAndDel - #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) - #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) -#endif - -#ifndef PySet_CheckExact -# define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #if PY_MAJOR_VERSION >= 3 @@ -148,23 +103,30 @@ #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask -#endif - -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#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 #if PY_MAJOR_VERSION >= 3 - #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) + #define PyMethod_New(func, self, klass) PyInstanceMethod_New(func) +#endif + +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#else + #define _USE_MATH_DEFINES #endif #if PY_VERSION_HEX < 0x02050000 @@ -184,64 +146,113 @@ #define __Pyx_NAMESTR(n) (n) #define __Pyx_DOCSTR(n) (n) #endif - #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif - -#if defined(WIN32) || defined(MS_WINDOWS) -#define _USE_MATH_DEFINES -#endif #include <math.h> #define __PYX_HAVE_API__cd_fast_sparse -#include "stdio.h" #include "stdlib.h" +#include "stdio.h" #include "numpy/arrayobject.h" #include "numpy/ufuncobject.h" #include "math.h" -/* inline attribute */ #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 -/* unused attribute */ -#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) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -#endif - typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ /* Type Conversion Predeclarations */ -#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s) -#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) PyBytes_AsString(s)) +#if PY_MAJOR_VERSION < 3 +#define __Pyx_PyBytes_FromString PyString_FromString +#define __Pyx_PyBytes_FromStringAndSize PyString_FromStringAndSize +#define __Pyx_PyBytes_AsString PyString_AsString +#else +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +#define __Pyx_PyBytes_AsString PyBytes_AsString +#endif + +#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s) +#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) __Pyx_PyBytes_AsString(s)) #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); +#if !defined(T_PYSSIZET) +#if PY_VERSION_HEX < 0x02050000 +#define T_PYSSIZET T_INT +#elif !defined(T_LONGLONG) +#define T_PYSSIZET \ + ((sizeof(Py_ssize_t) == sizeof(int)) ? T_INT : \ + ((sizeof(Py_ssize_t) == sizeof(long)) ? T_LONG : -1)) +#else +#define T_PYSSIZET \ + ((sizeof(Py_ssize_t) == sizeof(int)) ? T_INT : \ + ((sizeof(Py_ssize_t) == sizeof(long)) ? T_LONG : \ + ((sizeof(Py_ssize_t) == sizeof(PY_LONG_LONG)) ? T_LONGLONG : -1))) +#endif +#endif + + +#if !defined(T_ULONGLONG) +#define __Pyx_T_UNSIGNED_INT(x) \ + ((sizeof(x) == sizeof(unsigned char)) ? T_UBYTE : \ + ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \ + ((sizeof(x) == sizeof(unsigned int)) ? T_UINT : \ + ((sizeof(x) == sizeof(unsigned long)) ? T_ULONG : -1)))) +#else +#define __Pyx_T_UNSIGNED_INT(x) \ + ((sizeof(x) == sizeof(unsigned char)) ? T_UBYTE : \ + ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \ + ((sizeof(x) == sizeof(unsigned int)) ? T_UINT : \ + ((sizeof(x) == sizeof(unsigned long)) ? T_ULONG : \ + ((sizeof(x) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1))))) +#endif +#if !defined(T_LONGLONG) +#define __Pyx_T_SIGNED_INT(x) \ + ((sizeof(x) == sizeof(char)) ? T_BYTE : \ + ((sizeof(x) == sizeof(short)) ? T_SHORT : \ + ((sizeof(x) == sizeof(int)) ? T_INT : \ + ((sizeof(x) == sizeof(long)) ? T_LONG : -1)))) +#else +#define __Pyx_T_SIGNED_INT(x) \ + ((sizeof(x) == sizeof(char)) ? T_BYTE : \ + ((sizeof(x) == sizeof(short)) ? T_SHORT : \ + ((sizeof(x) == sizeof(int)) ? T_INT : \ + ((sizeof(x) == sizeof(long)) ? T_LONG : \ + ((sizeof(x) == sizeof(PY_LONG_LONG)) ? T_LONGLONG : -1))))) +#endif + +#define __Pyx_T_FLOATING(x) \ + ((sizeof(x) == sizeof(float)) ? T_FLOAT : \ + ((sizeof(x) == sizeof(double)) ? T_DOUBLE : -1)) + +#if !defined(T_SIZET) +#if !defined(T_ULONGLONG) +#define T_SIZET \ + ((sizeof(size_t) == sizeof(unsigned int)) ? T_UINT : \ + ((sizeof(size_t) == sizeof(unsigned long)) ? T_ULONG : -1)) +#else +#define T_SIZET \ + ((sizeof(size_t) == sizeof(unsigned int)) ? T_UINT : \ + ((sizeof(size_t) == sizeof(unsigned long)) ? T_ULONG : \ + ((sizeof(size_t) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1))) +#endif +#endif + static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); @@ -251,7 +262,7 @@ static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); #ifdef __GNUC__ /* Test for GCC > 2.95 */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) +#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* __GNUC__ > 2 ... */ @@ -271,6 +282,7 @@ static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; +static const char **__pyx_f; #if !defined(CYTHON_CCOMPLEX) @@ -296,11 +308,6 @@ static const char *__pyx_filename; #define _Complex_I 1.0fj #endif -static const char *__pyx_f[] = { - "cd_fast_sparse.pyx", - "numpy.pxd", -}; - typedef npy_int8 __pyx_t_5numpy_int8_t; typedef npy_int16 __pyx_t_5numpy_int16_t; @@ -419,8 +426,6 @@ typedef npy_cdouble __pyx_t_5numpy_complex_t; #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0) -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ - static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name); /*proto*/ @@ -429,9 +434,6 @@ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/ -static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact); /*proto*/ - /* Run-time type information about structs used with buffers */ struct __Pyx_StructField_; @@ -454,8 +456,8 @@ typedef struct { } __Pyx_BufFmt_StackElem; -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); +static int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0) @@ -472,11 +474,11 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j } -#define __Pyx_GetItemInt_List(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_List_Fast(o, i) : \ +#define __Pyx_GetItemInt_List(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \ + __Pyx_GetItemInt_List_Fast(o, i, size <= sizeof(long)) : \ __Pyx_GetItemInt_Generic(o, to_py_func(i))) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i) { +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int fits_long) { if (likely(o != Py_None)) { if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, i); @@ -489,14 +491,14 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_ return r; } } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); + return __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i)); } -#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_Tuple_Fast(o, i) : \ +#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \ + __Pyx_GetItemInt_Tuple_Fast(o, i, size <= sizeof(long)) : \ __Pyx_GetItemInt_Generic(o, to_py_func(i))) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i) { +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int fits_long) { if (likely(o != Py_None)) { if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, i); @@ -509,15 +511,15 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize return r; } } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); + return __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i)); } -#define __Pyx_GetItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_Fast(o, i) : \ +#define __Pyx_GetItemInt(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \ + __Pyx_GetItemInt_Fast(o, i, size <= sizeof(long)) : \ __Pyx_GetItemInt_Generic(o, to_py_func(i))) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) { +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int fits_long) { PyObject *r; if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) { r = PyList_GET_ITEM(o, i); @@ -531,13 +533,13 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) r = PySequence_GetItem(o, i); } else { - r = __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); + r = __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i)); } return r; } -#define __Pyx_SetItemInt(o, i, v, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \ - __Pyx_SetItemInt_Fast(o, i, v) : \ +#define __Pyx_SetItemInt(o, i, v, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \ + __Pyx_SetItemInt_Fast(o, i, v, size <= sizeof(long)) : \ __Pyx_SetItemInt_Generic(o, to_py_func(i), v)) static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) { @@ -548,7 +550,7 @@ static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyOb return r; } -static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v) { +static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int fits_long) { if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) { Py_INCREF(v); Py_DECREF(PyList_GET_ITEM(o, i)); @@ -558,7 +560,7 @@ static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObje else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_ass_item && (likely(i >= 0))) return PySequence_SetItem(o, i, v); else { - PyObject *j = PyInt_FromSsize_t(i); + PyObject *j = fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i); return __Pyx_SetItemInt_Generic(o, j, v); } } @@ -566,13 +568,19 @@ static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObje static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ -static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); - static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(void); + +static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); /*proto*/ +static int __Pyx_EndUnpack(PyObject *); /*proto*/ + +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /*proto*/ + +static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact); /*proto*/ #if PY_MAJOR_VERSION < 3 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); static void __Pyx_ReleaseBuffer(Py_buffer *view); @@ -586,6 +594,8 @@ Py_ssize_t __Pyx_minusones[] = {-1}; static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ +static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ + static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_npy_int32(npy_int32); #if CYTHON_CCOMPLEX @@ -689,8 +699,6 @@ static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *); static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *); -static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *); - static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *); static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *); @@ -710,15 +718,13 @@ static PyObject *__Pyx_ImportModule(const char *name); /*proto*/ static void __Pyx_AddTraceback(const char *funcname); /*proto*/ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ -/* Module declarations from cpython.buffer */ +/* Module declarations from python_buffer */ -/* Module declarations from cpython.ref */ +/* Module declarations from python_ref */ -/* Module declarations from libc.stdio */ +/* Module declarations from stdlib */ -/* Module declarations from cpython.object */ - -/* Module declarations from libc.stdlib */ +/* Module declarations from stdio */ /* Module declarations from numpy */ @@ -743,8 +749,8 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *); / static CYTHON_INLINE double __pyx_f_14cd_fast_sparse_fmax(double, double); /*proto*/ static CYTHON_INLINE double __pyx_f_14cd_fast_sparse_fsign(double); /*proto*/ -static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_14cd_fast_sparse_DOUBLE = { "DOUBLE", NULL, sizeof(__pyx_t_14cd_fast_sparse_DOUBLE), 'R' }; -static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_14cd_fast_sparse_INTEGER = { "INTEGER", NULL, sizeof(__pyx_t_14cd_fast_sparse_INTEGER), 'I' }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_14cd_fast_sparse_DOUBLE = { "cd_fast_sparse.DOUBLE", NULL, sizeof(__pyx_t_14cd_fast_sparse_DOUBLE), 'R' }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_14cd_fast_sparse_INTEGER = { "cd_fast_sparse.INTEGER", NULL, sizeof(__pyx_t_14cd_fast_sparse_INTEGER), 'I' }; #define __Pyx_MODULE_NAME "cd_fast_sparse" int __pyx_module_is_main_cd_fast_sparse = 0; @@ -797,6 +803,7 @@ static char __pyx_k__ndim[] = "ndim"; static char __pyx_k__norm[] = "norm"; static char __pyx_k__alpha[] = "alpha"; static char __pyx_k__descr[] = "descr"; +static char __pyx_k__max_iter[] = "max_iter"; static char __pyx_k__names[] = "names"; static char __pyx_k__numpy[] = "numpy"; static char __pyx_k__range[] = "range"; @@ -813,7 +820,6 @@ static char __pyx_k__X_indptr[] = "X_indptr"; static char __pyx_k____main__[] = "__main__"; static char __pyx_k____test__[] = "__test__"; static char __pyx_k__itemsize[] = "itemsize"; -static char __pyx_k__max_iter[] = "max_iter"; static char __pyx_k__readonly[] = "readonly"; static char __pyx_k__type_num[] = "type_num"; static char __pyx_k__X_indices[] = "X_indices"; @@ -876,7 +882,7 @@ static PyObject *__pyx_int_1; static PyObject *__pyx_int_2; static PyObject *__pyx_int_15; -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":16 +/* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":16 * double sqrt(double f) * * cdef inline double fmax(double x, double y): # <<<<<<<<<<<<<< @@ -889,7 +895,7 @@ static CYTHON_INLINE double __pyx_f_14cd_fast_sparse_fmax(double __pyx_v_x, doub int __pyx_t_1; __Pyx_RefNannySetupContext("fmax"); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":17 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":17 * * cdef inline double fmax(double x, double y): * if x > y: return x # <<<<<<<<<<<<<< @@ -904,7 +910,7 @@ static CYTHON_INLINE double __pyx_f_14cd_fast_sparse_fmax(double __pyx_v_x, doub } __pyx_L3:; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":18 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":18 * cdef inline double fmax(double x, double y): * if x > y: return x * return y # <<<<<<<<<<<<<< @@ -920,7 +926,7 @@ static CYTHON_INLINE double __pyx_f_14cd_fast_sparse_fmax(double __pyx_v_x, doub return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":20 +/* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":20 * return y * * cdef inline double fsign(double f): # <<<<<<<<<<<<<< @@ -933,39 +939,39 @@ static CYTHON_INLINE double __pyx_f_14cd_fast_sparse_fsign(double __pyx_v_f) { int __pyx_t_1; __Pyx_RefNannySetupContext("fsign"); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":21 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":21 * * cdef inline double fsign(double f): * if f == 0: # <<<<<<<<<<<<<< * return 0 * elif f > 0: */ - __pyx_t_1 = (__pyx_v_f == 0.0); + __pyx_t_1 = (__pyx_v_f == 0); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":22 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":22 * cdef inline double fsign(double f): * if f == 0: * return 0 # <<<<<<<<<<<<<< * elif f > 0: * return 1.0 */ - __pyx_r = 0.0; + __pyx_r = 0; goto __pyx_L0; goto __pyx_L3; } - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":23 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":23 * if f == 0: * return 0 * elif f > 0: # <<<<<<<<<<<<<< * return 1.0 * else: */ - __pyx_t_1 = (__pyx_v_f > 0.0); + __pyx_t_1 = (__pyx_v_f > 0); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":24 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":24 * return 0 * elif f > 0: * return 1.0 # <<<<<<<<<<<<<< @@ -978,7 +984,7 @@ static CYTHON_INLINE double __pyx_f_14cd_fast_sparse_fsign(double __pyx_v_f) { } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":26 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":26 * return 1.0 * else: * return -1.0 # <<<<<<<<<<<<<< @@ -996,7 +1002,7 @@ static CYTHON_INLINE double __pyx_f_14cd_fast_sparse_fsign(double __pyx_v_f) { return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":35 +/* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":35 * @cython.wraparound(False) * @cython.cdivision(True) * def enet_coordinate_descent(np.ndarray[DOUBLE, ndim=1] w, # <<<<<<<<<<<<<< @@ -1066,7 +1072,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p unsigned int __pyx_t_6; unsigned int __pyx_t_7; unsigned int __pyx_t_8; - long __pyx_t_9; + unsigned long __pyx_t_9; __pyx_t_14cd_fast_sparse_DOUBLE __pyx_t_10; unsigned int __pyx_t_11; PyArrayObject *__pyx_t_12 = NULL; @@ -1074,7 +1080,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; - long __pyx_t_17; + unsigned long __pyx_t_17; __pyx_t_14cd_fast_sparse_INTEGER __pyx_t_18; unsigned int __pyx_t_19; unsigned int __pyx_t_20; @@ -1086,20 +1092,20 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p unsigned int __pyx_t_26; int __pyx_t_27; unsigned int __pyx_t_28; - long __pyx_t_29; + unsigned long __pyx_t_29; unsigned int __pyx_t_30; unsigned int __pyx_t_31; unsigned int __pyx_t_32; unsigned int __pyx_t_33; __pyx_t_14cd_fast_sparse_INTEGER __pyx_t_34; - long __pyx_t_35; + unsigned long __pyx_t_35; unsigned int __pyx_t_36; unsigned int __pyx_t_37; __pyx_t_14cd_fast_sparse_INTEGER __pyx_t_38; unsigned int __pyx_t_39; unsigned int __pyx_t_40; unsigned int __pyx_t_41; - long __pyx_t_42; + unsigned long __pyx_t_42; unsigned int __pyx_t_43; unsigned int __pyx_t_44; unsigned int __pyx_t_45; @@ -1111,7 +1117,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p int __pyx_t_51; int __pyx_t_52; int __pyx_t_53; - long __pyx_t_54; + unsigned long __pyx_t_54; unsigned int __pyx_t_55; unsigned int __pyx_t_56; unsigned int __pyx_t_57; @@ -1220,9 +1226,13 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p __Pyx_RaiseArgtupleInvalid("enet_coordinate_descent", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("cd_fast_sparse.enet_coordinate_descent"); - __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF((PyObject *)__pyx_v_w); + __Pyx_INCREF((PyObject *)__pyx_v_X_data); + __Pyx_INCREF((PyObject *)__pyx_v_X_indices); + __Pyx_INCREF((PyObject *)__pyx_v_X_indptr); + __Pyx_INCREF((PyObject *)__pyx_v_y); __pyx_v_R = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_X_T_R = Py_None; __Pyx_INCREF(Py_None); __pyx_v_dual_norm_XtA = Py_None; __Pyx_INCREF(Py_None); @@ -1273,7 +1283,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p __pyx_bstride_0_y = __pyx_bstruct_y.strides[0]; __pyx_bshape_0_y = __pyx_bstruct_y.shape[0]; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":53 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":53 * * # get the data information into easy vars * cdef unsigned int n_samples = y.shape[0] # <<<<<<<<<<<<<< @@ -1282,7 +1292,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p */ __pyx_v_n_samples = (__pyx_v_y->dimensions[0]); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":54 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":54 * # get the data information into easy vars * cdef unsigned int n_samples = y.shape[0] * cdef unsigned int n_features = w.shape[0] # <<<<<<<<<<<<<< @@ -1291,7 +1301,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p */ __pyx_v_n_features = (__pyx_v_w->dimensions[0]); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":58 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":58 * # compute norms of the columns of X * cdef unsigned int ii * cdef np.ndarray[DOUBLE, ndim=1] norm_cols_X = np.zeros(n_features, # <<<<<<<<<<<<<< @@ -1306,7 +1316,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_v_n_features); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":59 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":59 * cdef unsigned int ii * cdef np.ndarray[DOUBLE, ndim=1] norm_cols_X = np.zeros(n_features, * np.float64) # <<<<<<<<<<<<<< @@ -1345,7 +1355,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p __pyx_v_norm_cols_X = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":60 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":60 * cdef np.ndarray[DOUBLE, ndim=1] norm_cols_X = np.zeros(n_features, * np.float64) * for ii in xrange(n_features): # <<<<<<<<<<<<<< @@ -1356,7 +1366,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_ii = __pyx_t_7; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":61 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":61 * np.float64) * for ii in xrange(n_features): * norm_cols_X[ii] = (X_data[X_indptr[ii]:X_indptr[ii + 1]] ** 2).sum() # <<<<<<<<<<<<<< @@ -1382,7 +1392,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p *__Pyx_BufPtrStrided1d(__pyx_t_14cd_fast_sparse_DOUBLE *, __pyx_bstruct_norm_cols_X.buf, __pyx_t_11, __pyx_bstride_0_norm_cols_X) = __pyx_t_10; } - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":71 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":71 * cdef double w_max * cdef double d_w_ii * cdef double gap = tol + 1.0 # <<<<<<<<<<<<<< @@ -1391,7 +1401,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p */ __pyx_v_gap = (__pyx_v_tol + 1.0); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":72 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":72 * cdef double d_w_ii * cdef double gap = tol + 1.0 * cdef double d_w_tol = tol # <<<<<<<<<<<<<< @@ -1400,7 +1410,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p */ __pyx_v_d_w_tol = __pyx_v_tol; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":77 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":77 * * # initialize the residuals * R = y.copy() # <<<<<<<<<<<<<< @@ -1436,7 +1446,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p __pyx_v_R = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":78 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":78 * # initialize the residuals * R = y.copy() * for ii in xrange(n_features): # <<<<<<<<<<<<<< @@ -1447,7 +1457,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_ii = __pyx_t_7; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":80 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":80 * for ii in xrange(n_features): * # sparse X column / dense w dot product * for jj in xrange(X_indptr[ii], X_indptr[ii + 1]): # <<<<<<<<<<<<<< @@ -1460,7 +1470,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p for (__pyx_t_20 = (*__Pyx_BufPtrStrided1d(__pyx_t_14cd_fast_sparse_INTEGER *, __pyx_bstruct_X_indptr.buf, __pyx_t_19, __pyx_bstride_0_X_indptr)); __pyx_t_20 < __pyx_t_18; __pyx_t_20+=1) { __pyx_v_jj = __pyx_t_20; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":81 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":81 * # sparse X column / dense w dot product * for jj in xrange(X_indptr[ii], X_indptr[ii + 1]): * R[X_indices[jj]] -= X_data[jj] * w[ii] # <<<<<<<<<<<<<< @@ -1475,7 +1485,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p } } - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":83 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":83 * R[X_indices[jj]] -= X_data[jj] * w[ii] * * tol = tol * linalg.norm(y) ** 2 # <<<<<<<<<<<<<< @@ -1509,7 +1519,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_tol = __pyx_t_25; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":85 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":85 * tol = tol * linalg.norm(y) ** 2 * * for n_iter in range(max_iter): # <<<<<<<<<<<<<< @@ -1520,7 +1530,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_13; __pyx_t_6+=1) { __pyx_v_n_iter = __pyx_t_6; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":87 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":87 * for n_iter in range(max_iter): * * w_max = 0.0 # <<<<<<<<<<<<<< @@ -1529,7 +1539,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p */ __pyx_v_w_max = 0.0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":88 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":88 * * w_max = 0.0 * d_w_max = 0.0 # <<<<<<<<<<<<<< @@ -1538,7 +1548,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p */ __pyx_v_d_w_max = 0.0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":90 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":90 * d_w_max = 0.0 * * for ii in xrange(n_features): # Loop over coordinates # <<<<<<<<<<<<<< @@ -1549,7 +1559,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_7; __pyx_t_20+=1) { __pyx_v_ii = __pyx_t_20; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":91 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":91 * * for ii in xrange(n_features): # Loop over coordinates * if norm_cols_X[ii] == 0.0: # <<<<<<<<<<<<<< @@ -1560,7 +1570,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p __pyx_t_27 = ((*__Pyx_BufPtrStrided1d(__pyx_t_14cd_fast_sparse_DOUBLE *, __pyx_bstruct_norm_cols_X.buf, __pyx_t_26, __pyx_bstride_0_norm_cols_X)) == 0.0); if (__pyx_t_27) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":92 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":92 * for ii in xrange(n_features): # Loop over coordinates * if norm_cols_X[ii] == 0.0: * continue # <<<<<<<<<<<<<< @@ -1572,7 +1582,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p } __pyx_L16:; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":94 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":94 * continue * * w_ii = w[ii] # Store previous value # <<<<<<<<<<<<<< @@ -1582,7 +1592,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p __pyx_t_28 = __pyx_v_ii; __pyx_v_w_ii = (*__Pyx_BufPtrStrided1d(__pyx_t_14cd_fast_sparse_DOUBLE *, __pyx_bstruct_w.buf, __pyx_t_28, __pyx_bstride_0_w)); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":96 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":96 * w_ii = w[ii] # Store previous value * * if w_ii != 0.0: # <<<<<<<<<<<<<< @@ -1592,7 +1602,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p __pyx_t_27 = (__pyx_v_w_ii != 0.0); if (__pyx_t_27) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":98 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":98 * if w_ii != 0.0: * # R += w_ii * X[:,ii] * for jj in xrange(X_indptr[ii], X_indptr[ii + 1]): # <<<<<<<<<<<<<< @@ -1605,7 +1615,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p for (__pyx_t_31 = (*__Pyx_BufPtrStrided1d(__pyx_t_14cd_fast_sparse_INTEGER *, __pyx_bstruct_X_indptr.buf, __pyx_t_30, __pyx_bstride_0_X_indptr)); __pyx_t_31 < __pyx_t_18; __pyx_t_31+=1) { __pyx_v_jj = __pyx_t_31; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":99 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":99 * # R += w_ii * X[:,ii] * for jj in xrange(X_indptr[ii], X_indptr[ii + 1]): * R[X_indices[jj]] += X_data[jj] * w_ii # <<<<<<<<<<<<<< @@ -1621,7 +1631,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p } __pyx_L17:; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":102 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":102 * * # tmp = (X[:,ii] * R).sum() * tmp = 0.0 # <<<<<<<<<<<<<< @@ -1630,7 +1640,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p */ __pyx_v_tmp = 0.0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":103 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":103 * # tmp = (X[:,ii] * R).sum() * tmp = 0.0 * for jj in xrange(X_indptr[ii], X_indptr[ii + 1]): # <<<<<<<<<<<<<< @@ -1643,7 +1653,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p for (__pyx_t_36 = (*__Pyx_BufPtrStrided1d(__pyx_t_14cd_fast_sparse_INTEGER *, __pyx_bstruct_X_indptr.buf, __pyx_t_31, __pyx_bstride_0_X_indptr)); __pyx_t_36 < __pyx_t_18; __pyx_t_36+=1) { __pyx_v_jj = __pyx_t_36; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":104 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":104 * tmp = 0.0 * for jj in xrange(X_indptr[ii], X_indptr[ii + 1]): * tmp += R[X_indices[jj]] * X_data[jj] # <<<<<<<<<<<<<< @@ -1656,7 +1666,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p __pyx_v_tmp += ((*__Pyx_BufPtrStrided1d(__pyx_t_14cd_fast_sparse_DOUBLE *, __pyx_bstruct_R.buf, __pyx_t_38, __pyx_bstride_0_R)) * (*__Pyx_BufPtrStrided1d(__pyx_t_14cd_fast_sparse_DOUBLE *, __pyx_bstruct_X_data.buf, __pyx_t_39, __pyx_bstride_0_X_data))); } - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":107 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":107 * * w[ii] = fsign(tmp) * fmax(fabs(tmp) - alpha, 0) \ * / (norm_cols_X[ii] + beta) # <<<<<<<<<<<<<< @@ -1665,7 +1675,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p */ __pyx_t_36 = __pyx_v_ii; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":106 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":106 * tmp += R[X_indices[jj]] * X_data[jj] * * w[ii] = fsign(tmp) * fmax(fabs(tmp) - alpha, 0) \ # <<<<<<<<<<<<<< @@ -1673,9 +1683,9 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p * */ __pyx_t_40 = __pyx_v_ii; - *__Pyx_BufPtrStrided1d(__pyx_t_14cd_fast_sparse_DOUBLE *, __pyx_bstruct_w.buf, __pyx_t_40, __pyx_bstride_0_w) = ((__pyx_f_14cd_fast_sparse_fsign(__pyx_v_tmp) * __pyx_f_14cd_fast_sparse_fmax((fabs(__pyx_v_tmp) - __pyx_v_alpha), 0.0)) / ((*__Pyx_BufPtrStrided1d(__pyx_t_14cd_fast_sparse_DOUBLE *, __pyx_bstruct_norm_cols_X.buf, __pyx_t_36, __pyx_bstride_0_norm_cols_X)) + __pyx_v_beta)); + *__Pyx_BufPtrStrided1d(__pyx_t_14cd_fast_sparse_DOUBLE *, __pyx_bstruct_w.buf, __pyx_t_40, __pyx_bstride_0_w) = ((__pyx_f_14cd_fast_sparse_fsign(__pyx_v_tmp) * __pyx_f_14cd_fast_sparse_fmax((fabs(__pyx_v_tmp) - __pyx_v_alpha), 0)) / ((*__Pyx_BufPtrStrided1d(__pyx_t_14cd_fast_sparse_DOUBLE *, __pyx_bstruct_norm_cols_X.buf, __pyx_t_36, __pyx_bstride_0_norm_cols_X)) + __pyx_v_beta)); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":109 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":109 * / (norm_cols_X[ii] + beta) * * if w[ii] != 0.0: # <<<<<<<<<<<<<< @@ -1686,7 +1696,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p __pyx_t_27 = ((*__Pyx_BufPtrStrided1d(__pyx_t_14cd_fast_sparse_DOUBLE *, __pyx_bstruct_w.buf, __pyx_t_41, __pyx_bstride_0_w)) != 0.0); if (__pyx_t_27) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":111 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":111 * if w[ii] != 0.0: * # R -= w[ii] * X[:,ii] # Update residual * for jj in xrange(X_indptr[ii], X_indptr[ii + 1]): # <<<<<<<<<<<<<< @@ -1699,7 +1709,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p for (__pyx_t_44 = (*__Pyx_BufPtrStrided1d(__pyx_t_14cd_fast_sparse_INTEGER *, __pyx_bstruct_X_indptr.buf, __pyx_t_43, __pyx_bstride_0_X_indptr)); __pyx_t_44 < __pyx_t_18; __pyx_t_44+=1) { __pyx_v_jj = __pyx_t_44; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":112 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":112 * # R -= w[ii] * X[:,ii] # Update residual * for jj in xrange(X_indptr[ii], X_indptr[ii + 1]): * R[X_indices[jj]] -= X_data[jj] * w[ii] # <<<<<<<<<<<<<< @@ -1716,7 +1726,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p } __pyx_L22:; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":115 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":115 * * # update the maximum absolute coefficient update * d_w_ii = fabs(w[ii] - w_ii) # <<<<<<<<<<<<<< @@ -1726,7 +1736,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p __pyx_t_44 = __pyx_v_ii; __pyx_v_d_w_ii = fabs(((*__Pyx_BufPtrStrided1d(__pyx_t_14cd_fast_sparse_DOUBLE *, __pyx_bstruct_w.buf, __pyx_t_44, __pyx_bstride_0_w)) - __pyx_v_w_ii)); - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":116 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":116 * # update the maximum absolute coefficient update * d_w_ii = fabs(w[ii] - w_ii) * if d_w_ii > d_w_max: # <<<<<<<<<<<<<< @@ -1736,7 +1746,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p __pyx_t_27 = (__pyx_v_d_w_ii > __pyx_v_d_w_max); if (__pyx_t_27) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":117 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":117 * d_w_ii = fabs(w[ii] - w_ii) * if d_w_ii > d_w_max: * d_w_max = d_w_ii # <<<<<<<<<<<<<< @@ -1748,7 +1758,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p } __pyx_L25:; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":119 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":119 * d_w_max = d_w_ii * * if w[ii] > w_max: # <<<<<<<<<<<<<< @@ -1759,7 +1769,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p __pyx_t_27 = ((*__Pyx_BufPtrStrided1d(__pyx_t_14cd_fast_sparse_DOUBLE *, __pyx_bstruct_w.buf, __pyx_t_49, __pyx_bstride_0_w)) > __pyx_v_w_max); if (__pyx_t_27) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":120 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":120 * * if w[ii] > w_max: * w_max = w[ii] # <<<<<<<<<<<<<< @@ -1774,7 +1784,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p __pyx_L14_continue:; } - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":122 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":122 * w_max = w[ii] * * if w_max == 0.0 or d_w_max / w_max < d_w_tol or n_iter == max_iter - 1: # <<<<<<<<<<<<<< @@ -1796,7 +1806,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p } if (__pyx_t_51) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":128 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":128 * * # sparse X.T / dense R dot product * X_T_R = np.zeros(n_features) # <<<<<<<<<<<<<< @@ -1823,7 +1833,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p __pyx_v_X_T_R = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":129 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":129 * # sparse X.T / dense R dot product * X_T_R = np.zeros(n_features) * for ii in xrange(n_features): # <<<<<<<<<<<<<< @@ -1834,7 +1844,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_7; __pyx_t_20+=1) { __pyx_v_ii = __pyx_t_20; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":130 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":130 * X_T_R = np.zeros(n_features) * for ii in xrange(n_features): * for jj in xrange(X_indptr[ii], X_indptr[ii + 1]): # <<<<<<<<<<<<<< @@ -1847,7 +1857,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p for (__pyx_t_56 = (*__Pyx_BufPtrStrided1d(__pyx_t_14cd_fast_sparse_INTEGER *, __pyx_bstruct_X_indptr.buf, __pyx_t_55, __pyx_bstride_0_X_indptr)); __pyx_t_56 < __pyx_t_18; __pyx_t_56+=1) { __pyx_v_jj = __pyx_t_56; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":131 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":131 * for ii in xrange(n_features): * for jj in xrange(X_indptr[ii], X_indptr[ii + 1]): * X_T_R[ii] += X_data[jj] * R[X_indices[jj]] # <<<<<<<<<<<<<< @@ -1870,7 +1880,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p } } - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":133 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":133 * X_T_R[ii] += X_data[jj] * R[X_indices[jj]] * * dual_norm_XtA = linalg.norm(X_T_R - beta * w, np.inf) # <<<<<<<<<<<<<< @@ -1911,7 +1921,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p __pyx_v_dual_norm_XtA = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":135 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":135 * dual_norm_XtA = linalg.norm(X_T_R - beta * w, np.inf) * # TODO: use squared L2 norm directly * R_norm = linalg.norm(R) # <<<<<<<<<<<<<< @@ -1936,7 +1946,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p __pyx_v_R_norm = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":136 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":136 * # TODO: use squared L2 norm directly * R_norm = linalg.norm(R) * w_norm = linalg.norm(w, 2) # <<<<<<<<<<<<<< @@ -1964,7 +1974,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p __pyx_v_w_norm = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":137 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":137 * R_norm = linalg.norm(R) * w_norm = linalg.norm(w, 2) * if (dual_norm_XtA > alpha): # <<<<<<<<<<<<<< @@ -1980,7 +1990,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_51) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":138 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":138 * w_norm = linalg.norm(w, 2) * if (dual_norm_XtA > alpha): * const = alpha / dual_norm_XtA # <<<<<<<<<<<<<< @@ -1996,7 +2006,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p __pyx_v_const = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":139 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":139 * if (dual_norm_XtA > alpha): * const = alpha / dual_norm_XtA * A_norm = R_norm * const # <<<<<<<<<<<<<< @@ -2009,7 +2019,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p __pyx_v_A_norm = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":140 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":140 * const = alpha / dual_norm_XtA * A_norm = R_norm * const * gap = 0.5 * (R_norm ** 2 + A_norm ** 2) # <<<<<<<<<<<<<< @@ -2037,7 +2047,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":142 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":142 * gap = 0.5 * (R_norm ** 2 + A_norm ** 2) * else: * const = 1.0 # <<<<<<<<<<<<<< @@ -2050,7 +2060,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p __pyx_v_const = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":143 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":143 * else: * const = 1.0 * gap = R_norm ** 2 # <<<<<<<<<<<<<< @@ -2065,7 +2075,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p } __pyx_L32:; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":145 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":145 * gap = R_norm ** 2 * * gap += alpha * linalg.norm(w, 1) - const * np.dot(R.T, y) + \ # <<<<<<<<<<<<<< @@ -2122,7 +2132,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":146 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":146 * * gap += alpha * linalg.norm(w, 1) - const * np.dot(R.T, y) + \ * 0.5 * beta * (1 + const ** 2) * (w_norm ** 2) # <<<<<<<<<<<<<< @@ -2154,7 +2164,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_gap += __pyx_t_25; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":148 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":148 * 0.5 * beta * (1 + const ** 2) * (w_norm ** 2) * * if gap < tol: # <<<<<<<<<<<<<< @@ -2164,7 +2174,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p __pyx_t_51 = (__pyx_v_gap < __pyx_v_tol); if (__pyx_t_51) { - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":150 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":150 * if gap < tol: * # return if we reached desired tolerance * break # <<<<<<<<<<<<<< @@ -2181,7 +2191,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p } __pyx_L13_break:; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":152 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":152 * break * * return w, gap, tol # <<<<<<<<<<<<<< @@ -2244,12 +2254,17 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p __Pyx_DECREF(__pyx_v_w_norm); __Pyx_DECREF(__pyx_v_const); __Pyx_DECREF(__pyx_v_A_norm); + __Pyx_DECREF((PyObject *)__pyx_v_w); + __Pyx_DECREF((PyObject *)__pyx_v_X_data); + __Pyx_DECREF((PyObject *)__pyx_v_X_indices); + __Pyx_DECREF((PyObject *)__pyx_v_X_indptr); + __Pyx_DECREF((PyObject *)__pyx_v_y); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":188 +/* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":187 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -2257,8 +2272,8 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p * # requirements, and does not yet fullfill the PEP. */ -static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ -static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__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; @@ -2283,8 +2298,9 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ if (__pyx_v_info == NULL) return 0; __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(__pyx_v_info->obj); + __Pyx_INCREF((PyObject *)__pyx_v_self); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":194 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":193 * # of flags * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -2293,7 +2309,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_endian_detector = 1; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":195 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":194 * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -2302,7 +2318,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":197 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":196 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) * * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< @@ -2311,7 +2327,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_ndim = PyArray_NDIM(((PyArrayObject *)__pyx_v_self)); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":199 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":198 * ndim = PyArray_NDIM(self) * * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -2321,7 +2337,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); if (__pyx_t_1) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":200 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":199 * * if sizeof(npy_intp) != sizeof(Py_ssize_t): * copy_shape = 1 # <<<<<<<<<<<<<< @@ -2333,7 +2349,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } /*else*/ { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":202 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":201 * copy_shape = 1 * else: * copy_shape = 0 # <<<<<<<<<<<<<< @@ -2344,7 +2360,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } __pyx_L5:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":204 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":203 * copy_shape = 0 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -2354,7 +2370,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ __pyx_t_1 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS); if (__pyx_t_1) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":205 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":204 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -2368,29 +2384,29 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } if (__pyx_t_3) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":206 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":205 * 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_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_kp_u_1)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_u_1)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_1)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":208 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":207 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -2400,7 +2416,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ __pyx_t_3 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS); if (__pyx_t_3) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":209 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":208 * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -2414,29 +2430,29 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } if (__pyx_t_2) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":210 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":209 * 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_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_kp_u_2)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_u_2)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_2)); - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L7; } __pyx_L7:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":212 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":211 * raise ValueError(u"ndarray is not Fortran contiguous") * * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< @@ -2445,7 +2461,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->buf = PyArray_DATA(((PyArrayObject *)__pyx_v_self)); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":213 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":212 * * info.buf = PyArray_DATA(self) * info.ndim = ndim # <<<<<<<<<<<<<< @@ -2454,16 +2470,17 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->ndim = __pyx_v_ndim; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":214 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":213 * 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. */ - if (__pyx_v_copy_shape) { + __pyx_t_6 = __pyx_v_copy_shape; + if (__pyx_t_6) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":217 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":216 * # Allocate new buffer for strides and shape info. This is allocated * # as one block, strides first. * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< @@ -2472,7 +2489,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * __pyx_v_ndim) * 2))); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":218 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":217 * # as one block, strides first. * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) * info.shape = info.strides + ndim # <<<<<<<<<<<<<< @@ -2481,7 +2498,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":219 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":218 * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) * info.shape = info.strides + ndim * for i in range(ndim): # <<<<<<<<<<<<<< @@ -2492,7 +2509,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":220 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":219 * info.shape = info.strides + ndim * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< @@ -2501,7 +2518,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":221 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":220 * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< @@ -2514,7 +2531,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } /*else*/ { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":223 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":222 * info.shape[i] = PyArray_DIMS(self)[i] * else: * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) # <<<<<<<<<<<<<< @@ -2523,7 +2540,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(((PyArrayObject *)__pyx_v_self))); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":224 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":223 * else: * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) * info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<< @@ -2534,7 +2551,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } __pyx_L8:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":225 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":224 * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) * info.shape = <Py_ssize_t*>PyArray_DIMS(self) * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -2543,7 +2560,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->suboffsets = NULL; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":226 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":225 * info.shape = <Py_ssize_t*>PyArray_DIMS(self) * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< @@ -2552,7 +2569,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->itemsize = PyArray_ITEMSIZE(((PyArrayObject *)__pyx_v_self)); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":227 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":226 * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< @@ -2561,7 +2578,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->readonly = (!PyArray_ISWRITEABLE(((PyArrayObject *)__pyx_v_self))); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":230 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":229 * * cdef int t * cdef char* f = NULL # <<<<<<<<<<<<<< @@ -2570,7 +2587,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_f = NULL; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":231 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":230 * cdef int t * cdef char* f = NULL * cdef dtype descr = self.descr # <<<<<<<<<<<<<< @@ -2580,7 +2597,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_self)->descr)); __pyx_v_descr = ((PyArrayObject *)__pyx_v_self)->descr; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":235 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":234 * cdef int offset * * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< @@ -2589,7 +2606,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":237 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":236 * cdef bint hasfields = PyDataType_HASFIELDS(descr) * * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< @@ -2605,7 +2622,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } if (__pyx_t_1) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":239 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":238 * if not hasfields and not copy_shape: * # do not call releasebuffer * info.obj = None # <<<<<<<<<<<<<< @@ -2621,7 +2638,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } /*else*/ { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":242 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":241 * else: * # need to call releasebuffer * info.obj = self # <<<<<<<<<<<<<< @@ -2636,7 +2653,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } __pyx_L11:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":244 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":243 * info.obj = self * * if not hasfields: # <<<<<<<<<<<<<< @@ -2646,7 +2663,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ __pyx_t_1 = (!__pyx_v_hasfields); if (__pyx_t_1) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":245 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":244 * * if not hasfields: * t = descr.type_num # <<<<<<<<<<<<<< @@ -2655,7 +2672,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_t = __pyx_v_descr->type_num; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":246 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":245 * if not hasfields: * t = descr.type_num * if ((descr.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< @@ -2670,7 +2687,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } if (!__pyx_t_2) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":247 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":246 * t = descr.type_num * if ((descr.byteorder == '>' and little_endian) or * (descr.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< @@ -2690,29 +2707,29 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } if (__pyx_t_1) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":248 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":247 * if ((descr.byteorder == '>' and little_endian) or * (descr.byteorder == '<' 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_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_kp_u_3)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_u_3)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_3)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L13; } __pyx_L13:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":249 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":248 * (descr.byteorder == '<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< @@ -2725,7 +2742,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":250 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":249 * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< @@ -2738,7 +2755,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":251 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":250 * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< @@ -2751,7 +2768,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":252 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":251 * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< @@ -2764,7 +2781,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":253 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":252 * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< @@ -2777,7 +2794,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":254 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":253 * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< @@ -2790,7 +2807,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":255 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":254 * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< @@ -2803,7 +2820,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":256 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":255 * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< @@ -2816,7 +2833,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":257 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":256 * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< @@ -2829,7 +2846,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":258 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":257 * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< @@ -2842,7 +2859,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":259 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":258 * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< @@ -2855,7 +2872,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":260 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":259 * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< @@ -2868,7 +2885,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":261 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":260 * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< @@ -2881,7 +2898,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":262 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":261 * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< @@ -2894,7 +2911,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":263 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":262 * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< @@ -2907,7 +2924,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":264 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":263 * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< @@ -2920,7 +2937,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":265 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":264 * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< @@ -2934,33 +2951,33 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } /*else*/ { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":267 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":266 * elif t == NPY_OBJECT: f = "O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< * info.format = f * return */ - __pyx_t_5 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_4), __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_4), __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_4)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L14:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":268 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":267 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f # <<<<<<<<<<<<<< @@ -2969,7 +2986,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->format = __pyx_v_f; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":269 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":268 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f * return # <<<<<<<<<<<<<< @@ -2982,7 +2999,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } /*else*/ { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":271 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":270 * return * else: * info.format = <char*>stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< @@ -2991,7 +3008,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->format = ((char *)malloc(255)); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":272 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":271 * else: * info.format = <char*>stdlib.malloc(_buffer_format_string_len) * info.format[0] = '^' # Native data types, manual alignment # <<<<<<<<<<<<<< @@ -3000,7 +3017,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ (__pyx_v_info->format[0]) = '^'; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":273 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":272 * info.format = <char*>stdlib.malloc(_buffer_format_string_len) * info.format[0] = '^' # Native data types, manual alignment * offset = 0 # <<<<<<<<<<<<<< @@ -3009,17 +3026,17 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_offset = 0; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":276 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":275 * f = _util_dtypestring(descr, info.format + 1, * info.format + _buffer_format_string_len, * &offset) # <<<<<<<<<<<<<< * f[0] = 0 # Terminate format string * */ - __pyx_t_9 = __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_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __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_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_f = __pyx_t_9; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":277 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":276 * info.format + _buffer_format_string_len, * &offset) * f[0] = 0 # Terminate format string # <<<<<<<<<<<<<< @@ -3047,11 +3064,12 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } __pyx_L2:; __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":279 +/* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":278 * f[0] = 0 # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -3059,12 +3077,13 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ * stdlib.free(info.format) */ -static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ -static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { +static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ +static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { int __pyx_t_1; __Pyx_RefNannySetupContext("__releasebuffer__"); + __Pyx_INCREF((PyObject *)__pyx_v_self); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":280 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":279 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -3074,7 +3093,7 @@ static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *_ __pyx_t_1 = PyArray_HASFIELDS(((PyArrayObject *)__pyx_v_self)); if (__pyx_t_1) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":281 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":280 * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): * stdlib.free(info.format) # <<<<<<<<<<<<<< @@ -3086,7 +3105,7 @@ static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *_ } __pyx_L5:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":282 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":281 * if PyArray_HASFIELDS(self): * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -3096,7 +3115,7 @@ static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *_ __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); if (__pyx_t_1) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":283 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":282 * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): * stdlib.free(info.strides) # <<<<<<<<<<<<<< @@ -3108,10 +3127,11 @@ static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *_ } __pyx_L6:; + __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_RefNannyFinishContext(); } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":756 +/* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":755 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -3124,7 +3144,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1"); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":757 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":756 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<< @@ -3132,7 +3152,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ * 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 = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -3150,7 +3170,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":759 +/* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":758 * return PyArray_MultiIterNew(1, <void*>a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -3163,7 +3183,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2"); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":760 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":759 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<< @@ -3171,7 +3191,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ * 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 = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -3189,7 +3209,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":762 +/* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":761 * return PyArray_MultiIterNew(2, <void*>a, <void*>b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -3202,7 +3222,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3"); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":763 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":762 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<< @@ -3210,7 +3230,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ * 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 = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -3228,7 +3248,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":765 +/* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":764 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -3241,7 +3261,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4"); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":766 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":765 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<< @@ -3249,7 +3269,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ * 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 = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -3267,7 +3287,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":768 +/* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":767 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -3280,7 +3300,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5"); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":769 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":768 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<< @@ -3288,7 +3308,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ * 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 = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -3306,7 +3326,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":771 +/* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":770 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -3334,13 +3354,14 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx int __pyx_t_9; char *__pyx_t_10; __Pyx_RefNannySetupContext("_util_dtypestring"); + __Pyx_INCREF((PyObject *)__pyx_v_descr); __pyx_v_child = ((PyArray_Descr *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_fields = ((PyObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_childname = Py_None; __Pyx_INCREF(Py_None); __pyx_v_new_offset = Py_None; __Pyx_INCREF(Py_None); __pyx_v_t = Py_None; __Pyx_INCREF(Py_None); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":778 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":777 * cdef int delta_offset * cdef tuple i * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -3349,7 +3370,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_endian_detector = 1; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":779 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":778 * cdef tuple i * cdef int endian_detector = 1 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -3358,7 +3379,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":782 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":781 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -3368,7 +3389,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx if (likely(((PyObject *)__pyx_v_descr->names) != Py_None)) { __pyx_t_1 = 0; __pyx_t_2 = ((PyObject *)__pyx_v_descr->names); __Pyx_INCREF(__pyx_t_2); } else { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } for (;;) { if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break; @@ -3377,21 +3398,21 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_v_childname = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":783 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":782 * * for childname in descr.names: * fields = descr.fields[childname] # <<<<<<<<<<<<<< * child, new_offset = fields * */ - __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (!__pyx_t_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (!__pyx_t_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_fields)); __pyx_v_fields = ((PyObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":784 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":783 * for childname in descr.names: * fields = descr.fields[childname] * child, new_offset = fields # <<<<<<<<<<<<<< @@ -3401,7 +3422,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx if (likely(((PyObject *)__pyx_v_fields) != Py_None) && likely(PyTuple_GET_SIZE(((PyObject *)__pyx_v_fields)) == 2)) { PyObject* tuple = ((PyObject *)__pyx_v_fields); __pyx_t_3 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_4); __Pyx_DECREF(((PyObject *)__pyx_v_child)); __pyx_v_child = ((PyArray_Descr *)__pyx_t_3); @@ -3411,57 +3432,57 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_4 = 0; } else { __Pyx_UnpackTupleError(((PyObject *)__pyx_v_fields), 2); - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":786 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":785 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * */ - __pyx_t_4 = PyInt_FromLong((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":787 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":786 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< * * if ((child.byteorder == '>' and little_endian) or */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_kp_u_5)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_u_5)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_5)); - __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L5; } __pyx_L5:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":789 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":788 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< @@ -3476,7 +3497,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } if (!__pyx_t_7) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":790 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":789 * * if ((child.byteorder == '>' and little_endian) or * (child.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< @@ -3496,29 +3517,29 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } if (__pyx_t_6) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":791 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":790 * if ((child.byteorder == '>' and little_endian) or * (child.byteorder == '<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_kp_u_3)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_u_3)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_3)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":801 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":800 * * # Output padding bytes * while offset[0] < new_offset: # <<<<<<<<<<<<<< @@ -3526,16 +3547,16 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx * f += 1 */ while (1) { - __pyx_t_5 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_6) break; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":802 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":801 * # Output padding bytes * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< @@ -3544,7 +3565,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ (__pyx_v_f[0]) = 120; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":803 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":802 * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte * f += 1 # <<<<<<<<<<<<<< @@ -3553,7 +3574,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f += 1; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":804 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":803 * f[0] = 120 # "x"; pad byte * f += 1 * offset[0] += 1 # <<<<<<<<<<<<<< @@ -3563,7 +3584,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx (__pyx_v_offset[0]) += 1; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":806 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":805 * offset[0] += 1 * * offset[0] += child.itemsize # <<<<<<<<<<<<<< @@ -3572,7 +3593,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ (__pyx_v_offset[0]) += __pyx_v_child->elsize; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":808 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":807 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -3582,20 +3603,20 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = (!PyDataType_HASFIELDS(__pyx_v_child)); if (__pyx_t_6) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":809 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":808 * * if not PyDataType_HASFIELDS(child): * t = child.type_num # <<<<<<<<<<<<<< * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") */ - __pyx_t_3 = PyInt_FromLong(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_v_t); __pyx_v_t = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":810 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":809 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -3605,288 +3626,288 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = ((__pyx_v_end - __pyx_v_f) < 5); if (__pyx_t_6) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":811 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":810 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_kp_u_6)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_u_6)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_6)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L10; } __pyx_L10:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":814 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":813 * * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" */ - __pyx_t_5 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 98; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":815 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":814 * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" */ - __pyx_t_3 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 66; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":816 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":815 * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" */ - __pyx_t_5 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 104; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":817 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":816 * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" */ - __pyx_t_3 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 72; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":818 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":817 * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" */ - __pyx_t_5 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 105; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":819 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":818 * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" */ - __pyx_t_3 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 73; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":820 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":819 * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" */ - __pyx_t_5 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 108; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":821 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":820 * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" */ - __pyx_t_3 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 76; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":822 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":821 * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" */ - __pyx_t_5 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 113; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":823 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":822 * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" */ - __pyx_t_3 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 81; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":824 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":823 * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" */ - __pyx_t_5 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 102; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":825 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":824 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf */ - __pyx_t_3 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 100; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":826 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":825 * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd */ - __pyx_t_5 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 103; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":827 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":826 * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg */ - __pyx_t_3 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -3895,19 +3916,19 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":828 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":827 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg * elif t == NPY_OBJECT: f[0] = 79 #"O" */ - __pyx_t_5 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -3916,19 +3937,19 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":829 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":828 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: */ - __pyx_t_3 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -3937,19 +3958,19 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":830 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":829 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) */ - __pyx_t_5 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 79; @@ -3957,30 +3978,30 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } /*else*/ { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":832 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":831 * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< * f += 1 * else: */ - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_4), __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_4), __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L11:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":833 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":832 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * f += 1 # <<<<<<<<<<<<<< @@ -3992,21 +4013,21 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } /*else*/ { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":837 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":836 * # Cython ignores struct boundary information ("T{...}"), * # so don't output it * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< * return f * */ - __pyx_t_10 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_f = __pyx_t_10; } __pyx_L9:; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":838 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":837 * # so don't output it * f = _util_dtypestring(child, f, end, offset) * return f # <<<<<<<<<<<<<< @@ -4031,11 +4052,12 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_v_childname); __Pyx_DECREF(__pyx_v_new_offset); __Pyx_DECREF(__pyx_v_t); + __Pyx_DECREF((PyObject *)__pyx_v_descr); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":953 +/* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":952 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -4047,8 +4069,10 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a PyObject *__pyx_v_baseptr; int __pyx_t_1; __Pyx_RefNannySetupContext("set_array_base"); + __Pyx_INCREF((PyObject *)__pyx_v_arr); + __Pyx_INCREF(__pyx_v_base); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":955 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":954 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -4058,7 +4082,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __pyx_t_1 = (__pyx_v_base == Py_None); if (__pyx_t_1) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":956 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":955 * cdef PyObject* baseptr * if base is None: * baseptr = NULL # <<<<<<<<<<<<<< @@ -4070,7 +4094,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } /*else*/ { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":958 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":957 * baseptr = NULL * else: * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< @@ -4079,7 +4103,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_INCREF(__pyx_v_base); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":959 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":958 * else: * Py_INCREF(base) # important to do this before decref below! * baseptr = <PyObject*>base # <<<<<<<<<<<<<< @@ -4090,7 +4114,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } __pyx_L3:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":960 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":959 * Py_INCREF(base) # important to do this before decref below! * baseptr = <PyObject*>base * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< @@ -4099,7 +4123,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_XDECREF(__pyx_v_arr->base); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":961 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":960 * baseptr = <PyObject*>base * Py_XDECREF(arr.base) * arr.base = baseptr # <<<<<<<<<<<<<< @@ -4108,10 +4132,12 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ __pyx_v_arr->base = __pyx_v_baseptr; + __Pyx_DECREF((PyObject *)__pyx_v_arr); + __Pyx_DECREF(__pyx_v_base); __Pyx_RefNannyFinishContext(); } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":963 +/* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":962 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -4123,8 +4149,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py PyObject *__pyx_r = NULL; int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base"); + __Pyx_INCREF((PyObject *)__pyx_v_arr); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":964 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":963 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -4134,7 +4161,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_t_1 = (__pyx_v_arr->base == NULL); if (__pyx_t_1) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":965 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":964 * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: * return None # <<<<<<<<<<<<<< @@ -4149,7 +4176,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py } /*else*/ { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":967 + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":966 * return None * else: * return <object>arr.base # <<<<<<<<<<<<<< @@ -4163,16 +4190,19 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = Py_None; __Pyx_INCREF(Py_None); __pyx_L0:; + __Pyx_DECREF((PyObject *)__pyx_v_arr); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyMethodDef __pyx_methods[] = { +static struct PyMethodDef __pyx_methods[] = { {__Pyx_NAMESTR("enet_coordinate_descent"), (PyCFunction)__pyx_pf_14cd_fast_sparse_enet_coordinate_descent, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_14cd_fast_sparse_enet_coordinate_descent)}, {0, 0, 0, 0} }; +static void __pyx_init_filenames(void); /*proto*/ + #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { PyModuleDef_HEAD_INIT, @@ -4248,8 +4278,8 @@ static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_xrange = __Pyx_GetName(__pyx_b, __pyx_n_s__xrange); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; @@ -4287,10 +4317,12 @@ PyMODINIT_FUNC PyInit_cd_fast_sparse(void) } __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit_cd_fast_sparse(void)", __LINE__, __FILE__); #endif + __pyx_init_filenames(); __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if PY_MAJOR_VERSION < 3 + __pyx_empty_bytes = PyString_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #ifdef __pyx_binding_PyCFunctionType_USED - if (__pyx_binding_PyCFunctionType_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ @@ -4323,15 +4355,15 @@ PyMODINIT_FUNC PyInit_cd_fast_sparse(void) /*--- Function export code ---*/ /*--- Type init code ---*/ /*--- Type import code ---*/ - __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Function import code ---*/ /*--- Execution code ---*/ - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":8 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":8 * * cimport numpy as np * import numpy as np # <<<<<<<<<<<<<< @@ -4343,7 +4375,7 @@ PyMODINIT_FUNC PyInit_cd_fast_sparse(void) if (PyObject_SetAttr(__pyx_m, __pyx_n_s__np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":9 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":9 * cimport numpy as np * import numpy as np * import numpy.linalg as linalg # <<<<<<<<<<<<<< @@ -4361,7 +4393,7 @@ PyMODINIT_FUNC PyInit_cd_fast_sparse(void) if (PyObject_SetAttr(__pyx_m, __pyx_n_s__linalg, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":1 + /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":1 * # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # <<<<<<<<<<<<<< * # Fabian Pedregosa <fabian.pedregosa@inria.fr> * # Olivier Grisel <olivier.grisel@ensta.org> @@ -4370,7 +4402,7 @@ PyMODINIT_FUNC PyInit_cd_fast_sparse(void) __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __pyx_t_1 = PyObject_GetAttr(__pyx_m, __pyx_n_s_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_1, "__doc__"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_1, "__doc__"); __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_kp_u_9), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -4378,12 +4410,11 @@ PyMODINIT_FUNC PyInit_cd_fast_sparse(void) if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":963 - * arr.base = baseptr + /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/stdlib.pxd":2 * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None + * cdef extern from "stdlib.h" nogil: # <<<<<<<<<<<<<< + * void free(void *ptr) + * void *malloc(size_t size) */ goto __pyx_L0; __pyx_L1_error:; @@ -4405,14 +4436,15 @@ PyMODINIT_FUNC PyInit_cd_fast_sparse(void) #endif } +static const char *__pyx_filenames[] = { + "cd_fast_sparse.pyx", + "numpy.pxd", +}; + /* Runtime support code */ -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { - PyObject *result; - result = PyObject_GetAttr(dict, name); - if (!result) - PyErr_SetObject(PyExc_NameError, name); - return result; +static void __pyx_init_filenames(void) { + __pyx_f = __pyx_filenames; } static void __Pyx_RaiseDoubleKeywordsError( @@ -4537,26 +4569,6 @@ bad: return -1; } -static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact) -{ - if (!type) { - PyErr_Format(PyExc_SystemError, "Missing type object"); - return 0; - } - if (none_allowed && obj == Py_None) return 1; - else if (exact) { - if (Py_TYPE(obj) == type) return 1; - } - else { - if (PyObject_TypeCheck(obj, type)) return 1; - } - PyErr_Format(PyExc_TypeError, - "Argument '%s' has incorrect type (expected %s, got %s)", - name, type->tp_name, Py_TYPE(obj)->tp_name); - return 0; -} - static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { unsigned int n = 1; return *(unsigned char*)(&n) != 0; @@ -4962,7 +4974,7 @@ static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) { buf->suboffsets = __Pyx_minusones; } -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 int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack) { if (obj == Py_None) { __Pyx_ZeroBuffer(buf); return 0; @@ -5048,10 +5060,6 @@ static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyOb } -static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); -} - static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, #if PY_VERSION_HEX < 0x02050000 @@ -5062,13 +5070,35 @@ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { (index == 1) ? "" : "s"); } -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { - PyErr_Format(PyExc_ValueError, - #if PY_VERSION_HEX < 0x02050000 - "too many values to unpack (expected %d)", (int)expected); - #else - "too many values to unpack (expected %zd)", expected); - #endif +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(void) { + PyErr_SetString(PyExc_ValueError, "too many values to unpack"); +} + +static PyObject *__Pyx_UnpackItem(PyObject *iter, Py_ssize_t index) { + PyObject *item; + if (!(item = PyIter_Next(iter))) { + if (!PyErr_Occurred()) { + __Pyx_RaiseNeedMoreValuesError(index); + } + } + return item; +} + +static int __Pyx_EndUnpack(PyObject *iter) { + PyObject *item; + if ((item = PyIter_Next(iter))) { + Py_DECREF(item); + __Pyx_RaiseTooManyValuesError(); + return -1; + } + else if (!PyErr_Occurred()) + return 0; + else + return -1; +} + +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { @@ -5077,8 +5107,28 @@ static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { } else if (PyTuple_GET_SIZE(t) < index) { __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); } else { - __Pyx_RaiseTooManyValuesError(index); + __Pyx_RaiseTooManyValuesError(); + } +} + +static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact) +{ + if (!type) { + PyErr_Format(PyExc_SystemError, "Missing type object"); + return 0; + } + if (none_allowed && obj == Py_None) return 1; + else if (exact) { + if (Py_TYPE(obj) == type) return 1; + } + else { + if (PyObject_TypeCheck(obj, type)) return 1; } + PyErr_Format(PyExc_TypeError, + "Argument '%s' has incorrect type (expected %s, got %s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); + return 0; } #if PY_MAJOR_VERSION < 3 @@ -5106,14 +5156,14 @@ if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pf_5numpy_7ndarra #endif static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) { - PyObject *py_import = 0; + PyObject *__import__ = 0; PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; - py_import = __Pyx_GetAttrString(__pyx_b, "__import__"); - if (!py_import) + __import__ = __Pyx_GetAttrString(__pyx_b, "__import__"); + if (!__import__) goto bad; if (from_list) list = from_list; @@ -5129,37 +5179,38 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) { empty_dict = PyDict_New(); if (!empty_dict) goto bad; - module = PyObject_CallFunctionObjArgs(py_import, + module = PyObject_CallFunctionObjArgs(__import__, name, global_dict, empty_dict, list, NULL); bad: Py_XDECREF(empty_list); - Py_XDECREF(py_import); + Py_XDECREF(__import__); Py_XDECREF(empty_dict); return module; } +static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { + PyObject *result; + result = PyObject_GetAttr(dict, name); + if (!result) + PyErr_SetObject(PyExc_NameError, name); + return result; +} + static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_npy_int32(npy_int32 val) { - const npy_int32 neg_one = (npy_int32)-1, const_zero = (npy_int32)0; - const int is_unsigned = const_zero < neg_one; - if ((sizeof(npy_int32) == sizeof(char)) || - (sizeof(npy_int32) == sizeof(short))) { + const npy_int32 neg_one = (npy_int32)-1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (sizeof(npy_int32) < sizeof(long)) { return PyInt_FromLong((long)val); - } else if ((sizeof(npy_int32) == sizeof(int)) || - (sizeof(npy_int32) == sizeof(long))) { + } else if (sizeof(npy_int32) == sizeof(long)) { if (is_unsigned) return PyLong_FromUnsignedLong((unsigned long)val); else return PyInt_FromLong((long)val); - } else if (sizeof(npy_int32) == sizeof(PY_LONG_LONG)) { + } else { /* (sizeof(npy_int32) > sizeof(long)) */ if (is_unsigned) return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val); else return PyLong_FromLongLong((PY_LONG_LONG)val); - } else { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - return _PyLong_FromByteArray(bytes, sizeof(npy_int32), - little, !is_unsigned); } } @@ -5594,25 +5645,6 @@ static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) { return (signed int)__Pyx_PyInt_AsSignedLong(x); } -static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) { - const int neg_one = (int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to int" : - "value too large to convert to int"); - } - return (int)-1; - } - return (int)val; - } - return (int)__Pyx_PyInt_AsLong(x); -} - static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) { const unsigned long neg_one = (unsigned long)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; @@ -5860,11 +5892,7 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility", module_name, class_name); - #if PY_VERSION_HEX < 0x02050000 - PyErr_Warn(NULL, warning); - #else PyErr_WarnEx(NULL, warning, 0); - #endif } else if (((PyTypeObject *)result)->tp_basicsize != size) { PyErr_Format(PyExc_ValueError, @@ -6005,8 +6033,8 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { /* Type Conversion Functions */ static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - int is_true = x == Py_True; - if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + if (x == Py_True) return 1; + else if ((x == Py_False) | (x == Py_None)) return 0; else return PyObject_IsTrue(x); } diff --git a/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx b/scikits/learn/linear_model/sparse/src/cd_fast_sparse.pyx similarity index 100% rename from sklearn/linear_model/sparse/src/cd_fast_sparse.pyx rename to scikits/learn/linear_model/sparse/src/cd_fast_sparse.pyx diff --git a/sklearn/linear_model/sparse/stochastic_gradient.py b/scikits/learn/linear_model/sparse/stochastic_gradient.py similarity index 99% rename from sklearn/linear_model/sparse/stochastic_gradient.py rename to scikits/learn/linear_model/sparse/stochastic_gradient.py index 6c6fe5b59f52d6e36e6b6fb27d18a4e61a9a096a..0202838676723130c08a3ecb3757a7c5bf0d1ba2 100644 --- a/sklearn/linear_model/sparse/stochastic_gradient.py +++ b/scikits/learn/linear_model/sparse/stochastic_gradient.py @@ -105,7 +105,7 @@ class SGDClassifier(BaseSGDClassifier): Examples -------- >>> import numpy as np - >>> from sklearn import linear_model + >>> from scikits.learn import linear_model >>> X = np.array([[-1, -1], [-2, -1], [1, 1], [2, 1]]) >>> y = np.array([1, 1, 2, 2]) >>> clf = linear_model.sparse.SGDClassifier() @@ -331,7 +331,7 @@ class SGDRegressor(BaseSGDRegressor): Examples -------- >>> import numpy as np - >>> from sklearn import linear_model + >>> from scikits.learn import linear_model >>> n_samples, n_features = 10, 5 >>> np.random.seed(0) >>> y = np.random.randn(n_samples) diff --git a/sklearn/linear_model/sparse/tests/__init__.py b/scikits/learn/linear_model/sparse/tests/__init__.py similarity index 100% rename from sklearn/linear_model/sparse/tests/__init__.py rename to scikits/learn/linear_model/sparse/tests/__init__.py diff --git a/sklearn/linear_model/sparse/tests/test_coordinate_descent.py b/scikits/learn/linear_model/sparse/tests/test_coordinate_descent.py similarity index 94% rename from sklearn/linear_model/sparse/tests/test_coordinate_descent.py rename to scikits/learn/linear_model/sparse/tests/test_coordinate_descent.py index 0a5d0c74528ab1a6b2a1281f1d048f7296d7f076..90e5cee44269815f0122f441fb365c3135e66436 100644 --- a/sklearn/linear_model/sparse/tests/test_coordinate_descent.py +++ b/scikits/learn/linear_model/sparse/tests/test_coordinate_descent.py @@ -4,10 +4,10 @@ from numpy.testing import assert_array_almost_equal from numpy.testing import assert_almost_equal from numpy.testing import assert_equal -from sklearn.linear_model.sparse.coordinate_descent import Lasso as SparseLasso -from sklearn.linear_model.sparse.coordinate_descent import ElasticNet as SparseENet -from sklearn.linear_model.coordinate_descent import Lasso as DenseLasso -from sklearn.linear_model.coordinate_descent import ElasticNet as DenseENet +from scikits.learn.linear_model.sparse.coordinate_descent import Lasso as SparseLasso +from scikits.learn.linear_model.sparse.coordinate_descent import ElasticNet as SparseENet +from scikits.learn.linear_model.coordinate_descent import Lasso as DenseLasso +from scikits.learn.linear_model.coordinate_descent import ElasticNet as DenseENet def test_sparse_predict(): diff --git a/sklearn/linear_model/sparse/tests/test_logistic.py b/scikits/learn/linear_model/sparse/tests/test_logistic.py similarity index 95% rename from sklearn/linear_model/sparse/tests/test_logistic.py rename to scikits/learn/linear_model/sparse/tests/test_logistic.py index 564b888e0eec5161ede8da72c7d76e3946cd9617..81274cda476079d39b9139b1a4998549b22a5459 100644 --- a/sklearn/linear_model/sparse/tests/test_logistic.py +++ b/scikits/learn/linear_model/sparse/tests/test_logistic.py @@ -4,8 +4,8 @@ from numpy.testing import assert_array_equal import nose from nose.tools import assert_raises -from sklearn.linear_model.sparse import logistic -from sklearn import datasets +from scikits.learn.linear_model.sparse import logistic +from scikits.learn import datasets import scipy.sparse as sp diff --git a/sklearn/linear_model/stochastic_gradient.py b/scikits/learn/linear_model/stochastic_gradient.py similarity index 99% rename from sklearn/linear_model/stochastic_gradient.py rename to scikits/learn/linear_model/stochastic_gradient.py index 1c7d2d94990fd759e0b0582447e73905cc1726e0..62f5695ddd00e6752409d7250b8fb13ad4e7ef55 100644 --- a/sklearn/linear_model/stochastic_gradient.py +++ b/scikits/learn/linear_model/stochastic_gradient.py @@ -98,7 +98,7 @@ class SGDClassifier(BaseSGDClassifier): Examples -------- >>> import numpy as np - >>> from sklearn import linear_model + >>> from scikits.learn import linear_model >>> X = np.array([[-1, -1], [-2, -1], [1, 1], [2, 1]]) >>> Y = np.array([1, 1, 2, 2]) >>> clf = linear_model.SGDClassifier() @@ -293,7 +293,7 @@ class SGDRegressor(BaseSGDRegressor): Examples -------- >>> import numpy as np - >>> from sklearn import linear_model + >>> from scikits.learn import linear_model >>> n_samples, n_features = 10, 5 >>> np.random.seed(0) >>> y = np.random.randn(n_samples) diff --git a/sklearn/linear_model/tests/__init__.py b/scikits/learn/linear_model/tests/__init__.py similarity index 100% rename from sklearn/linear_model/tests/__init__.py rename to scikits/learn/linear_model/tests/__init__.py diff --git a/sklearn/linear_model/tests/test_base.py b/scikits/learn/linear_model/tests/test_base.py similarity index 100% rename from sklearn/linear_model/tests/test_base.py rename to scikits/learn/linear_model/tests/test_base.py diff --git a/sklearn/linear_model/tests/test_bayes.py b/scikits/learn/linear_model/tests/test_bayes.py similarity index 97% rename from sklearn/linear_model/tests/test_bayes.py rename to scikits/learn/linear_model/tests/test_bayes.py index f5048c24d65fc1870d85e777291c1d8fbb416014..6c94ebacbe52fdbcb70166822282e409f6d0c3bb 100644 --- a/sklearn/linear_model/tests/test_bayes.py +++ b/scikits/learn/linear_model/tests/test_bayes.py @@ -11,7 +11,7 @@ import nose from ..bayes import BayesianRidge, ARDRegression -from sklearn import datasets +from scikits.learn import datasets def test_bayesian_on_diabetes(): diff --git a/sklearn/linear_model/tests/test_coordinate_descent.py b/scikits/learn/linear_model/tests/test_coordinate_descent.py similarity index 100% rename from sklearn/linear_model/tests/test_coordinate_descent.py rename to scikits/learn/linear_model/tests/test_coordinate_descent.py diff --git a/sklearn/linear_model/tests/test_least_angle.py b/scikits/learn/linear_model/tests/test_least_angle.py similarity index 99% rename from sklearn/linear_model/tests/test_least_angle.py rename to scikits/learn/linear_model/tests/test_least_angle.py index 1f954bb610916bdfc9b512b9e1187d73f208699b..ceadcb33cf65c17d8f13aa04fb81ec4cc8730f65 100644 --- a/sklearn/linear_model/tests/test_least_angle.py +++ b/scikits/learn/linear_model/tests/test_least_angle.py @@ -1,7 +1,7 @@ import numpy as np from numpy.testing import assert_array_almost_equal -from sklearn import linear_model, datasets +from scikits.learn import linear_model, datasets diabetes = datasets.load_diabetes() X, y = diabetes.data, diabetes.target diff --git a/sklearn/linear_model/tests/test_logistic.py b/scikits/learn/linear_model/tests/test_logistic.py similarity index 96% rename from sklearn/linear_model/tests/test_logistic.py rename to scikits/learn/linear_model/tests/test_logistic.py index 0f3785160acfa15d6e6bd8d83ef6dbf45144793e..83bc11f7316f11881764e534ad90b6debc9e33da 100644 --- a/sklearn/linear_model/tests/test_logistic.py +++ b/scikits/learn/linear_model/tests/test_logistic.py @@ -4,8 +4,8 @@ from numpy.testing import assert_array_equal import nose from nose.tools import assert_raises, raises -from sklearn.linear_model import logistic -from sklearn import datasets +from scikits.learn.linear_model import logistic +from scikits.learn import datasets X = [[-1, 0], [0, 1], [1, 1]] Y1 = [0, 1, 1] diff --git a/sklearn/linear_model/tests/test_omp.py b/scikits/learn/linear_model/tests/test_omp.py similarity index 100% rename from sklearn/linear_model/tests/test_omp.py rename to scikits/learn/linear_model/tests/test_omp.py diff --git a/sklearn/linear_model/tests/test_ridge.py b/scikits/learn/linear_model/tests/test_ridge.py similarity index 94% rename from sklearn/linear_model/tests/test_ridge.py rename to scikits/learn/linear_model/tests/test_ridge.py index 85761972f4e4c410e7fb881dc42f1ed2c8eea062..d5ca7fb31b8499210cc846501eeb59a05def39b3 100644 --- a/sklearn/linear_model/tests/test_ridge.py +++ b/scikits/learn/linear_model/tests/test_ridge.py @@ -4,19 +4,19 @@ import scipy.sparse as sp from numpy.testing import assert_almost_equal, assert_array_almost_equal, \ assert_equal, assert_array_equal -from sklearn import datasets -from sklearn.metrics import mean_square_error +from scikits.learn import datasets +from scikits.learn.metrics import mean_square_error -from sklearn.linear_model.base import LinearRegression +from scikits.learn.linear_model.base import LinearRegression -from sklearn.linear_model.ridge import Ridge -from sklearn.linear_model.ridge import _RidgeGCV -from sklearn.linear_model.ridge import RidgeCV -from sklearn.linear_model.ridge import RidgeClassifier -from sklearn.linear_model.ridge import RidgeClassifierCV +from scikits.learn.linear_model.ridge import Ridge +from scikits.learn.linear_model.ridge import _RidgeGCV +from scikits.learn.linear_model.ridge import RidgeCV +from scikits.learn.linear_model.ridge import RidgeClassifier +from scikits.learn.linear_model.ridge import RidgeClassifierCV -from sklearn.cross_val import KFold +from scikits.learn.cross_val import KFold diabetes = datasets.load_diabetes() diff --git a/sklearn/linear_model/tests/test_sgd.py b/scikits/learn/linear_model/tests/test_sgd.py similarity index 99% rename from sklearn/linear_model/tests/test_sgd.py rename to scikits/learn/linear_model/tests/test_sgd.py index 331116aecd8221bbab9dcfde0e27277dd56d637e..58e3e086ca3dee618b8a6febb3c45bbe85d1b562 100644 --- a/sklearn/linear_model/tests/test_sgd.py +++ b/scikits/learn/linear_model/tests/test_sgd.py @@ -2,8 +2,8 @@ import numpy as np from numpy.testing import assert_array_equal, assert_approx_equal from numpy.testing import assert_almost_equal, assert_array_almost_equal -from sklearn import linear_model, datasets, metrics -from sklearn import preprocessing +from scikits.learn import linear_model, datasets, metrics +from scikits.learn import preprocessing import unittest from nose.tools import raises diff --git a/sklearn/manifold/__init__.py b/scikits/learn/manifold/__init__.py similarity index 100% rename from sklearn/manifold/__init__.py rename to scikits/learn/manifold/__init__.py diff --git a/sklearn/manifold/isomap.py b/scikits/learn/manifold/isomap.py similarity index 99% rename from sklearn/manifold/isomap.py rename to scikits/learn/manifold/isomap.py index 98015b76e03daea20c6e4829a095ac3c9e852164..c78fed170751241f4cc6ec4486abe2eff8cf1253 100644 --- a/sklearn/manifold/isomap.py +++ b/scikits/learn/manifold/isomap.py @@ -57,7 +57,7 @@ class Isomap(BaseEstimator): `training_data_` : array-like, shape (n_samples, n_features) Stores the training data - `ball_tree_` : sklearn.neighbors.BallTree instance + `ball_tree_` : scikits.learn.neighbors.BallTree instance Stores ball tree of training data for faster transform `dist_matrix_` : array-like, shape (n_samples, n_samples) diff --git a/sklearn/manifold/locally_linear.py b/scikits/learn/manifold/locally_linear.py similarity index 100% rename from sklearn/manifold/locally_linear.py rename to scikits/learn/manifold/locally_linear.py diff --git a/sklearn/manifold/tests/test_isomap.py b/scikits/learn/manifold/tests/test_isomap.py similarity index 94% rename from sklearn/manifold/tests/test_isomap.py rename to scikits/learn/manifold/tests/test_isomap.py index b89fe9124bb3e9de1d5c60765477f5906b21d0b4..19e66259b72277f14ad5363983379e8b4b40ea72 100644 --- a/sklearn/manifold/tests/test_isomap.py +++ b/scikits/learn/manifold/tests/test_isomap.py @@ -1,12 +1,12 @@ import numpy as np from numpy.testing import assert_almost_equal, assert_array_almost_equal -from sklearn import datasets -from sklearn import manifold -from sklearn import neighbors -from sklearn import pipeline -from sklearn import preprocessing -from sklearn.utils.fixes import product +from scikits.learn import datasets +from scikits.learn import manifold +from scikits.learn import neighbors +from scikits.learn import pipeline +from scikits.learn import preprocessing +from scikits.learn.utils.fixes import product eigen_solvers = ['auto', 'dense', 'arpack'] path_methods = ['auto', 'FW', 'D'] diff --git a/sklearn/manifold/tests/test_locally_linear.py b/scikits/learn/manifold/tests/test_locally_linear.py similarity index 95% rename from sklearn/manifold/tests/test_locally_linear.py rename to scikits/learn/manifold/tests/test_locally_linear.py index 1a89516d623458f657edf623006265f9e8e45ec2..01007484d72e87eaa9a77f68fb5e8eb956eb788d 100644 --- a/sklearn/manifold/tests/test_locally_linear.py +++ b/scikits/learn/manifold/tests/test_locally_linear.py @@ -1,8 +1,8 @@ import numpy as np from numpy.testing import assert_almost_equal -from sklearn import neighbors, manifold -from sklearn.utils.fixes import product +from scikits.learn import neighbors, manifold +from scikits.learn.utils.fixes import product eigen_solvers = ['dense', 'arpack'] @@ -75,7 +75,7 @@ def test_lle_manifold(): def test_pipeline(): # check that LocallyLinearEmbedding works fine as a Pipeline - from sklearn import pipeline, datasets + from scikits.learn import pipeline, datasets iris = datasets.load_iris() clf = pipeline.Pipeline( [('filter', manifold.LocallyLinearEmbedding()), diff --git a/sklearn/metrics/__init__.py b/scikits/learn/metrics/__init__.py similarity index 100% rename from sklearn/metrics/__init__.py rename to scikits/learn/metrics/__init__.py diff --git a/sklearn/metrics/cluster.py b/scikits/learn/metrics/cluster.py similarity index 98% rename from sklearn/metrics/cluster.py rename to scikits/learn/metrics/cluster.py index 1bc242937f9ac8e77d4238b32fe0e53371b38ab3..2dc3fd2546b58e8acf3a2fbe2da03844c0b1a90d 100644 --- a/sklearn/metrics/cluster.py +++ b/scikits/learn/metrics/cluster.py @@ -158,7 +158,7 @@ def homogeneity_score(labels_true, labels_pred): Perfect labelings are homegenous:: - >>> from sklearn.metrics.cluster import homogeneity_score + >>> from scikits.learn.metrics.cluster import homogeneity_score >>> homogeneity_score([0, 0, 1, 1], [1, 1, 0, 0]) 1.0 @@ -224,7 +224,7 @@ def completeness_score(labels_true, labels_pred): Perfect labelings are complete:: - >>> from sklearn.metrics.cluster import completeness_score + >>> from scikits.learn.metrics.cluster import completeness_score >>> completeness_score([0, 0, 1, 1], [1, 1, 0, 0]) 1.0 @@ -293,7 +293,7 @@ def v_measure_score(labels_true, labels_pred): Perfect labelings are both homogeneous and complete, hence have score 1.0:: - >>> from sklearn.metrics.cluster import v_measure_score + >>> from scikits.learn.metrics.cluster import v_measure_score >>> v_measure_score([0, 0, 1, 1], [0, 0, 1, 1]) 1.0 >>> v_measure_score([0, 0, 1, 1], [1, 1, 0, 0]) diff --git a/sklearn/metrics/metrics.py b/scikits/learn/metrics/metrics.py similarity index 99% rename from sklearn/metrics/metrics.py rename to scikits/learn/metrics/metrics.py index 4704788db5599ea2854db528c608966df0076c17..18903e1684a829c44b79b3af945eb5edf843daf5 100644 --- a/sklearn/metrics/metrics.py +++ b/scikits/learn/metrics/metrics.py @@ -99,7 +99,7 @@ def roc_curve(y_true, y_score): Examples -------- >>> import numpy as np - >>> from sklearn import metrics + >>> from scikits.learn import metrics >>> y = np.array([1, 1, 2, 2]) >>> scores = np.array([0.1, 0.4, 0.35, 0.8]) >>> fpr, tpr, thresholds = metrics.roc_curve(y, scores) @@ -161,7 +161,7 @@ def auc(x, y): Examples -------- >>> import numpy as np - >>> from sklearn import metrics + >>> from scikits.learn import metrics >>> y = np.array([1, 1, 2, 2]) >>> pred = np.array([0.1, 0.4, 0.35, 0.8]) >>> fpr, tpr, thresholds = metrics.roc_curve(y, pred) diff --git a/sklearn/metrics/pairwise.py b/scikits/learn/metrics/pairwise.py similarity index 98% rename from sklearn/metrics/pairwise.py rename to scikits/learn/metrics/pairwise.py index c92dc3862d0e0dea269820118b1f2d51eb961868..4bc270d49d3b53ebebad660571ca1d012a52e1e1 100644 --- a/sklearn/metrics/pairwise.py +++ b/scikits/learn/metrics/pairwise.py @@ -91,7 +91,7 @@ def euclidean_distances(X, Y=None, Y_norm_squared=None, squared=False): Examples -------- - >>> from sklearn.metrics.pairwise import euclidean_distances + >>> from scikits.learn.metrics.pairwise import euclidean_distances >>> X = [[0, 1], [1, 1]] >>> # distance between rows of X >>> euclidean_distances(X, X) @@ -172,7 +172,7 @@ def l1_distances(X, Y): Examples -------- - >>> from sklearn.metrics.pairwise import l1_distances + >>> from scikits.learn.metrics.pairwise import l1_distances >>> l1_distances(3, 3) array([[0]]) >>> l1_distances(3, 2) diff --git a/sklearn/metrics/tests/__init__.py b/scikits/learn/metrics/tests/__init__.py similarity index 100% rename from sklearn/metrics/tests/__init__.py rename to scikits/learn/metrics/tests/__init__.py diff --git a/sklearn/metrics/tests/test_cluster.py b/scikits/learn/metrics/tests/test_cluster.py similarity index 88% rename from sklearn/metrics/tests/test_cluster.py rename to scikits/learn/metrics/tests/test_cluster.py index e62379b2efd9afc847567fdf7ddcc80fd0ff8efb..7307a4e55a8d18896a02fea7369f312ba3e8fc25 100644 --- a/sklearn/metrics/tests/test_cluster.py +++ b/scikits/learn/metrics/tests/test_cluster.py @@ -1,8 +1,8 @@ -from sklearn.metrics.cluster import homogeneity_score -from sklearn.metrics.cluster import completeness_score -from sklearn.metrics.cluster import v_measure_score -from sklearn.metrics.cluster import v_measure_score -from sklearn.metrics.cluster import homogeneity_completeness_v_measure +from scikits.learn.metrics.cluster import homogeneity_score +from scikits.learn.metrics.cluster import completeness_score +from scikits.learn.metrics.cluster import v_measure_score +from scikits.learn.metrics.cluster import v_measure_score +from scikits.learn.metrics.cluster import homogeneity_completeness_v_measure from nose.tools import assert_almost_equal diff --git a/sklearn/metrics/tests/test_metrics.py b/scikits/learn/metrics/tests/test_metrics.py similarity index 100% rename from sklearn/metrics/tests/test_metrics.py rename to scikits/learn/metrics/tests/test_metrics.py diff --git a/sklearn/metrics/tests/test_pairwise.py b/scikits/learn/metrics/tests/test_pairwise.py similarity index 100% rename from sklearn/metrics/tests/test_pairwise.py rename to scikits/learn/metrics/tests/test_pairwise.py diff --git a/sklearn/mixture/__init__.py b/scikits/learn/mixture/__init__.py similarity index 100% rename from sklearn/mixture/__init__.py rename to scikits/learn/mixture/__init__.py diff --git a/sklearn/mixture/dpgmm.py b/scikits/learn/mixture/dpgmm.py similarity index 100% rename from sklearn/mixture/dpgmm.py rename to scikits/learn/mixture/dpgmm.py diff --git a/sklearn/mixture/gmm.py b/scikits/learn/mixture/gmm.py similarity index 99% rename from sklearn/mixture/gmm.py rename to scikits/learn/mixture/gmm.py index 7fc4276a693ce66f00eef7a4c8e51e5409833836..54aeff41eac0624c15f3f83dbe3f50fd6df6f258 100644 --- a/sklearn/mixture/gmm.py +++ b/scikits/learn/mixture/gmm.py @@ -198,7 +198,7 @@ class GMM(BaseEstimator): Examples -------- >>> import numpy as np - >>> from sklearn import mixture + >>> from scikits.learn import mixture >>> np.random.seed(1) >>> g = mixture.GMM(n_components=2) diff --git a/sklearn/mixture/tests/__init__.py b/scikits/learn/mixture/tests/__init__.py similarity index 100% rename from sklearn/mixture/tests/__init__.py rename to scikits/learn/mixture/tests/__init__.py diff --git a/sklearn/mixture/tests/test_dpgmm.py b/scikits/learn/mixture/tests/test_dpgmm.py similarity index 93% rename from sklearn/mixture/tests/test_dpgmm.py rename to scikits/learn/mixture/tests/test_dpgmm.py index e65b8a2ce84af16f9672f01d53eb9425fc5a11c7..516882bf157cffd279e5f04447c9996c83813d18 100644 --- a/sklearn/mixture/tests/test_dpgmm.py +++ b/scikits/learn/mixture/tests/test_dpgmm.py @@ -4,8 +4,8 @@ import nose import numpy as np -from sklearn.mixture import DPGMM, VBGMM -from sklearn.mixture.dpgmm import log_normalize +from scikits.learn.mixture import DPGMM, VBGMM +from scikits.learn.mixture.dpgmm import log_normalize from .test_gmm import GMMTester np.seterr(all='warn') diff --git a/sklearn/mixture/tests/test_gmm.py b/scikits/learn/mixture/tests/test_gmm.py similarity index 98% rename from sklearn/mixture/tests/test_gmm.py rename to scikits/learn/mixture/tests/test_gmm.py index dd11fc75ca6c2e6ba9975a93abab3de253e4ab53..4618e13d339fa7c87bb6392a1c92044cc9e01a70 100644 --- a/sklearn/mixture/tests/test_gmm.py +++ b/scikits/learn/mixture/tests/test_gmm.py @@ -6,8 +6,8 @@ from numpy.testing import assert_array_equal, assert_array_almost_equal, \ assert_raises from scipy import stats -from sklearn import mixture -from sklearn.datasets.samples_generator import make_spd_matrix +from scikits.learn import mixture +from scikits.learn.datasets.samples_generator import make_spd_matrix rng = np.random.RandomState(0) diff --git a/sklearn/multiclass.py b/scikits/learn/multiclass.py similarity index 100% rename from sklearn/multiclass.py rename to scikits/learn/multiclass.py diff --git a/sklearn/naive_bayes.py b/scikits/learn/naive_bayes.py similarity index 98% rename from sklearn/naive_bayes.py rename to scikits/learn/naive_bayes.py index 3680efdff57721daff187684fccaf22d6424e04a..4c71c33bdb05fcd6ea33ee151d4898eb6dd79fff 100644 --- a/sklearn/naive_bayes.py +++ b/scikits/learn/naive_bayes.py @@ -72,7 +72,7 @@ class GaussianNB(BaseEstimator, ClassifierMixin): >>> import numpy as np >>> X = np.array([[-1, -1], [-2, -1], [-3, -2], [1, 1], [2, 1], [3, 2]]) >>> Y = np.array([1, 1, 1, 2, 2, 2]) - >>> from sklearn.naive_bayes import GaussianNB + >>> from scikits.learn.naive_bayes import GaussianNB >>> clf = GaussianNB() >>> clf.fit(X, Y) GaussianNB() @@ -370,7 +370,7 @@ class MultinomialNB(BaseDiscreteNB): >>> import numpy as np >>> X = np.random.randint(5, size=(6, 100)) >>> Y = np.array([1, 2, 3, 4, 5, 6]) - >>> from sklearn.naive_bayes import MultinomialNB + >>> from scikits.learn.naive_bayes import MultinomialNB >>> clf = MultinomialNB() >>> clf.fit(X, Y) MultinomialNB(alpha=1.0, fit_prior=True) @@ -448,7 +448,7 @@ class BernoulliNB(BaseDiscreteNB): >>> import numpy as np >>> X = np.random.randint(2, size=(6, 100)) >>> Y = np.array([1, 2, 3, 4, 4, 5]) - >>> from sklearn.naive_bayes import BernoulliNB + >>> from scikits.learn.naive_bayes import BernoulliNB >>> clf = BernoulliNB() >>> clf.fit(X, Y) BernoulliNB(alpha=1.0, binarize=0.0, fit_prior=True) diff --git a/sklearn/neighbors.py b/scikits/learn/neighbors.py similarity index 98% rename from sklearn/neighbors.py rename to scikits/learn/neighbors.py index 495f51c18753337168999344cc1c255468f4167e..4cfd05b320c5e9a4fc618729726c5769938c4164 100644 --- a/sklearn/neighbors.py +++ b/scikits/learn/neighbors.py @@ -41,7 +41,7 @@ class NeighborsClassifier(BaseEstimator, ClassifierMixin): -------- >>> samples = [[0, 0, 2], [1, 0, 0]] >>> labels = [0, 1] - >>> from sklearn.neighbors import NeighborsClassifier + >>> from scikits.learn.neighbors import NeighborsClassifier >>> neigh = NeighborsClassifier(n_neighbors=1) >>> neigh.fit(samples, labels) NeighborsClassifier(algorithm='auto', leaf_size=20, n_neighbors=1) @@ -173,7 +173,7 @@ class NeighborsClassifier(BaseEstimator, ClassifierMixin): >>> samples = [[0., 0., 0.], [0., .5, 0.], [1., 1., .5]] >>> labels = [0, 0, 1] - >>> from sklearn.neighbors import NeighborsClassifier + >>> from scikits.learn.neighbors import NeighborsClassifier >>> neigh = NeighborsClassifier(n_neighbors=1) >>> neigh.fit(samples, labels) NeighborsClassifier(algorithm='auto', leaf_size=20, n_neighbors=1) @@ -271,7 +271,7 @@ class NeighborsRegressor(NeighborsClassifier, RegressorMixin): -------- >>> X = [[0], [1], [2], [3]] >>> y = [0, 0, 1, 1] - >>> from sklearn.neighbors import NeighborsRegressor + >>> from scikits.learn.neighbors import NeighborsRegressor >>> neigh = NeighborsRegressor(n_neighbors=2) >>> neigh.fit(X, y) NeighborsRegressor(algorithm='auto', leaf_size=20, mode='mean', n_neighbors=2) @@ -416,7 +416,7 @@ def kneighbors_graph(X, n_neighbors, mode='connectivity', reg=1e-3): Examples -------- >>> X = [[0], [3], [1]] - >>> from sklearn.neighbors import kneighbors_graph + >>> from scikits.learn.neighbors import kneighbors_graph >>> A = kneighbors_graph(X, 2) >>> A.todense() matrix([[ 1., 0., 1.], @@ -491,7 +491,7 @@ def radius_neighbors_graph(X, radius, mode='connectivity'): Examples -------- >>> X = [[0], [3], [1]] - >>> from sklearn.neighbors import radius_neighbors_graph + >>> from scikits.learn.neighbors import radius_neighbors_graph >>> A = radius_neighbors_graph(X, 1.5) >>> A.todense() matrix([[ 1., 0., 1.], diff --git a/sklearn/pipeline.py b/scikits/learn/pipeline.py similarity index 95% rename from sklearn/pipeline.py rename to scikits/learn/pipeline.py index 7815b7ae79358e851e9e66b2588bf914e7a8d2a6..d871a19aea487f692a7a866c87198244882fb446 100644 --- a/sklearn/pipeline.py +++ b/scikits/learn/pipeline.py @@ -57,11 +57,11 @@ class Pipeline(BaseEstimator): Example ======= - >>> from sklearn import svm - >>> from sklearn.datasets import samples_generator - >>> from sklearn.feature_selection import SelectKBest - >>> from sklearn.feature_selection import f_regression - >>> from sklearn.pipeline import Pipeline + >>> from scikits.learn import svm + >>> from scikits.learn.datasets import samples_generator + >>> from scikits.learn.feature_selection import SelectKBest + >>> from scikits.learn.feature_selection import f_regression + >>> from scikits.learn.pipeline import Pipeline >>> # generate some data to play with >>> X, y = samples_generator.make_classification( diff --git a/sklearn/pls.py b/scikits/learn/pls.py similarity index 99% rename from sklearn/pls.py rename to scikits/learn/pls.py index e1d15f4e2fab02f9e8ee6cf235db26901f4692f2..3d8a1235f05bec5e44f29443ff4d7e420709e86d 100644 --- a/sklearn/pls.py +++ b/scikits/learn/pls.py @@ -5,7 +5,7 @@ # License: BSD Style. from .base import BaseEstimator -#from sklearn.base import BaseEstimator +#from scikits.learn.base import BaseEstimator import warnings import numpy as np from scipy import linalg @@ -468,7 +468,7 @@ class PLSRegression(_PLS): Examples -------- - >>> from sklearn.pls import PLSCanonical, PLSRegression, CCA + >>> from scikits.learn.pls import PLSCanonical, PLSRegression, CCA >>> X = [[0., 0., 1.], [1.,0.,0.], [2.,2.,2.], [2.,5.,4.]] >>> Y = [[0.1, -0.2], [0.9, 1.1], [6.2, 5.9], [11.9, 12.3]] >>> pls2 = PLSRegression(n_components=2) @@ -573,7 +573,7 @@ class PLSCanonical(_PLS): Examples -------- - >>> from sklearn.pls import PLSCanonical, PLSRegression, CCA + >>> from scikits.learn.pls import PLSCanonical, PLSRegression, CCA >>> X = [[0., 0., 1.], [1.,0.,0.], [2.,2.,2.], [2.,5.,4.]] >>> Y = [[0.1, -0.2], [0.9, 1.1], [6.2, 5.9], [11.9, 12.3]] >>> plsca = PLSCanonical(n_components=2) @@ -681,7 +681,7 @@ class CCA(_PLS): Examples -------- - >>> from sklearn.pls import PLSCanonical, PLSRegression, CCA + >>> from scikits.learn.pls import PLSCanonical, PLSRegression, CCA >>> X = [[0., 0., 1.], [1.,0.,0.], [2.,2.,2.], [3.,5.,4.]] >>> Y = [[0.1, -0.2], [0.9, 1.1], [6.2, 5.9], [11.9, 12.3]] >>> cca = CCA(n_components=1) diff --git a/sklearn/preprocessing/__init__.py b/scikits/learn/preprocessing/__init__.py similarity index 96% rename from sklearn/preprocessing/__init__.py rename to scikits/learn/preprocessing/__init__.py index 32cd8b6379b99ffbd99aa8bc75891cd68677bfd4..45a8a9b23b3fea83044a226299bae9d3e6fdd0ae 100644 --- a/sklearn/preprocessing/__init__.py +++ b/scikits/learn/preprocessing/__init__.py @@ -70,9 +70,9 @@ def scale(X, axis=0, with_mean=True, with_std=True, copy=True): See also -------- - :class:`sklearn.preprocessing.Scaler` to perform centering and + :class:`scikits.learn.preprocessing.Scaler` to perform centering and scaling using the ``Transformer`` API (e.g. as part of a preprocessing - :class:`sklearn.pipeline.Pipeline`) + :class:`scikits.learn.pipeline.Pipeline`) """ if sp.issparse(X): raise NotImplementedError( @@ -135,10 +135,10 @@ class Scaler(BaseEstimator, TransformerMixin): See also -------- - :func:`sklearn.preprocessing.scale` to perform centering and + :func:`scikits.learn.preprocessing.scale` to perform centering and scaling without using the ``Transformer`` object oriented API - :class:`sklearn.decomposition.RandomizedPCA` with `whiten=True` + :class:`scikits.learn.decomposition.RandomizedPCA` with `whiten=True` to further remove the linear correlation across features. """ @@ -231,9 +231,9 @@ def normalize(X, norm='l2', axis=1, copy=True): See also -------- - :class:`sklearn.preprocessing.Normalizer` to perform normalization + :class:`scikits.learn.preprocessing.Normalizer` to perform normalization using the ``Transformer`` API (e.g. as part of a preprocessing - :class:`sklearn.pipeline.Pipeline`) + :class:`scikits.learn.pipeline.Pipeline`) """ if norm not in ('l1', 'l2'): raise ValueError("'%s' is not a supported norm" % norm) @@ -303,7 +303,7 @@ class Normalizer(BaseEstimator, TransformerMixin): See also -------- - :func:`sklearn.preprocessing.normalize` equivalent function + :func:`scikits.learn.preprocessing.normalize` equivalent function without the object oriented API """ @@ -352,9 +352,9 @@ def binarize(X, threshold=0.0, copy=True): See also -------- - :class:`sklearn.preprocessing.Binarizer` to perform binarization + :class:`scikits.learn.preprocessing.Binarizer` to perform binarization using the ``Transformer`` API (e.g. as part of a preprocessing - :class:`sklearn.pipeline.Pipeline`) + :class:`scikits.learn.pipeline.Pipeline`) """ X = check_arrays(X, sparse_format='csr', copy=copy)[0] if sp.issparse(X): @@ -459,7 +459,7 @@ class LabelBinarizer(BaseEstimator, TransformerMixin): Examples -------- - >>> from sklearn import preprocessing + >>> from scikits.learn import preprocessing >>> clf = preprocessing.LabelBinarizer() >>> clf.fit([1, 2, 6, 4, 2]) LabelBinarizer() @@ -596,7 +596,7 @@ class KernelCenterer(BaseEstimator, TransformerMixin): """Center a kernel matrix This is equivalent to centering phi(X) with - sklearn.preprocessing.Scaler(with_std=False). + scikits.learn.preprocessing.Scaler(with_std=False). """ def fit(self, K): diff --git a/sklearn/preprocessing/setup.py b/scikits/learn/preprocessing/setup.py similarity index 100% rename from sklearn/preprocessing/setup.py rename to scikits/learn/preprocessing/setup.py diff --git a/sklearn/preprocessing/src/_preprocessing.c b/scikits/learn/preprocessing/src/_preprocessing.c similarity index 100% rename from sklearn/preprocessing/src/_preprocessing.c rename to scikits/learn/preprocessing/src/_preprocessing.c diff --git a/sklearn/preprocessing/src/_preprocessing.pyx b/scikits/learn/preprocessing/src/_preprocessing.pyx similarity index 100% rename from sklearn/preprocessing/src/_preprocessing.pyx rename to scikits/learn/preprocessing/src/_preprocessing.pyx diff --git a/sklearn/preprocessing/tests/__init__.py b/scikits/learn/preprocessing/tests/__init__.py similarity index 100% rename from sklearn/preprocessing/tests/__init__.py rename to scikits/learn/preprocessing/tests/__init__.py diff --git a/sklearn/preprocessing/tests/test_preprocessing.py b/scikits/learn/preprocessing/tests/test_preprocessing.py similarity index 96% rename from sklearn/preprocessing/tests/test_preprocessing.py rename to scikits/learn/preprocessing/tests/test_preprocessing.py index 330d5902b98039cce293785091228caa9951f10c..446a1c63adf54e98599de0d153823c6920a9f905 100644 --- a/sklearn/preprocessing/tests/test_preprocessing.py +++ b/scikits/learn/preprocessing/tests/test_preprocessing.py @@ -9,16 +9,16 @@ from numpy.testing import assert_equal from nose.tools import assert_raises -from sklearn.preprocessing import Binarizer -from sklearn.preprocessing import KernelCenterer -from sklearn.preprocessing import LabelBinarizer -from sklearn.preprocessing import Normalizer -from sklearn.preprocessing import normalize -from sklearn.preprocessing import Scaler -from sklearn.preprocessing import scale - -from sklearn import datasets -from sklearn.linear_model.stochastic_gradient import SGDClassifier +from scikits.learn.preprocessing import Binarizer +from scikits.learn.preprocessing import KernelCenterer +from scikits.learn.preprocessing import LabelBinarizer +from scikits.learn.preprocessing import Normalizer +from scikits.learn.preprocessing import normalize +from scikits.learn.preprocessing import Scaler +from scikits.learn.preprocessing import scale + +from scikits.learn import datasets +from scikits.learn.linear_model.stochastic_gradient import SGDClassifier np.random.seed(0) diff --git a/sklearn/qda.py b/scikits/learn/qda.py similarity index 99% rename from sklearn/qda.py rename to scikits/learn/qda.py index 37784b778b78c7919a01b7aacc675b296c98b7d5..b275410dc50a01d64c216d1ecbc50087c42d998d 100644 --- a/sklearn/qda.py +++ b/scikits/learn/qda.py @@ -45,7 +45,7 @@ class QDA(BaseEstimator, ClassifierMixin): Examples -------- - >>> from sklearn.qda import QDA + >>> from scikits.learn.qda import QDA >>> import numpy as np >>> X = np.array([[-1, -1], [-2, -1], [-3, -2], [1, 1], [2, 1], [3, 2]]) >>> y = np.array([1, 1, 1, 2, 2, 2]) diff --git a/sklearn/setup.py b/scikits/learn/setup.py similarity index 100% rename from sklearn/setup.py rename to scikits/learn/setup.py diff --git a/sklearn/src/cblas/ATL_drefcopy.c b/scikits/learn/src/cblas/ATL_drefcopy.c similarity index 100% rename from sklearn/src/cblas/ATL_drefcopy.c rename to scikits/learn/src/cblas/ATL_drefcopy.c diff --git a/sklearn/src/cblas/ATL_drefrot.c b/scikits/learn/src/cblas/ATL_drefrot.c similarity index 100% rename from sklearn/src/cblas/ATL_drefrot.c rename to scikits/learn/src/cblas/ATL_drefrot.c diff --git a/sklearn/src/cblas/ATL_drefrotg.c b/scikits/learn/src/cblas/ATL_drefrotg.c similarity index 100% rename from sklearn/src/cblas/ATL_drefrotg.c rename to scikits/learn/src/cblas/ATL_drefrotg.c diff --git a/sklearn/src/cblas/ATL_dreftrsv.c b/scikits/learn/src/cblas/ATL_dreftrsv.c similarity index 100% rename from sklearn/src/cblas/ATL_dreftrsv.c rename to scikits/learn/src/cblas/ATL_dreftrsv.c diff --git a/sklearn/src/cblas/ATL_dreftrsvLNN.c b/scikits/learn/src/cblas/ATL_dreftrsvLNN.c similarity index 100% rename from sklearn/src/cblas/ATL_dreftrsvLNN.c rename to scikits/learn/src/cblas/ATL_dreftrsvLNN.c diff --git a/sklearn/src/cblas/ATL_dreftrsvLNU.c b/scikits/learn/src/cblas/ATL_dreftrsvLNU.c similarity index 100% rename from sklearn/src/cblas/ATL_dreftrsvLNU.c rename to scikits/learn/src/cblas/ATL_dreftrsvLNU.c diff --git a/sklearn/src/cblas/ATL_dreftrsvLTN.c b/scikits/learn/src/cblas/ATL_dreftrsvLTN.c similarity index 100% rename from sklearn/src/cblas/ATL_dreftrsvLTN.c rename to scikits/learn/src/cblas/ATL_dreftrsvLTN.c diff --git a/sklearn/src/cblas/ATL_dreftrsvLTU.c b/scikits/learn/src/cblas/ATL_dreftrsvLTU.c similarity index 100% rename from sklearn/src/cblas/ATL_dreftrsvLTU.c rename to scikits/learn/src/cblas/ATL_dreftrsvLTU.c diff --git a/sklearn/src/cblas/ATL_dreftrsvUNN.c b/scikits/learn/src/cblas/ATL_dreftrsvUNN.c similarity index 100% rename from sklearn/src/cblas/ATL_dreftrsvUNN.c rename to scikits/learn/src/cblas/ATL_dreftrsvUNN.c diff --git a/sklearn/src/cblas/ATL_dreftrsvUNU.c b/scikits/learn/src/cblas/ATL_dreftrsvUNU.c similarity index 100% rename from sklearn/src/cblas/ATL_dreftrsvUNU.c rename to scikits/learn/src/cblas/ATL_dreftrsvUNU.c diff --git a/sklearn/src/cblas/ATL_dreftrsvUTN.c b/scikits/learn/src/cblas/ATL_dreftrsvUTN.c similarity index 100% rename from sklearn/src/cblas/ATL_dreftrsvUTN.c rename to scikits/learn/src/cblas/ATL_dreftrsvUTN.c diff --git a/sklearn/src/cblas/ATL_dreftrsvUTU.c b/scikits/learn/src/cblas/ATL_dreftrsvUTU.c similarity index 100% rename from sklearn/src/cblas/ATL_dreftrsvUTU.c rename to scikits/learn/src/cblas/ATL_dreftrsvUTU.c diff --git a/sklearn/src/cblas/ATL_srefcopy.c b/scikits/learn/src/cblas/ATL_srefcopy.c similarity index 100% rename from sklearn/src/cblas/ATL_srefcopy.c rename to scikits/learn/src/cblas/ATL_srefcopy.c diff --git a/sklearn/src/cblas/ATL_srefrot.c b/scikits/learn/src/cblas/ATL_srefrot.c similarity index 100% rename from sklearn/src/cblas/ATL_srefrot.c rename to scikits/learn/src/cblas/ATL_srefrot.c diff --git a/sklearn/src/cblas/ATL_srefrotg.c b/scikits/learn/src/cblas/ATL_srefrotg.c similarity index 100% rename from sklearn/src/cblas/ATL_srefrotg.c rename to scikits/learn/src/cblas/ATL_srefrotg.c diff --git a/sklearn/src/cblas/ATL_sreftrsv.c b/scikits/learn/src/cblas/ATL_sreftrsv.c similarity index 100% rename from sklearn/src/cblas/ATL_sreftrsv.c rename to scikits/learn/src/cblas/ATL_sreftrsv.c diff --git a/sklearn/src/cblas/ATL_sreftrsvLNN.c b/scikits/learn/src/cblas/ATL_sreftrsvLNN.c similarity index 100% rename from sklearn/src/cblas/ATL_sreftrsvLNN.c rename to scikits/learn/src/cblas/ATL_sreftrsvLNN.c diff --git a/sklearn/src/cblas/ATL_sreftrsvLNU.c b/scikits/learn/src/cblas/ATL_sreftrsvLNU.c similarity index 100% rename from sklearn/src/cblas/ATL_sreftrsvLNU.c rename to scikits/learn/src/cblas/ATL_sreftrsvLNU.c diff --git a/sklearn/src/cblas/ATL_sreftrsvLTN.c b/scikits/learn/src/cblas/ATL_sreftrsvLTN.c similarity index 100% rename from sklearn/src/cblas/ATL_sreftrsvLTN.c rename to scikits/learn/src/cblas/ATL_sreftrsvLTN.c diff --git a/sklearn/src/cblas/ATL_sreftrsvLTU.c b/scikits/learn/src/cblas/ATL_sreftrsvLTU.c similarity index 100% rename from sklearn/src/cblas/ATL_sreftrsvLTU.c rename to scikits/learn/src/cblas/ATL_sreftrsvLTU.c diff --git a/sklearn/src/cblas/ATL_sreftrsvUNN.c b/scikits/learn/src/cblas/ATL_sreftrsvUNN.c similarity index 100% rename from sklearn/src/cblas/ATL_sreftrsvUNN.c rename to scikits/learn/src/cblas/ATL_sreftrsvUNN.c diff --git a/sklearn/src/cblas/ATL_sreftrsvUNU.c b/scikits/learn/src/cblas/ATL_sreftrsvUNU.c similarity index 100% rename from sklearn/src/cblas/ATL_sreftrsvUNU.c rename to scikits/learn/src/cblas/ATL_sreftrsvUNU.c diff --git a/sklearn/src/cblas/ATL_sreftrsvUTN.c b/scikits/learn/src/cblas/ATL_sreftrsvUTN.c similarity index 100% rename from sklearn/src/cblas/ATL_sreftrsvUTN.c rename to scikits/learn/src/cblas/ATL_sreftrsvUTN.c diff --git a/sklearn/src/cblas/ATL_sreftrsvUTU.c b/scikits/learn/src/cblas/ATL_sreftrsvUTU.c similarity index 100% rename from sklearn/src/cblas/ATL_sreftrsvUTU.c rename to scikits/learn/src/cblas/ATL_sreftrsvUTU.c diff --git a/sklearn/src/cblas/README.txt b/scikits/learn/src/cblas/README.txt similarity index 100% rename from sklearn/src/cblas/README.txt rename to scikits/learn/src/cblas/README.txt diff --git a/sklearn/src/cblas/atlas_aux.h b/scikits/learn/src/cblas/atlas_aux.h similarity index 100% rename from sklearn/src/cblas/atlas_aux.h rename to scikits/learn/src/cblas/atlas_aux.h diff --git a/sklearn/src/cblas/atlas_dsysinfo.h b/scikits/learn/src/cblas/atlas_dsysinfo.h similarity index 100% rename from sklearn/src/cblas/atlas_dsysinfo.h rename to scikits/learn/src/cblas/atlas_dsysinfo.h diff --git a/sklearn/src/cblas/atlas_enum.h b/scikits/learn/src/cblas/atlas_enum.h similarity index 100% rename from sklearn/src/cblas/atlas_enum.h rename to scikits/learn/src/cblas/atlas_enum.h diff --git a/sklearn/src/cblas/atlas_level1.h b/scikits/learn/src/cblas/atlas_level1.h similarity index 100% rename from sklearn/src/cblas/atlas_level1.h rename to scikits/learn/src/cblas/atlas_level1.h diff --git a/sklearn/src/cblas/atlas_level2.h b/scikits/learn/src/cblas/atlas_level2.h similarity index 100% rename from sklearn/src/cblas/atlas_level2.h rename to scikits/learn/src/cblas/atlas_level2.h diff --git a/sklearn/src/cblas/atlas_misc.h b/scikits/learn/src/cblas/atlas_misc.h similarity index 100% rename from sklearn/src/cblas/atlas_misc.h rename to scikits/learn/src/cblas/atlas_misc.h diff --git a/sklearn/src/cblas/atlas_refalias1.h b/scikits/learn/src/cblas/atlas_refalias1.h similarity index 100% rename from sklearn/src/cblas/atlas_refalias1.h rename to scikits/learn/src/cblas/atlas_refalias1.h diff --git a/sklearn/src/cblas/atlas_refalias2.h b/scikits/learn/src/cblas/atlas_refalias2.h similarity index 100% rename from sklearn/src/cblas/atlas_refalias2.h rename to scikits/learn/src/cblas/atlas_refalias2.h diff --git a/sklearn/src/cblas/atlas_reflevel1.h b/scikits/learn/src/cblas/atlas_reflevel1.h similarity index 100% rename from sklearn/src/cblas/atlas_reflevel1.h rename to scikits/learn/src/cblas/atlas_reflevel1.h diff --git a/sklearn/src/cblas/atlas_reflevel2.h b/scikits/learn/src/cblas/atlas_reflevel2.h similarity index 100% rename from sklearn/src/cblas/atlas_reflevel2.h rename to scikits/learn/src/cblas/atlas_reflevel2.h diff --git a/sklearn/src/cblas/atlas_reflvl2.h b/scikits/learn/src/cblas/atlas_reflvl2.h similarity index 100% rename from sklearn/src/cblas/atlas_reflvl2.h rename to scikits/learn/src/cblas/atlas_reflvl2.h diff --git a/sklearn/src/cblas/atlas_refmisc.h b/scikits/learn/src/cblas/atlas_refmisc.h similarity index 100% rename from sklearn/src/cblas/atlas_refmisc.h rename to scikits/learn/src/cblas/atlas_refmisc.h diff --git a/sklearn/src/cblas/atlas_ssysinfo.h b/scikits/learn/src/cblas/atlas_ssysinfo.h similarity index 100% rename from sklearn/src/cblas/atlas_ssysinfo.h rename to scikits/learn/src/cblas/atlas_ssysinfo.h diff --git a/sklearn/src/cblas/atlas_type.h b/scikits/learn/src/cblas/atlas_type.h similarity index 100% rename from sklearn/src/cblas/atlas_type.h rename to scikits/learn/src/cblas/atlas_type.h diff --git a/sklearn/src/cblas/cblas.h b/scikits/learn/src/cblas/cblas.h similarity index 100% rename from sklearn/src/cblas/cblas.h rename to scikits/learn/src/cblas/cblas.h diff --git a/sklearn/src/cblas/cblas_daxpy.c b/scikits/learn/src/cblas/cblas_daxpy.c similarity index 100% rename from sklearn/src/cblas/cblas_daxpy.c rename to scikits/learn/src/cblas/cblas_daxpy.c diff --git a/sklearn/src/cblas/cblas_dcopy.c b/scikits/learn/src/cblas/cblas_dcopy.c similarity index 100% rename from sklearn/src/cblas/cblas_dcopy.c rename to scikits/learn/src/cblas/cblas_dcopy.c diff --git a/sklearn/src/cblas/cblas_ddot.c b/scikits/learn/src/cblas/cblas_ddot.c similarity index 100% rename from sklearn/src/cblas/cblas_ddot.c rename to scikits/learn/src/cblas/cblas_ddot.c diff --git a/sklearn/src/cblas/cblas_dnrm2.c b/scikits/learn/src/cblas/cblas_dnrm2.c similarity index 100% rename from sklearn/src/cblas/cblas_dnrm2.c rename to scikits/learn/src/cblas/cblas_dnrm2.c diff --git a/sklearn/src/cblas/cblas_drot.c b/scikits/learn/src/cblas/cblas_drot.c similarity index 100% rename from sklearn/src/cblas/cblas_drot.c rename to scikits/learn/src/cblas/cblas_drot.c diff --git a/sklearn/src/cblas/cblas_drotg.c b/scikits/learn/src/cblas/cblas_drotg.c similarity index 100% rename from sklearn/src/cblas/cblas_drotg.c rename to scikits/learn/src/cblas/cblas_drotg.c diff --git a/sklearn/src/cblas/cblas_dscal.c b/scikits/learn/src/cblas/cblas_dscal.c similarity index 100% rename from sklearn/src/cblas/cblas_dscal.c rename to scikits/learn/src/cblas/cblas_dscal.c diff --git a/sklearn/src/cblas/cblas_dtrsv.c b/scikits/learn/src/cblas/cblas_dtrsv.c similarity index 100% rename from sklearn/src/cblas/cblas_dtrsv.c rename to scikits/learn/src/cblas/cblas_dtrsv.c diff --git a/sklearn/src/cblas/cblas_errprn.c b/scikits/learn/src/cblas/cblas_errprn.c similarity index 100% rename from sklearn/src/cblas/cblas_errprn.c rename to scikits/learn/src/cblas/cblas_errprn.c diff --git a/sklearn/src/cblas/cblas_scopy.c b/scikits/learn/src/cblas/cblas_scopy.c similarity index 100% rename from sklearn/src/cblas/cblas_scopy.c rename to scikits/learn/src/cblas/cblas_scopy.c diff --git a/sklearn/src/cblas/cblas_srot.c b/scikits/learn/src/cblas/cblas_srot.c similarity index 100% rename from sklearn/src/cblas/cblas_srot.c rename to scikits/learn/src/cblas/cblas_srot.c diff --git a/sklearn/src/cblas/cblas_srotg.c b/scikits/learn/src/cblas/cblas_srotg.c similarity index 100% rename from sklearn/src/cblas/cblas_srotg.c rename to scikits/learn/src/cblas/cblas_srotg.c diff --git a/sklearn/src/cblas/cblas_strsv.c b/scikits/learn/src/cblas/cblas_strsv.c similarity index 100% rename from sklearn/src/cblas/cblas_strsv.c rename to scikits/learn/src/cblas/cblas_strsv.c diff --git a/sklearn/src/cblas/cblas_xerbla.c b/scikits/learn/src/cblas/cblas_xerbla.c similarity index 100% rename from sklearn/src/cblas/cblas_xerbla.c rename to scikits/learn/src/cblas/cblas_xerbla.c diff --git a/sklearn/svm/__init__.py b/scikits/learn/svm/__init__.py similarity index 100% rename from sklearn/svm/__init__.py rename to scikits/learn/svm/__init__.py diff --git a/sklearn/svm/base.py b/scikits/learn/svm/base.py similarity index 100% rename from sklearn/svm/base.py rename to scikits/learn/svm/base.py diff --git a/sklearn/svm/bounds.py b/scikits/learn/svm/bounds.py similarity index 100% rename from sklearn/svm/bounds.py rename to scikits/learn/svm/bounds.py diff --git a/sklearn/svm/classes.py b/scikits/learn/svm/classes.py similarity index 99% rename from sklearn/svm/classes.py rename to scikits/learn/svm/classes.py index 038e35758df02bad4d81b5f663f9e0c36d327ff1..ba96899e01e59418cff4cb7bde425b8027d23fb7 100644 --- a/sklearn/svm/classes.py +++ b/scikits/learn/svm/classes.py @@ -141,7 +141,7 @@ class SVC(BaseLibSVM, ClassifierMixin): >>> import numpy as np >>> X = np.array([[-1, -1], [-2, -1], [1, 1], [2, 1]]) >>> y = np.array([1, 1, 2, 2]) - >>> from sklearn.svm import SVC + >>> from scikits.learn.svm import SVC >>> clf = SVC() >>> clf.fit(X, y) SVC(C=1.0, coef0=0.0, degree=3, gamma=0.25, kernel='rbf', probability=False, @@ -242,7 +242,7 @@ class NuSVC(BaseLibSVM, ClassifierMixin): >>> import numpy as np >>> X = np.array([[-1, -1], [-2, -1], [1, 1], [2, 1]]) >>> y = np.array([1, 1, 2, 2]) - >>> from sklearn.svm import NuSVC + >>> from scikits.learn.svm import NuSVC >>> clf = NuSVC() >>> clf.fit(X, y) NuSVC(coef0=0.0, degree=3, gamma=0.25, kernel='rbf', nu=0.5, @@ -327,7 +327,7 @@ class SVR(BaseLibSVM, RegressorMixin): Examples -------- - >>> from sklearn.svm import SVR + >>> from scikits.learn.svm import SVR >>> import numpy as np >>> n_samples, n_features = 10, 5 >>> np.random.seed(0) @@ -435,7 +435,7 @@ class NuSVR(BaseLibSVM, RegressorMixin): Examples -------- - >>> from sklearn.svm import NuSVR + >>> from scikits.learn.svm import NuSVR >>> import numpy as np >>> n_samples, n_features = 10, 5 >>> np.random.seed(0) diff --git a/sklearn/svm/liblinear.c b/scikits/learn/svm/liblinear.c similarity index 88% rename from sklearn/svm/liblinear.c rename to scikits/learn/svm/liblinear.c index 729949476594f9a6ad2407df2b628da47e1a6623..c336bfe023d6ba75233902d0e203d3b4a9a72e60 100644 --- a/sklearn/svm/liblinear.c +++ b/scikits/learn/svm/liblinear.c @@ -1,39 +1,18 @@ -/* Generated by Cython 0.13 on Fri Sep 2 11:25:23 2011 */ +/* Generated by Cython 0.12.1 on Wed Mar 30 16:06:46 2011 */ #define PY_SSIZE_T_CLEAN #include "Python.h" +#include "structmember.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #else -#include <stddef.h> /* For offsetof */ -#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 +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif - -#ifndef PY_LONG_LONG - #define PY_LONG_LONG LONG_LONG -#endif - #if PY_VERSION_HEX < 0x02040000 #define METH_COEXIST 0 #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type) @@ -103,35 +82,11 @@ #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_VERSION_HEX < 0x02060000 - #define PyBytesObject PyStringObject +#else #define PyBytes_Type PyString_Type - #define PyBytes_Check PyString_Check #define PyBytes_CheckExact PyString_CheckExact - #define PyBytes_FromString PyString_FromString - #define PyBytes_FromStringAndSize PyString_FromStringAndSize - #define PyBytes_FromFormat PyString_FromFormat - #define PyBytes_DecodeEscape PyString_DecodeEscape - #define PyBytes_AsString PyString_AsString - #define PyBytes_AsStringAndSize PyString_AsStringAndSize - #define PyBytes_Size PyString_Size - #define PyBytes_AS_STRING PyString_AS_STRING - #define PyBytes_GET_SIZE PyString_GET_SIZE - #define PyBytes_Repr PyString_Repr - #define PyBytes_Concat PyString_Concat - #define PyBytes_ConcatAndDel PyString_ConcatAndDel - #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) - #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) -#endif - -#ifndef PySet_CheckExact -# define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #if PY_MAJOR_VERSION >= 3 @@ -148,23 +103,30 @@ #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask -#endif - -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#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 #if PY_MAJOR_VERSION >= 3 - #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) + #define PyMethod_New(func, self, klass) PyInstanceMethod_New(func) +#endif + +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#else + #define _USE_MATH_DEFINES #endif #if PY_VERSION_HEX < 0x02050000 @@ -184,65 +146,114 @@ #define __Pyx_NAMESTR(n) (n) #define __Pyx_DOCSTR(n) (n) #endif - #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif - -#if defined(WIN32) || defined(MS_WINDOWS) -#define _USE_MATH_DEFINES -#endif #include <math.h> -#define __PYX_HAVE_API__sklearn__svm__liblinear -#include "stdio.h" +#define __PYX_HAVE_API__scikits__learn__svm__liblinear #include "stdlib.h" +#include "stdio.h" #include "numpy/arrayobject.h" #include "numpy/ufuncobject.h" #include "src/liblinear/linear.h" #include "src/liblinear/liblinear_helper.c" -/* inline attribute */ #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 -/* unused attribute */ -#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) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -#endif - typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ /* Type Conversion Predeclarations */ -#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s) -#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) PyBytes_AsString(s)) +#if PY_MAJOR_VERSION < 3 +#define __Pyx_PyBytes_FromString PyString_FromString +#define __Pyx_PyBytes_FromStringAndSize PyString_FromStringAndSize +#define __Pyx_PyBytes_AsString PyString_AsString +#else +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +#define __Pyx_PyBytes_AsString PyBytes_AsString +#endif + +#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s) +#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) __Pyx_PyBytes_AsString(s)) #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); +#if !defined(T_PYSSIZET) +#if PY_VERSION_HEX < 0x02050000 +#define T_PYSSIZET T_INT +#elif !defined(T_LONGLONG) +#define T_PYSSIZET \ + ((sizeof(Py_ssize_t) == sizeof(int)) ? T_INT : \ + ((sizeof(Py_ssize_t) == sizeof(long)) ? T_LONG : -1)) +#else +#define T_PYSSIZET \ + ((sizeof(Py_ssize_t) == sizeof(int)) ? T_INT : \ + ((sizeof(Py_ssize_t) == sizeof(long)) ? T_LONG : \ + ((sizeof(Py_ssize_t) == sizeof(PY_LONG_LONG)) ? T_LONGLONG : -1))) +#endif +#endif + + +#if !defined(T_ULONGLONG) +#define __Pyx_T_UNSIGNED_INT(x) \ + ((sizeof(x) == sizeof(unsigned char)) ? T_UBYTE : \ + ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \ + ((sizeof(x) == sizeof(unsigned int)) ? T_UINT : \ + ((sizeof(x) == sizeof(unsigned long)) ? T_ULONG : -1)))) +#else +#define __Pyx_T_UNSIGNED_INT(x) \ + ((sizeof(x) == sizeof(unsigned char)) ? T_UBYTE : \ + ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \ + ((sizeof(x) == sizeof(unsigned int)) ? T_UINT : \ + ((sizeof(x) == sizeof(unsigned long)) ? T_ULONG : \ + ((sizeof(x) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1))))) +#endif +#if !defined(T_LONGLONG) +#define __Pyx_T_SIGNED_INT(x) \ + ((sizeof(x) == sizeof(char)) ? T_BYTE : \ + ((sizeof(x) == sizeof(short)) ? T_SHORT : \ + ((sizeof(x) == sizeof(int)) ? T_INT : \ + ((sizeof(x) == sizeof(long)) ? T_LONG : -1)))) +#else +#define __Pyx_T_SIGNED_INT(x) \ + ((sizeof(x) == sizeof(char)) ? T_BYTE : \ + ((sizeof(x) == sizeof(short)) ? T_SHORT : \ + ((sizeof(x) == sizeof(int)) ? T_INT : \ + ((sizeof(x) == sizeof(long)) ? T_LONG : \ + ((sizeof(x) == sizeof(PY_LONG_LONG)) ? T_LONGLONG : -1))))) +#endif + +#define __Pyx_T_FLOATING(x) \ + ((sizeof(x) == sizeof(float)) ? T_FLOAT : \ + ((sizeof(x) == sizeof(double)) ? T_DOUBLE : -1)) + +#if !defined(T_SIZET) +#if !defined(T_ULONGLONG) +#define T_SIZET \ + ((sizeof(size_t) == sizeof(unsigned int)) ? T_UINT : \ + ((sizeof(size_t) == sizeof(unsigned long)) ? T_ULONG : -1)) +#else +#define T_SIZET \ + ((sizeof(size_t) == sizeof(unsigned int)) ? T_UINT : \ + ((sizeof(size_t) == sizeof(unsigned long)) ? T_ULONG : \ + ((sizeof(size_t) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1))) +#endif +#endif + static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); @@ -252,7 +263,7 @@ static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); #ifdef __GNUC__ /* Test for GCC > 2.95 */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) +#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* __GNUC__ > 2 ... */ @@ -272,6 +283,7 @@ static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; +static const char **__pyx_f; #if !defined(CYTHON_CCOMPLEX) @@ -297,11 +309,6 @@ static const char *__pyx_filename; #define _Complex_I 1.0fj #endif -static const char *__pyx_f[] = { - "liblinear.pyx", - "numpy.pxd", -}; - typedef npy_int8 __pyx_t_5numpy_int8_t; typedef npy_int16 __pyx_t_5numpy_int16_t; @@ -416,8 +423,6 @@ typedef npy_cdouble __pyx_t_5numpy_complex_t; #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0) -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ - static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name); /*proto*/ @@ -426,9 +431,6 @@ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/ -static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact); /*proto*/ - /* Run-time type information about structs used with buffers */ struct __Pyx_StructField_; @@ -451,8 +453,8 @@ typedef struct { } __Pyx_BufFmt_StackElem; -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); +static int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ @@ -461,13 +463,19 @@ static void __Pyx_RaiseBufferFallbackError(void); /*proto*/ static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ -static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); - static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(void); + +static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); /*proto*/ +static int __Pyx_EndUnpack(PyObject *); /*proto*/ + +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /*proto*/ + +static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact); /*proto*/ #if PY_MAJOR_VERSION < 3 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); static void __Pyx_ReleaseBuffer(Py_buffer *view); @@ -481,9 +489,11 @@ Py_ssize_t __Pyx_minusones[] = {-1, -1}; static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ +static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ + static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ -static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_Py_intptr_t(Py_intptr_t); +static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_npy_intp(npy_intp); #if CYTHON_CCOMPLEX #ifdef __cplusplus @@ -584,8 +594,6 @@ static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *); static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *); -static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *); - static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *); static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *); @@ -605,15 +613,13 @@ static PyObject *__Pyx_ImportModule(const char *name); /*proto*/ static void __Pyx_AddTraceback(const char *funcname); /*proto*/ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ -/* Module declarations from cpython.buffer */ - -/* Module declarations from cpython.ref */ +/* Module declarations from python_buffer */ -/* Module declarations from libc.stdio */ +/* Module declarations from python_ref */ -/* Module declarations from cpython.object */ +/* Module declarations from stdlib */ -/* Module declarations from libc.stdlib */ +/* Module declarations from stdio */ /* Module declarations from numpy */ @@ -632,14 +638,14 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *, static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *, PyObject *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *); /*proto*/ -/* Module declarations from sklearn.svm.liblinear */ +/* Module declarations from scikits.learn.svm.liblinear */ -static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), 'R' }; -static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t = { "int32_t", NULL, sizeof(__pyx_t_5numpy_int32_t), 'I' }; -#define __Pyx_MODULE_NAME "sklearn.svm.liblinear" -int __pyx_module_is_main_sklearn__svm__liblinear = 0; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "numpy.float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), 'R' }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t = { "numpy.int32_t", NULL, sizeof(__pyx_t_5numpy_int32_t), 'I' }; +#define __Pyx_MODULE_NAME "scikits.learn.svm.liblinear" +int __pyx_module_is_main_scikits__learn__svm__liblinear = 0; -/* Implementation of sklearn.svm.liblinear */ +/* Implementation of scikits.learn.svm.liblinear */ static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_MemoryError; static PyObject *__pyx_builtin_range; @@ -797,9 +803,10 @@ static PyObject *__pyx_n_s__type_num; static PyObject *__pyx_n_s__weight; static PyObject *__pyx_n_s__weight_label; static PyObject *__pyx_int_1; +static PyObject *__pyx_int_2; static PyObject *__pyx_int_15; -/* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":59 +/* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":59 * * * def train_wrap ( np.ndarray[np.float64_t, ndim=2, mode='c'] X, # <<<<<<<<<<<<<< @@ -807,9 +814,9 @@ static PyObject *__pyx_int_15; * solver_type, double eps, double bias, double C, */ -static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_train_wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_7sklearn_3svm_9liblinear_train_wrap[] = "\n Wrapper for train methd.\n "; -static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_train_wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_train_wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_7scikits_5learn_3svm_9liblinear_train_wrap[] = "\n Wrapper for train methd.\n "; +static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_train_wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyArrayObject *__pyx_v_X = 0; PyArrayObject *__pyx_v_Y = 0; int __pyx_v_solver_type; @@ -955,10 +962,13 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_train_wrap(PyObject *__pyx_se __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("train_wrap", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("sklearn.svm.liblinear.train_wrap"); - __Pyx_RefNannyFinishContext(); + __Pyx_AddTraceback("scikits.learn.svm.liblinear.train_wrap"); return NULL; __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF((PyObject *)__pyx_v_X); + __Pyx_INCREF((PyObject *)__pyx_v_Y); + __Pyx_INCREF((PyObject *)__pyx_v_weight_label); + __Pyx_INCREF((PyObject *)__pyx_v_weight); __pyx_v_w = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_label = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_w.buf = NULL; @@ -996,7 +1006,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_train_wrap(PyObject *__pyx_se __pyx_bstride_0_weight = __pyx_bstruct_weight.strides[0]; __pyx_bshape_0_weight = __pyx_bstruct_weight.shape[0]; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":73 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":73 * cdef int len_w * * problem = set_problem(X.data, Y.data, X.shape, bias) # <<<<<<<<<<<<<< @@ -1005,7 +1015,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_train_wrap(PyObject *__pyx_se */ __pyx_v_problem = set_problem(__pyx_v_X->data, __pyx_v_Y->data, __pyx_v_X->dimensions, __pyx_v_bias); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":75 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":75 * problem = set_problem(X.data, Y.data, X.shape, bias) * * param = set_parameter(solver_type, eps, C, weight.shape[0], weight_label.data, weight.data) # <<<<<<<<<<<<<< @@ -1014,7 +1024,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_train_wrap(PyObject *__pyx_se */ __pyx_v_param = set_parameter(__pyx_v_solver_type, __pyx_v_eps, __pyx_v_C, (__pyx_v_weight->dimensions[0]), __pyx_v_weight_label->data, __pyx_v_weight->data); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":77 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":77 * param = set_parameter(solver_type, eps, C, weight.shape[0], weight_label.data, weight.data) * * error_msg = check_parameter(problem, param) # <<<<<<<<<<<<<< @@ -1023,7 +1033,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_train_wrap(PyObject *__pyx_se */ __pyx_v_error_msg = check_parameter(__pyx_v_problem, __pyx_v_param); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":78 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":78 * * error_msg = check_parameter(problem, param) * if error_msg: # <<<<<<<<<<<<<< @@ -1033,7 +1043,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_train_wrap(PyObject *__pyx_se __pyx_t_1 = (__pyx_v_error_msg != 0); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":79 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":79 * error_msg = check_parameter(problem, param) * if error_msg: * free_problem(problem) # <<<<<<<<<<<<<< @@ -1042,7 +1052,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_train_wrap(PyObject *__pyx_se */ free_problem(__pyx_v_problem); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":80 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":80 * if error_msg: * free_problem(problem) * free_parameter(param) # <<<<<<<<<<<<<< @@ -1051,14 +1061,14 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_train_wrap(PyObject *__pyx_se */ free_parameter(__pyx_v_param); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":81 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":81 * free_problem(problem) * free_parameter(param) * raise ValueError(error_msg) # <<<<<<<<<<<<<< * * # early return */ - __pyx_t_2 = PyBytes_FromString(__pyx_v_error_msg); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_error_msg); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); @@ -1075,7 +1085,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_train_wrap(PyObject *__pyx_se } __pyx_L6:; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":84 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":84 * * # early return * model = train(problem, param) # <<<<<<<<<<<<<< @@ -1084,7 +1094,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_train_wrap(PyObject *__pyx_se */ __pyx_v_model = train(__pyx_v_problem, __pyx_v_param); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":88 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":88 * # coef matrix holder created as fortran since that's what's used in liblinear * cdef np.ndarray[np.float64_t, ndim=2, mode='fortran'] w * cdef int nr_class = get_nr_class(model) # <<<<<<<<<<<<<< @@ -1093,7 +1103,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_train_wrap(PyObject *__pyx_se */ __pyx_v_nr_class = get_nr_class(__pyx_v_model); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":89 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":89 * cdef np.ndarray[np.float64_t, ndim=2, mode='fortran'] w * cdef int nr_class = get_nr_class(model) * cdef int nr_feature = get_nr_feature(model) # <<<<<<<<<<<<<< @@ -1102,21 +1112,21 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_train_wrap(PyObject *__pyx_se */ __pyx_v_nr_feature = get_nr_feature(__pyx_v_model); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":90 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":90 * cdef int nr_class = get_nr_class(model) * cdef int nr_feature = get_nr_feature(model) * if bias > 0: nr_feature = nr_feature + 1 # <<<<<<<<<<<<<< * if nr_class == 2: * w = np.empty((1, nr_feature),order='F') */ - __pyx_t_1 = (__pyx_v_bias > 0.0); + __pyx_t_1 = (__pyx_v_bias > 0); if (__pyx_t_1) { __pyx_v_nr_feature = (__pyx_v_nr_feature + 1); goto __pyx_L7; } __pyx_L7:; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":91 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":91 * cdef int nr_feature = get_nr_feature(model) * if bias > 0: nr_feature = nr_feature + 1 * if nr_class == 2: # <<<<<<<<<<<<<< @@ -1126,7 +1136,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_train_wrap(PyObject *__pyx_se __pyx_t_1 = (__pyx_v_nr_class == 2); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":92 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":92 * if bias > 0: nr_feature = nr_feature + 1 * if nr_class == 2: * w = np.empty((1, nr_feature),order='F') # <<<<<<<<<<<<<< @@ -1185,7 +1195,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_train_wrap(PyObject *__pyx_se __pyx_v_w = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":93 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":93 * if nr_class == 2: * w = np.empty((1, nr_feature),order='F') * copy_w(w.data, model, nr_feature) # <<<<<<<<<<<<<< @@ -1197,7 +1207,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_train_wrap(PyObject *__pyx_se } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":95 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":95 * copy_w(w.data, model, nr_feature) * else: * len_w = (nr_class) * nr_feature # <<<<<<<<<<<<<< @@ -1206,7 +1216,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_train_wrap(PyObject *__pyx_se */ __pyx_v_len_w = (__pyx_v_nr_class * __pyx_v_nr_feature); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":96 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":96 * else: * len_w = (nr_class) * nr_feature * w = np.empty((nr_class, nr_feature),order='F') # <<<<<<<<<<<<<< @@ -1267,7 +1277,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_train_wrap(PyObject *__pyx_se __pyx_v_w = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":97 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":97 * len_w = (nr_class) * nr_feature * w = np.empty((nr_class, nr_feature),order='F') * copy_w(w.data, model, len_w) # <<<<<<<<<<<<<< @@ -1278,7 +1288,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_train_wrap(PyObject *__pyx_se } __pyx_L8:; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":100 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":100 * * cdef np.ndarray[np.int32_t, ndim=1, mode='c'] label * label = np.empty(nr_class, dtype=np.int32) # <<<<<<<<<<<<<< @@ -1335,7 +1345,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_train_wrap(PyObject *__pyx_se __pyx_v_label = ((PyArrayObject *)__pyx_t_11); __pyx_t_11 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":101 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":101 * cdef np.ndarray[np.int32_t, ndim=1, mode='c'] label * label = np.empty(nr_class, dtype=np.int32) * copy_label(label.data, model, nr_class) # <<<<<<<<<<<<<< @@ -1344,7 +1354,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_train_wrap(PyObject *__pyx_se */ copy_label(__pyx_v_label->data, __pyx_v_model, __pyx_v_nr_class); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":104 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":104 * * ### FREE * free_and_destroy_model(&model) # <<<<<<<<<<<<<< @@ -1353,7 +1363,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_train_wrap(PyObject *__pyx_se */ free_and_destroy_model((&__pyx_v_model)); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":105 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":105 * ### FREE * free_and_destroy_model(&model) * free_problem(problem) # <<<<<<<<<<<<<< @@ -1362,7 +1372,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_train_wrap(PyObject *__pyx_se */ free_problem(__pyx_v_problem); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":106 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":106 * free_and_destroy_model(&model) * free_problem(problem) * free_parameter(param) # <<<<<<<<<<<<<< @@ -1371,7 +1381,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_train_wrap(PyObject *__pyx_se */ free_parameter(__pyx_v_param); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":109 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":109 * # destroy_param(param) don't call this or it will destroy weight_label and weight * * return w, label # <<<<<<<<<<<<<< @@ -1408,7 +1418,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_train_wrap(PyObject *__pyx_se __Pyx_SafeReleaseBuffer(&__pyx_bstruct_X); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_label); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("sklearn.svm.liblinear.train_wrap"); + __Pyx_AddTraceback("scikits.learn.svm.liblinear.train_wrap"); __pyx_r = NULL; goto __pyx_L2; __pyx_L0:; @@ -1421,12 +1431,16 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_train_wrap(PyObject *__pyx_se __pyx_L2:; __Pyx_DECREF((PyObject *)__pyx_v_w); __Pyx_DECREF((PyObject *)__pyx_v_label); + __Pyx_DECREF((PyObject *)__pyx_v_X); + __Pyx_DECREF((PyObject *)__pyx_v_Y); + __Pyx_DECREF((PyObject *)__pyx_v_weight_label); + __Pyx_DECREF((PyObject *)__pyx_v_weight); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":111 +/* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":111 * return w, label * * def csr_train_wrap ( int n_features, # <<<<<<<<<<<<<< @@ -1434,9 +1448,9 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_train_wrap(PyObject *__pyx_se * np.ndarray[np.int32_t, ndim=1, mode='c'] X_indices, */ -static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_train_wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_7sklearn_3svm_9liblinear_csr_train_wrap[] = "\n Wrapper for train.\n\n X matrix is given in CSR sparse format.\n "; -static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_train_wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_train_wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_7scikits_5learn_3svm_9liblinear_csr_train_wrap[] = "\n Wrapper for train.\n\n X matrix is given in CSR sparse format.\n "; +static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_train_wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_v_n_features; PyArrayObject *__pyx_v_X_values = 0; PyArrayObject *__pyx_v_X_indices = 0; @@ -1616,10 +1630,15 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_train_wrap(PyObject *__py __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("csr_train_wrap", 1, 11, 11, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("sklearn.svm.liblinear.csr_train_wrap"); - __Pyx_RefNannyFinishContext(); + __Pyx_AddTraceback("scikits.learn.svm.liblinear.csr_train_wrap"); return NULL; __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF((PyObject *)__pyx_v_X_values); + __Pyx_INCREF((PyObject *)__pyx_v_X_indices); + __Pyx_INCREF((PyObject *)__pyx_v_X_indptr); + __Pyx_INCREF((PyObject *)__pyx_v_Y); + __Pyx_INCREF((PyObject *)__pyx_v_weight_label); + __Pyx_INCREF((PyObject *)__pyx_v_weight); __pyx_v_w = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_label = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_w.buf = NULL; @@ -1673,7 +1692,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_train_wrap(PyObject *__py __pyx_bstride_0_weight = __pyx_bstruct_weight.strides[0]; __pyx_bshape_0_weight = __pyx_bstruct_weight.shape[0]; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":131 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":131 * * problem = csr_set_problem(X_values.data, X_indices.shape, * X_indices.data, X_indptr.shape, X_indptr.data, Y.data, n_features, bias) # <<<<<<<<<<<<<< @@ -1682,7 +1701,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_train_wrap(PyObject *__py */ __pyx_v_problem = csr_set_problem(__pyx_v_X_values->data, __pyx_v_X_indices->dimensions, __pyx_v_X_indices->data, __pyx_v_X_indptr->dimensions, __pyx_v_X_indptr->data, __pyx_v_Y->data, __pyx_v_n_features, __pyx_v_bias); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":133 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":133 * X_indices.data, X_indptr.shape, X_indptr.data, Y.data, n_features, bias) * * param = set_parameter(solver_type, eps, C, weight.shape[0], weight_label.data, weight.data) # <<<<<<<<<<<<<< @@ -1691,7 +1710,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_train_wrap(PyObject *__py */ __pyx_v_param = set_parameter(__pyx_v_solver_type, __pyx_v_eps, __pyx_v_C, (__pyx_v_weight->dimensions[0]), __pyx_v_weight_label->data, __pyx_v_weight->data); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":135 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":135 * param = set_parameter(solver_type, eps, C, weight.shape[0], weight_label.data, weight.data) * * error_msg = check_parameter(problem, param) # <<<<<<<<<<<<<< @@ -1700,7 +1719,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_train_wrap(PyObject *__py */ __pyx_v_error_msg = check_parameter(__pyx_v_problem, __pyx_v_param); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":136 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":136 * * error_msg = check_parameter(problem, param) * if error_msg: # <<<<<<<<<<<<<< @@ -1710,7 +1729,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_train_wrap(PyObject *__py __pyx_t_1 = (__pyx_v_error_msg != 0); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":137 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":137 * error_msg = check_parameter(problem, param) * if error_msg: * free_problem(problem) # <<<<<<<<<<<<<< @@ -1719,7 +1738,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_train_wrap(PyObject *__py */ free_problem(__pyx_v_problem); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":138 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":138 * if error_msg: * free_problem(problem) * free_parameter(param) # <<<<<<<<<<<<<< @@ -1728,14 +1747,14 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_train_wrap(PyObject *__py */ free_parameter(__pyx_v_param); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":139 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":139 * free_problem(problem) * free_parameter(param) * raise ValueError(error_msg) # <<<<<<<<<<<<<< * * # early return */ - __pyx_t_2 = PyBytes_FromString(__pyx_v_error_msg); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_error_msg); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); @@ -1752,7 +1771,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_train_wrap(PyObject *__py } __pyx_L6:; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":142 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":142 * * # early return * model = train(problem, param) # <<<<<<<<<<<<<< @@ -1761,7 +1780,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_train_wrap(PyObject *__py */ __pyx_v_model = train(__pyx_v_problem, __pyx_v_param); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":146 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":146 * # fortran order since that's what liblinear does * cdef np.ndarray[np.float64_t, ndim=2, mode='fortran'] w * cdef int nr_class = get_nr_class(model) # <<<<<<<<<<<<<< @@ -1770,7 +1789,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_train_wrap(PyObject *__py */ __pyx_v_nr_class = get_nr_class(__pyx_v_model); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":147 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":147 * cdef np.ndarray[np.float64_t, ndim=2, mode='fortran'] w * cdef int nr_class = get_nr_class(model) * cdef int nr_feature = n_features # <<<<<<<<<<<<<< @@ -1779,21 +1798,21 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_train_wrap(PyObject *__py */ __pyx_v_nr_feature = __pyx_v_n_features; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":148 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":148 * cdef int nr_class = get_nr_class(model) * cdef int nr_feature = n_features * if bias > 0: nr_feature = nr_feature + 1 # <<<<<<<<<<<<<< * if nr_class == 2: * w = np.empty((1, nr_feature),order='F') */ - __pyx_t_1 = (__pyx_v_bias > 0.0); + __pyx_t_1 = (__pyx_v_bias > 0); if (__pyx_t_1) { __pyx_v_nr_feature = (__pyx_v_nr_feature + 1); goto __pyx_L7; } __pyx_L7:; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":149 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":149 * cdef int nr_feature = n_features * if bias > 0: nr_feature = nr_feature + 1 * if nr_class == 2: # <<<<<<<<<<<<<< @@ -1803,7 +1822,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_train_wrap(PyObject *__py __pyx_t_1 = (__pyx_v_nr_class == 2); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":150 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":150 * if bias > 0: nr_feature = nr_feature + 1 * if nr_class == 2: * w = np.empty((1, nr_feature),order='F') # <<<<<<<<<<<<<< @@ -1862,7 +1881,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_train_wrap(PyObject *__py __pyx_v_w = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":151 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":151 * if nr_class == 2: * w = np.empty((1, nr_feature),order='F') * copy_w(w.data, model, nr_feature) # <<<<<<<<<<<<<< @@ -1874,7 +1893,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_train_wrap(PyObject *__py } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":153 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":153 * copy_w(w.data, model, nr_feature) * else: * len_w = (nr_class * nr_feature) # <<<<<<<<<<<<<< @@ -1883,7 +1902,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_train_wrap(PyObject *__py */ __pyx_v_len_w = (__pyx_v_nr_class * __pyx_v_nr_feature); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":154 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":154 * else: * len_w = (nr_class * nr_feature) * w = np.empty((nr_class, nr_feature),order='F') # <<<<<<<<<<<<<< @@ -1944,7 +1963,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_train_wrap(PyObject *__py __pyx_v_w = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":155 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":155 * len_w = (nr_class * nr_feature) * w = np.empty((nr_class, nr_feature),order='F') * copy_w(w.data, model, len_w) # <<<<<<<<<<<<<< @@ -1955,7 +1974,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_train_wrap(PyObject *__py } __pyx_L8:; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":158 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":158 * * cdef np.ndarray[np.int32_t, ndim=1, mode='c'] label * label = np.empty((nr_class), dtype=np.int32) # <<<<<<<<<<<<<< @@ -2012,7 +2031,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_train_wrap(PyObject *__py __pyx_v_label = ((PyArrayObject *)__pyx_t_11); __pyx_t_11 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":159 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":159 * cdef np.ndarray[np.int32_t, ndim=1, mode='c'] label * label = np.empty((nr_class), dtype=np.int32) * copy_label(label.data, model, nr_class) # <<<<<<<<<<<<<< @@ -2021,7 +2040,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_train_wrap(PyObject *__py */ copy_label(__pyx_v_label->data, __pyx_v_model, __pyx_v_nr_class); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":162 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":162 * * ### FREE * free_and_destroy_model(&model) # <<<<<<<<<<<<<< @@ -2030,7 +2049,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_train_wrap(PyObject *__py */ free_and_destroy_model((&__pyx_v_model)); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":163 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":163 * ### FREE * free_and_destroy_model(&model) * free_problem(problem) # <<<<<<<<<<<<<< @@ -2039,7 +2058,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_train_wrap(PyObject *__py */ free_problem(__pyx_v_problem); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":164 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":164 * free_and_destroy_model(&model) * free_problem(problem) * free_parameter(param) # <<<<<<<<<<<<<< @@ -2048,7 +2067,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_train_wrap(PyObject *__py */ free_parameter(__pyx_v_param); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":167 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":167 * # destroy_param(param) don't call this or it will destroy weight_label and weight * * return w, label # <<<<<<<<<<<<<< @@ -2087,7 +2106,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_train_wrap(PyObject *__py __Pyx_SafeReleaseBuffer(&__pyx_bstruct_Y); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_label); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("sklearn.svm.liblinear.csr_train_wrap"); + __Pyx_AddTraceback("scikits.learn.svm.liblinear.csr_train_wrap"); __pyx_r = NULL; goto __pyx_L2; __pyx_L0:; @@ -2102,12 +2121,18 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_train_wrap(PyObject *__py __pyx_L2:; __Pyx_DECREF((PyObject *)__pyx_v_w); __Pyx_DECREF((PyObject *)__pyx_v_label); + __Pyx_DECREF((PyObject *)__pyx_v_X_values); + __Pyx_DECREF((PyObject *)__pyx_v_X_indices); + __Pyx_DECREF((PyObject *)__pyx_v_X_indptr); + __Pyx_DECREF((PyObject *)__pyx_v_Y); + __Pyx_DECREF((PyObject *)__pyx_v_weight_label); + __Pyx_DECREF((PyObject *)__pyx_v_weight); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":170 +/* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":170 * * * def decision_function_wrap( # <<<<<<<<<<<<<< @@ -2115,8 +2140,8 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_train_wrap(PyObject *__py * np.ndarray[np.float64_t, ndim=2, mode='fortran'] coef_, */ -static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_decision_function_wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_decision_function_wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_decision_function_wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_decision_function_wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyArrayObject *__pyx_v_T = 0; PyArrayObject *__pyx_v_coef_ = 0; int __pyx_v_solver_type; @@ -2129,7 +2154,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_decision_function_wrap(PyObje PyArrayObject *__pyx_v_dec_values; struct parameter *__pyx_v_param; struct model *__pyx_v_model; - long __pyx_v_n_class; + PyObject *__pyx_v_n_class; Py_buffer __pyx_bstruct_dec_values; Py_ssize_t __pyx_bstride_0_dec_values = 0; Py_ssize_t __pyx_bstride_1_dec_values = 0; @@ -2155,8 +2180,8 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_decision_function_wrap(PyObje Py_ssize_t __pyx_bshape_0_T = 0; Py_ssize_t __pyx_bshape_1_T = 0; PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; @@ -2268,11 +2293,16 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_decision_function_wrap(PyObje __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("decision_function_wrap", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("sklearn.svm.liblinear.decision_function_wrap"); - __Pyx_RefNannyFinishContext(); + __Pyx_AddTraceback("scikits.learn.svm.liblinear.decision_function_wrap"); return NULL; __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF((PyObject *)__pyx_v_T); + __Pyx_INCREF((PyObject *)__pyx_v_coef_); + __Pyx_INCREF((PyObject *)__pyx_v_weight_label); + __Pyx_INCREF((PyObject *)__pyx_v_weight); + __Pyx_INCREF((PyObject *)__pyx_v_label); __pyx_v_dec_values = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_n_class = Py_None; __Pyx_INCREF(Py_None); __pyx_bstruct_dec_values.buf = NULL; __pyx_bstruct_T.buf = NULL; __pyx_bstruct_coef_.buf = NULL; @@ -2315,7 +2345,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_decision_function_wrap(PyObje __pyx_bstride_0_label = __pyx_bstruct_label.strides[0]; __pyx_bshape_0_label = __pyx_bstruct_label.shape[0]; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":184 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":184 * * param = set_parameter( * solver_type, eps, C, weight.shape[0], weight_label.data, weight.data) # <<<<<<<<<<<<<< @@ -2324,7 +2354,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_decision_function_wrap(PyObje */ __pyx_v_param = set_parameter(__pyx_v_solver_type, __pyx_v_eps, __pyx_v_C, (__pyx_v_weight->dimensions[0]), __pyx_v_weight_label->data, __pyx_v_weight->data); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":186 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":186 * solver_type, eps, C, weight.shape[0], weight_label.data, weight.data) * * model = set_model(param, coef_.data, coef_.shape, label.data, bias) # <<<<<<<<<<<<<< @@ -2333,72 +2363,79 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_decision_function_wrap(PyObje */ __pyx_v_model = set_model(__pyx_v_param, __pyx_v_coef_->data, __pyx_v_coef_->dimensions, __pyx_v_label->data, __pyx_v_bias); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":188 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":188 * model = set_model(param, coef_.data, coef_.shape, label.data, bias) * * n_class = label.shape[0] # <<<<<<<<<<<<<< * if n_class <= 2: n_class = 1 * dec_values = np.empty((T.shape[0], n_class), dtype=np.float64) */ - __pyx_v_n_class = (__pyx_v_label->dimensions[0]); + __pyx_t_1 = __Pyx_PyInt_to_py_npy_intp((__pyx_v_label->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_v_n_class); + __pyx_v_n_class = __pyx_t_1; + __pyx_t_1 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":189 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":189 * * n_class = label.shape[0] * if n_class <= 2: n_class = 1 # <<<<<<<<<<<<<< * dec_values = np.empty((T.shape[0], n_class), dtype=np.float64) * */ - __pyx_t_1 = (__pyx_v_n_class <= 2); - if (__pyx_t_1) { - __pyx_v_n_class = 1; + __pyx_t_1 = PyObject_RichCompare(__pyx_v_n_class, __pyx_int_2, Py_LE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + __Pyx_INCREF(__pyx_int_1); + __Pyx_DECREF(__pyx_v_n_class); + __pyx_v_n_class = __pyx_int_1; goto __pyx_L6; } __pyx_L6:; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":190 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":190 * n_class = label.shape[0] * if n_class <= 2: n_class = 1 * dec_values = np.empty((T.shape[0], n_class), dtype=np.float64) # <<<<<<<<<<<<<< * * if copy_predict_values(T.data, model, T.shape, dec_values.data, n_class) < 0: */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_to_py_Py_intptr_t((__pyx_v_T->dimensions[0])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyInt_FromLong(__pyx_v_n_class); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_to_py_npy_intp((__pyx_v_T->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_n_class); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_n_class); + __Pyx_GIVEREF(__pyx_v_n_class); + __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_2 = 0; __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __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 = 0; - __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_3, __pyx_t_1, ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); { @@ -2423,17 +2460,18 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_decision_function_wrap(PyObje __pyx_v_dec_values = ((PyArrayObject *)__pyx_t_6); __pyx_t_6 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":192 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":192 * dec_values = np.empty((T.shape[0], n_class), dtype=np.float64) * * if copy_predict_values(T.data, model, T.shape, dec_values.data, n_class) < 0: # <<<<<<<<<<<<<< * raise MemoryError("We've run out of of memory") * */ - __pyx_t_1 = (copy_predict_values(__pyx_v_T->data, __pyx_v_model, __pyx_v_T->dimensions, __pyx_v_dec_values->data, __pyx_v_n_class) < 0); - if (__pyx_t_1) { + __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_v_n_class); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = (copy_predict_values(__pyx_v_T->data, __pyx_v_model, __pyx_v_T->dimensions, __pyx_v_dec_values->data, __pyx_t_8) < 0); + if (__pyx_t_2) { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":193 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":193 * * if copy_predict_values(T.data, model, T.shape, dec_values.data, n_class) < 0: * raise MemoryError("We've run out of of memory") # <<<<<<<<<<<<<< @@ -2445,17 +2483,17 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_decision_function_wrap(PyObje __Pyx_INCREF(((PyObject *)__pyx_kp_s_1)); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_kp_s_1)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L7; } __pyx_L7:; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":196 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":196 * * ### FREE * free_parameter(param) # <<<<<<<<<<<<<< @@ -2464,7 +2502,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_decision_function_wrap(PyObje */ free_parameter(__pyx_v_param); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":197 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":197 * ### FREE * free_parameter(param) * free_and_destroy_model(&model) # <<<<<<<<<<<<<< @@ -2473,7 +2511,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_decision_function_wrap(PyObje */ free_and_destroy_model((&__pyx_v_model)); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":198 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":198 * free_parameter(param) * free_and_destroy_model(&model) * return dec_values # <<<<<<<<<<<<<< @@ -2488,7 +2526,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_decision_function_wrap(PyObje __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); @@ -2502,7 +2540,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_decision_function_wrap(PyObje __Pyx_SafeReleaseBuffer(&__pyx_bstruct_coef_); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_T); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("sklearn.svm.liblinear.decision_function_wrap"); + __Pyx_AddTraceback("scikits.learn.svm.liblinear.decision_function_wrap"); __pyx_r = NULL; goto __pyx_L2; __pyx_L0:; @@ -2514,12 +2552,18 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_decision_function_wrap(PyObje __Pyx_SafeReleaseBuffer(&__pyx_bstruct_T); __pyx_L2:; __Pyx_DECREF((PyObject *)__pyx_v_dec_values); + __Pyx_DECREF(__pyx_v_n_class); + __Pyx_DECREF((PyObject *)__pyx_v_T); + __Pyx_DECREF((PyObject *)__pyx_v_coef_); + __Pyx_DECREF((PyObject *)__pyx_v_weight_label); + __Pyx_DECREF((PyObject *)__pyx_v_weight); + __Pyx_DECREF((PyObject *)__pyx_v_label); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":202 +/* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":202 * * * def csr_decision_function_wrap( # <<<<<<<<<<<<<< @@ -2527,9 +2571,9 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_decision_function_wrap(PyObje * np.ndarray[np.float64_t, ndim=1, mode='c'] T_values, */ -static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_decision_function_wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_7sklearn_3svm_9liblinear_csr_decision_function_wrap[] = "\n Predict from model\n\n Test data given in CSR format\n "; -static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_decision_function_wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_decision_function_wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_7scikits_5learn_3svm_9liblinear_csr_decision_function_wrap[] = "\n Predict from model\n\n Test data given in CSR format\n "; +static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_decision_function_wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_v_n_features; PyArrayObject *__pyx_v_T_values = 0; PyArrayObject *__pyx_v_T_indices = 0; @@ -2545,7 +2589,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_decision_function_wrap(Py PyArrayObject *__pyx_v_dec_values; struct parameter *__pyx_v_param; struct model *__pyx_v_model; - long __pyx_v_n_class; + PyObject *__pyx_v_n_class; Py_buffer __pyx_bstruct_weight_label; Py_ssize_t __pyx_bstride_0_weight_label = 0; Py_ssize_t __pyx_bshape_0_weight_label = 0; @@ -2575,8 +2619,8 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_decision_function_wrap(Py Py_ssize_t __pyx_bstride_0_label = 0; Py_ssize_t __pyx_bshape_0_label = 0; PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; @@ -2715,11 +2759,18 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_decision_function_wrap(Py __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("csr_decision_function_wrap", 1, 12, 12, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("sklearn.svm.liblinear.csr_decision_function_wrap"); - __Pyx_RefNannyFinishContext(); + __Pyx_AddTraceback("scikits.learn.svm.liblinear.csr_decision_function_wrap"); return NULL; __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF((PyObject *)__pyx_v_T_values); + __Pyx_INCREF((PyObject *)__pyx_v_T_indices); + __Pyx_INCREF((PyObject *)__pyx_v_T_indptr); + __Pyx_INCREF((PyObject *)__pyx_v_coef_); + __Pyx_INCREF((PyObject *)__pyx_v_weight_label); + __Pyx_INCREF((PyObject *)__pyx_v_weight); + __Pyx_INCREF((PyObject *)__pyx_v_label); __pyx_v_dec_values = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_n_class = Py_None; __Pyx_INCREF(Py_None); __pyx_bstruct_dec_values.buf = NULL; __pyx_bstruct_T_values.buf = NULL; __pyx_bstruct_T_indices.buf = NULL; @@ -2778,7 +2829,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_decision_function_wrap(Py __pyx_bstride_0_label = __pyx_bstruct_label.strides[0]; __pyx_bshape_0_label = __pyx_bstruct_label.shape[0]; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":224 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":224 * * param = set_parameter( * solver_type, eps, C, weight.shape[0], weight_label.data, weight.data) # <<<<<<<<<<<<<< @@ -2787,7 +2838,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_decision_function_wrap(Py */ __pyx_v_param = set_parameter(__pyx_v_solver_type, __pyx_v_eps, __pyx_v_C, (__pyx_v_weight->dimensions[0]), __pyx_v_weight_label->data, __pyx_v_weight->data); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":226 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":226 * solver_type, eps, C, weight.shape[0], weight_label.data, weight.data) * * model = set_model(param, coef_.data, coef_.shape, label.data, bias) # <<<<<<<<<<<<<< @@ -2796,72 +2847,79 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_decision_function_wrap(Py */ __pyx_v_model = set_model(__pyx_v_param, __pyx_v_coef_->data, __pyx_v_coef_->dimensions, __pyx_v_label->data, __pyx_v_bias); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":228 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":228 * model = set_model(param, coef_.data, coef_.shape, label.data, bias) * * n_class = label.shape[0] # <<<<<<<<<<<<<< * if n_class <= 2: n_class = 1 * */ - __pyx_v_n_class = (__pyx_v_label->dimensions[0]); + __pyx_t_1 = __Pyx_PyInt_to_py_npy_intp((__pyx_v_label->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_v_n_class); + __pyx_v_n_class = __pyx_t_1; + __pyx_t_1 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":229 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":229 * * n_class = label.shape[0] * if n_class <= 2: n_class = 1 # <<<<<<<<<<<<<< * * dec_values = np.empty((T_indptr.shape[0] - 1, n_class), dtype=np.float64) */ - __pyx_t_1 = (__pyx_v_n_class <= 2); - if (__pyx_t_1) { - __pyx_v_n_class = 1; + __pyx_t_1 = PyObject_RichCompare(__pyx_v_n_class, __pyx_int_2, Py_LE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + __Pyx_INCREF(__pyx_int_1); + __Pyx_DECREF(__pyx_v_n_class); + __pyx_v_n_class = __pyx_int_1; goto __pyx_L6; } __pyx_L6:; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":231 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":231 * if n_class <= 2: n_class = 1 * * dec_values = np.empty((T_indptr.shape[0] - 1, n_class), dtype=np.float64) # <<<<<<<<<<<<<< * * if csr_copy_predict_values( */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyInt_FromLong(((__pyx_v_T_indptr->dimensions[0]) - 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyInt_FromLong(__pyx_v_n_class); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromLong(((__pyx_v_T_indptr->dimensions[0]) - 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_n_class); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_n_class); + __Pyx_GIVEREF(__pyx_v_n_class); + __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_2 = 0; __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __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 = 0; - __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_3, __pyx_t_1, ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); { @@ -2886,17 +2944,18 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_decision_function_wrap(Py __pyx_v_dec_values = ((PyArrayObject *)__pyx_t_6); __pyx_t_6 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":236 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":236 * n_features, T_values.shape, T_values.data, T_indices.shape, * T_indices.data, T_indptr.shape, T_indptr.data, model, * dec_values.data, n_class) < 0: # <<<<<<<<<<<<<< * raise MemoryError("We've run out of of memory") * */ - __pyx_t_1 = (csr_copy_predict_values(__pyx_v_n_features, __pyx_v_T_values->dimensions, __pyx_v_T_values->data, __pyx_v_T_indices->dimensions, __pyx_v_T_indices->data, __pyx_v_T_indptr->dimensions, __pyx_v_T_indptr->data, __pyx_v_model, __pyx_v_dec_values->data, __pyx_v_n_class) < 0); - if (__pyx_t_1) { + __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_v_n_class); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = (csr_copy_predict_values(__pyx_v_n_features, __pyx_v_T_values->dimensions, __pyx_v_T_values->data, __pyx_v_T_indices->dimensions, __pyx_v_T_indices->data, __pyx_v_T_indptr->dimensions, __pyx_v_T_indptr->data, __pyx_v_model, __pyx_v_dec_values->data, __pyx_t_8) < 0); + if (__pyx_t_2) { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":237 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":237 * T_indices.data, T_indptr.shape, T_indptr.data, model, * dec_values.data, n_class) < 0: * raise MemoryError("We've run out of of memory") # <<<<<<<<<<<<<< @@ -2908,17 +2967,17 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_decision_function_wrap(Py __Pyx_INCREF(((PyObject *)__pyx_kp_s_1)); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_kp_s_1)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L7; } __pyx_L7:; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":240 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":240 * * ### FREE * free_parameter(param) # <<<<<<<<<<<<<< @@ -2927,7 +2986,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_decision_function_wrap(Py */ free_parameter(__pyx_v_param); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":241 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":241 * ### FREE * free_parameter(param) * free_and_destroy_model(&model) # <<<<<<<<<<<<<< @@ -2936,7 +2995,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_decision_function_wrap(Py */ free_and_destroy_model((&__pyx_v_model)); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":242 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":242 * free_parameter(param) * free_and_destroy_model(&model) * return dec_values # <<<<<<<<<<<<<< @@ -2951,7 +3010,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_decision_function_wrap(Py __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); @@ -2967,7 +3026,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_decision_function_wrap(Py __Pyx_SafeReleaseBuffer(&__pyx_bstruct_dec_values); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_label); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("sklearn.svm.liblinear.csr_decision_function_wrap"); + __Pyx_AddTraceback("scikits.learn.svm.liblinear.csr_decision_function_wrap"); __pyx_r = NULL; goto __pyx_L2; __pyx_L0:; @@ -2981,12 +3040,20 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_decision_function_wrap(Py __Pyx_SafeReleaseBuffer(&__pyx_bstruct_label); __pyx_L2:; __Pyx_DECREF((PyObject *)__pyx_v_dec_values); + __Pyx_DECREF(__pyx_v_n_class); + __Pyx_DECREF((PyObject *)__pyx_v_T_values); + __Pyx_DECREF((PyObject *)__pyx_v_T_indices); + __Pyx_DECREF((PyObject *)__pyx_v_T_indptr); + __Pyx_DECREF((PyObject *)__pyx_v_coef_); + __Pyx_DECREF((PyObject *)__pyx_v_weight_label); + __Pyx_DECREF((PyObject *)__pyx_v_weight); + __Pyx_DECREF((PyObject *)__pyx_v_label); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":245 +/* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":245 * * * def predict_wrap( # <<<<<<<<<<<<<< @@ -2994,8 +3061,8 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_decision_function_wrap(Py * np.ndarray[np.float64_t, ndim=2, mode='fortran'] coef_, */ -static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_predict_wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_predict_wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_predict_wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_predict_wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyArrayObject *__pyx_v_T = 0; PyArrayObject *__pyx_v_coef_ = 0; int __pyx_v_solver_type; @@ -3144,10 +3211,14 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_predict_wrap(PyObject *__pyx_ __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("predict_wrap", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("sklearn.svm.liblinear.predict_wrap"); - __Pyx_RefNannyFinishContext(); + __Pyx_AddTraceback("scikits.learn.svm.liblinear.predict_wrap"); return NULL; __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF((PyObject *)__pyx_v_T); + __Pyx_INCREF((PyObject *)__pyx_v_coef_); + __Pyx_INCREF((PyObject *)__pyx_v_weight_label); + __Pyx_INCREF((PyObject *)__pyx_v_weight); + __Pyx_INCREF((PyObject *)__pyx_v_label); __pyx_v_dec_values = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_dec_values.buf = NULL; __pyx_bstruct_T.buf = NULL; @@ -3191,7 +3262,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_predict_wrap(PyObject *__pyx_ __pyx_bstride_0_label = __pyx_bstruct_label.strides[0]; __pyx_bshape_0_label = __pyx_bstruct_label.shape[0]; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":258 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":258 * cdef model *model * * param = set_parameter(solver_type, eps, C, weight.shape[0], weight_label.data, weight.data) # <<<<<<<<<<<<<< @@ -3200,7 +3271,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_predict_wrap(PyObject *__pyx_ */ __pyx_v_param = set_parameter(__pyx_v_solver_type, __pyx_v_eps, __pyx_v_C, (__pyx_v_weight->dimensions[0]), __pyx_v_weight_label->data, __pyx_v_weight->data); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":260 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":260 * param = set_parameter(solver_type, eps, C, weight.shape[0], weight_label.data, weight.data) * * model = set_model(param, coef_.data, coef_.shape, label.data, bias) # <<<<<<<<<<<<<< @@ -3209,7 +3280,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_predict_wrap(PyObject *__pyx_ */ __pyx_v_model = set_model(__pyx_v_param, __pyx_v_coef_->data, __pyx_v_coef_->dimensions, __pyx_v_label->data, __pyx_v_bias); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":262 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":262 * model = set_model(param, coef_.data, coef_.shape, label.data, bias) * * dec_values = np.empty(T.shape[0], dtype=np.int32) # <<<<<<<<<<<<<< @@ -3221,7 +3292,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_predict_wrap(PyObject *__pyx_ __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_to_py_Py_intptr_t((__pyx_v_T->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_to_py_npy_intp((__pyx_v_T->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); @@ -3266,7 +3337,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_predict_wrap(PyObject *__pyx_ __pyx_v_dec_values = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":263 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":263 * * dec_values = np.empty(T.shape[0], dtype=np.int32) * if copy_predict(T.data, model, T.shape, dec_values.data) < 0: # <<<<<<<<<<<<<< @@ -3276,7 +3347,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_predict_wrap(PyObject *__pyx_ __pyx_t_11 = (copy_predict(__pyx_v_T->data, __pyx_v_model, __pyx_v_T->dimensions, __pyx_v_dec_values->data) < 0); if (__pyx_t_11) { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":264 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":264 * dec_values = np.empty(T.shape[0], dtype=np.int32) * if copy_predict(T.data, model, T.shape, dec_values.data) < 0: * raise MemoryError("We've run out of of memory") # <<<<<<<<<<<<<< @@ -3298,7 +3369,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_predict_wrap(PyObject *__pyx_ } __pyx_L6:; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":267 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":267 * * ### FREE * free_parameter(param) # <<<<<<<<<<<<<< @@ -3307,7 +3378,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_predict_wrap(PyObject *__pyx_ */ free_parameter(__pyx_v_param); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":268 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":268 * ### FREE * free_parameter(param) * free_and_destroy_model(&model) # <<<<<<<<<<<<<< @@ -3316,7 +3387,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_predict_wrap(PyObject *__pyx_ */ free_and_destroy_model((&__pyx_v_model)); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":269 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":269 * free_parameter(param) * free_and_destroy_model(&model) * return dec_values # <<<<<<<<<<<<<< @@ -3345,7 +3416,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_predict_wrap(PyObject *__pyx_ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_coef_); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_T); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("sklearn.svm.liblinear.predict_wrap"); + __Pyx_AddTraceback("scikits.learn.svm.liblinear.predict_wrap"); __pyx_r = NULL; goto __pyx_L2; __pyx_L0:; @@ -3357,12 +3428,17 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_predict_wrap(PyObject *__pyx_ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_T); __pyx_L2:; __Pyx_DECREF((PyObject *)__pyx_v_dec_values); + __Pyx_DECREF((PyObject *)__pyx_v_T); + __Pyx_DECREF((PyObject *)__pyx_v_coef_); + __Pyx_DECREF((PyObject *)__pyx_v_weight_label); + __Pyx_DECREF((PyObject *)__pyx_v_weight); + __Pyx_DECREF((PyObject *)__pyx_v_label); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":272 +/* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":272 * * * def csr_predict_wrap( # <<<<<<<<<<<<<< @@ -3370,9 +3446,9 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_predict_wrap(PyObject *__pyx_ * np.ndarray[np.float64_t, ndim=1, mode='c'] T_values, */ -static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_predict_wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_7sklearn_3svm_9liblinear_csr_predict_wrap[] = "\n Predict from model\n\n Test data given in CSR format\n "; -static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_predict_wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_predict_wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_7scikits_5learn_3svm_9liblinear_csr_predict_wrap[] = "\n Predict from model\n\n Test data given in CSR format\n "; +static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_predict_wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_v_n_features; PyArrayObject *__pyx_v_T_values = 0; PyArrayObject *__pyx_v_T_indices = 0; @@ -3555,10 +3631,16 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_predict_wrap(PyObject *__ __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("csr_predict_wrap", 1, 12, 12, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("sklearn.svm.liblinear.csr_predict_wrap"); - __Pyx_RefNannyFinishContext(); + __Pyx_AddTraceback("scikits.learn.svm.liblinear.csr_predict_wrap"); return NULL; __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF((PyObject *)__pyx_v_T_values); + __Pyx_INCREF((PyObject *)__pyx_v_T_indices); + __Pyx_INCREF((PyObject *)__pyx_v_T_indptr); + __Pyx_INCREF((PyObject *)__pyx_v_coef_); + __Pyx_INCREF((PyObject *)__pyx_v_weight_label); + __Pyx_INCREF((PyObject *)__pyx_v_weight); + __Pyx_INCREF((PyObject *)__pyx_v_label); __pyx_v_dec_values = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_dec_values.buf = NULL; __pyx_bstruct_T_values.buf = NULL; @@ -3618,7 +3700,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_predict_wrap(PyObject *__ __pyx_bstride_0_label = __pyx_bstruct_label.strides[0]; __pyx_bshape_0_label = __pyx_bstruct_label.shape[0]; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":293 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":293 * cdef model *model * * param = set_parameter(solver_type, eps, C, weight.shape[0], weight_label.data, weight.data) # <<<<<<<<<<<<<< @@ -3627,7 +3709,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_predict_wrap(PyObject *__ */ __pyx_v_param = set_parameter(__pyx_v_solver_type, __pyx_v_eps, __pyx_v_C, (__pyx_v_weight->dimensions[0]), __pyx_v_weight_label->data, __pyx_v_weight->data); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":295 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":295 * param = set_parameter(solver_type, eps, C, weight.shape[0], weight_label.data, weight.data) * * model = set_model(param, coef_.data, coef_.shape, label.data, bias) # <<<<<<<<<<<<<< @@ -3636,7 +3718,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_predict_wrap(PyObject *__ */ __pyx_v_model = set_model(__pyx_v_param, __pyx_v_coef_->data, __pyx_v_coef_->dimensions, __pyx_v_label->data, __pyx_v_bias); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":297 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":297 * model = set_model(param, coef_.data, coef_.shape, label.data, bias) * * dec_values = np.empty(T_indptr.shape[0] - 1, dtype=np.int32) # <<<<<<<<<<<<<< @@ -3693,7 +3775,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_predict_wrap(PyObject *__ __pyx_v_dec_values = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":301 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":301 * T_indices.shape, T_indices.data, * T_indptr.shape, T_indptr.data, * model, dec_values.data) < 0: # <<<<<<<<<<<<<< @@ -3703,7 +3785,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_predict_wrap(PyObject *__ __pyx_t_11 = (csr_copy_predict(__pyx_v_n_features, __pyx_v_T_values->dimensions, __pyx_v_T_values->data, __pyx_v_T_indices->dimensions, __pyx_v_T_indices->data, __pyx_v_T_indptr->dimensions, __pyx_v_T_indptr->data, __pyx_v_model, __pyx_v_dec_values->data) < 0); if (__pyx_t_11) { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":302 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":302 * T_indptr.shape, T_indptr.data, * model, dec_values.data) < 0: * raise MemoryError("We've run out of of memory") # <<<<<<<<<<<<<< @@ -3725,7 +3807,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_predict_wrap(PyObject *__ } __pyx_L6:; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":305 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":305 * * ### FREE * free_parameter(param) # <<<<<<<<<<<<<< @@ -3734,7 +3816,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_predict_wrap(PyObject *__ */ free_parameter(__pyx_v_param); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":306 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":306 * ### FREE * free_parameter(param) * free_and_destroy_model(&model) # <<<<<<<<<<<<<< @@ -3743,7 +3825,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_predict_wrap(PyObject *__ */ free_and_destroy_model((&__pyx_v_model)); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":307 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":307 * free_parameter(param) * free_and_destroy_model(&model) * return dec_values # <<<<<<<<<<<<<< @@ -3774,7 +3856,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_predict_wrap(PyObject *__ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_dec_values); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_label); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("sklearn.svm.liblinear.csr_predict_wrap"); + __Pyx_AddTraceback("scikits.learn.svm.liblinear.csr_predict_wrap"); __pyx_r = NULL; goto __pyx_L2; __pyx_L0:; @@ -3788,12 +3870,19 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_predict_wrap(PyObject *__ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_label); __pyx_L2:; __Pyx_DECREF((PyObject *)__pyx_v_dec_values); + __Pyx_DECREF((PyObject *)__pyx_v_T_values); + __Pyx_DECREF((PyObject *)__pyx_v_T_indices); + __Pyx_DECREF((PyObject *)__pyx_v_T_indptr); + __Pyx_DECREF((PyObject *)__pyx_v_coef_); + __Pyx_DECREF((PyObject *)__pyx_v_weight_label); + __Pyx_DECREF((PyObject *)__pyx_v_weight); + __Pyx_DECREF((PyObject *)__pyx_v_label); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":312 +/* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":312 * * * def predict_prob_wrap(np.ndarray[np.float64_t, ndim=2, mode='c'] T, # <<<<<<<<<<<<<< @@ -3801,9 +3890,9 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_predict_wrap(PyObject *__ * int solver_type, double eps, double C, */ -static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_predict_prob_wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_7sklearn_3svm_9liblinear_predict_prob_wrap[] = "\n Predict probabilities\n\n svm_model stores all parameters needed to predict a given value.\n\n For speed, all real work is done at the C level in function\n copy_predict (libsvm_helper.c).\n\n We have to reconstruct model and parameters to make sure we stay\n in sync with the python object. predict_wrap skips this step.\n\n Parameters\n ----------\n X: array-like, dtype=float\n Y: array\n target vector\n\n Optional Parameters\n -------------------\n See scikits.learn.svm.predict for a complete list of parameters.\n\n Return\n ------\n dec_values : array\n predicted values.\n "; -static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_predict_prob_wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_predict_prob_wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_7scikits_5learn_3svm_9liblinear_predict_prob_wrap[] = "\n Predict probabilities\n\n svm_model stores all parameters needed to predict a given value.\n\n For speed, all real work is done at the C level in function\n copy_predict (libsvm_helper.c).\n\n We have to reconstruct model and parameters to make sure we stay\n in sync with the python object. predict_wrap skips this step.\n\n Parameters\n ----------\n X: array-like, dtype=float\n Y: array\n target vector\n\n Optional Parameters\n -------------------\n See scikits.learn.svm.predict for a complete list of parameters.\n\n Return\n ------\n dec_values : array\n predicted values.\n "; +static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_predict_prob_wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyArrayObject *__pyx_v_T = 0; PyArrayObject *__pyx_v_coef_ = 0; int __pyx_v_solver_type; @@ -3955,10 +4044,14 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_predict_prob_wrap(PyObject *_ __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("predict_prob_wrap", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("sklearn.svm.liblinear.predict_prob_wrap"); - __Pyx_RefNannyFinishContext(); + __Pyx_AddTraceback("scikits.learn.svm.liblinear.predict_prob_wrap"); return NULL; __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF((PyObject *)__pyx_v_T); + __Pyx_INCREF((PyObject *)__pyx_v_coef_); + __Pyx_INCREF((PyObject *)__pyx_v_weight_label); + __Pyx_INCREF((PyObject *)__pyx_v_weight); + __Pyx_INCREF((PyObject *)__pyx_v_label); __pyx_v_dec_values = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_dec_values.buf = NULL; __pyx_bstruct_T.buf = NULL; @@ -4002,7 +4095,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_predict_prob_wrap(PyObject *_ __pyx_bstride_0_label = __pyx_bstruct_label.strides[0]; __pyx_bshape_0_label = __pyx_bstruct_label.shape[0]; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":349 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":349 * cdef model *model * * param = set_parameter(solver_type, eps, C, weight.shape[0], weight_label.data, weight.data) # <<<<<<<<<<<<<< @@ -4011,7 +4104,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_predict_prob_wrap(PyObject *_ */ __pyx_v_param = set_parameter(__pyx_v_solver_type, __pyx_v_eps, __pyx_v_C, (__pyx_v_weight->dimensions[0]), __pyx_v_weight_label->data, __pyx_v_weight->data); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":351 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":351 * param = set_parameter(solver_type, eps, C, weight.shape[0], weight_label.data, weight.data) * * model = set_model(param, coef_.data, coef_.shape, label.data, bias) # <<<<<<<<<<<<<< @@ -4020,7 +4113,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_predict_prob_wrap(PyObject *_ */ __pyx_v_model = set_model(__pyx_v_param, __pyx_v_coef_->data, __pyx_v_coef_->dimensions, __pyx_v_label->data, __pyx_v_bias); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":353 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":353 * model = set_model(param, coef_.data, coef_.shape, label.data, bias) * * cdef int nr_class = get_nr_class(model) # <<<<<<<<<<<<<< @@ -4029,7 +4122,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_predict_prob_wrap(PyObject *_ */ __pyx_v_nr_class = get_nr_class(__pyx_v_model); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":354 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":354 * * cdef int nr_class = get_nr_class(model) * dec_values = np.empty((T.shape[0], nr_class), dtype=np.float64) # <<<<<<<<<<<<<< @@ -4041,7 +4134,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_predict_prob_wrap(PyObject *_ __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_to_py_Py_intptr_t((__pyx_v_T->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_to_py_npy_intp((__pyx_v_T->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyInt_FromLong(__pyx_v_nr_class); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); @@ -4096,7 +4189,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_predict_prob_wrap(PyObject *_ __pyx_v_dec_values = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":355 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":355 * cdef int nr_class = get_nr_class(model) * dec_values = np.empty((T.shape[0], nr_class), dtype=np.float64) * if copy_prob_predict(T.data, model, T.shape, dec_values.data) < 0: # <<<<<<<<<<<<<< @@ -4106,7 +4199,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_predict_prob_wrap(PyObject *_ __pyx_t_11 = (copy_prob_predict(__pyx_v_T->data, __pyx_v_model, __pyx_v_T->dimensions, __pyx_v_dec_values->data) < 0); if (__pyx_t_11) { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":356 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":356 * dec_values = np.empty((T.shape[0], nr_class), dtype=np.float64) * if copy_prob_predict(T.data, model, T.shape, dec_values.data) < 0: * raise MemoryError("We've run out of of memory") # <<<<<<<<<<<<<< @@ -4128,7 +4221,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_predict_prob_wrap(PyObject *_ } __pyx_L6:; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":359 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":359 * * ### FREE * free_parameter(param) # <<<<<<<<<<<<<< @@ -4137,7 +4230,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_predict_prob_wrap(PyObject *_ */ free_parameter(__pyx_v_param); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":360 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":360 * ### FREE * free_parameter(param) * free_and_destroy_model(&model) # <<<<<<<<<<<<<< @@ -4146,7 +4239,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_predict_prob_wrap(PyObject *_ */ free_and_destroy_model((&__pyx_v_model)); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":362 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":362 * free_and_destroy_model(&model) * * return dec_values # <<<<<<<<<<<<<< @@ -4175,7 +4268,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_predict_prob_wrap(PyObject *_ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_coef_); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_T); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("sklearn.svm.liblinear.predict_prob_wrap"); + __Pyx_AddTraceback("scikits.learn.svm.liblinear.predict_prob_wrap"); __pyx_r = NULL; goto __pyx_L2; __pyx_L0:; @@ -4187,12 +4280,17 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_predict_prob_wrap(PyObject *_ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_T); __pyx_L2:; __Pyx_DECREF((PyObject *)__pyx_v_dec_values); + __Pyx_DECREF((PyObject *)__pyx_v_T); + __Pyx_DECREF((PyObject *)__pyx_v_coef_); + __Pyx_DECREF((PyObject *)__pyx_v_weight_label); + __Pyx_DECREF((PyObject *)__pyx_v_weight); + __Pyx_DECREF((PyObject *)__pyx_v_label); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":366 +/* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":366 * * * def csr_predict_prob( # <<<<<<<<<<<<<< @@ -4200,9 +4298,9 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_predict_prob_wrap(PyObject *_ * np.ndarray[np.float64_t, ndim=1, mode='c'] T_values, */ -static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_predict_prob(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_7sklearn_3svm_9liblinear_csr_predict_prob[] = "\n Predict probability from model\n\n Test data given in CSR format\n "; -static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_predict_prob(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_predict_prob(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_7scikits_5learn_3svm_9liblinear_csr_predict_prob[] = "\n Predict probability from model\n\n Test data given in CSR format\n "; +static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_predict_prob(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_v_n_features; PyArrayObject *__pyx_v_T_values = 0; PyArrayObject *__pyx_v_T_indices = 0; @@ -4388,10 +4486,16 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_predict_prob(PyObject *__ __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("csr_predict_prob", 1, 12, 12, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("sklearn.svm.liblinear.csr_predict_prob"); - __Pyx_RefNannyFinishContext(); + __Pyx_AddTraceback("scikits.learn.svm.liblinear.csr_predict_prob"); return NULL; __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF((PyObject *)__pyx_v_T_values); + __Pyx_INCREF((PyObject *)__pyx_v_T_indices); + __Pyx_INCREF((PyObject *)__pyx_v_T_indptr); + __Pyx_INCREF((PyObject *)__pyx_v_coef_); + __Pyx_INCREF((PyObject *)__pyx_v_weight_label); + __Pyx_INCREF((PyObject *)__pyx_v_weight); + __Pyx_INCREF((PyObject *)__pyx_v_label); __pyx_v_dec_values = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_dec_values.buf = NULL; __pyx_bstruct_T_values.buf = NULL; @@ -4451,7 +4555,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_predict_prob(PyObject *__ __pyx_bstride_0_label = __pyx_bstruct_label.strides[0]; __pyx_bshape_0_label = __pyx_bstruct_label.shape[0]; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":388 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":388 * * param = set_parameter(solver_type, eps, C, weight.shape[0], * weight_label.data, weight.data) # <<<<<<<<<<<<<< @@ -4460,7 +4564,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_predict_prob(PyObject *__ */ __pyx_v_param = set_parameter(__pyx_v_solver_type, __pyx_v_eps, __pyx_v_C, (__pyx_v_weight->dimensions[0]), __pyx_v_weight_label->data, __pyx_v_weight->data); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":390 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":390 * weight_label.data, weight.data) * * model = set_model(param, coef_.data, coef_.shape, label.data, bias) # <<<<<<<<<<<<<< @@ -4469,7 +4573,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_predict_prob(PyObject *__ */ __pyx_v_model = set_model(__pyx_v_param, __pyx_v_coef_->data, __pyx_v_coef_->dimensions, __pyx_v_label->data, __pyx_v_bias); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":391 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":391 * * model = set_model(param, coef_.data, coef_.shape, label.data, bias) * cdef int nr_class = get_nr_class(model) # <<<<<<<<<<<<<< @@ -4478,7 +4582,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_predict_prob(PyObject *__ */ __pyx_v_nr_class = get_nr_class(__pyx_v_model); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":392 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":392 * model = set_model(param, coef_.data, coef_.shape, label.data, bias) * cdef int nr_class = get_nr_class(model) * dec_values = np.empty((T_indptr.shape[0]-1, nr_class), dtype=np.float64) # <<<<<<<<<<<<<< @@ -4545,7 +4649,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_predict_prob(PyObject *__ __pyx_v_dec_values = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":397 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":397 * T_indices.shape, T_indices.data, * T_indptr.shape, T_indptr.data, * model, dec_values.data) < 0: # <<<<<<<<<<<<<< @@ -4555,7 +4659,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_predict_prob(PyObject *__ __pyx_t_11 = (csr_copy_predict_proba(__pyx_v_n_features, __pyx_v_T_values->dimensions, __pyx_v_T_values->data, __pyx_v_T_indices->dimensions, __pyx_v_T_indices->data, __pyx_v_T_indptr->dimensions, __pyx_v_T_indptr->data, __pyx_v_model, __pyx_v_dec_values->data) < 0); if (__pyx_t_11) { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":398 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":398 * T_indptr.shape, T_indptr.data, * model, dec_values.data) < 0: * raise MemoryError("We've run out of of memory") # <<<<<<<<<<<<<< @@ -4577,7 +4681,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_predict_prob(PyObject *__ } __pyx_L6:; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":401 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":401 * * ### FREE * free_parameter(param) # <<<<<<<<<<<<<< @@ -4586,7 +4690,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_predict_prob(PyObject *__ */ free_parameter(__pyx_v_param); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":402 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":402 * ### FREE * free_parameter(param) * free_and_destroy_model(&model) # <<<<<<<<<<<<<< @@ -4594,7 +4698,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_predict_prob(PyObject *__ */ free_and_destroy_model((&__pyx_v_model)); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":403 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":403 * free_parameter(param) * free_and_destroy_model(&model) * return dec_values # <<<<<<<<<<<<<< @@ -4623,7 +4727,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_predict_prob(PyObject *__ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_dec_values); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_label); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("sklearn.svm.liblinear.csr_predict_prob"); + __Pyx_AddTraceback("scikits.learn.svm.liblinear.csr_predict_prob"); __pyx_r = NULL; goto __pyx_L2; __pyx_L0:; @@ -4637,12 +4741,19 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_predict_prob(PyObject *__ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_label); __pyx_L2:; __Pyx_DECREF((PyObject *)__pyx_v_dec_values); + __Pyx_DECREF((PyObject *)__pyx_v_T_values); + __Pyx_DECREF((PyObject *)__pyx_v_T_indices); + __Pyx_DECREF((PyObject *)__pyx_v_T_indptr); + __Pyx_DECREF((PyObject *)__pyx_v_coef_); + __Pyx_DECREF((PyObject *)__pyx_v_weight_label); + __Pyx_DECREF((PyObject *)__pyx_v_weight); + __Pyx_DECREF((PyObject *)__pyx_v_label); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":188 +/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":187 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -4650,8 +4761,8 @@ static PyObject *__pyx_pf_7sklearn_3svm_9liblinear_csr_predict_prob(PyObject *__ * # requirements, and does not yet fullfill the PEP. */ -static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ -static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__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; @@ -4676,8 +4787,9 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ if (__pyx_v_info == NULL) return 0; __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(__pyx_v_info->obj); + __Pyx_INCREF((PyObject *)__pyx_v_self); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":194 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":193 * # of flags * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -4686,7 +4798,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_endian_detector = 1; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":195 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":194 * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -4695,7 +4807,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":197 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":196 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) * * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< @@ -4704,7 +4816,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_ndim = PyArray_NDIM(((PyArrayObject *)__pyx_v_self)); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":199 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":198 * ndim = PyArray_NDIM(self) * * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -4714,7 +4826,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); if (__pyx_t_1) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":200 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":199 * * if sizeof(npy_intp) != sizeof(Py_ssize_t): * copy_shape = 1 # <<<<<<<<<<<<<< @@ -4726,7 +4838,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } /*else*/ { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":202 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":201 * copy_shape = 1 * else: * copy_shape = 0 # <<<<<<<<<<<<<< @@ -4737,7 +4849,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } __pyx_L5:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":204 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":203 * copy_shape = 0 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -4747,7 +4859,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ __pyx_t_1 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS); if (__pyx_t_1) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":205 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":204 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -4761,29 +4873,29 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } if (__pyx_t_3) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":206 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":205 * 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_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_kp_u_2)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_u_2)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_2)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":208 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":207 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -4793,7 +4905,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ __pyx_t_3 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS); if (__pyx_t_3) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":209 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":208 * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -4807,29 +4919,29 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } if (__pyx_t_2) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":210 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":209 * 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_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_kp_u_3)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_u_3)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_3)); - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L7; } __pyx_L7:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":212 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":211 * raise ValueError(u"ndarray is not Fortran contiguous") * * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< @@ -4838,7 +4950,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->buf = PyArray_DATA(((PyArrayObject *)__pyx_v_self)); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":213 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":212 * * info.buf = PyArray_DATA(self) * info.ndim = ndim # <<<<<<<<<<<<<< @@ -4847,16 +4959,17 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->ndim = __pyx_v_ndim; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":214 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":213 * 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. */ - if (__pyx_v_copy_shape) { + __pyx_t_6 = __pyx_v_copy_shape; + if (__pyx_t_6) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":217 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":216 * # Allocate new buffer for strides and shape info. This is allocated * # as one block, strides first. * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< @@ -4865,7 +4978,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * __pyx_v_ndim) * 2))); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":218 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":217 * # as one block, strides first. * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) * info.shape = info.strides + ndim # <<<<<<<<<<<<<< @@ -4874,7 +4987,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":219 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":218 * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) * info.shape = info.strides + ndim * for i in range(ndim): # <<<<<<<<<<<<<< @@ -4885,7 +4998,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":220 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":219 * info.shape = info.strides + ndim * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< @@ -4894,7 +5007,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":221 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":220 * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< @@ -4907,7 +5020,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } /*else*/ { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":223 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":222 * info.shape[i] = PyArray_DIMS(self)[i] * else: * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) # <<<<<<<<<<<<<< @@ -4916,7 +5029,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(((PyArrayObject *)__pyx_v_self))); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":224 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":223 * else: * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) * info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<< @@ -4927,7 +5040,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } __pyx_L8:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":225 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":224 * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) * info.shape = <Py_ssize_t*>PyArray_DIMS(self) * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -4936,7 +5049,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->suboffsets = NULL; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":226 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":225 * info.shape = <Py_ssize_t*>PyArray_DIMS(self) * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< @@ -4945,7 +5058,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->itemsize = PyArray_ITEMSIZE(((PyArrayObject *)__pyx_v_self)); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":227 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":226 * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< @@ -4954,7 +5067,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->readonly = (!PyArray_ISWRITEABLE(((PyArrayObject *)__pyx_v_self))); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":230 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":229 * * cdef int t * cdef char* f = NULL # <<<<<<<<<<<<<< @@ -4963,7 +5076,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_f = NULL; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":231 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":230 * cdef int t * cdef char* f = NULL * cdef dtype descr = self.descr # <<<<<<<<<<<<<< @@ -4973,7 +5086,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_self)->descr)); __pyx_v_descr = ((PyArrayObject *)__pyx_v_self)->descr; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":235 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":234 * cdef int offset * * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< @@ -4982,7 +5095,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":237 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":236 * cdef bint hasfields = PyDataType_HASFIELDS(descr) * * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< @@ -4998,7 +5111,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } if (__pyx_t_1) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":239 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":238 * if not hasfields and not copy_shape: * # do not call releasebuffer * info.obj = None # <<<<<<<<<<<<<< @@ -5014,7 +5127,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } /*else*/ { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":242 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":241 * else: * # need to call releasebuffer * info.obj = self # <<<<<<<<<<<<<< @@ -5029,7 +5142,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } __pyx_L11:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":244 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":243 * info.obj = self * * if not hasfields: # <<<<<<<<<<<<<< @@ -5039,7 +5152,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ __pyx_t_1 = (!__pyx_v_hasfields); if (__pyx_t_1) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":245 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":244 * * if not hasfields: * t = descr.type_num # <<<<<<<<<<<<<< @@ -5048,7 +5161,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_t = __pyx_v_descr->type_num; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":246 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":245 * if not hasfields: * t = descr.type_num * if ((descr.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< @@ -5063,7 +5176,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } if (!__pyx_t_2) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":247 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":246 * t = descr.type_num * if ((descr.byteorder == '>' and little_endian) or * (descr.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< @@ -5083,29 +5196,29 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } if (__pyx_t_1) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":248 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":247 * if ((descr.byteorder == '>' and little_endian) or * (descr.byteorder == '<' 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_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_kp_u_4)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_u_4)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_4)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L13; } __pyx_L13:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":249 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":248 * (descr.byteorder == '<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< @@ -5118,7 +5231,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":250 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":249 * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< @@ -5131,7 +5244,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":251 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":250 * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< @@ -5144,7 +5257,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":252 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":251 * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< @@ -5157,7 +5270,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":253 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":252 * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< @@ -5170,7 +5283,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":254 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":253 * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< @@ -5183,7 +5296,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":255 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":254 * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< @@ -5196,7 +5309,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":256 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":255 * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< @@ -5209,7 +5322,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":257 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":256 * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< @@ -5222,7 +5335,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":258 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":257 * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< @@ -5235,7 +5348,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":259 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":258 * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< @@ -5248,7 +5361,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":260 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":259 * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< @@ -5261,7 +5374,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":261 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":260 * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< @@ -5274,7 +5387,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":262 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":261 * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< @@ -5287,7 +5400,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":263 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":262 * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< @@ -5300,7 +5413,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":264 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":263 * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< @@ -5313,7 +5426,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":265 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":264 * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< @@ -5327,33 +5440,33 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } /*else*/ { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":267 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":266 * elif t == NPY_OBJECT: f = "O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< * info.format = f * return */ - __pyx_t_5 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_5), __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_5), __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_4)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L14:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":268 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":267 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f # <<<<<<<<<<<<<< @@ -5362,7 +5475,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->format = __pyx_v_f; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":269 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":268 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f * return # <<<<<<<<<<<<<< @@ -5375,7 +5488,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } /*else*/ { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":271 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":270 * return * else: * info.format = <char*>stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< @@ -5384,7 +5497,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->format = ((char *)malloc(255)); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":272 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":271 * else: * info.format = <char*>stdlib.malloc(_buffer_format_string_len) * info.format[0] = '^' # Native data types, manual alignment # <<<<<<<<<<<<<< @@ -5393,7 +5506,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ (__pyx_v_info->format[0]) = '^'; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":273 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":272 * info.format = <char*>stdlib.malloc(_buffer_format_string_len) * info.format[0] = '^' # Native data types, manual alignment * offset = 0 # <<<<<<<<<<<<<< @@ -5402,17 +5515,17 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_offset = 0; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":276 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":275 * f = _util_dtypestring(descr, info.format + 1, * info.format + _buffer_format_string_len, * &offset) # <<<<<<<<<<<<<< * f[0] = 0 # Terminate format string * */ - __pyx_t_9 = __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_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __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_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_f = __pyx_t_9; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":277 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":276 * info.format + _buffer_format_string_len, * &offset) * f[0] = 0 # Terminate format string # <<<<<<<<<<<<<< @@ -5440,11 +5553,12 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } __pyx_L2:; __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":279 +/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":278 * f[0] = 0 # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -5452,12 +5566,13 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ * stdlib.free(info.format) */ -static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ -static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { +static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ +static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { int __pyx_t_1; __Pyx_RefNannySetupContext("__releasebuffer__"); + __Pyx_INCREF((PyObject *)__pyx_v_self); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":280 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":279 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -5467,7 +5582,7 @@ static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *_ __pyx_t_1 = PyArray_HASFIELDS(((PyArrayObject *)__pyx_v_self)); if (__pyx_t_1) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":281 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":280 * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): * stdlib.free(info.format) # <<<<<<<<<<<<<< @@ -5479,7 +5594,7 @@ static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *_ } __pyx_L5:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":282 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":281 * if PyArray_HASFIELDS(self): * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -5489,7 +5604,7 @@ static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *_ __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); if (__pyx_t_1) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":283 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":282 * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): * stdlib.free(info.strides) # <<<<<<<<<<<<<< @@ -5501,10 +5616,11 @@ static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *_ } __pyx_L6:; + __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_RefNannyFinishContext(); } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":756 +/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":755 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -5517,7 +5633,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1"); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":757 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":756 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<< @@ -5525,7 +5641,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ * 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 = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -5543,7 +5659,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":759 +/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":758 * return PyArray_MultiIterNew(1, <void*>a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -5556,7 +5672,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2"); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":760 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":759 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<< @@ -5564,7 +5680,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ * 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 = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -5582,7 +5698,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":762 +/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":761 * return PyArray_MultiIterNew(2, <void*>a, <void*>b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -5595,7 +5711,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3"); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":763 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":762 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<< @@ -5603,7 +5719,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ * 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 = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -5621,7 +5737,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":765 +/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":764 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -5634,7 +5750,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4"); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":766 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":765 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<< @@ -5642,7 +5758,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ * 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 = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -5660,7 +5776,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":768 +/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":767 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -5673,7 +5789,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5"); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":769 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":768 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<< @@ -5681,7 +5797,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ * 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 = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -5699,7 +5815,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":771 +/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":770 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -5727,13 +5843,14 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx int __pyx_t_9; char *__pyx_t_10; __Pyx_RefNannySetupContext("_util_dtypestring"); + __Pyx_INCREF((PyObject *)__pyx_v_descr); __pyx_v_child = ((PyArray_Descr *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_fields = ((PyObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_childname = Py_None; __Pyx_INCREF(Py_None); __pyx_v_new_offset = Py_None; __Pyx_INCREF(Py_None); __pyx_v_t = Py_None; __Pyx_INCREF(Py_None); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":778 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":777 * cdef int delta_offset * cdef tuple i * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -5742,7 +5859,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_endian_detector = 1; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":779 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":778 * cdef tuple i * cdef int endian_detector = 1 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -5751,7 +5868,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":782 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":781 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -5761,7 +5878,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx if (likely(((PyObject *)__pyx_v_descr->names) != Py_None)) { __pyx_t_1 = 0; __pyx_t_2 = ((PyObject *)__pyx_v_descr->names); __Pyx_INCREF(__pyx_t_2); } else { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } for (;;) { if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break; @@ -5770,21 +5887,21 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_v_childname = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":783 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":782 * * for childname in descr.names: * fields = descr.fields[childname] # <<<<<<<<<<<<<< * child, new_offset = fields * */ - __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (!__pyx_t_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (!__pyx_t_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_fields)); __pyx_v_fields = ((PyObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":784 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":783 * for childname in descr.names: * fields = descr.fields[childname] * child, new_offset = fields # <<<<<<<<<<<<<< @@ -5794,7 +5911,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx if (likely(((PyObject *)__pyx_v_fields) != Py_None) && likely(PyTuple_GET_SIZE(((PyObject *)__pyx_v_fields)) == 2)) { PyObject* tuple = ((PyObject *)__pyx_v_fields); __pyx_t_3 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_4); __Pyx_DECREF(((PyObject *)__pyx_v_child)); __pyx_v_child = ((PyArray_Descr *)__pyx_t_3); @@ -5804,57 +5921,57 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_4 = 0; } else { __Pyx_UnpackTupleError(((PyObject *)__pyx_v_fields), 2); - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":786 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":785 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * */ - __pyx_t_4 = PyInt_FromLong((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":787 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":786 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< * * if ((child.byteorder == '>' and little_endian) or */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_kp_u_6)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_u_6)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_6)); - __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L5; } __pyx_L5:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":789 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":788 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< @@ -5869,7 +5986,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } if (!__pyx_t_7) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":790 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":789 * * if ((child.byteorder == '>' and little_endian) or * (child.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< @@ -5889,29 +6006,29 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } if (__pyx_t_6) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":791 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":790 * if ((child.byteorder == '>' and little_endian) or * (child.byteorder == '<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_kp_u_4)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_u_4)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_4)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":801 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":800 * * # Output padding bytes * while offset[0] < new_offset: # <<<<<<<<<<<<<< @@ -5919,16 +6036,16 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx * f += 1 */ while (1) { - __pyx_t_5 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_6) break; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":802 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":801 * # Output padding bytes * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< @@ -5937,7 +6054,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ (__pyx_v_f[0]) = 120; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":803 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":802 * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte * f += 1 # <<<<<<<<<<<<<< @@ -5946,7 +6063,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f += 1; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":804 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":803 * f[0] = 120 # "x"; pad byte * f += 1 * offset[0] += 1 # <<<<<<<<<<<<<< @@ -5956,7 +6073,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx (__pyx_v_offset[0]) += 1; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":806 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":805 * offset[0] += 1 * * offset[0] += child.itemsize # <<<<<<<<<<<<<< @@ -5965,7 +6082,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ (__pyx_v_offset[0]) += __pyx_v_child->elsize; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":808 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":807 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -5975,20 +6092,20 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = (!PyDataType_HASFIELDS(__pyx_v_child)); if (__pyx_t_6) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":809 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":808 * * if not PyDataType_HASFIELDS(child): * t = child.type_num # <<<<<<<<<<<<<< * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") */ - __pyx_t_3 = PyInt_FromLong(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_v_t); __pyx_v_t = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":810 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":809 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -5998,288 +6115,288 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = ((__pyx_v_end - __pyx_v_f) < 5); if (__pyx_t_6) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":811 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":810 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_kp_u_7)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_u_7)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_7)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L10; } __pyx_L10:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":814 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":813 * * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" */ - __pyx_t_5 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 98; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":815 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":814 * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" */ - __pyx_t_3 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 66; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":816 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":815 * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" */ - __pyx_t_5 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 104; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":817 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":816 * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" */ - __pyx_t_3 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 72; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":818 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":817 * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" */ - __pyx_t_5 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 105; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":819 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":818 * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" */ - __pyx_t_3 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 73; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":820 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":819 * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" */ - __pyx_t_5 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 108; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":821 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":820 * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" */ - __pyx_t_3 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 76; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":822 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":821 * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" */ - __pyx_t_5 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 113; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":823 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":822 * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" */ - __pyx_t_3 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 81; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":824 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":823 * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" */ - __pyx_t_5 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 102; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":825 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":824 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf */ - __pyx_t_3 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 100; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":826 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":825 * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd */ - __pyx_t_5 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 103; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":827 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":826 * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg */ - __pyx_t_3 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -6288,19 +6405,19 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":828 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":827 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg * elif t == NPY_OBJECT: f[0] = 79 #"O" */ - __pyx_t_5 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -6309,19 +6426,19 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":829 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":828 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: */ - __pyx_t_3 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -6330,19 +6447,19 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":830 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":829 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) */ - __pyx_t_5 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 79; @@ -6350,30 +6467,30 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } /*else*/ { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":832 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":831 * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< * f += 1 * else: */ - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_5), __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_5), __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L11:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":833 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":832 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * f += 1 # <<<<<<<<<<<<<< @@ -6385,21 +6502,21 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } /*else*/ { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":837 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":836 * # Cython ignores struct boundary information ("T{...}"), * # so don't output it * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< * return f * */ - __pyx_t_10 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_f = __pyx_t_10; } __pyx_L9:; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":838 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":837 * # so don't output it * f = _util_dtypestring(child, f, end, offset) * return f # <<<<<<<<<<<<<< @@ -6424,11 +6541,12 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_v_childname); __Pyx_DECREF(__pyx_v_new_offset); __Pyx_DECREF(__pyx_v_t); + __Pyx_DECREF((PyObject *)__pyx_v_descr); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":953 +/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":952 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -6440,8 +6558,10 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a PyObject *__pyx_v_baseptr; int __pyx_t_1; __Pyx_RefNannySetupContext("set_array_base"); + __Pyx_INCREF((PyObject *)__pyx_v_arr); + __Pyx_INCREF(__pyx_v_base); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":955 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":954 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -6451,7 +6571,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __pyx_t_1 = (__pyx_v_base == Py_None); if (__pyx_t_1) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":956 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":955 * cdef PyObject* baseptr * if base is None: * baseptr = NULL # <<<<<<<<<<<<<< @@ -6463,7 +6583,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } /*else*/ { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":958 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":957 * baseptr = NULL * else: * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< @@ -6472,7 +6592,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_INCREF(__pyx_v_base); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":959 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":958 * else: * Py_INCREF(base) # important to do this before decref below! * baseptr = <PyObject*>base # <<<<<<<<<<<<<< @@ -6483,7 +6603,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } __pyx_L3:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":960 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":959 * Py_INCREF(base) # important to do this before decref below! * baseptr = <PyObject*>base * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< @@ -6492,7 +6612,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_XDECREF(__pyx_v_arr->base); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":961 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":960 * baseptr = <PyObject*>base * Py_XDECREF(arr.base) * arr.base = baseptr # <<<<<<<<<<<<<< @@ -6501,10 +6621,12 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ __pyx_v_arr->base = __pyx_v_baseptr; + __Pyx_DECREF((PyObject *)__pyx_v_arr); + __Pyx_DECREF(__pyx_v_base); __Pyx_RefNannyFinishContext(); } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":963 +/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":962 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -6516,8 +6638,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py PyObject *__pyx_r = NULL; int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base"); + __Pyx_INCREF((PyObject *)__pyx_v_arr); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":964 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":963 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -6527,7 +6650,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_t_1 = (__pyx_v_arr->base == NULL); if (__pyx_t_1) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":965 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":964 * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: * return None # <<<<<<<<<<<<<< @@ -6542,7 +6665,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py } /*else*/ { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":967 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":966 * return None * else: * return <object>arr.base # <<<<<<<<<<<<<< @@ -6556,23 +6679,26 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = Py_None; __Pyx_INCREF(Py_None); __pyx_L0:; + __Pyx_DECREF((PyObject *)__pyx_v_arr); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyMethodDef __pyx_methods[] = { - {__Pyx_NAMESTR("train_wrap"), (PyCFunction)__pyx_pf_7sklearn_3svm_9liblinear_train_wrap, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7sklearn_3svm_9liblinear_train_wrap)}, - {__Pyx_NAMESTR("csr_train_wrap"), (PyCFunction)__pyx_pf_7sklearn_3svm_9liblinear_csr_train_wrap, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7sklearn_3svm_9liblinear_csr_train_wrap)}, - {__Pyx_NAMESTR("decision_function_wrap"), (PyCFunction)__pyx_pf_7sklearn_3svm_9liblinear_decision_function_wrap, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("csr_decision_function_wrap"), (PyCFunction)__pyx_pf_7sklearn_3svm_9liblinear_csr_decision_function_wrap, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7sklearn_3svm_9liblinear_csr_decision_function_wrap)}, - {__Pyx_NAMESTR("predict_wrap"), (PyCFunction)__pyx_pf_7sklearn_3svm_9liblinear_predict_wrap, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("csr_predict_wrap"), (PyCFunction)__pyx_pf_7sklearn_3svm_9liblinear_csr_predict_wrap, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7sklearn_3svm_9liblinear_csr_predict_wrap)}, - {__Pyx_NAMESTR("predict_prob_wrap"), (PyCFunction)__pyx_pf_7sklearn_3svm_9liblinear_predict_prob_wrap, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7sklearn_3svm_9liblinear_predict_prob_wrap)}, - {__Pyx_NAMESTR("csr_predict_prob"), (PyCFunction)__pyx_pf_7sklearn_3svm_9liblinear_csr_predict_prob, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7sklearn_3svm_9liblinear_csr_predict_prob)}, +static struct PyMethodDef __pyx_methods[] = { + {__Pyx_NAMESTR("train_wrap"), (PyCFunction)__pyx_pf_7scikits_5learn_3svm_9liblinear_train_wrap, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7scikits_5learn_3svm_9liblinear_train_wrap)}, + {__Pyx_NAMESTR("csr_train_wrap"), (PyCFunction)__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_train_wrap, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7scikits_5learn_3svm_9liblinear_csr_train_wrap)}, + {__Pyx_NAMESTR("decision_function_wrap"), (PyCFunction)__pyx_pf_7scikits_5learn_3svm_9liblinear_decision_function_wrap, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("csr_decision_function_wrap"), (PyCFunction)__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_decision_function_wrap, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7scikits_5learn_3svm_9liblinear_csr_decision_function_wrap)}, + {__Pyx_NAMESTR("predict_wrap"), (PyCFunction)__pyx_pf_7scikits_5learn_3svm_9liblinear_predict_wrap, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("csr_predict_wrap"), (PyCFunction)__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_predict_wrap, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7scikits_5learn_3svm_9liblinear_csr_predict_wrap)}, + {__Pyx_NAMESTR("predict_prob_wrap"), (PyCFunction)__pyx_pf_7scikits_5learn_3svm_9liblinear_predict_prob_wrap, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7scikits_5learn_3svm_9liblinear_predict_prob_wrap)}, + {__Pyx_NAMESTR("csr_predict_prob"), (PyCFunction)__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_predict_prob, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7scikits_5learn_3svm_9liblinear_csr_predict_prob)}, {0, 0, 0, 0} }; +static void __pyx_init_filenames(void); /*proto*/ + #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { PyModuleDef_HEAD_INIT, @@ -6660,8 +6786,8 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_MemoryError = __Pyx_GetName(__pyx_b, __pyx_n_s__MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; @@ -6670,6 +6796,7 @@ static int __Pyx_InitCachedBuiltins(void) { static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; return 0; __pyx_L1_error:; @@ -6698,10 +6825,12 @@ PyMODINIT_FUNC PyInit_liblinear(void) } __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit_liblinear(void)", __LINE__, __FILE__); #endif + __pyx_init_filenames(); __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if PY_MAJOR_VERSION < 3 + __pyx_empty_bytes = PyString_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #ifdef __pyx_binding_PyCFunctionType_USED - if (__pyx_binding_PyCFunctionType_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ @@ -6725,7 +6854,7 @@ PyMODINIT_FUNC PyInit_liblinear(void) if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_module_is_main_sklearn__svm__liblinear) { + if (__pyx_module_is_main_scikits__learn__svm__liblinear) { if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; } /*--- Builtin init code ---*/ @@ -6734,15 +6863,15 @@ PyMODINIT_FUNC PyInit_liblinear(void) /*--- Function export code ---*/ /*--- Type init code ---*/ /*--- Type import code ---*/ - __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Function import code ---*/ /*--- Execution code ---*/ - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":7 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":7 * """ * * import numpy as np # <<<<<<<<<<<<<< @@ -6754,7 +6883,7 @@ PyMODINIT_FUNC PyInit_liblinear(void) if (PyObject_SetAttr(__pyx_m, __pyx_n_s__np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":1 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":1 * """ # <<<<<<<<<<<<<< * Wrapper for liblinear * @@ -6763,42 +6892,42 @@ PyMODINIT_FUNC PyInit_liblinear(void) __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__train_wrap); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_2, "__doc__"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_2, "__doc__"); __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_9), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s__csr_train_wrap); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_10), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s_12); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_2, "__doc__"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_2, "__doc__"); __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_11), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s__csr_predict_wrap); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_13), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__predict_prob_wrap); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_2, "__doc__"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_2, "__doc__"); __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_14), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s__csr_predict_prob); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_15), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -6806,12 +6935,11 @@ PyMODINIT_FUNC PyInit_liblinear(void) if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":963 - * arr.base = baseptr + /* "/usr/lib/pymodules/python2.6/Cython/Includes/stdlib.pxd":2 * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None + * cdef extern from "stdlib.h" nogil: # <<<<<<<<<<<<<< + * void free(void *ptr) + * void *malloc(size_t size) */ goto __pyx_L0; __pyx_L1_error:; @@ -6819,10 +6947,10 @@ PyMODINIT_FUNC PyInit_liblinear(void) __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); if (__pyx_m) { - __Pyx_AddTraceback("init sklearn.svm.liblinear"); + __Pyx_AddTraceback("init scikits.learn.svm.liblinear"); Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init sklearn.svm.liblinear"); + PyErr_SetString(PyExc_ImportError, "init scikits.learn.svm.liblinear"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); @@ -6833,14 +6961,15 @@ PyMODINIT_FUNC PyInit_liblinear(void) #endif } +static const char *__pyx_filenames[] = { + "liblinear.pyx", + "numpy.pxd", +}; + /* Runtime support code */ -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { - PyObject *result; - result = PyObject_GetAttr(dict, name); - if (!result) - PyErr_SetObject(PyExc_NameError, name); - return result; +static void __pyx_init_filenames(void) { + __pyx_f = __pyx_filenames; } static void __Pyx_RaiseDoubleKeywordsError( @@ -6965,26 +7094,6 @@ bad: return -1; } -static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact) -{ - if (!type) { - PyErr_Format(PyExc_SystemError, "Missing type object"); - return 0; - } - if (none_allowed && obj == Py_None) return 1; - else if (exact) { - if (Py_TYPE(obj) == type) return 1; - } - else { - if (PyObject_TypeCheck(obj, type)) return 1; - } - PyErr_Format(PyExc_TypeError, - "Argument '%s' has incorrect type (expected %s, got %s)", - name, type->tp_name, Py_TYPE(obj)->tp_name); - return 0; -} - static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { unsigned int n = 1; return *(unsigned char*)(&n) != 0; @@ -7390,7 +7499,7 @@ static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) { buf->suboffsets = __Pyx_minusones; } -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 int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack) { if (obj == Py_None) { __Pyx_ZeroBuffer(buf); return 0; @@ -7474,10 +7583,6 @@ static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyOb } -static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); -} - static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, #if PY_VERSION_HEX < 0x02050000 @@ -7488,13 +7593,35 @@ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { (index == 1) ? "" : "s"); } -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { - PyErr_Format(PyExc_ValueError, - #if PY_VERSION_HEX < 0x02050000 - "too many values to unpack (expected %d)", (int)expected); - #else - "too many values to unpack (expected %zd)", expected); - #endif +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(void) { + PyErr_SetString(PyExc_ValueError, "too many values to unpack"); +} + +static PyObject *__Pyx_UnpackItem(PyObject *iter, Py_ssize_t index) { + PyObject *item; + if (!(item = PyIter_Next(iter))) { + if (!PyErr_Occurred()) { + __Pyx_RaiseNeedMoreValuesError(index); + } + } + return item; +} + +static int __Pyx_EndUnpack(PyObject *iter) { + PyObject *item; + if ((item = PyIter_Next(iter))) { + Py_DECREF(item); + __Pyx_RaiseTooManyValuesError(); + return -1; + } + else if (!PyErr_Occurred()) + return 0; + else + return -1; +} + +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { @@ -7503,10 +7630,30 @@ static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { } else if (PyTuple_GET_SIZE(t) < index) { __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); } else { - __Pyx_RaiseTooManyValuesError(index); + __Pyx_RaiseTooManyValuesError(); } } +static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact) +{ + if (!type) { + PyErr_Format(PyExc_SystemError, "Missing type object"); + return 0; + } + if (none_allowed && obj == Py_None) return 1; + else if (exact) { + if (Py_TYPE(obj) == type) return 1; + } + else { + if (PyObject_TypeCheck(obj, type)) return 1; + } + PyErr_Format(PyExc_TypeError, + "Argument '%s' has incorrect type (expected %s, got %s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); + return 0; +} + #if PY_MAJOR_VERSION < 3 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { #if PY_VERSION_HEX >= 0x02060000 @@ -7532,14 +7679,14 @@ if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pf_5numpy_7ndarra #endif static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) { - PyObject *py_import = 0; + PyObject *__import__ = 0; PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; - py_import = __Pyx_GetAttrString(__pyx_b, "__import__"); - if (!py_import) + __import__ = __Pyx_GetAttrString(__pyx_b, "__import__"); + if (!__import__) goto bad; if (from_list) list = from_list; @@ -7555,15 +7702,23 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) { empty_dict = PyDict_New(); if (!empty_dict) goto bad; - module = PyObject_CallFunctionObjArgs(py_import, + module = PyObject_CallFunctionObjArgs(__import__, name, global_dict, empty_dict, list, NULL); bad: Py_XDECREF(empty_list); - Py_XDECREF(py_import); + Py_XDECREF(__import__); Py_XDECREF(empty_dict); return module; } +static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { + PyObject *result; + result = PyObject_GetAttr(dict, name); + if (!result) + PyErr_SetObject(PyExc_NameError, name); + return result; +} + #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { Py_XINCREF(type); @@ -7674,28 +7829,21 @@ bad: } #endif -static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_Py_intptr_t(Py_intptr_t val) { - const Py_intptr_t neg_one = (Py_intptr_t)-1, const_zero = (Py_intptr_t)0; - const int is_unsigned = const_zero < neg_one; - if ((sizeof(Py_intptr_t) == sizeof(char)) || - (sizeof(Py_intptr_t) == sizeof(short))) { +static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_npy_intp(npy_intp val) { + const npy_intp neg_one = (npy_intp)-1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (sizeof(npy_intp) < sizeof(long)) { return PyInt_FromLong((long)val); - } else if ((sizeof(Py_intptr_t) == sizeof(int)) || - (sizeof(Py_intptr_t) == sizeof(long))) { + } else if (sizeof(npy_intp) == sizeof(long)) { if (is_unsigned) return PyLong_FromUnsignedLong((unsigned long)val); else return PyInt_FromLong((long)val); - } else if (sizeof(Py_intptr_t) == sizeof(PY_LONG_LONG)) { + } else { /* (sizeof(npy_intp) > sizeof(long)) */ if (is_unsigned) return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val); else return PyLong_FromLongLong((PY_LONG_LONG)val); - } else { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - return _PyLong_FromByteArray(bytes, sizeof(Py_intptr_t), - little, !is_unsigned); } } @@ -8020,25 +8168,6 @@ static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) { return (signed int)__Pyx_PyInt_AsSignedLong(x); } -static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) { - const int neg_one = (int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to int" : - "value too large to convert to int"); - } - return (int)-1; - } - return (int)val; - } - return (int)__Pyx_PyInt_AsLong(x); -} - static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) { const unsigned long neg_one = (unsigned long)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; @@ -8286,11 +8415,7 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility", module_name, class_name); - #if PY_VERSION_HEX < 0x02050000 - PyErr_Warn(NULL, warning); - #else PyErr_WarnEx(NULL, warning, 0); - #endif } else if (((PyTypeObject *)result)->tp_basicsize != size) { PyErr_Format(PyExc_ValueError, @@ -8431,8 +8556,8 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { /* Type Conversion Functions */ static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - int is_true = x == Py_True; - if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + if (x == Py_True) return 1; + else if ((x == Py_False) | (x == Py_None)) return 0; else return PyObject_IsTrue(x); } diff --git a/sklearn/svm/liblinear.pyx b/scikits/learn/svm/liblinear.pyx similarity index 100% rename from sklearn/svm/liblinear.pyx rename to scikits/learn/svm/liblinear.pyx diff --git a/sklearn/svm/libsvm.c b/scikits/learn/svm/libsvm.c similarity index 77% rename from sklearn/svm/libsvm.c rename to scikits/learn/svm/libsvm.c index 6e6e7477af14eb8acb925a2ef92920023712accc..74d46ba33744137355a9c87f797876bf4dd7c612 100644 --- a/sklearn/svm/libsvm.c +++ b/scikits/learn/svm/libsvm.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.13 on Fri Sep 2 11:25:18 2011 */ +/* Generated by Cython 0.14.1 on Mon Jul 11 18:25:49 2011 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -126,15 +126,20 @@ #define PyBytes_Repr PyString_Repr #define PyBytes_Concat PyString_Concat #define PyBytes_ConcatAndDel PyString_ConcatAndDel +#endif + +#if PY_VERSION_HEX < 0x02060000 #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) #endif - #ifndef PySet_CheckExact -# define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) + #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) @@ -151,7 +156,7 @@ #endif #if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject + #define PyBoolObject PyLongObject #endif @@ -163,6 +168,25 @@ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif +#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) + #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) + #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) +#else + #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) + #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) + #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ + (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ + (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ + (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) +#endif + #if PY_MAJOR_VERSION >= 3 #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #endif @@ -195,7 +219,7 @@ #define _USE_MATH_DEFINES #endif #include <math.h> -#define __PYX_HAVE_API__sklearn__svm__libsvm +#define __PYX_HAVE_API__scikits__learn__svm__libsvm #include "stdio.h" #include "stdlib.h" #include "numpy/arrayobject.h" @@ -203,6 +227,11 @@ #include "svm.h" #include "libsvm_helper.c" +#ifdef PYREX_WITHOUT_ASSERTIONS +#define CYTHON_WITHOUT_ASSERTIONS +#endif + + /* inline attribute */ #ifndef CYTHON_INLINE #if defined(__GNUC__) @@ -212,7 +241,7 @@ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else - #define CYTHON_INLINE + #define CYTHON_INLINE #endif #endif @@ -220,14 +249,14 @@ #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || defined(__INTEL_COMPILER) -# define CYTHON_UNUSED __attribute__ ((__unused__)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) # else -# define CYTHON_UNUSED +# define CYTHON_UNUSED # endif #endif @@ -252,7 +281,7 @@ static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); #ifdef __GNUC__ /* Test for GCC > 2.95 */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) +#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* __GNUC__ > 2 ... */ @@ -418,12 +447,12 @@ typedef npy_cdouble __pyx_t_5numpy_complex_t; static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, PyObject* kw_name); /*proto*/ - 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); /*proto*/ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, PyObject* kw_name); /*proto*/ + static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/ static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, @@ -461,6 +490,8 @@ static void __Pyx_RaiseBufferFallbackError(void); /*proto*/ static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ + static CYTHON_INLINE long __Pyx_div_long(long, long); /* proto */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); @@ -485,8 +516,6 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_Py_intptr_t(Py_intptr_t); -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ - #if CYTHON_CCOMPLEX #ifdef __cplusplus #define __Pyx_CREAL(z) ((z).real()) @@ -520,11 +549,17 @@ static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(floa #ifdef __cplusplus #define __Pyx_c_is_zerof(z) ((z)==(float)0) #define __Pyx_c_conjf(z) (::std::conj(z)) - /*#define __Pyx_c_absf(z) (::std::abs(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)) - /*#define __Pyx_c_absf(z) (cabsf(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); @@ -535,7 +570,10 @@ static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(floa 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); - /*static CYTHON_INLINE float __Pyx_c_absf(__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); @@ -550,11 +588,17 @@ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(do #ifdef __cplusplus #define __Pyx_c_is_zero(z) ((z)==(double)0) #define __Pyx_c_conj(z) (::std::conj(z)) - /*#define __Pyx_c_abs(z) (::std::abs(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)) - /*#define __Pyx_c_abs(z) (cabs(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); @@ -565,7 +609,10 @@ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(do 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); - /*static CYTHON_INLINE double __Pyx_c_abs(__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 CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *); @@ -634,36 +681,29 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *, static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *, PyObject *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *); /*proto*/ -/* Module declarations from sklearn.svm.libsvm */ +/* Module declarations from scikits.learn.svm.libsvm */ static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), 'R' }; static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t = { "int32_t", NULL, sizeof(__pyx_t_5numpy_int32_t), 'I' }; -#define __Pyx_MODULE_NAME "sklearn.svm.libsvm" -int __pyx_module_is_main_sklearn__svm__libsvm = 0; +#define __Pyx_MODULE_NAME "scikits.learn.svm.libsvm" +static int __pyx_module_is_main_scikits__learn__svm__libsvm = 0; -/* Implementation of sklearn.svm.libsvm */ +/* Implementation of scikits.learn.svm.libsvm */ static PyObject *__pyx_builtin_MemoryError; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_RuntimeError; static char __pyx_k_4[] = "sample_weight and X have incompatible shapes: "; static char __pyx_k_5[] = "sample_weight has %s samples while X has %s"; -static char __pyx_k_6[] = "Seems we've run out of of memory"; -static char __pyx_k_12[] = "We've run out of of memory"; -static char __pyx_k_26[] = "Number of samples is less than number of folds"; -static char __pyx_k_27[] = "ndarray is not C contiguous"; -static char __pyx_k_28[] = "ndarray is not Fortran contiguous"; -static char __pyx_k_29[] = "Non-native byte order not supported"; -static char __pyx_k_30[] = "unknown dtype code in numpy.pxd (%d)"; -static char __pyx_k_31[] = "Format string allocated too short, see comment in numpy.pxd"; -static char __pyx_k_32[] = "Format string allocated too short."; -static char __pyx_k_33[] = "\nBinding for libsvm_skl\n----------------------\n\nThese are the bindings for libsvm_skl, which is a fork o libsvm[1]\nthat adds to libsvm some capabilities, like index of support vectors\nand efficient representation of dense matrices.\n\nThese are low-level routines, but can be used for flexibility or\nperformance reasons. See scikits.learn.svm for a higher-level API.\n\nLow-level memory management is done in libsvm_helper.c. If we happen\nto run out of memory a MemoryError will be raised. In practice this is\nnot very helpful since hight changes are malloc fails inside svm.cpp,\nwhere no sort of memory checks are done.\n\n[1] http://www.csie.ntu.edu.tw/~cjlin/libsvm/\n\nNotes\n-----\nMaybe we could speed it a bit further by decorating functions with\n@cython.boundscheck(False), but probably it is not worth since all\nwork is done in lisvm_helper.c\nAlso, the signature mode='c' is somewhat superficial, since we already\ncheck that arrays are C-contiguous in svm.py\n\nAuthors\n-------\n2010: Fabian Pedregosa <fabian.pedregosa@inria.fr>\n Gael Varoquaux <gael.varoquaux@normalesup.org>\n"; -static char __pyx_k_34[] = "fit (line 47)"; -static char __pyx_k_35[] = "predict (line 223)"; -static char __pyx_k_36[] = "predict_proba (line 308)"; -static char __pyx_k_37[] = "decision_function (line 382)"; -static char __pyx_k_38[] = "cross_validation (line 439)"; -static char __pyx_k_39[] = "set_verbosity_wrap (line 540)"; +static char __pyx_k_30[] = "Number of samples is less than number of folds"; +static char __pyx_k_32[] = "ndarray is not C contiguous"; +static char __pyx_k_34[] = "ndarray is not Fortran contiguous"; +static char __pyx_k_36[] = "Non-native byte order not supported"; +static char __pyx_k_38[] = "unknown dtype code in numpy.pxd (%d)"; +static char __pyx_k_39[] = "Format string allocated too short, see comment in numpy.pxd"; +static char __pyx_k_42[] = "Format string allocated too short."; +static char __pyx_k_44[] = "\nBinding for libsvm_skl\n----------------------\n\nThese are the bindings for libsvm_skl, which is a fork o libsvm[1]\nthat adds to libsvm some capabilities, like index of support vectors\nand efficient representation of dense matrices.\n\nThese are low-level routines, but can be used for flexibility or\nperformance reasons. See scikits.learn.svm for a higher-level API.\n\nLow-level memory management is done in libsvm_helper.c. If we happen\nto run out of memory a MemoryError will be raised. In practice this is\nnot very helpful since hight changes are malloc fails inside svm.cpp,\nwhere no sort of memory checks are done.\n\n[1] http://www.csie.ntu.edu.tw/~cjlin/libsvm/\n\nNotes\n-----\nMaybe we could speed it a bit further by decorating functions with\n@cython.boundscheck(False), but probably it is not worth since all\nwork is done in lisvm_helper.c\nAlso, the signature mode='c' is somewhat superficial, since we already\ncheck that arrays are C-contiguous in svm.py\n\nAuthors\n-------\n2010: Fabian Pedregosa <fabian.pedregosa@inria.fr>\n Gael Varoquaux <gael.varoquaux@normalesup.org>\n"; +static char __pyx_k_48[] = "scikits.learn.svm.libsvm"; static char __pyx_k__B[] = "B"; static char __pyx_k__C[] = "C"; static char __pyx_k__H[] = "H"; @@ -750,23 +790,16 @@ static char __pyx_k__decision_function[] = "decision_function"; static char __pyx_k__class_weight_label[] = "class_weight_label"; static char __pyx_k__set_verbosity_wrap[] = "set_verbosity_wrap"; static char __pyx_k__LIBSVM_KERNEL_TYPES[] = "LIBSVM_KERNEL_TYPES"; -static PyObject *__pyx_kp_s_12; -static PyObject *__pyx_kp_s_26; -static PyObject *__pyx_kp_u_27; -static PyObject *__pyx_kp_u_28; -static PyObject *__pyx_kp_u_29; -static PyObject *__pyx_kp_u_30; -static PyObject *__pyx_kp_u_31; +static PyObject *__pyx_kp_s_30; static PyObject *__pyx_kp_u_32; static PyObject *__pyx_kp_u_34; -static PyObject *__pyx_kp_u_35; static PyObject *__pyx_kp_u_36; -static PyObject *__pyx_kp_u_37; static PyObject *__pyx_kp_u_38; static PyObject *__pyx_kp_u_39; static PyObject *__pyx_kp_s_4; +static PyObject *__pyx_kp_u_42; +static PyObject *__pyx_n_s_48; static PyObject *__pyx_kp_s_5; -static PyObject *__pyx_kp_s_6; static PyObject *__pyx_n_s__C; static PyObject *__pyx_n_s__LIBSVM_KERNEL_TYPES; static PyObject *__pyx_n_s__MemoryError; @@ -844,11 +877,7 @@ static PyObject *__pyx_int_15; static PyArrayObject *__pyx_k_1; static PyArrayObject *__pyx_k_2; static PyArrayObject *__pyx_k_3; -static PyArrayObject *__pyx_k_7; -static PyArrayObject *__pyx_k_8; -static PyArrayObject *__pyx_k_9; -static PyArrayObject *__pyx_k_10; -static PyArrayObject *__pyx_k_11; +static PyArrayObject *__pyx_k_12; static PyArrayObject *__pyx_k_13; static PyArrayObject *__pyx_k_14; static PyArrayObject *__pyx_k_15; @@ -862,8 +891,46 @@ static PyArrayObject *__pyx_k_22; static PyArrayObject *__pyx_k_23; static PyArrayObject *__pyx_k_24; static PyArrayObject *__pyx_k_25; - -/* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":47 +static PyArrayObject *__pyx_k_26; +static PyArrayObject *__pyx_k_27; +static PyArrayObject *__pyx_k_28; +static PyArrayObject *__pyx_k_29; +static PyObject *__pyx_k_tuple_6; +static PyObject *__pyx_k_tuple_7; +static PyObject *__pyx_k_tuple_8; +static PyObject *__pyx_k_tuple_9; +static PyObject *__pyx_k_tuple_10; +static PyObject *__pyx_k_tuple_11; +static PyObject *__pyx_k_tuple_31; +static PyObject *__pyx_k_tuple_33; +static PyObject *__pyx_k_tuple_35; +static PyObject *__pyx_k_tuple_37; +static PyObject *__pyx_k_tuple_40; +static PyObject *__pyx_k_tuple_41; +static PyObject *__pyx_k_tuple_43; +static PyObject *__pyx_k_tuple_45; +static PyObject *__pyx_k_tuple_46; +static PyObject *__pyx_k_tuple_47; +static PyObject *__pyx_k_tuple_49; +static PyObject *__pyx_k_tuple_50; +static PyObject *__pyx_k_tuple_51; +static PyObject *__pyx_k_tuple_52; +static PyObject *__pyx_k_tuple_53; +static PyObject *__pyx_k_tuple_54; +static PyObject *__pyx_k_tuple_55; +static PyObject *__pyx_k_tuple_56; +static PyObject *__pyx_k_tuple_57; +static PyObject *__pyx_k_tuple_58; +static PyObject *__pyx_k_tuple_59; +static PyObject *__pyx_k_tuple_60; +static PyObject *__pyx_k_tuple_61; +static PyObject *__pyx_k_tuple_62; +static PyObject *__pyx_k_tuple_63; +static PyObject *__pyx_k_tuple_64; +static PyObject *__pyx_k_tuple_65; +static PyObject *__pyx_k_tuple_66; + +/* "scikits/learn/svm/libsvm.pyx":47 * # Wrapper functions * * def fit( # <<<<<<<<<<<<<< @@ -871,9 +938,10 @@ static PyArrayObject *__pyx_k_25; * np.ndarray[np.float64_t, ndim=1, mode='c'] Y, */ -static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_7sklearn_3svm_6libsvm_fit[] = "\n Train the model using libsvm (low-level method)\n\n Parameters\n ----------\n X: array-like, dtype=float64, size=[n_samples, n_features]\n\n Y: array, dtype=float64, size=[n_samples]\n target vector\n\n svm_type : {0, 1, 2, 3, 4}\n Type of SVM: C_SVC, NuSVC, OneClassSVM, EpsilonSVR or NuSVR\n respectevely.\n\n kernel : {'linear', 'rbf', 'poly', 'sigmoid', 'precomputed'}\n Kernel to use in the model: linear, polynomial, RBF, sigmoid\n or precomputed.\n\n degree : int32\n Degree of the polynomial kernel (only relevant if kernel is\n set to polynomial)\n\n gamma : float64\n Gamma parameter in RBF kernel (only relevant if kernel is set\n to RBF)\n\n coef0 : float64\n Independent parameter in poly/sigmoid kernel.\n\n tol : float64\n Stopping criteria.\n\n C : float64\n C parameter in C-Support Vector Classification\n\n nu : float64\n\n cache_size : float64\n\n Return\n ------\n support : array, shape=[n_support]\n index of support vectors\n\n support_vectors : array, shape=[n_support, n_features]\n support vectors (equivalent to X[support]). Will return an\n empty array in the case of precomputed kernel.\n\n n_class_SV : array\n number of support vectors in each class.\n\n sv_coef : array\n coefficients of support vectors in decision function.\n\n intercept : array\n intercept in decision function\n\n label : labels for different classes (only relevant in classification).\n\n probA, probB : array\n probability estimates, empty array for probability=False\n "; -static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_7scikits_5learn_3svm_6libsvm_fit[] = "\n Train the model using libsvm (low-level method)\n\n Parameters\n ----------\n X: array-like, dtype=float64, size=[n_samples, n_features]\n\n Y: array, dtype=float64, size=[n_samples]\n target vector\n\n svm_type : {0, 1, 2, 3, 4}\n Type of SVM: C_SVC, NuSVC, OneClassSVM, EpsilonSVR or NuSVR\n respectevely.\n\n kernel : {'linear', 'rbf', 'poly', 'sigmoid', 'precomputed'}\n Kernel to use in the model: linear, polynomial, RBF, sigmoid\n or precomputed.\n\n degree : int32\n Degree of the polynomial kernel (only relevant if kernel is\n set to polynomial)\n\n gamma : float64\n Gamma parameter in RBF kernel (only relevant if kernel is set\n to RBF)\n\n coef0 : float64\n Independent parameter in poly/sigmoid kernel.\n\n tol : float64\n Stopping criteria.\n\n C : float64\n C parameter in C-Support Vector Classification\n\n nu : float64\n\n cache_size : float64\n\n Return\n ------\n support : array, shape=[n_support]\n index of support vectors\n\n support_vectors : array, shape=[n_support, n_features]\n support vectors (equivalent to X[support]). Will return an\n empty array in the case of precomputed kernel.\n\n n_class_SV : array\n number of support vectors in each class.\n\n sv_coef : array\n coefficients of support vectors in decision function.\n\n intercept : array\n intercept in decision function\n\n label : labels for different classes (only relevant in classification).\n\n probA, probB : array\n probability estimates, empty array for probability=False\n "; +static PyMethodDef __pyx_mdef_7scikits_5learn_3svm_6libsvm_fit = {__Pyx_NAMESTR("fit"), (PyCFunction)__pyx_pf_7scikits_5learn_3svm_6libsvm_fit, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7scikits_5learn_3svm_6libsvm_fit)}; +static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyArrayObject *__pyx_v_X = 0; PyArrayObject *__pyx_v_Y = 0; int __pyx_v_svm_type; @@ -952,9 +1020,9 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObje Py_ssize_t __pyx_bstride_0_support = 0; Py_ssize_t __pyx_bshape_0_support = 0; PyObject *__pyx_r = NULL; - Py_ssize_t __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; @@ -964,21 +1032,39 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObje PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; - PyArrayObject *__pyx_t_13 = NULL; - PyArrayObject *__pyx_t_14 = NULL; - PyArrayObject *__pyx_t_15 = NULL; - PyArrayObject *__pyx_t_16 = NULL; - PyArrayObject *__pyx_t_17 = NULL; - PyArrayObject *__pyx_t_18 = NULL; - PyArrayObject *__pyx_t_19 = NULL; - PyArrayObject *__pyx_t_20 = NULL; + struct svm_problem *__pyx_t_13; + char *__pyx_t_14; + char *__pyx_t_15; + char *__pyx_t_16; + npy_intp *__pyx_t_17; + struct svm_parameter *__pyx_t_18; + int __pyx_t_19; + int __pyx_t_20; + double __pyx_t_21; + double __pyx_t_22; + double __pyx_t_23; + double __pyx_t_24; + double __pyx_t_25; + double __pyx_t_26; + double __pyx_t_27; + int __pyx_t_28; + int __pyx_t_29; + int __pyx_t_30; + PyArrayObject *__pyx_t_31 = NULL; + PyArrayObject *__pyx_t_32 = NULL; + PyArrayObject *__pyx_t_33 = NULL; + PyArrayObject *__pyx_t_34 = NULL; + PyArrayObject *__pyx_t_35 = NULL; + PyArrayObject *__pyx_t_36 = NULL; + PyArrayObject *__pyx_t_37 = NULL; + PyArrayObject *__pyx_t_38 = NULL; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__X,&__pyx_n_s__Y,&__pyx_n_s__svm_type,&__pyx_n_s__kernel,&__pyx_n_s__degree,&__pyx_n_s__gamma,&__pyx_n_s__coef0,&__pyx_n_s__tol,&__pyx_n_s__C,&__pyx_n_s__nu,&__pyx_n_s__epsilon,&__pyx_n_s__class_weight_label,&__pyx_n_s__class_weight,&__pyx_n_s__sample_weight,&__pyx_n_s__shrinking,&__pyx_n_s__probability,&__pyx_n_s__cache_size,0}; __Pyx_RefNannySetupContext("fit"); __pyx_self = __pyx_self; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[17] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; - values[3] = ((PyObject *)__pyx_n_s__rbf); + values[3] = ((PyObject*)__pyx_n_s__rbf); values[11] = (PyObject *)__pyx_k_1; values[12] = (PyObject *)__pyx_k_2; values[13] = (PyObject *)__pyx_k_3; @@ -1100,7 +1186,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObje } else { __pyx_v_svm_type = ((int)0); } - __pyx_v_kernel = ((PyObject *)values[3]); + __pyx_v_kernel = ((PyObject*)values[3]); if (values[4]) { __pyx_v_degree = __Pyx_PyInt_AsInt(values[4]); if (unlikely((__pyx_v_degree == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { @@ -1110,7 +1196,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObje __pyx_v_gamma = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_gamma == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":51 + /* "scikits/learn/svm/libsvm.pyx":51 * np.ndarray[np.float64_t, ndim=1, mode='c'] Y, * int svm_type=0, str kernel='rbf', int degree=3, * double gamma=0.1, double coef0=0., double tol=1e-3, # <<<<<<<<<<<<<< @@ -1133,7 +1219,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObje __pyx_v_C = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_C == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":52 + /* "scikits/learn/svm/libsvm.pyx":52 * int svm_type=0, str kernel='rbf', int degree=3, * double gamma=0.1, double coef0=0., double tol=1e-3, * double C=1., double nu=0.5, double epsilon=0.1, # <<<<<<<<<<<<<< @@ -1169,7 +1255,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObje __pyx_v_cache_size = __pyx_PyFloat_AsDouble(values[16]); if (unlikely((__pyx_v_cache_size == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":60 + /* "scikits/learn/svm/libsvm.pyx":60 * sample_weight=np.empty(0), * int shrinking=1, int probability=0, * double cache_size=100.): # <<<<<<<<<<<<<< @@ -1180,10 +1266,10 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObje } } else { __pyx_v_svm_type = ((int)0); - __pyx_v_kernel = ((PyObject *)__pyx_n_s__rbf); + __pyx_v_kernel = ((PyObject*)__pyx_n_s__rbf); __pyx_v_degree = ((int)3); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":51 + /* "scikits/learn/svm/libsvm.pyx":51 * np.ndarray[np.float64_t, ndim=1, mode='c'] Y, * int svm_type=0, str kernel='rbf', int degree=3, * double gamma=0.1, double coef0=0., double tol=1e-3, # <<<<<<<<<<<<<< @@ -1194,7 +1280,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObje __pyx_v_coef0 = ((double)0.); __pyx_v_tol = ((double)1e-3); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":52 + /* "scikits/learn/svm/libsvm.pyx":52 * int svm_type=0, str kernel='rbf', int degree=3, * double gamma=0.1, double coef0=0., double tol=1e-3, * double C=1., double nu=0.5, double epsilon=0.1, # <<<<<<<<<<<<<< @@ -1210,7 +1296,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObje __pyx_v_shrinking = ((int)1); __pyx_v_probability = ((int)0); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":60 + /* "scikits/learn/svm/libsvm.pyx":60 * sample_weight=np.empty(0), * int shrinking=1, int probability=0, * double cache_size=100.): # <<<<<<<<<<<<<< @@ -1246,7 +1332,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObje case 5: __pyx_v_degree = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 4)); if (unlikely((__pyx_v_degree == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L3_error;} case 4: - __pyx_v_kernel = ((PyObject *)PyTuple_GET_ITEM(__pyx_args, 3)); + __pyx_v_kernel = ((PyObject*)PyTuple_GET_ITEM(__pyx_args, 3)); case 3: __pyx_v_svm_type = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_svm_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L3_error;} case 2: @@ -1260,7 +1346,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObje __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("fit", 0, 2, 17, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("sklearn.svm.libsvm.fit"); + __Pyx_AddTraceback("scikits.learn.svm.libsvm.fit"); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; @@ -1290,7 +1376,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObje __pyx_bstruct_sample_weight.buf = NULL; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_X), __pyx_ptype_5numpy_ndarray, 1, "X", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_Y), __pyx_ptype_5numpy_ndarray, 1, "Y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kernel), &PyString_Type, 1, "kernel", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kernel), (&PyString_Type), 1, "kernel", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_class_weight_label), __pyx_ptype_5numpy_ndarray, 1, "class_weight_label", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_class_weight), __pyx_ptype_5numpy_ndarray, 1, "class_weight", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sample_weight), __pyx_ptype_5numpy_ndarray, 1, "sample_weight", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -1325,50 +1411,53 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObje __pyx_bstride_0_sample_weight = __pyx_bstruct_sample_weight.strides[0]; __pyx_bshape_0_sample_weight = __pyx_bstruct_sample_weight.shape[0]; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":132 + /* "scikits/learn/svm/libsvm.pyx":132 * * * if len(sample_weight) == 0: # <<<<<<<<<<<<<< * sample_weight = np.ones(X.shape[0], dtype=np.float64) * else: */ - __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_sample_weight)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = (__pyx_t_1 == 0); - if (__pyx_t_2) { + __pyx_t_1 = ((PyObject *)__pyx_v_sample_weight); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_t_2 == 0); + if (__pyx_t_3) { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":133 + /* "scikits/learn/svm/libsvm.pyx":133 * * if len(sample_weight) == 0: * sample_weight = np.ones(X.shape[0], dtype=np.float64) # <<<<<<<<<<<<<< * else: * assert sample_weight.shape[0] == X.shape[0], \ */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__ones); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__ones); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_to_py_Py_intptr_t((__pyx_v_X->dimensions[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_to_py_Py_intptr_t((__pyx_v_X->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __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 = 0; - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyEval_CallObjectWithKeywords(__pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyEval_CallObjectWithKeywords(__pyx_t_4, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = ((PyArrayObject *)__pyx_t_7); { @@ -1396,17 +1485,17 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObje } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":135 + /* "scikits/learn/svm/libsvm.pyx":135 * sample_weight = np.ones(X.shape[0], dtype=np.float64) * else: * assert sample_weight.shape[0] == X.shape[0], \ # <<<<<<<<<<<<<< * "sample_weight and X have incompatible shapes: " + \ * "sample_weight has %s samples while X has %s" % \ */ - #ifndef PYREX_WITHOUT_ASSERTIONS + #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!((__pyx_v_sample_weight->dimensions[0]) == (__pyx_v_X->dimensions[0])))) { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":138 + /* "scikits/learn/svm/libsvm.pyx":138 * "sample_weight and X have incompatible shapes: " + \ * "sample_weight has %s samples while X has %s" % \ * (sample_weight.shape[0], X.shape[0]) # <<<<<<<<<<<<<< @@ -1415,22 +1504,22 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObje */ __pyx_t_7 = __Pyx_PyInt_to_py_Py_intptr_t((__pyx_v_sample_weight->dimensions[0])); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = __Pyx_PyInt_to_py_Py_intptr_t((__pyx_v_X->dimensions[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyInt_to_py_Py_intptr_t((__pyx_v_X->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); __pyx_t_7 = 0; - __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_5), __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Add(((PyObject *)__pyx_kp_s_4), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_5), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + __pyx_t_5 = PyNumber_Add(((PyObject *)__pyx_kp_s_4), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_t_5)); __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -1439,7 +1528,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObje } __pyx_L6:; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":141 + /* "scikits/learn/svm/libsvm.pyx":141 * * # set problem * kernel_index = LIBSVM_KERNEL_TYPES.index(kernel) # <<<<<<<<<<<<<< @@ -1448,83 +1537,100 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObje */ __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__LIBSVM_KERNEL_TYPES); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__index); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); __Pyx_INCREF(((PyObject *)__pyx_v_kernel)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_kernel)); __Pyx_GIVEREF(((PyObject *)__pyx_v_kernel)); - __pyx_t_7 = PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_v_kernel_index); __pyx_v_kernel_index = __pyx_t_7; __pyx_t_7 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":143 + /* "scikits/learn/svm/libsvm.pyx":143 * kernel_index = LIBSVM_KERNEL_TYPES.index(kernel) * set_problem( * &problem, X.data, Y.data, sample_weight.data, X.shape, kernel_index) # <<<<<<<<<<<<<< * if problem.x == NULL: * raise MemoryError("Seems we've run out of of memory") */ + __pyx_t_13 = (&__pyx_v_problem); + __pyx_t_14 = __pyx_v_X->data; + __pyx_t_15 = __pyx_v_Y->data; + __pyx_t_16 = __pyx_v_sample_weight->data; + __pyx_t_17 = __pyx_v_X->dimensions; __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_v_kernel_index); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - set_problem((&__pyx_v_problem), __pyx_v_X->data, __pyx_v_Y->data, __pyx_v_sample_weight->data, __pyx_v_X->dimensions, __pyx_t_9); + set_problem(__pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_t_9); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":144 + /* "scikits/learn/svm/libsvm.pyx":144 * set_problem( * &problem, X.data, Y.data, sample_weight.data, X.shape, kernel_index) * if problem.x == NULL: # <<<<<<<<<<<<<< * raise MemoryError("Seems we've run out of of memory") * */ - __pyx_t_2 = (__pyx_v_problem.x == NULL); - if (__pyx_t_2) { + __pyx_t_3 = (__pyx_v_problem.x == NULL); + if (__pyx_t_3) { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":145 + /* "scikits/learn/svm/libsvm.pyx":145 * &problem, X.data, Y.data, sample_weight.data, X.shape, kernel_index) * if problem.x == NULL: * raise MemoryError("Seems we've run out of of memory") # <<<<<<<<<<<<<< * * # set parameters */ - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_6)); - PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_kp_s_6)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_6)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L7; } __pyx_L7:; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":149 + /* "scikits/learn/svm/libsvm.pyx":149 * # set parameters * set_parameter( * ¶m, svm_type, kernel_index, degree, gamma, coef0, nu, cache_size, # <<<<<<<<<<<<<< * C, tol, epsilon, shrinking, probability, <int> class_weight.shape[0], * class_weight_label.data, class_weight.data) */ - __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_v_kernel_index); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = (&__pyx_v_param); + __pyx_t_9 = __pyx_v_svm_type; + __pyx_t_19 = __Pyx_PyInt_AsInt(__pyx_v_kernel_index); if (unlikely((__pyx_t_19 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_20 = __pyx_v_degree; + __pyx_t_21 = __pyx_v_gamma; + __pyx_t_22 = __pyx_v_coef0; + __pyx_t_23 = __pyx_v_nu; + __pyx_t_24 = __pyx_v_cache_size; + + /* "scikits/learn/svm/libsvm.pyx":150 + * set_parameter( + * ¶m, svm_type, kernel_index, degree, gamma, coef0, nu, cache_size, + * C, tol, epsilon, shrinking, probability, <int> class_weight.shape[0], # <<<<<<<<<<<<<< + * class_weight_label.data, class_weight.data) + * + */ + __pyx_t_25 = __pyx_v_C; + __pyx_t_26 = __pyx_v_tol; + __pyx_t_27 = __pyx_v_epsilon; + __pyx_t_28 = __pyx_v_shrinking; + __pyx_t_29 = __pyx_v_probability; + __pyx_t_30 = ((int)(__pyx_v_class_weight->dimensions[0])); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":151 + /* "scikits/learn/svm/libsvm.pyx":151 * ¶m, svm_type, kernel_index, degree, gamma, coef0, nu, cache_size, * C, tol, epsilon, shrinking, probability, <int> class_weight.shape[0], * class_weight_label.data, class_weight.data) # <<<<<<<<<<<<<< * * # check parameters */ - set_parameter((&__pyx_v_param), __pyx_v_svm_type, __pyx_t_9, __pyx_v_degree, __pyx_v_gamma, __pyx_v_coef0, __pyx_v_nu, __pyx_v_cache_size, __pyx_v_C, __pyx_v_tol, __pyx_v_epsilon, __pyx_v_shrinking, __pyx_v_probability, ((int)(__pyx_v_class_weight->dimensions[0])), __pyx_v_class_weight_label->data, __pyx_v_class_weight->data); + __pyx_t_16 = __pyx_v_class_weight_label->data; + set_parameter(__pyx_t_18, __pyx_t_9, __pyx_t_19, __pyx_t_20, __pyx_t_21, __pyx_t_22, __pyx_t_23, __pyx_t_24, __pyx_t_25, __pyx_t_26, __pyx_t_27, __pyx_t_28, __pyx_t_29, __pyx_t_30, __pyx_t_16, __pyx_v_class_weight->data); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":154 + /* "scikits/learn/svm/libsvm.pyx":154 * * # check parameters * error_msg = svm_check_parameter(&problem, ¶m) # <<<<<<<<<<<<<< @@ -1533,41 +1639,41 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObje */ __pyx_v_error_msg = svm_check_parameter((&__pyx_v_problem), (&__pyx_v_param)); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":155 + /* "scikits/learn/svm/libsvm.pyx":155 * # check parameters * error_msg = svm_check_parameter(&problem, ¶m) * if error_msg: # <<<<<<<<<<<<<< * raise ValueError(error_msg) * */ - __pyx_t_2 = (__pyx_v_error_msg != 0); - if (__pyx_t_2) { + __pyx_t_3 = (__pyx_v_error_msg != 0); + if (__pyx_t_3) { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":156 + /* "scikits/learn/svm/libsvm.pyx":156 * error_msg = svm_check_parameter(&problem, ¶m) * if error_msg: * raise ValueError(error_msg) # <<<<<<<<<<<<<< * * # this does the real work */ - __pyx_t_5 = PyBytes_FromString(__pyx_v_error_msg); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyBytes_FromString(__pyx_v_error_msg); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_7)); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_7)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_7)); + __pyx_t_7 = 0; + __pyx_t_7 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_t_5)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_5)); - __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_7, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L8; } __pyx_L8:; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":159 + /* "scikits/learn/svm/libsvm.pyx":159 * * # this does the real work * model = svm_train(&problem, ¶m) # <<<<<<<<<<<<<< @@ -1576,7 +1682,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObje */ __pyx_v_model = svm_train((&__pyx_v_problem), (&__pyx_v_param)); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":163 + /* "scikits/learn/svm/libsvm.pyx":163 * # from here until the end, we just copy the data returned by * # svm_train * SV_len = get_l(model) # <<<<<<<<<<<<<< @@ -1585,69 +1691,69 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObje */ __pyx_v_SV_len = get_l(__pyx_v_model); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":164 + /* "scikits/learn/svm/libsvm.pyx":164 * # svm_train * SV_len = get_l(model) * n_class = get_nr(model) # <<<<<<<<<<<<<< * * # copy model.sv_coef */ - __pyx_t_5 = __Pyx_PyInt_to_py_Py_intptr_t(get_nr(__pyx_v_model)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = __Pyx_PyInt_to_py_Py_intptr_t(get_nr(__pyx_v_model)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_v_n_class); - __pyx_v_n_class = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_v_n_class = __pyx_t_7; + __pyx_t_7 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":168 + /* "scikits/learn/svm/libsvm.pyx":168 * # copy model.sv_coef * cdef np.ndarray[np.float64_t, ndim=2, mode='c'] sv_coef * sv_coef = np.empty((n_class-1, SV_len), dtype=np.float64) # <<<<<<<<<<<<<< * copy_sv_coef (sv_coef.data, model) * */ - __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__empty); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Subtract(__pyx_v_n_class, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyInt_to_py_Py_intptr_t(__pyx_v_SV_len); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyNumber_Subtract(__pyx_v_n_class, __pyx_int_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = __Pyx_PyInt_to_py_Py_intptr_t(__pyx_v_SV_len); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __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); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_5 = 0; - __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_7 = 0; + __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_4)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_7, __pyx_t_3, ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_5, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_13 = ((PyArrayObject *)__pyx_t_6); + __pyx_t_31 = ((PyArrayObject *)__pyx_t_6); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_sv_coef); - __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_sv_coef, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack); - if (unlikely(__pyx_t_9 < 0)) { + __pyx_t_30 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_sv_coef, (PyObject*)__pyx_t_31, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_30 < 0)) { PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_sv_coef, (PyObject*)__pyx_v_sv_coef, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) { Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); @@ -1658,14 +1764,14 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObje } __pyx_bstride_0_sv_coef = __pyx_bstruct_sv_coef.strides[0]; __pyx_bstride_1_sv_coef = __pyx_bstruct_sv_coef.strides[1]; __pyx_bshape_0_sv_coef = __pyx_bstruct_sv_coef.shape[0]; __pyx_bshape_1_sv_coef = __pyx_bstruct_sv_coef.shape[1]; - if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_30 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_13 = 0; + __pyx_t_31 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_sv_coef)); __pyx_v_sv_coef = ((PyArrayObject *)__pyx_t_6); __pyx_t_6 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":169 + /* "scikits/learn/svm/libsvm.pyx":169 * cdef np.ndarray[np.float64_t, ndim=2, mode='c'] sv_coef * sv_coef = np.empty((n_class-1, SV_len), dtype=np.float64) * copy_sv_coef (sv_coef.data, model) # <<<<<<<<<<<<<< @@ -1674,7 +1780,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObje */ copy_sv_coef(__pyx_v_sv_coef->data, __pyx_v_model); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":174 + /* "scikits/learn/svm/libsvm.pyx":174 * # the intercept is just model.rho but with sign changed * cdef np.ndarray[np.float64_t, ndim=1, mode='c'] intercept * intercept = np.empty(n_class*(n_class-1)/2, dtype=np.float64) # <<<<<<<<<<<<<< @@ -1688,38 +1794,38 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObje __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyNumber_Subtract(__pyx_v_n_class, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = PyNumber_Multiply(__pyx_v_n_class, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyNumber_Multiply(__pyx_v_n_class, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_int_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_int_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __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[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); + __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 = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_6)); - __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_4, __pyx_t_3, ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyEval_CallObjectWithKeywords(__pyx_t_4, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_14 = ((PyArrayObject *)__pyx_t_5); + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_32 = ((PyArrayObject *)__pyx_t_7); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_intercept); - __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_intercept, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack); - if (unlikely(__pyx_t_9 < 0)) { + __pyx_t_30 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_intercept, (PyObject*)__pyx_t_32, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_30 < 0)) { PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_intercept, (PyObject*)__pyx_v_intercept, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) { Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); @@ -1730,14 +1836,14 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObje } __pyx_bstride_0_intercept = __pyx_bstruct_intercept.strides[0]; __pyx_bshape_0_intercept = __pyx_bstruct_intercept.shape[0]; - if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_30 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_14 = 0; + __pyx_t_32 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_intercept)); - __pyx_v_intercept = ((PyArrayObject *)__pyx_t_5); - __pyx_t_5 = 0; + __pyx_v_intercept = ((PyArrayObject *)__pyx_t_7); + __pyx_t_7 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":175 + /* "scikits/learn/svm/libsvm.pyx":175 * cdef np.ndarray[np.float64_t, ndim=1, mode='c'] intercept * intercept = np.empty(n_class*(n_class-1)/2, dtype=np.float64) * copy_intercept (intercept.data, model, intercept.shape) # <<<<<<<<<<<<<< @@ -1746,46 +1852,46 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObje */ copy_intercept(__pyx_v_intercept->data, __pyx_v_model, __pyx_v_intercept->dimensions); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":178 + /* "scikits/learn/svm/libsvm.pyx":178 * * cdef np.ndarray[np.int32_t, ndim=1, mode='c'] support * support = np.empty (SV_len, dtype=np.int32) # <<<<<<<<<<<<<< * copy_support (support.data, model) * */ - __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyInt_to_py_Py_intptr_t(__pyx_v_SV_len); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __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); - __pyx_t_5 = 0; - __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyInt_to_py_Py_intptr_t(__pyx_v_SV_len); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_7)); __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__int32); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyEval_CallObjectWithKeywords(__pyx_t_6, __pyx_t_3, ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_6, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_15 = ((PyArrayObject *)__pyx_t_7); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_33 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_support); - __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_support, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack); - if (unlikely(__pyx_t_9 < 0)) { + __pyx_t_30 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_support, (PyObject*)__pyx_t_33, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_30 < 0)) { PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_support, (PyObject*)__pyx_v_support, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) { Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); @@ -1796,14 +1902,14 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObje } __pyx_bstride_0_support = __pyx_bstruct_support.strides[0]; __pyx_bshape_0_support = __pyx_bstruct_support.shape[0]; - if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_30 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_15 = 0; + __pyx_t_33 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_support)); - __pyx_v_support = ((PyArrayObject *)__pyx_t_7); - __pyx_t_7 = 0; + __pyx_v_support = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":179 + /* "scikits/learn/svm/libsvm.pyx":179 * cdef np.ndarray[np.int32_t, ndim=1, mode='c'] support * support = np.empty (SV_len, dtype=np.int32) * copy_support (support.data, model) # <<<<<<<<<<<<<< @@ -1812,65 +1918,51 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObje */ copy_support(__pyx_v_support->data, __pyx_v_model); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":183 + /* "scikits/learn/svm/libsvm.pyx":183 * # copy model.SV * cdef np.ndarray[np.float64_t, ndim=2, mode='c'] support_vectors * if kernel_index == 4: # <<<<<<<<<<<<<< * support_vectors = np.empty((0, 0), dtype=np.float64) * else: */ - __pyx_t_7 = PyObject_RichCompare(__pyx_v_kernel_index, __pyx_int_4, Py_EQ); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__pyx_t_2) { + __pyx_t_5 = PyObject_RichCompare(__pyx_v_kernel_index, __pyx_int_4, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_3) { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":184 + /* "scikits/learn/svm/libsvm.pyx":184 * cdef np.ndarray[np.float64_t, ndim=2, mode='c'] support_vectors * if kernel_index == 4: * support_vectors = np.empty((0, 0), dtype=np.float64) # <<<<<<<<<<<<<< * else: * support_vectors = np.empty((SV_len, X.shape[1]), dtype=np.float64) */ - __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__empty); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_7); - __pyx_t_7 = 0; - __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_7)); - __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_5, __pyx_t_3, ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_16 = ((PyArrayObject *)__pyx_t_4); + __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_7, ((PyObject *)__pyx_k_tuple_7), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_34 = ((PyArrayObject *)__pyx_t_6); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_support_vectors); - __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_support_vectors, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack); - if (unlikely(__pyx_t_9 < 0)) { + __pyx_t_30 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_support_vectors, (PyObject*)__pyx_t_34, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_30 < 0)) { PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_support_vectors, (PyObject*)__pyx_v_support_vectors, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) { Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); @@ -1881,66 +1973,66 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObje } __pyx_bstride_0_support_vectors = __pyx_bstruct_support_vectors.strides[0]; __pyx_bstride_1_support_vectors = __pyx_bstruct_support_vectors.strides[1]; __pyx_bshape_0_support_vectors = __pyx_bstruct_support_vectors.shape[0]; __pyx_bshape_1_support_vectors = __pyx_bstruct_support_vectors.shape[1]; - if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_30 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_16 = 0; + __pyx_t_34 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_support_vectors)); - __pyx_v_support_vectors = ((PyArrayObject *)__pyx_t_4); - __pyx_t_4 = 0; + __pyx_v_support_vectors = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; goto __pyx_L9; } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":186 + /* "scikits/learn/svm/libsvm.pyx":186 * support_vectors = np.empty((0, 0), dtype=np.float64) * else: * support_vectors = np.empty((SV_len, X.shape[1]), dtype=np.float64) # <<<<<<<<<<<<<< * copy_SV(support_vectors.data, model, support_vectors.shape) * */ - __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__empty); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyInt_to_py_Py_intptr_t(__pyx_v_SV_len); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyInt_to_py_Py_intptr_t((__pyx_v_X->dimensions[1])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __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); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_4 = 0; - __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __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); - __pyx_t_5 = 0; - __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_7, __pyx_t_3, ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyInt_to_py_Py_intptr_t(__pyx_v_SV_len); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_16 = ((PyArrayObject *)__pyx_t_6); + __pyx_t_7 = __Pyx_PyInt_to_py_Py_intptr_t((__pyx_v_X->dimensions[1])); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_7)); + PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_t_1)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_5, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_34 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_support_vectors); - __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_support_vectors, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack); - if (unlikely(__pyx_t_9 < 0)) { + __pyx_t_30 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_support_vectors, (PyObject*)__pyx_t_34, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_30 < 0)) { PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_support_vectors, (PyObject*)__pyx_v_support_vectors, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) { Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); @@ -1951,14 +2043,14 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObje } __pyx_bstride_0_support_vectors = __pyx_bstruct_support_vectors.strides[0]; __pyx_bstride_1_support_vectors = __pyx_bstruct_support_vectors.strides[1]; __pyx_bshape_0_support_vectors = __pyx_bstruct_support_vectors.shape[0]; __pyx_bshape_1_support_vectors = __pyx_bstruct_support_vectors.shape[1]; - if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_30 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_16 = 0; + __pyx_t_34 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_support_vectors)); - __pyx_v_support_vectors = ((PyArrayObject *)__pyx_t_6); - __pyx_t_6 = 0; + __pyx_v_support_vectors = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":187 + /* "scikits/learn/svm/libsvm.pyx":187 * else: * support_vectors = np.empty((SV_len, X.shape[1]), dtype=np.float64) * copy_SV(support_vectors.data, model, support_vectors.shape) # <<<<<<<<<<<<<< @@ -1969,44 +2061,44 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObje } __pyx_L9:; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":192 + /* "scikits/learn/svm/libsvm.pyx":192 * # TODO: do only in classification * cdef np.ndarray[np.int32_t, ndim=1, mode='c'] n_class_SV * n_class_SV = np.empty(n_class, dtype=np.int32) # <<<<<<<<<<<<<< * copy_nSV(n_class_SV.data, model) * */ - __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF(__pyx_v_n_class); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_n_class); - __Pyx_GIVEREF(__pyx_v_n_class); - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__int32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_5, __pyx_t_6, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_INCREF(__pyx_v_n_class); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_n_class); + __Pyx_GIVEREF(__pyx_v_n_class); + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_7)); + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__int32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_17 = ((PyArrayObject *)__pyx_t_4); + __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_35 = ((PyArrayObject *)__pyx_t_6); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_n_class_SV); - __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_n_class_SV, (PyObject*)__pyx_t_17, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack); - if (unlikely(__pyx_t_9 < 0)) { + __pyx_t_30 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_n_class_SV, (PyObject*)__pyx_t_35, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_30 < 0)) { PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_n_class_SV, (PyObject*)__pyx_v_n_class_SV, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) { Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); @@ -2017,14 +2109,14 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObje } __pyx_bstride_0_n_class_SV = __pyx_bstruct_n_class_SV.strides[0]; __pyx_bshape_0_n_class_SV = __pyx_bstruct_n_class_SV.shape[0]; - if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_30 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_17 = 0; + __pyx_t_35 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_n_class_SV)); - __pyx_v_n_class_SV = ((PyArrayObject *)__pyx_t_4); - __pyx_t_4 = 0; + __pyx_v_n_class_SV = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":193 + /* "scikits/learn/svm/libsvm.pyx":193 * cdef np.ndarray[np.int32_t, ndim=1, mode='c'] n_class_SV * n_class_SV = np.empty(n_class, dtype=np.int32) * copy_nSV(n_class_SV.data, model) # <<<<<<<<<<<<<< @@ -2033,44 +2125,44 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObje */ copy_nSV(__pyx_v_n_class_SV->data, __pyx_v_model); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":197 + /* "scikits/learn/svm/libsvm.pyx":197 * # copy label * cdef np.ndarray[np.int32_t, ndim=1, mode='c'] label * label = np.empty((n_class), dtype=np.int32) # <<<<<<<<<<<<<< * copy_label(label.data, model) * */ - __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __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 = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__empty); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_6)); __Pyx_INCREF(__pyx_v_n_class); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_n_class); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_n_class); __Pyx_GIVEREF(__pyx_v_n_class); - __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); - __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__int32); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_7, ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyEval_CallObjectWithKeywords(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_18 = ((PyArrayObject *)__pyx_t_7); + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_36 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_label); - __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_label, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack); - if (unlikely(__pyx_t_9 < 0)) { + __pyx_t_30 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_label, (PyObject*)__pyx_t_36, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_30 < 0)) { PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_label, (PyObject*)__pyx_v_label, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) { Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); @@ -2081,14 +2173,14 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObje } __pyx_bstride_0_label = __pyx_bstruct_label.strides[0]; __pyx_bshape_0_label = __pyx_bstruct_label.shape[0]; - if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_30 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_18 = 0; + __pyx_t_36 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_label)); - __pyx_v_label = ((PyArrayObject *)__pyx_t_7); - __pyx_t_7 = 0; + __pyx_v_label = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":198 + /* "scikits/learn/svm/libsvm.pyx":198 * cdef np.ndarray[np.int32_t, ndim=1, mode='c'] label * label = np.empty((n_class), dtype=np.int32) * copy_label(label.data, model) # <<<<<<<<<<<<<< @@ -2097,72 +2189,72 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObje */ copy_label(__pyx_v_label->data, __pyx_v_model); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":203 + /* "scikits/learn/svm/libsvm.pyx":203 * cdef np.ndarray[np.float64_t, ndim=1, mode='c'] probA * cdef np.ndarray[np.float64_t, ndim=1, mode='c'] probB * if probability != 0: # <<<<<<<<<<<<<< * if svm_type < 2: # SVC and NuSVC * probA = np.empty(n_class*(n_class-1)/2, dtype=np.float64) */ - __pyx_t_2 = (__pyx_v_probability != 0); - if (__pyx_t_2) { + __pyx_t_3 = (__pyx_v_probability != 0); + if (__pyx_t_3) { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":204 + /* "scikits/learn/svm/libsvm.pyx":204 * cdef np.ndarray[np.float64_t, ndim=1, mode='c'] probB * if probability != 0: * if svm_type < 2: # SVC and NuSVC # <<<<<<<<<<<<<< * probA = np.empty(n_class*(n_class-1)/2, dtype=np.float64) * probB = np.empty(n_class*(n_class-1)/2, dtype=np.float64) */ - __pyx_t_2 = (__pyx_v_svm_type < 2); - if (__pyx_t_2) { + __pyx_t_3 = (__pyx_v_svm_type < 2); + if (__pyx_t_3) { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":205 + /* "scikits/learn/svm/libsvm.pyx":205 * if probability != 0: * if svm_type < 2: # SVC and NuSVC * probA = np.empty(n_class*(n_class-1)/2, dtype=np.float64) # <<<<<<<<<<<<<< * probB = np.empty(n_class*(n_class-1)/2, dtype=np.float64) * copy_probB(probB.data, model, probB.shape) */ - __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_Subtract(__pyx_v_n_class, __pyx_int_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = PyNumber_Multiply(__pyx_v_n_class, __pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_int_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __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 = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_7); - __pyx_t_7 = 0; - __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_7)); - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyNumber_Subtract(__pyx_v_n_class, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyNumber_Multiply(__pyx_v_n_class, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_6, __pyx_t_4, ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_6, __pyx_int_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_6)); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__float64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_t_4, ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_19 = ((PyArrayObject *)__pyx_t_5); + __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_37 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_probA); - __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_probA, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack); - if (unlikely(__pyx_t_9 < 0)) { + __pyx_t_30 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_probA, (PyObject*)__pyx_t_37, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_30 < 0)) { PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_probA, (PyObject*)__pyx_v_probA, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) { Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); @@ -2173,59 +2265,59 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObje } __pyx_bstride_0_probA = __pyx_bstruct_probA.strides[0]; __pyx_bshape_0_probA = __pyx_bstruct_probA.shape[0]; - if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_30 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_19 = 0; + __pyx_t_37 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_probA)); - __pyx_v_probA = ((PyArrayObject *)__pyx_t_5); - __pyx_t_5 = 0; + __pyx_v_probA = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":206 + /* "scikits/learn/svm/libsvm.pyx":206 * if svm_type < 2: # SVC and NuSVC * probA = np.empty(n_class*(n_class-1)/2, dtype=np.float64) * probB = np.empty(n_class*(n_class-1)/2, dtype=np.float64) # <<<<<<<<<<<<<< * copy_probB(probB.data, model, probB.shape) * else: */ - __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__empty); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Subtract(__pyx_v_n_class, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyNumber_Multiply(__pyx_v_n_class, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_int_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __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 = 206; __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 = 0; - __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Subtract(__pyx_v_n_class, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyNumber_Multiply(__pyx_v_n_class, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__float64); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_6, __pyx_int_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyEval_CallObjectWithKeywords(__pyx_t_7, __pyx_t_4, ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_6)); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_20 = ((PyArrayObject *)__pyx_t_3); + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyEval_CallObjectWithKeywords(__pyx_t_5, ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_38 = ((PyArrayObject *)__pyx_t_7); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_probB); - __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_probB, (PyObject*)__pyx_t_20, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack); - if (unlikely(__pyx_t_9 < 0)) { + __pyx_t_30 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_probB, (PyObject*)__pyx_t_38, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_30 < 0)) { PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_probB, (PyObject*)__pyx_v_probB, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) { Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); @@ -2236,14 +2328,14 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObje } __pyx_bstride_0_probB = __pyx_bstruct_probB.strides[0]; __pyx_bshape_0_probB = __pyx_bstruct_probB.shape[0]; - if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_30 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_20 = 0; + __pyx_t_38 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_probB)); - __pyx_v_probB = ((PyArrayObject *)__pyx_t_3); - __pyx_t_3 = 0; + __pyx_v_probB = ((PyArrayObject *)__pyx_t_7); + __pyx_t_7 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":207 + /* "scikits/learn/svm/libsvm.pyx":207 * probA = np.empty(n_class*(n_class-1)/2, dtype=np.float64) * probB = np.empty(n_class*(n_class-1)/2, dtype=np.float64) * copy_probB(probB.data, model, probB.shape) # <<<<<<<<<<<<<< @@ -2255,44 +2347,38 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObje } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":209 + /* "scikits/learn/svm/libsvm.pyx":209 * copy_probB(probB.data, model, probB.shape) * else: * probA = np.empty(1, dtype=np.float64) # <<<<<<<<<<<<<< * probB = np.empty(0, dtype=np.float64) * copy_probA(probA.data, model, probA.shape) */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_int_1); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_5, __pyx_t_3, ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_7)); + __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_19 = ((PyArrayObject *)__pyx_t_6); + __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_k_tuple_8), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_37 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_probA); - __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_probA, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack); - if (unlikely(__pyx_t_9 < 0)) { + __pyx_t_30 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_probA, (PyObject*)__pyx_t_37, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_30 < 0)) { PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_probA, (PyObject*)__pyx_v_probA, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) { Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); @@ -2303,51 +2389,45 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObje } __pyx_bstride_0_probA = __pyx_bstruct_probA.strides[0]; __pyx_bshape_0_probA = __pyx_bstruct_probA.shape[0]; - if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_30 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_19 = 0; + __pyx_t_37 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_probA)); - __pyx_v_probA = ((PyArrayObject *)__pyx_t_6); - __pyx_t_6 = 0; + __pyx_v_probA = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":210 + /* "scikits/learn/svm/libsvm.pyx":210 * else: * probA = np.empty(1, dtype=np.float64) * probB = np.empty(0, dtype=np.float64) # <<<<<<<<<<<<<< * copy_probA(probA.data, model, probA.shape) * else: */ - __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__empty); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyEval_CallObjectWithKeywords(__pyx_t_4, __pyx_t_6, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_20 = ((PyArrayObject *)__pyx_t_7); + __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_7, ((PyObject *)__pyx_k_tuple_9), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_38 = ((PyArrayObject *)__pyx_t_6); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_probB); - __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_probB, (PyObject*)__pyx_t_20, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack); - if (unlikely(__pyx_t_9 < 0)) { + __pyx_t_30 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_probB, (PyObject*)__pyx_t_38, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_30 < 0)) { PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_probB, (PyObject*)__pyx_v_probB, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) { Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); @@ -2358,16 +2438,16 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObje } __pyx_bstride_0_probB = __pyx_bstruct_probB.strides[0]; __pyx_bshape_0_probB = __pyx_bstruct_probB.shape[0]; - if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_30 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_20 = 0; + __pyx_t_38 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_probB)); - __pyx_v_probB = ((PyArrayObject *)__pyx_t_7); - __pyx_t_7 = 0; + __pyx_v_probB = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; } __pyx_L11:; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":211 + /* "scikits/learn/svm/libsvm.pyx":211 * probA = np.empty(1, dtype=np.float64) * probB = np.empty(0, dtype=np.float64) * copy_probA(probA.data, model, probA.shape) # <<<<<<<<<<<<<< @@ -2379,44 +2459,38 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObje } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":213 + /* "scikits/learn/svm/libsvm.pyx":213 * copy_probA(probA.data, model, probA.shape) * else: * probA = np.empty(0, dtype=np.float64) # <<<<<<<<<<<<<< * probA = np.empty(0, dtype=np.float64) * */ + __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_6)); __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__float64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); - __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_t_5, ((PyObject *)__pyx_k_tuple_10), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_3, __pyx_t_7, ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_19 = ((PyArrayObject *)__pyx_t_5); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_37 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_probA); - __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_probA, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack); - if (unlikely(__pyx_t_9 < 0)) { + __pyx_t_30 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_probA, (PyObject*)__pyx_t_37, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_30 < 0)) { PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_probA, (PyObject*)__pyx_v_probA, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) { Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); @@ -2427,51 +2501,45 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObje } __pyx_bstride_0_probA = __pyx_bstruct_probA.strides[0]; __pyx_bshape_0_probA = __pyx_bstruct_probA.shape[0]; - if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_30 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_19 = 0; + __pyx_t_37 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_probA)); - __pyx_v_probA = ((PyArrayObject *)__pyx_t_5); - __pyx_t_5 = 0; + __pyx_v_probA = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":214 + /* "scikits/learn/svm/libsvm.pyx":214 * else: * probA = np.empty(0, dtype=np.float64) * probA = np.empty(0, dtype=np.float64) # <<<<<<<<<<<<<< * * # memory deallocation */ + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_7)); - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_6, __pyx_t_5, ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyEval_CallObjectWithKeywords(__pyx_t_6, ((PyObject *)__pyx_k_tuple_11), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_19 = ((PyArrayObject *)__pyx_t_4); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_37 = ((PyArrayObject *)__pyx_t_7); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_probA); - __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_probA, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack); - if (unlikely(__pyx_t_9 < 0)) { + __pyx_t_30 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_probA, (PyObject*)__pyx_t_37, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_30 < 0)) { PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_probA, (PyObject*)__pyx_v_probA, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) { Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); @@ -2482,16 +2550,16 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObje } __pyx_bstride_0_probA = __pyx_bstruct_probA.strides[0]; __pyx_bshape_0_probA = __pyx_bstruct_probA.shape[0]; - if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_30 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_19 = 0; + __pyx_t_37 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_probA)); - __pyx_v_probA = ((PyArrayObject *)__pyx_t_4); - __pyx_t_4 = 0; + __pyx_v_probA = ((PyArrayObject *)__pyx_t_7); + __pyx_t_7 = 0; } __pyx_L10:; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":217 + /* "scikits/learn/svm/libsvm.pyx":217 * * # memory deallocation * svm_free_and_destroy_model(&model) # <<<<<<<<<<<<<< @@ -2500,7 +2568,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObje */ svm_free_and_destroy_model((&__pyx_v_model)); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":218 + /* "scikits/learn/svm/libsvm.pyx":218 * # memory deallocation * svm_free_and_destroy_model(&model) * free(problem.x) # <<<<<<<<<<<<<< @@ -2509,7 +2577,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObje */ free(__pyx_v_problem.x); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":219 + /* "scikits/learn/svm/libsvm.pyx":219 * svm_free_and_destroy_model(&model) * free(problem.x) * return support, support_vectors, n_class_SV, sv_coef, intercept, label, \ # <<<<<<<<<<<<<< @@ -2518,47 +2586,47 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObje */ __Pyx_XDECREF(__pyx_r); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":220 + /* "scikits/learn/svm/libsvm.pyx":220 * free(problem.x) * return support, support_vectors, n_class_SV, sv_coef, intercept, label, \ * probA, probB # <<<<<<<<<<<<<< * * */ - __pyx_t_4 = PyTuple_New(8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = PyTuple_New(8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_7)); __Pyx_INCREF(((PyObject *)__pyx_v_support)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_support)); + PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_support)); __Pyx_GIVEREF(((PyObject *)__pyx_v_support)); __Pyx_INCREF(((PyObject *)__pyx_v_support_vectors)); - PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_support_vectors)); + PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)__pyx_v_support_vectors)); __Pyx_GIVEREF(((PyObject *)__pyx_v_support_vectors)); __Pyx_INCREF(((PyObject *)__pyx_v_n_class_SV)); - PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_v_n_class_SV)); + PyTuple_SET_ITEM(__pyx_t_7, 2, ((PyObject *)__pyx_v_n_class_SV)); __Pyx_GIVEREF(((PyObject *)__pyx_v_n_class_SV)); __Pyx_INCREF(((PyObject *)__pyx_v_sv_coef)); - PyTuple_SET_ITEM(__pyx_t_4, 3, ((PyObject *)__pyx_v_sv_coef)); + PyTuple_SET_ITEM(__pyx_t_7, 3, ((PyObject *)__pyx_v_sv_coef)); __Pyx_GIVEREF(((PyObject *)__pyx_v_sv_coef)); __Pyx_INCREF(((PyObject *)__pyx_v_intercept)); - PyTuple_SET_ITEM(__pyx_t_4, 4, ((PyObject *)__pyx_v_intercept)); + PyTuple_SET_ITEM(__pyx_t_7, 4, ((PyObject *)__pyx_v_intercept)); __Pyx_GIVEREF(((PyObject *)__pyx_v_intercept)); __Pyx_INCREF(((PyObject *)__pyx_v_label)); - PyTuple_SET_ITEM(__pyx_t_4, 5, ((PyObject *)__pyx_v_label)); + PyTuple_SET_ITEM(__pyx_t_7, 5, ((PyObject *)__pyx_v_label)); __Pyx_GIVEREF(((PyObject *)__pyx_v_label)); __Pyx_INCREF(((PyObject *)__pyx_v_probA)); - PyTuple_SET_ITEM(__pyx_t_4, 6, ((PyObject *)__pyx_v_probA)); + PyTuple_SET_ITEM(__pyx_t_7, 6, ((PyObject *)__pyx_v_probA)); __Pyx_GIVEREF(((PyObject *)__pyx_v_probA)); __Pyx_INCREF(((PyObject *)__pyx_v_probB)); - PyTuple_SET_ITEM(__pyx_t_4, 7, ((PyObject *)__pyx_v_probB)); + PyTuple_SET_ITEM(__pyx_t_7, 7, ((PyObject *)__pyx_v_probB)); __Pyx_GIVEREF(((PyObject *)__pyx_v_probB)); - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_r = ((PyObject *)__pyx_t_7); + __pyx_t_7 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); @@ -2579,7 +2647,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObje __Pyx_SafeReleaseBuffer(&__pyx_bstruct_n_class_SV); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_support); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("sklearn.svm.libsvm.fit"); + __Pyx_AddTraceback("scikits.learn.svm.libsvm.fit"); __pyx_r = NULL; goto __pyx_L2; __pyx_L0:; @@ -2613,7 +2681,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObje return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":223 +/* "scikits/learn/svm/libsvm.pyx":223 * * * def predict(np.ndarray[np.float64_t, ndim=2, mode='c'] X, # <<<<<<<<<<<<<< @@ -2621,9 +2689,10 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObje * np.ndarray[np.float64_t, ndim=2, mode='c'] SV, */ -static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_predict(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_7sklearn_3svm_6libsvm_predict[] = "\n Predict target values of X given a model (low-level method)\n\n Parameters\n ----------\n X: array-like, dtype=float, size=[n_samples, n_features]\n\n svm_type : {0, 1, 2, 3, 4}\n Type of SVM: C SVC, nu SVC, one class, epsilon SVR, nu SVR\n\n kernel : {'linear', 'rbf', 'poly', 'sigmoid', 'precomputed'}\n Kernel to use in the model: linear, polynomial, RBF, sigmoid\n or precomputed.\n\n degree : int\n Degree of the polynomial kernel (only relevant if kernel is\n set to polynomial)\n\n gamma : float\n Gamma parameter in RBF kernel (only relevant if kernel is set\n to RBF)\n\n coef0 : float\n Independent parameter in poly/sigmoid kernel.\n\n eps : float\n Stopping criteria.\n\n C : float\n C parameter in C-Support Vector Classification\n\n\n Return\n ------\n dec_values : array\n predicted values.\n\n\n TODO: probably there's no point in setting some parameters, like\n cache_size or weights.\n "; -static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_predict(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_1predict(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_7scikits_5learn_3svm_6libsvm_1predict[] = "\n Predict target values of X given a model (low-level method)\n\n Parameters\n ----------\n X: array-like, dtype=float, size=[n_samples, n_features]\n\n svm_type : {0, 1, 2, 3, 4}\n Type of SVM: C SVC, nu SVC, one class, epsilon SVR, nu SVR\n\n kernel : {'linear', 'rbf', 'poly', 'sigmoid', 'precomputed'}\n Kernel to use in the model: linear, polynomial, RBF, sigmoid\n or precomputed.\n\n degree : int\n Degree of the polynomial kernel (only relevant if kernel is\n set to polynomial)\n\n gamma : float\n Gamma parameter in RBF kernel (only relevant if kernel is set\n to RBF)\n\n coef0 : float\n Independent parameter in poly/sigmoid kernel.\n\n eps : float\n Stopping criteria.\n\n C : float\n C parameter in C-Support Vector Classification\n\n\n Return\n ------\n dec_values : array\n predicted values.\n\n\n TODO: probably there's no point in setting some parameters, like\n cache_size or weights.\n "; +static PyMethodDef __pyx_mdef_7scikits_5learn_3svm_6libsvm_1predict = {__Pyx_NAMESTR("predict"), (PyCFunction)__pyx_pf_7scikits_5learn_3svm_6libsvm_1predict, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7scikits_5learn_3svm_6libsvm_1predict)}; +static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_1predict(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyArrayObject *__pyx_v_X = 0; PyArrayObject *__pyx_v_support = 0; PyArrayObject *__pyx_v_SV = 0; @@ -2701,24 +2770,38 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_predict(PyObject *__pyx_self, Py PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - PyArrayObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - int __pyx_t_9; + struct svm_parameter *__pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + double __pyx_t_8; + double __pyx_t_9; + double __pyx_t_10; + double __pyx_t_11; + double __pyx_t_12; + double __pyx_t_13; + double __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + char *__pyx_t_18; + PyArrayObject *__pyx_t_19 = NULL; + PyObject *__pyx_t_20 = NULL; + PyObject *__pyx_t_21 = NULL; + PyObject *__pyx_t_22 = NULL; + int __pyx_t_23; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__X,&__pyx_n_s__support,&__pyx_n_s__SV,&__pyx_n_s__nSV,&__pyx_n_s__sv_coef,&__pyx_n_s__intercept,&__pyx_n_s__label,&__pyx_n_s__probA,&__pyx_n_s__probB,&__pyx_n_s__svm_type,&__pyx_n_s__kernel,&__pyx_n_s__degree,&__pyx_n_s__gamma,&__pyx_n_s__coef0,&__pyx_n_s__tol,&__pyx_n_s__C,&__pyx_n_s__nu,&__pyx_n_s__epsilon,&__pyx_n_s__class_weight_label,&__pyx_n_s__class_weight,&__pyx_n_s__sample_weight,&__pyx_n_s__shrinking,&__pyx_n_s__probability,&__pyx_n_s__cache_size,0}; __Pyx_RefNannySetupContext("predict"); __pyx_self = __pyx_self; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[24] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; - values[7] = (PyObject *)__pyx_k_7; - values[8] = (PyObject *)__pyx_k_8; - values[10] = ((PyObject *)__pyx_n_s__rbf); - values[18] = (PyObject *)__pyx_k_9; - values[19] = (PyObject *)__pyx_k_10; - values[20] = (PyObject *)__pyx_k_11; + values[7] = (PyObject *)__pyx_k_12; + values[8] = (PyObject *)__pyx_k_13; + values[10] = ((PyObject*)__pyx_n_s__rbf); + values[18] = (PyObject *)__pyx_k_14; + values[19] = (PyObject *)__pyx_k_15; + values[20] = (PyObject *)__pyx_k_16; switch (PyTuple_GET_SIZE(__pyx_args)) { case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23); case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22); @@ -2891,7 +2974,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_predict(PyObject *__pyx_self, Py } else { __pyx_v_svm_type = ((int)0); } - __pyx_v_kernel = ((PyObject *)values[10]); + __pyx_v_kernel = ((PyObject*)values[10]); if (values[11]) { __pyx_v_degree = __Pyx_PyInt_AsInt(values[11]); if (unlikely((__pyx_v_degree == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { @@ -2901,7 +2984,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_predict(PyObject *__pyx_self, Py __pyx_v_gamma = __pyx_PyFloat_AsDouble(values[12]); if (unlikely((__pyx_v_gamma == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":233 + /* "scikits/learn/svm/libsvm.pyx":233 * np.ndarray[np.float64_t, ndim=1, mode='c'] probB=np.empty(0), * int svm_type=0, str kernel='rbf', int degree=3, * double gamma=0.1, double coef0=0., double tol=1e-3, # <<<<<<<<<<<<<< @@ -2924,7 +3007,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_predict(PyObject *__pyx_self, Py __pyx_v_C = __pyx_PyFloat_AsDouble(values[15]); if (unlikely((__pyx_v_C == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":234 + /* "scikits/learn/svm/libsvm.pyx":234 * int svm_type=0, str kernel='rbf', int degree=3, * double gamma=0.1, double coef0=0., double tol=1e-3, * double C=1., double nu=0.5, double epsilon=0.1, # <<<<<<<<<<<<<< @@ -2960,7 +3043,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_predict(PyObject *__pyx_self, Py __pyx_v_cache_size = __pyx_PyFloat_AsDouble(values[23]); if (unlikely((__pyx_v_cache_size == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":242 + /* "scikits/learn/svm/libsvm.pyx":242 * sample_weight=np.empty(0), * int shrinking=0, int probability=0, * double cache_size=100.): # <<<<<<<<<<<<<< @@ -2970,13 +3053,13 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_predict(PyObject *__pyx_self, Py __pyx_v_cache_size = ((double)100.); } } else { - __pyx_v_probA = __pyx_k_7; - __pyx_v_probB = __pyx_k_8; + __pyx_v_probA = __pyx_k_12; + __pyx_v_probB = __pyx_k_13; __pyx_v_svm_type = ((int)0); - __pyx_v_kernel = ((PyObject *)__pyx_n_s__rbf); + __pyx_v_kernel = ((PyObject*)__pyx_n_s__rbf); __pyx_v_degree = ((int)3); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":233 + /* "scikits/learn/svm/libsvm.pyx":233 * np.ndarray[np.float64_t, ndim=1, mode='c'] probB=np.empty(0), * int svm_type=0, str kernel='rbf', int degree=3, * double gamma=0.1, double coef0=0., double tol=1e-3, # <<<<<<<<<<<<<< @@ -2987,7 +3070,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_predict(PyObject *__pyx_self, Py __pyx_v_coef0 = ((double)0.); __pyx_v_tol = ((double)1e-3); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":234 + /* "scikits/learn/svm/libsvm.pyx":234 * int svm_type=0, str kernel='rbf', int degree=3, * double gamma=0.1, double coef0=0., double tol=1e-3, * double C=1., double nu=0.5, double epsilon=0.1, # <<<<<<<<<<<<<< @@ -2997,13 +3080,13 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_predict(PyObject *__pyx_self, Py __pyx_v_C = ((double)1.); __pyx_v_nu = ((double)0.5); __pyx_v_epsilon = ((double)0.1); - __pyx_v_class_weight_label = __pyx_k_9; - __pyx_v_class_weight = __pyx_k_10; - __pyx_v_sample_weight = __pyx_k_11; + __pyx_v_class_weight_label = __pyx_k_14; + __pyx_v_class_weight = __pyx_k_15; + __pyx_v_sample_weight = __pyx_k_16; __pyx_v_shrinking = ((int)0); __pyx_v_probability = ((int)0); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":242 + /* "scikits/learn/svm/libsvm.pyx":242 * sample_weight=np.empty(0), * int shrinking=0, int probability=0, * double cache_size=100.): # <<<<<<<<<<<<<< @@ -3039,7 +3122,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_predict(PyObject *__pyx_self, Py case 12: __pyx_v_degree = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 11)); if (unlikely((__pyx_v_degree == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L3_error;} case 11: - __pyx_v_kernel = ((PyObject *)PyTuple_GET_ITEM(__pyx_args, 10)); + __pyx_v_kernel = ((PyObject*)PyTuple_GET_ITEM(__pyx_args, 10)); case 10: __pyx_v_svm_type = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 9)); if (unlikely((__pyx_v_svm_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L3_error;} case 9: @@ -3062,7 +3145,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_predict(PyObject *__pyx_self, Py __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("predict", 0, 7, 24, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("sklearn.svm.libsvm.predict"); + __Pyx_AddTraceback("scikits.learn.svm.libsvm.predict"); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; @@ -3090,7 +3173,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_predict(PyObject *__pyx_self, Py if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_label), __pyx_ptype_5numpy_ndarray, 1, "label", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_probA), __pyx_ptype_5numpy_ndarray, 1, "probA", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_probB), __pyx_ptype_5numpy_ndarray, 1, "probB", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kernel), &PyString_Type, 1, "kernel", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kernel), (&PyString_Type), 1, "kernel", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_class_weight_label), __pyx_ptype_5numpy_ndarray, 1, "class_weight_label", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_class_weight), __pyx_ptype_5numpy_ndarray, 1, "class_weight", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sample_weight), __pyx_ptype_5numpy_ndarray, 1, "sample_weight", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -3167,7 +3250,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_predict(PyObject *__pyx_self, Py __pyx_bstride_0_sample_weight = __pyx_bstruct_sample_weight.strides[0]; __pyx_bshape_0_sample_weight = __pyx_bstruct_sample_weight.shape[0]; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":288 + /* "scikits/learn/svm/libsvm.pyx":288 * cdef svm_model *model * * kernel_index = LIBSVM_KERNEL_TYPES.index(kernel) # <<<<<<<<<<<<<< @@ -3180,37 +3263,67 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_predict(PyObject *__pyx_self, Py __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 = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_INCREF(((PyObject *)__pyx_v_kernel)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_kernel)); __Pyx_GIVEREF(((PyObject *)__pyx_v_kernel)); - __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_v_kernel_index); __pyx_v_kernel_index = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":289 + /* "scikits/learn/svm/libsvm.pyx":289 * * kernel_index = LIBSVM_KERNEL_TYPES.index(kernel) * set_parameter(¶m, svm_type, kernel_index, degree, gamma, coef0, # <<<<<<<<<<<<<< * nu, cache_size, C, tol, epsilon, shrinking, * probability, <int> class_weight.shape[0], */ - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_v_kernel_index); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = (&__pyx_v_param); + __pyx_t_5 = __pyx_v_svm_type; + __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_kernel_index); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __pyx_v_degree; + __pyx_t_8 = __pyx_v_gamma; + __pyx_t_9 = __pyx_v_coef0; + + /* "scikits/learn/svm/libsvm.pyx":290 + * kernel_index = LIBSVM_KERNEL_TYPES.index(kernel) + * set_parameter(¶m, svm_type, kernel_index, degree, gamma, coef0, + * nu, cache_size, C, tol, epsilon, shrinking, # <<<<<<<<<<<<<< + * probability, <int> class_weight.shape[0], + * class_weight_label.data, class_weight.data) + */ + __pyx_t_10 = __pyx_v_nu; + __pyx_t_11 = __pyx_v_cache_size; + __pyx_t_12 = __pyx_v_C; + __pyx_t_13 = __pyx_v_tol; + __pyx_t_14 = __pyx_v_epsilon; + __pyx_t_15 = __pyx_v_shrinking; + + /* "scikits/learn/svm/libsvm.pyx":291 + * set_parameter(¶m, svm_type, kernel_index, degree, gamma, coef0, + * nu, cache_size, C, tol, epsilon, shrinking, + * probability, <int> class_weight.shape[0], # <<<<<<<<<<<<<< + * class_weight_label.data, class_weight.data) + * + */ + __pyx_t_16 = __pyx_v_probability; + __pyx_t_17 = ((int)(__pyx_v_class_weight->dimensions[0])); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":292 + /* "scikits/learn/svm/libsvm.pyx":292 * nu, cache_size, C, tol, epsilon, shrinking, * probability, <int> class_weight.shape[0], * class_weight_label.data, class_weight.data) # <<<<<<<<<<<<<< * * model = set_model(¶m, <int> nSV.shape[0], SV.data, SV.shape, */ - set_parameter((&__pyx_v_param), __pyx_v_svm_type, __pyx_t_4, __pyx_v_degree, __pyx_v_gamma, __pyx_v_coef0, __pyx_v_nu, __pyx_v_cache_size, __pyx_v_C, __pyx_v_tol, __pyx_v_epsilon, __pyx_v_shrinking, __pyx_v_probability, ((int)(__pyx_v_class_weight->dimensions[0])), __pyx_v_class_weight_label->data, __pyx_v_class_weight->data); + __pyx_t_18 = __pyx_v_class_weight_label->data; + set_parameter(__pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_t_12, __pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_t_18, __pyx_v_class_weight->data); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":297 + /* "scikits/learn/svm/libsvm.pyx":297 * support.data, support.shape, sv_coef.strides, * sv_coef.data, intercept.data, nSV.data, * label.data, probA.data, probB.data) # <<<<<<<<<<<<<< @@ -3219,7 +3332,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_predict(PyObject *__pyx_self, Py */ __pyx_v_model = set_model((&__pyx_v_param), ((int)(__pyx_v_nSV->dimensions[0])), __pyx_v_SV->data, __pyx_v_SV->dimensions, __pyx_v_support->data, __pyx_v_support->dimensions, __pyx_v_sv_coef->strides, __pyx_v_sv_coef->data, __pyx_v_intercept->data, __pyx_v_nSV->data, __pyx_v_label->data, __pyx_v_probA->data, __pyx_v_probB->data); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":300 + /* "scikits/learn/svm/libsvm.pyx":300 * * #TODO: use check_model * dec_values = np.empty(X.shape[0]) # <<<<<<<<<<<<<< @@ -3234,71 +3347,61 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_predict(PyObject *__pyx_self, Py __pyx_t_3 = __Pyx_PyInt_to_py_Py_intptr_t((__pyx_v_X->dimensions[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_5 = ((PyArrayObject *)__pyx_t_3); + __pyx_t_19 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_dec_values); - __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_dec_values, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack); - if (unlikely(__pyx_t_4 < 0)) { - PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + __pyx_t_17 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_dec_values, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_17 < 0)) { + PyErr_Fetch(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_dec_values, (PyObject*)__pyx_v_dec_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); + Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_22); __Pyx_RaiseBufferFallbackError(); } else { - PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + PyErr_Restore(__pyx_t_20, __pyx_t_21, __pyx_t_22); } } __pyx_bstride_0_dec_values = __pyx_bstruct_dec_values.strides[0]; __pyx_bshape_0_dec_values = __pyx_bstruct_dec_values.shape[0]; - if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_17 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_5 = 0; + __pyx_t_19 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_dec_values)); __pyx_v_dec_values = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":301 + /* "scikits/learn/svm/libsvm.pyx":301 * #TODO: use check_model * dec_values = np.empty(X.shape[0]) * if copy_predict(X.data, model, X.shape, dec_values.data) < 0: # <<<<<<<<<<<<<< * raise MemoryError("We've run out of of memory") * free_model(model) */ - __pyx_t_9 = (copy_predict(__pyx_v_X->data, __pyx_v_model, __pyx_v_X->dimensions, __pyx_v_dec_values->data) < 0); - if (__pyx_t_9) { + __pyx_t_23 = (copy_predict(__pyx_v_X->data, __pyx_v_model, __pyx_v_X->dimensions, __pyx_v_dec_values->data) < 0); + if (__pyx_t_23) { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":302 + /* "scikits/learn/svm/libsvm.pyx":302 * dec_values = np.empty(X.shape[0]) * if copy_predict(X.data, model, X.shape, dec_values.data) < 0: * raise MemoryError("We've run out of of memory") # <<<<<<<<<<<<<< * free_model(model) * return dec_values */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_12)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_12)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_12)); - __pyx_t_2 = PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":303 + /* "scikits/learn/svm/libsvm.pyx":303 * if copy_predict(X.data, model, X.shape, dec_values.data) < 0: * raise MemoryError("We've run out of of memory") * free_model(model) # <<<<<<<<<<<<<< @@ -3307,7 +3410,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_predict(PyObject *__pyx_self, Py */ free_model(__pyx_v_model); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":304 + /* "scikits/learn/svm/libsvm.pyx":304 * raise MemoryError("We've run out of of memory") * free_model(model) * return dec_values # <<<<<<<<<<<<<< @@ -3341,7 +3444,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_predict(PyObject *__pyx_self, Py __Pyx_SafeReleaseBuffer(&__pyx_bstruct_SV); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_class_weight_label); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("sklearn.svm.libsvm.predict"); + __Pyx_AddTraceback("scikits.learn.svm.libsvm.predict"); __pyx_r = NULL; goto __pyx_L2; __pyx_L0:; @@ -3366,7 +3469,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_predict(PyObject *__pyx_self, Py return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":308 +/* "scikits/learn/svm/libsvm.pyx":308 * * * def predict_proba( # <<<<<<<<<<<<<< @@ -3374,9 +3477,10 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_predict(PyObject *__pyx_self, Py * np.ndarray[np.int32_t, ndim=1, mode='c'] support, */ -static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_predict_proba(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_7sklearn_3svm_6libsvm_predict_proba[] = "\n Predict probabilities\n\n svm_model stores all parameters needed to predict a given value.\n\n For speed, all real work is done at the C level in function\n copy_predict (libsvm_helper.c).\n\n We have to reconstruct model and parameters to make sure we stay\n in sync with the python object.\n\n Parameters\n ----------\n X: array-like, dtype=float\n Y: array\n target vector\n\n kernel : {'linear', 'rbf', 'poly', 'sigmoid', 'precomputed'}\n\n\n Optional Parameters\n -------------------\n See scikits.learn.svm.predict for a complete list of parameters.\n\n Return\n ------\n dec_values : array\n predicted values.\n "; -static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_predict_proba(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_2predict_proba(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_7scikits_5learn_3svm_6libsvm_2predict_proba[] = "\n Predict probabilities\n\n svm_model stores all parameters needed to predict a given value.\n\n For speed, all real work is done at the C level in function\n copy_predict (libsvm_helper.c).\n\n We have to reconstruct model and parameters to make sure we stay\n in sync with the python object.\n\n Parameters\n ----------\n X: array-like, dtype=float\n Y: array\n target vector\n\n kernel : {'linear', 'rbf', 'poly', 'sigmoid', 'precomputed'}\n\n\n Optional Parameters\n -------------------\n See scikits.learn.svm.predict for a complete list of parameters.\n\n Return\n ------\n dec_values : array\n predicted values.\n "; +static PyMethodDef __pyx_mdef_7scikits_5learn_3svm_6libsvm_2predict_proba = {__Pyx_NAMESTR("predict_proba"), (PyCFunction)__pyx_pf_7scikits_5learn_3svm_6libsvm_2predict_proba, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7scikits_5learn_3svm_6libsvm_2predict_proba)}; +static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_2predict_proba(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyArrayObject *__pyx_v_X = 0; PyArrayObject *__pyx_v_support = 0; PyArrayObject *__pyx_v_SV = 0; @@ -3457,26 +3561,40 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_predict_proba(PyObject *__pyx_se PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyArrayObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - PyObject *__pyx_t_10 = NULL; - int __pyx_t_11; + struct svm_parameter *__pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + double __pyx_t_8; + double __pyx_t_9; + double __pyx_t_10; + double __pyx_t_11; + double __pyx_t_12; + double __pyx_t_13; + double __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + char *__pyx_t_18; + PyObject *__pyx_t_19 = NULL; + PyObject *__pyx_t_20 = NULL; + PyArrayObject *__pyx_t_21 = NULL; + PyObject *__pyx_t_22 = NULL; + PyObject *__pyx_t_23 = NULL; + PyObject *__pyx_t_24 = NULL; + int __pyx_t_25; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__X,&__pyx_n_s__support,&__pyx_n_s__SV,&__pyx_n_s__nSV,&__pyx_n_s__sv_coef,&__pyx_n_s__intercept,&__pyx_n_s__label,&__pyx_n_s__probA,&__pyx_n_s__probB,&__pyx_n_s__svm_type,&__pyx_n_s__kernel,&__pyx_n_s__degree,&__pyx_n_s__gamma,&__pyx_n_s__coef0,&__pyx_n_s__tol,&__pyx_n_s__C,&__pyx_n_s__nu,&__pyx_n_s__epsilon,&__pyx_n_s__class_weight_label,&__pyx_n_s__class_weight,&__pyx_n_s__sample_weight,&__pyx_n_s__shrinking,&__pyx_n_s__probability,&__pyx_n_s__cache_size,0}; __Pyx_RefNannySetupContext("predict_proba"); __pyx_self = __pyx_self; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[24] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; - values[7] = (PyObject *)__pyx_k_13; - values[8] = (PyObject *)__pyx_k_14; - values[10] = ((PyObject *)__pyx_n_s__rbf); - values[18] = (PyObject *)__pyx_k_15; - values[19] = (PyObject *)__pyx_k_16; - values[20] = (PyObject *)__pyx_k_17; + values[7] = (PyObject *)__pyx_k_17; + values[8] = (PyObject *)__pyx_k_18; + values[10] = ((PyObject*)__pyx_n_s__rbf); + values[18] = (PyObject *)__pyx_k_19; + values[19] = (PyObject *)__pyx_k_20; + values[20] = (PyObject *)__pyx_k_21; switch (PyTuple_GET_SIZE(__pyx_args)) { case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23); case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22); @@ -3649,7 +3767,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_predict_proba(PyObject *__pyx_se } else { __pyx_v_svm_type = ((int)0); } - __pyx_v_kernel = ((PyObject *)values[10]); + __pyx_v_kernel = ((PyObject*)values[10]); if (values[11]) { __pyx_v_degree = __Pyx_PyInt_AsInt(values[11]); if (unlikely((__pyx_v_degree == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { @@ -3659,7 +3777,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_predict_proba(PyObject *__pyx_se __pyx_v_gamma = __pyx_PyFloat_AsDouble(values[12]); if (unlikely((__pyx_v_gamma == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":319 + /* "scikits/learn/svm/libsvm.pyx":319 * np.ndarray[np.float64_t, ndim=1, mode='c'] probB=np.empty(0), * int svm_type=0, str kernel='rbf', int degree=3, * double gamma=0.1, double coef0=0., double tol=1e-3, # <<<<<<<<<<<<<< @@ -3682,7 +3800,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_predict_proba(PyObject *__pyx_se __pyx_v_C = __pyx_PyFloat_AsDouble(values[15]); if (unlikely((__pyx_v_C == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":320 + /* "scikits/learn/svm/libsvm.pyx":320 * int svm_type=0, str kernel='rbf', int degree=3, * double gamma=0.1, double coef0=0., double tol=1e-3, * double C=1., double nu=0.5, double epsilon=0.1, # <<<<<<<<<<<<<< @@ -3718,7 +3836,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_predict_proba(PyObject *__pyx_se __pyx_v_cache_size = __pyx_PyFloat_AsDouble(values[23]); if (unlikely((__pyx_v_cache_size == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":328 + /* "scikits/learn/svm/libsvm.pyx":328 * sample_weight=np.empty(0), * int shrinking=0, int probability=0, * double cache_size=100.): # <<<<<<<<<<<<<< @@ -3728,13 +3846,13 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_predict_proba(PyObject *__pyx_se __pyx_v_cache_size = ((double)100.); } } else { - __pyx_v_probA = __pyx_k_13; - __pyx_v_probB = __pyx_k_14; + __pyx_v_probA = __pyx_k_17; + __pyx_v_probB = __pyx_k_18; __pyx_v_svm_type = ((int)0); - __pyx_v_kernel = ((PyObject *)__pyx_n_s__rbf); + __pyx_v_kernel = ((PyObject*)__pyx_n_s__rbf); __pyx_v_degree = ((int)3); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":319 + /* "scikits/learn/svm/libsvm.pyx":319 * np.ndarray[np.float64_t, ndim=1, mode='c'] probB=np.empty(0), * int svm_type=0, str kernel='rbf', int degree=3, * double gamma=0.1, double coef0=0., double tol=1e-3, # <<<<<<<<<<<<<< @@ -3745,7 +3863,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_predict_proba(PyObject *__pyx_se __pyx_v_coef0 = ((double)0.); __pyx_v_tol = ((double)1e-3); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":320 + /* "scikits/learn/svm/libsvm.pyx":320 * int svm_type=0, str kernel='rbf', int degree=3, * double gamma=0.1, double coef0=0., double tol=1e-3, * double C=1., double nu=0.5, double epsilon=0.1, # <<<<<<<<<<<<<< @@ -3755,13 +3873,13 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_predict_proba(PyObject *__pyx_se __pyx_v_C = ((double)1.); __pyx_v_nu = ((double)0.5); __pyx_v_epsilon = ((double)0.1); - __pyx_v_class_weight_label = __pyx_k_15; - __pyx_v_class_weight = __pyx_k_16; - __pyx_v_sample_weight = __pyx_k_17; + __pyx_v_class_weight_label = __pyx_k_19; + __pyx_v_class_weight = __pyx_k_20; + __pyx_v_sample_weight = __pyx_k_21; __pyx_v_shrinking = ((int)0); __pyx_v_probability = ((int)0); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":328 + /* "scikits/learn/svm/libsvm.pyx":328 * sample_weight=np.empty(0), * int shrinking=0, int probability=0, * double cache_size=100.): # <<<<<<<<<<<<<< @@ -3797,7 +3915,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_predict_proba(PyObject *__pyx_se case 12: __pyx_v_degree = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 11)); if (unlikely((__pyx_v_degree == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L3_error;} case 11: - __pyx_v_kernel = ((PyObject *)PyTuple_GET_ITEM(__pyx_args, 10)); + __pyx_v_kernel = ((PyObject*)PyTuple_GET_ITEM(__pyx_args, 10)); case 10: __pyx_v_svm_type = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 9)); if (unlikely((__pyx_v_svm_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L3_error;} case 9: @@ -3820,7 +3938,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_predict_proba(PyObject *__pyx_se __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("predict_proba", 0, 7, 24, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("sklearn.svm.libsvm.predict_proba"); + __Pyx_AddTraceback("scikits.learn.svm.libsvm.predict_proba"); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; @@ -3848,7 +3966,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_predict_proba(PyObject *__pyx_se if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_label), __pyx_ptype_5numpy_ndarray, 1, "label", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_probA), __pyx_ptype_5numpy_ndarray, 1, "probA", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_probB), __pyx_ptype_5numpy_ndarray, 1, "probB", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kernel), &PyString_Type, 1, "kernel", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kernel), (&PyString_Type), 1, "kernel", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_class_weight_label), __pyx_ptype_5numpy_ndarray, 1, "class_weight_label", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_class_weight), __pyx_ptype_5numpy_ndarray, 1, "class_weight", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sample_weight), __pyx_ptype_5numpy_ndarray, 1, "sample_weight", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -3925,7 +4043,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_predict_proba(PyObject *__pyx_se __pyx_bstride_0_sample_weight = __pyx_bstruct_sample_weight.strides[0]; __pyx_bshape_0_sample_weight = __pyx_bstruct_sample_weight.shape[0]; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":362 + /* "scikits/learn/svm/libsvm.pyx":362 * cdef svm_model *model * * kernel_index = LIBSVM_KERNEL_TYPES.index(kernel) # <<<<<<<<<<<<<< @@ -3938,37 +4056,67 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_predict_proba(PyObject *__pyx_se __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 = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_INCREF(((PyObject *)__pyx_v_kernel)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_kernel)); __Pyx_GIVEREF(((PyObject *)__pyx_v_kernel)); - __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_v_kernel_index); __pyx_v_kernel_index = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":363 + /* "scikits/learn/svm/libsvm.pyx":363 * * kernel_index = LIBSVM_KERNEL_TYPES.index(kernel) * set_parameter(¶m, svm_type, kernel_index, degree, gamma, # <<<<<<<<<<<<<< * coef0, nu, cache_size, C, tol, epsilon, shrinking, * probability, <int> class_weight.shape[0], class_weight_label.data, */ - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_v_kernel_index); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = (&__pyx_v_param); + __pyx_t_5 = __pyx_v_svm_type; + __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_kernel_index); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __pyx_v_degree; + __pyx_t_8 = __pyx_v_gamma; + + /* "scikits/learn/svm/libsvm.pyx":364 + * kernel_index = LIBSVM_KERNEL_TYPES.index(kernel) + * set_parameter(¶m, svm_type, kernel_index, degree, gamma, + * coef0, nu, cache_size, C, tol, epsilon, shrinking, # <<<<<<<<<<<<<< + * probability, <int> class_weight.shape[0], class_weight_label.data, + * class_weight.data) + */ + __pyx_t_9 = __pyx_v_coef0; + __pyx_t_10 = __pyx_v_nu; + __pyx_t_11 = __pyx_v_cache_size; + __pyx_t_12 = __pyx_v_C; + __pyx_t_13 = __pyx_v_tol; + __pyx_t_14 = __pyx_v_epsilon; + __pyx_t_15 = __pyx_v_shrinking; + + /* "scikits/learn/svm/libsvm.pyx":365 + * set_parameter(¶m, svm_type, kernel_index, degree, gamma, + * coef0, nu, cache_size, C, tol, epsilon, shrinking, + * probability, <int> class_weight.shape[0], class_weight_label.data, # <<<<<<<<<<<<<< + * class_weight.data) + * + */ + __pyx_t_16 = __pyx_v_probability; + __pyx_t_17 = ((int)(__pyx_v_class_weight->dimensions[0])); + __pyx_t_18 = __pyx_v_class_weight_label->data; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":366 + /* "scikits/learn/svm/libsvm.pyx":366 * coef0, nu, cache_size, C, tol, epsilon, shrinking, * probability, <int> class_weight.shape[0], class_weight_label.data, * class_weight.data) # <<<<<<<<<<<<<< * * model = set_model(¶m, <int> nSV.shape[0], SV.data, SV.shape, */ - set_parameter((&__pyx_v_param), __pyx_v_svm_type, __pyx_t_4, __pyx_v_degree, __pyx_v_gamma, __pyx_v_coef0, __pyx_v_nu, __pyx_v_cache_size, __pyx_v_C, __pyx_v_tol, __pyx_v_epsilon, __pyx_v_shrinking, __pyx_v_probability, ((int)(__pyx_v_class_weight->dimensions[0])), __pyx_v_class_weight_label->data, __pyx_v_class_weight->data); + set_parameter(__pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_t_12, __pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_t_18, __pyx_v_class_weight->data); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":371 + /* "scikits/learn/svm/libsvm.pyx":371 * support.data, support.shape, sv_coef.strides, * sv_coef.data, intercept.data, nSV.data, * label.data, probA.data, probB.data) # <<<<<<<<<<<<<< @@ -3977,7 +4125,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_predict_proba(PyObject *__pyx_se */ __pyx_v_model = set_model((&__pyx_v_param), ((int)(__pyx_v_nSV->dimensions[0])), __pyx_v_SV->data, __pyx_v_SV->dimensions, __pyx_v_support->data, __pyx_v_support->dimensions, __pyx_v_sv_coef->strides, __pyx_v_sv_coef->data, __pyx_v_intercept->data, __pyx_v_nSV->data, __pyx_v_label->data, __pyx_v_probA->data, __pyx_v_probB->data); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":373 + /* "scikits/learn/svm/libsvm.pyx":373 * label.data, probA.data, probB.data) * * cdef np.npy_intp n_class = get_nr(model) # <<<<<<<<<<<<<< @@ -3986,7 +4134,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_predict_proba(PyObject *__pyx_se */ __pyx_v_n_class = get_nr(__pyx_v_model); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":374 + /* "scikits/learn/svm/libsvm.pyx":374 * * cdef np.npy_intp n_class = get_nr(model) * dec_values = np.empty((X.shape[0], n_class), dtype=np.float64) # <<<<<<<<<<<<<< @@ -4002,90 +4150,80 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_predict_proba(PyObject *__pyx_se __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_to_py_Py_intptr_t(__pyx_v_n_class); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_19)); + PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_19)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_19)); + __pyx_t_19 = 0; + __pyx_t_19 = PyDict_New(); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_19)); __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_20 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__float64); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_19, ((PyObject *)__pyx_n_s__dtype), __pyx_t_20) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __pyx_t_20 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_19)); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_20); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0; + if (!(likely(((__pyx_t_20) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_20, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_21 = ((PyArrayObject *)__pyx_t_20); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_dec_values); - __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_dec_values, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack); - if (unlikely(__pyx_t_4 < 0)) { - PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + __pyx_t_17 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_dec_values, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_17 < 0)) { + PyErr_Fetch(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_dec_values, (PyObject*)__pyx_v_dec_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_23); Py_XDECREF(__pyx_t_24); __Pyx_RaiseBufferFallbackError(); } else { - PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + PyErr_Restore(__pyx_t_22, __pyx_t_23, __pyx_t_24); } } __pyx_bstride_0_dec_values = __pyx_bstruct_dec_values.strides[0]; __pyx_bstride_1_dec_values = __pyx_bstruct_dec_values.strides[1]; __pyx_bshape_0_dec_values = __pyx_bstruct_dec_values.shape[0]; __pyx_bshape_1_dec_values = __pyx_bstruct_dec_values.shape[1]; - if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_17 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_7 = 0; + __pyx_t_21 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_dec_values)); - __pyx_v_dec_values = ((PyArrayObject *)__pyx_t_6); - __pyx_t_6 = 0; + __pyx_v_dec_values = ((PyArrayObject *)__pyx_t_20); + __pyx_t_20 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":375 + /* "scikits/learn/svm/libsvm.pyx":375 * cdef np.npy_intp n_class = get_nr(model) * dec_values = np.empty((X.shape[0], n_class), dtype=np.float64) * if copy_predict_proba(X.data, model, X.shape, dec_values.data) < 0: # <<<<<<<<<<<<<< * raise MemoryError("We've run out of of memory") * # free model and param */ - __pyx_t_11 = (copy_predict_proba(__pyx_v_X->data, __pyx_v_model, __pyx_v_X->dimensions, __pyx_v_dec_values->data) < 0); - if (__pyx_t_11) { + __pyx_t_25 = (copy_predict_proba(__pyx_v_X->data, __pyx_v_model, __pyx_v_X->dimensions, __pyx_v_dec_values->data) < 0); + if (__pyx_t_25) { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":376 + /* "scikits/learn/svm/libsvm.pyx":376 * dec_values = np.empty((X.shape[0], n_class), dtype=np.float64) * if copy_predict_proba(X.data, model, X.shape, dec_values.data) < 0: * raise MemoryError("We've run out of of memory") # <<<<<<<<<<<<<< * # free model and param * free_model(model) */ - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_12)); - PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_kp_s_12)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_12)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":378 + /* "scikits/learn/svm/libsvm.pyx":378 * raise MemoryError("We've run out of of memory") * # free model and param * free_model(model) # <<<<<<<<<<<<<< @@ -4094,7 +4232,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_predict_proba(PyObject *__pyx_se */ free_model(__pyx_v_model); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":379 + /* "scikits/learn/svm/libsvm.pyx":379 * # free model and param * free_model(model) * return dec_values # <<<<<<<<<<<<<< @@ -4112,8 +4250,8 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_predict_proba(PyObject *__pyx_se __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_19); + __Pyx_XDECREF(__pyx_t_20); { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_probA); @@ -4130,7 +4268,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_predict_proba(PyObject *__pyx_se __Pyx_SafeReleaseBuffer(&__pyx_bstruct_SV); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_class_weight_label); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("sklearn.svm.libsvm.predict_proba"); + __Pyx_AddTraceback("scikits.learn.svm.libsvm.predict_proba"); __pyx_r = NULL; goto __pyx_L2; __pyx_L0:; @@ -4155,7 +4293,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_predict_proba(PyObject *__pyx_se return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":382 +/* "scikits/learn/svm/libsvm.pyx":382 * * * def decision_function( # <<<<<<<<<<<<<< @@ -4163,9 +4301,10 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_predict_proba(PyObject *__pyx_se * np.ndarray[np.int32_t, ndim=1, mode='c'] support, */ -static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_decision_function(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_7sklearn_3svm_6libsvm_decision_function[] = "\n Predict margin (libsvm name for this is predict_values)\n\n We have to reconstruct model and parameters to make sure we stay\n in sync with the python object.\n "; -static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_decision_function(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_3decision_function(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_7scikits_5learn_3svm_6libsvm_3decision_function[] = "\n Predict margin (libsvm name for this is predict_values)\n\n We have to reconstruct model and parameters to make sure we stay\n in sync with the python object.\n "; +static PyMethodDef __pyx_mdef_7scikits_5learn_3svm_6libsvm_3decision_function = {__Pyx_NAMESTR("decision_function"), (PyCFunction)__pyx_pf_7scikits_5learn_3svm_6libsvm_3decision_function, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7scikits_5learn_3svm_6libsvm_3decision_function)}; +static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_3decision_function(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyArrayObject *__pyx_v_X = 0; PyArrayObject *__pyx_v_support = 0; PyArrayObject *__pyx_v_SV = 0; @@ -4246,26 +4385,40 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_decision_function(PyObject *__py PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; + struct svm_parameter *__pyx_t_4; int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyArrayObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - PyObject *__pyx_t_10 = NULL; - PyObject *__pyx_t_11 = NULL; + int __pyx_t_6; + int __pyx_t_7; + double __pyx_t_8; + double __pyx_t_9; + double __pyx_t_10; + double __pyx_t_11; + double __pyx_t_12; + double __pyx_t_13; + double __pyx_t_14; + int __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + char *__pyx_t_18; + int __pyx_t_19; + PyObject *__pyx_t_20 = NULL; + PyObject *__pyx_t_21 = NULL; + PyArrayObject *__pyx_t_22 = NULL; + PyObject *__pyx_t_23 = NULL; + PyObject *__pyx_t_24 = NULL; + PyObject *__pyx_t_25 = NULL; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__X,&__pyx_n_s__support,&__pyx_n_s__SV,&__pyx_n_s__nSV,&__pyx_n_s__sv_coef,&__pyx_n_s__intercept,&__pyx_n_s__label,&__pyx_n_s__probA,&__pyx_n_s__probB,&__pyx_n_s__svm_type,&__pyx_n_s__kernel,&__pyx_n_s__degree,&__pyx_n_s__gamma,&__pyx_n_s__coef0,&__pyx_n_s__tol,&__pyx_n_s__C,&__pyx_n_s__nu,&__pyx_n_s__epsilon,&__pyx_n_s__class_weight_label,&__pyx_n_s__class_weight,&__pyx_n_s__sample_weight,&__pyx_n_s__shrinking,&__pyx_n_s__probability,&__pyx_n_s__cache_size,0}; __Pyx_RefNannySetupContext("decision_function"); __pyx_self = __pyx_self; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[24] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; - values[7] = (PyObject *)__pyx_k_18; - values[8] = (PyObject *)__pyx_k_19; - values[10] = ((PyObject *)__pyx_n_s__rbf); - values[18] = (PyObject *)__pyx_k_20; - values[19] = (PyObject *)__pyx_k_21; - values[20] = (PyObject *)__pyx_k_22; + values[7] = (PyObject *)__pyx_k_22; + values[8] = (PyObject *)__pyx_k_23; + values[10] = ((PyObject*)__pyx_n_s__rbf); + values[18] = (PyObject *)__pyx_k_24; + values[19] = (PyObject *)__pyx_k_25; + values[20] = (PyObject *)__pyx_k_26; switch (PyTuple_GET_SIZE(__pyx_args)) { case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23); case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22); @@ -4438,7 +4591,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_decision_function(PyObject *__py } else { __pyx_v_svm_type = ((int)0); } - __pyx_v_kernel = ((PyObject *)values[10]); + __pyx_v_kernel = ((PyObject*)values[10]); if (values[11]) { __pyx_v_degree = __Pyx_PyInt_AsInt(values[11]); if (unlikely((__pyx_v_degree == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { @@ -4448,7 +4601,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_decision_function(PyObject *__py __pyx_v_gamma = __pyx_PyFloat_AsDouble(values[12]); if (unlikely((__pyx_v_gamma == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":393 + /* "scikits/learn/svm/libsvm.pyx":393 * np.ndarray[np.float64_t, ndim=1, mode='c'] probB=np.empty(0), * int svm_type=0, str kernel='rbf', int degree=3, * double gamma=0.1, double coef0=0., double tol=1e-3, # <<<<<<<<<<<<<< @@ -4471,7 +4624,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_decision_function(PyObject *__py __pyx_v_C = __pyx_PyFloat_AsDouble(values[15]); if (unlikely((__pyx_v_C == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":394 + /* "scikits/learn/svm/libsvm.pyx":394 * int svm_type=0, str kernel='rbf', int degree=3, * double gamma=0.1, double coef0=0., double tol=1e-3, * double C=1., double nu=0.5, double epsilon=0.1, # <<<<<<<<<<<<<< @@ -4507,7 +4660,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_decision_function(PyObject *__py __pyx_v_cache_size = __pyx_PyFloat_AsDouble(values[23]); if (unlikely((__pyx_v_cache_size == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":402 + /* "scikits/learn/svm/libsvm.pyx":402 * sample_weight=np.empty(0), * int shrinking=0, int probability=0, * double cache_size=100.): # <<<<<<<<<<<<<< @@ -4517,13 +4670,13 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_decision_function(PyObject *__py __pyx_v_cache_size = ((double)100.); } } else { - __pyx_v_probA = __pyx_k_18; - __pyx_v_probB = __pyx_k_19; + __pyx_v_probA = __pyx_k_22; + __pyx_v_probB = __pyx_k_23; __pyx_v_svm_type = ((int)0); - __pyx_v_kernel = ((PyObject *)__pyx_n_s__rbf); + __pyx_v_kernel = ((PyObject*)__pyx_n_s__rbf); __pyx_v_degree = ((int)3); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":393 + /* "scikits/learn/svm/libsvm.pyx":393 * np.ndarray[np.float64_t, ndim=1, mode='c'] probB=np.empty(0), * int svm_type=0, str kernel='rbf', int degree=3, * double gamma=0.1, double coef0=0., double tol=1e-3, # <<<<<<<<<<<<<< @@ -4534,7 +4687,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_decision_function(PyObject *__py __pyx_v_coef0 = ((double)0.); __pyx_v_tol = ((double)1e-3); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":394 + /* "scikits/learn/svm/libsvm.pyx":394 * int svm_type=0, str kernel='rbf', int degree=3, * double gamma=0.1, double coef0=0., double tol=1e-3, * double C=1., double nu=0.5, double epsilon=0.1, # <<<<<<<<<<<<<< @@ -4544,13 +4697,13 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_decision_function(PyObject *__py __pyx_v_C = ((double)1.); __pyx_v_nu = ((double)0.5); __pyx_v_epsilon = ((double)0.1); - __pyx_v_class_weight_label = __pyx_k_20; - __pyx_v_class_weight = __pyx_k_21; - __pyx_v_sample_weight = __pyx_k_22; + __pyx_v_class_weight_label = __pyx_k_24; + __pyx_v_class_weight = __pyx_k_25; + __pyx_v_sample_weight = __pyx_k_26; __pyx_v_shrinking = ((int)0); __pyx_v_probability = ((int)0); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":402 + /* "scikits/learn/svm/libsvm.pyx":402 * sample_weight=np.empty(0), * int shrinking=0, int probability=0, * double cache_size=100.): # <<<<<<<<<<<<<< @@ -4586,7 +4739,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_decision_function(PyObject *__py case 12: __pyx_v_degree = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 11)); if (unlikely((__pyx_v_degree == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L3_error;} case 11: - __pyx_v_kernel = ((PyObject *)PyTuple_GET_ITEM(__pyx_args, 10)); + __pyx_v_kernel = ((PyObject*)PyTuple_GET_ITEM(__pyx_args, 10)); case 10: __pyx_v_svm_type = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 9)); if (unlikely((__pyx_v_svm_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L3_error;} case 9: @@ -4609,7 +4762,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_decision_function(PyObject *__py __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("decision_function", 0, 7, 24, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("sklearn.svm.libsvm.decision_function"); + __Pyx_AddTraceback("scikits.learn.svm.libsvm.decision_function"); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; @@ -4637,7 +4790,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_decision_function(PyObject *__py if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_label), __pyx_ptype_5numpy_ndarray, 1, "label", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_probA), __pyx_ptype_5numpy_ndarray, 1, "probA", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_probB), __pyx_ptype_5numpy_ndarray, 1, "probB", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kernel), &PyString_Type, 1, "kernel", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kernel), (&PyString_Type), 1, "kernel", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_class_weight_label), __pyx_ptype_5numpy_ndarray, 1, "class_weight_label", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_class_weight), __pyx_ptype_5numpy_ndarray, 1, "class_weight", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sample_weight), __pyx_ptype_5numpy_ndarray, 1, "sample_weight", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -4714,7 +4867,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_decision_function(PyObject *__py __pyx_bstride_0_sample_weight = __pyx_bstruct_sample_weight.strides[0]; __pyx_bshape_0_sample_weight = __pyx_bstruct_sample_weight.shape[0]; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":414 + /* "scikits/learn/svm/libsvm.pyx":414 * cdef np.npy_intp n_class * * kernel_index = LIBSVM_KERNEL_TYPES.index(kernel) # <<<<<<<<<<<<<< @@ -4727,37 +4880,67 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_decision_function(PyObject *__py __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 = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_INCREF(((PyObject *)__pyx_v_kernel)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_kernel)); __Pyx_GIVEREF(((PyObject *)__pyx_v_kernel)); - __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_v_kernel_index); __pyx_v_kernel_index = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":415 + /* "scikits/learn/svm/libsvm.pyx":415 * * kernel_index = LIBSVM_KERNEL_TYPES.index(kernel) * set_parameter(¶m, svm_type, kernel_index, degree, gamma, # <<<<<<<<<<<<<< * coef0, nu, cache_size, C, tol, epsilon, shrinking, * probability, <int> class_weight.shape[0], class_weight_label.data, */ - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_v_kernel_index); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = (&__pyx_v_param); + __pyx_t_5 = __pyx_v_svm_type; + __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_kernel_index); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __pyx_v_degree; + __pyx_t_8 = __pyx_v_gamma; + + /* "scikits/learn/svm/libsvm.pyx":416 + * kernel_index = LIBSVM_KERNEL_TYPES.index(kernel) + * set_parameter(¶m, svm_type, kernel_index, degree, gamma, + * coef0, nu, cache_size, C, tol, epsilon, shrinking, # <<<<<<<<<<<<<< + * probability, <int> class_weight.shape[0], class_weight_label.data, + * class_weight.data) + */ + __pyx_t_9 = __pyx_v_coef0; + __pyx_t_10 = __pyx_v_nu; + __pyx_t_11 = __pyx_v_cache_size; + __pyx_t_12 = __pyx_v_C; + __pyx_t_13 = __pyx_v_tol; + __pyx_t_14 = __pyx_v_epsilon; + __pyx_t_15 = __pyx_v_shrinking; + + /* "scikits/learn/svm/libsvm.pyx":417 + * set_parameter(¶m, svm_type, kernel_index, degree, gamma, + * coef0, nu, cache_size, C, tol, epsilon, shrinking, + * probability, <int> class_weight.shape[0], class_weight_label.data, # <<<<<<<<<<<<<< + * class_weight.data) + * + */ + __pyx_t_16 = __pyx_v_probability; + __pyx_t_17 = ((int)(__pyx_v_class_weight->dimensions[0])); + __pyx_t_18 = __pyx_v_class_weight_label->data; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":418 + /* "scikits/learn/svm/libsvm.pyx":418 * coef0, nu, cache_size, C, tol, epsilon, shrinking, * probability, <int> class_weight.shape[0], class_weight_label.data, * class_weight.data) # <<<<<<<<<<<<<< * * model = set_model(¶m, <int> nSV.shape[0], SV.data, SV.shape, */ - set_parameter((&__pyx_v_param), __pyx_v_svm_type, __pyx_t_4, __pyx_v_degree, __pyx_v_gamma, __pyx_v_coef0, __pyx_v_nu, __pyx_v_cache_size, __pyx_v_C, __pyx_v_tol, __pyx_v_epsilon, __pyx_v_shrinking, __pyx_v_probability, ((int)(__pyx_v_class_weight->dimensions[0])), __pyx_v_class_weight_label->data, __pyx_v_class_weight->data); + set_parameter(__pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_t_12, __pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_t_18, __pyx_v_class_weight->data); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":423 + /* "scikits/learn/svm/libsvm.pyx":423 * support.data, support.shape, sv_coef.strides, * sv_coef.data, intercept.data, nSV.data, * label.data, probA.data, probB.data) # <<<<<<<<<<<<<< @@ -4766,17 +4949,17 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_decision_function(PyObject *__py */ __pyx_v_model = set_model((&__pyx_v_param), ((int)(__pyx_v_nSV->dimensions[0])), __pyx_v_SV->data, __pyx_v_SV->dimensions, __pyx_v_support->data, __pyx_v_support->dimensions, __pyx_v_sv_coef->strides, __pyx_v_sv_coef->data, __pyx_v_intercept->data, __pyx_v_nSV->data, __pyx_v_label->data, __pyx_v_probA->data, __pyx_v_probB->data); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":425 + /* "scikits/learn/svm/libsvm.pyx":425 * label.data, probA.data, probB.data) * * if svm_type > 1: # <<<<<<<<<<<<<< * n_class = 1 * else: */ - __pyx_t_5 = (__pyx_v_svm_type > 1); - if (__pyx_t_5) { + __pyx_t_19 = (__pyx_v_svm_type > 1); + if (__pyx_t_19) { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":426 + /* "scikits/learn/svm/libsvm.pyx":426 * * if svm_type > 1: * n_class = 1 # <<<<<<<<<<<<<< @@ -4788,7 +4971,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_decision_function(PyObject *__py } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":428 + /* "scikits/learn/svm/libsvm.pyx":428 * n_class = 1 * else: * n_class = get_nr(model) # <<<<<<<<<<<<<< @@ -4797,7 +4980,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_decision_function(PyObject *__py */ __pyx_v_n_class = get_nr(__pyx_v_model); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":429 + /* "scikits/learn/svm/libsvm.pyx":429 * else: * n_class = get_nr(model) * n_class = n_class * (n_class - 1) / 2 # <<<<<<<<<<<<<< @@ -4808,7 +4991,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_decision_function(PyObject *__py } __pyx_L6:; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":431 + /* "scikits/learn/svm/libsvm.pyx":431 * n_class = n_class * (n_class - 1) / 2 * * dec_values = np.empty((X.shape[0], n_class), dtype=np.float64) # <<<<<<<<<<<<<< @@ -4824,90 +5007,80 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_decision_function(PyObject *__py __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_to_py_Py_intptr_t(__pyx_v_n_class); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); + __pyx_t_20 = PyTuple_New(2); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_20)); + PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_20)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_20)); + __pyx_t_20 = 0; + __pyx_t_20 = PyDict_New(); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_20)); __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_21 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__float64); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_21); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyEval_CallObjectWithKeywords(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_20, ((PyObject *)__pyx_n_s__dtype), __pyx_t_21) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + __pyx_t_21 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_20)); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_21); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_8 = ((PyArrayObject *)__pyx_t_7); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_20)); __pyx_t_20 = 0; + if (!(likely(((__pyx_t_21) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_21, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_22 = ((PyArrayObject *)__pyx_t_21); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_dec_values); - __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_dec_values, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack); - if (unlikely(__pyx_t_4 < 0)) { - PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + __pyx_t_17 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_dec_values, (PyObject*)__pyx_t_22, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_17 < 0)) { + PyErr_Fetch(&__pyx_t_23, &__pyx_t_24, &__pyx_t_25); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_dec_values, (PyObject*)__pyx_v_dec_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); + Py_XDECREF(__pyx_t_23); Py_XDECREF(__pyx_t_24); Py_XDECREF(__pyx_t_25); __Pyx_RaiseBufferFallbackError(); } else { - PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + PyErr_Restore(__pyx_t_23, __pyx_t_24, __pyx_t_25); } } __pyx_bstride_0_dec_values = __pyx_bstruct_dec_values.strides[0]; __pyx_bstride_1_dec_values = __pyx_bstruct_dec_values.strides[1]; __pyx_bshape_0_dec_values = __pyx_bstruct_dec_values.shape[0]; __pyx_bshape_1_dec_values = __pyx_bstruct_dec_values.shape[1]; - if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_17 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_8 = 0; + __pyx_t_22 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_dec_values)); - __pyx_v_dec_values = ((PyArrayObject *)__pyx_t_7); - __pyx_t_7 = 0; + __pyx_v_dec_values = ((PyArrayObject *)__pyx_t_21); + __pyx_t_21 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":432 + /* "scikits/learn/svm/libsvm.pyx":432 * * dec_values = np.empty((X.shape[0], n_class), dtype=np.float64) * if copy_predict_values(X.data, model, X.shape, dec_values.data, n_class) < 0: # <<<<<<<<<<<<<< * raise MemoryError("We've run out of of memory") * # free model and param */ - __pyx_t_5 = (copy_predict_values(__pyx_v_X->data, __pyx_v_model, __pyx_v_X->dimensions, __pyx_v_dec_values->data, __pyx_v_n_class) < 0); - if (__pyx_t_5) { + __pyx_t_19 = (copy_predict_values(__pyx_v_X->data, __pyx_v_model, __pyx_v_X->dimensions, __pyx_v_dec_values->data, __pyx_v_n_class) < 0); + if (__pyx_t_19) { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":433 + /* "scikits/learn/svm/libsvm.pyx":433 * dec_values = np.empty((X.shape[0], n_class), dtype=np.float64) * if copy_predict_values(X.data, model, X.shape, dec_values.data, n_class) < 0: * raise MemoryError("We've run out of of memory") # <<<<<<<<<<<<<< * # free model and param * free_model(model) */ - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_12)); - PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_kp_s_12)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_12)); - __pyx_t_6 = PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_Raise(__pyx_t_6, 0, 0); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L7; } __pyx_L7:; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":435 + /* "scikits/learn/svm/libsvm.pyx":435 * raise MemoryError("We've run out of of memory") * # free model and param * free_model(model) # <<<<<<<<<<<<<< @@ -4916,7 +5089,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_decision_function(PyObject *__py */ free_model(__pyx_v_model); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":436 + /* "scikits/learn/svm/libsvm.pyx":436 * # free model and param * free_model(model) * return dec_values # <<<<<<<<<<<<<< @@ -4934,8 +5107,8 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_decision_function(PyObject *__py __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_20); + __Pyx_XDECREF(__pyx_t_21); { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_probA); @@ -4952,7 +5125,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_decision_function(PyObject *__py __Pyx_SafeReleaseBuffer(&__pyx_bstruct_SV); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_class_weight_label); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("sklearn.svm.libsvm.decision_function"); + __Pyx_AddTraceback("scikits.learn.svm.libsvm.decision_function"); __pyx_r = NULL; goto __pyx_L2; __pyx_L0:; @@ -4977,7 +5150,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_decision_function(PyObject *__py return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":439 +/* "scikits/learn/svm/libsvm.pyx":439 * * * def cross_validation( # <<<<<<<<<<<<<< @@ -4985,9 +5158,10 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_decision_function(PyObject *__py * np.ndarray[np.float64_t, ndim=1, mode='c'] Y, */ -static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_cross_validation(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_7sklearn_3svm_6libsvm_cross_validation[] = "\n Binding of the cross-validation routine (low-level routine)\n\n Parameters\n ----------\n\n X: array-like, dtype=float, size=[n_samples, n_features]\n\n Y: array, dtype=float, size=[n_samples]\n target vector\n\n svm_type : {0, 1, 2, 3, 4}\n Type of SVM: C SVC, nu SVC, one class, epsilon SVR, nu SVR\n\n kernel : {'linear', 'rbf', 'poly', 'sigmoid', 'precomputed'}\n Kernel to use in the model: linear, polynomial, RBF, sigmoid\n or precomputed.\n\n degree : int\n Degree of the polynomial kernel (only relevant if kernel is\n set to polynomial)\n\n gamma : float\n Gamma parameter in RBF kernel (only relevant if kernel is set\n to RBF)\n\n coef0 : float\n Independent parameter in poly/sigmoid kernel.\n\n tol : float\n Stopping criteria.\n\n C : float\n C parameter in C-Support Vector Classification\n\n nu : float\n\n cache_size : float\n\n Returns\n -------\n target : array, float\n\n "; -static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_cross_validation(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_4cross_validation(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_7scikits_5learn_3svm_6libsvm_4cross_validation[] = "\n Binding of the cross-validation routine (low-level routine)\n\n Parameters\n ----------\n\n X: array-like, dtype=float, size=[n_samples, n_features]\n\n Y: array, dtype=float, size=[n_samples]\n target vector\n\n svm_type : {0, 1, 2, 3, 4}\n Type of SVM: C SVC, nu SVC, one class, epsilon SVR, nu SVR\n\n kernel : {'linear', 'rbf', 'poly', 'sigmoid', 'precomputed'}\n Kernel to use in the model: linear, polynomial, RBF, sigmoid\n or precomputed.\n\n degree : int\n Degree of the polynomial kernel (only relevant if kernel is\n set to polynomial)\n\n gamma : float\n Gamma parameter in RBF kernel (only relevant if kernel is set\n to RBF)\n\n coef0 : float\n Independent parameter in poly/sigmoid kernel.\n\n tol : float\n Stopping criteria.\n\n C : float\n C parameter in C-Support Vector Classification\n\n nu : float\n\n cache_size : float\n\n Returns\n -------\n target : array, float\n\n "; +static PyMethodDef __pyx_mdef_7scikits_5learn_3svm_6libsvm_4cross_validation = {__Pyx_NAMESTR("cross_validation"), (PyCFunction)__pyx_pf_7scikits_5learn_3svm_6libsvm_4cross_validation, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7scikits_5learn_3svm_6libsvm_4cross_validation)}; +static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_4cross_validation(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyArrayObject *__pyx_v_X = 0; PyArrayObject *__pyx_v_Y = 0; int __pyx_v_n_fold; @@ -5032,9 +5206,9 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_cross_validation(PyObject *__pyx Py_ssize_t __pyx_bstride_0_target = 0; Py_ssize_t __pyx_bshape_0_target = 0; PyObject *__pyx_r = NULL; - Py_ssize_t __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; @@ -5044,8 +5218,25 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_cross_validation(PyObject *__pyx PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; - int __pyx_t_13; - PyArrayObject *__pyx_t_14 = NULL; + struct svm_problem *__pyx_t_13; + char *__pyx_t_14; + char *__pyx_t_15; + char *__pyx_t_16; + npy_intp *__pyx_t_17; + struct svm_parameter *__pyx_t_18; + int __pyx_t_19; + int __pyx_t_20; + double __pyx_t_21; + double __pyx_t_22; + double __pyx_t_23; + double __pyx_t_24; + double __pyx_t_25; + double __pyx_t_26; + double __pyx_t_27; + int __pyx_t_28; + int __pyx_t_29; + int __pyx_t_30; + PyArrayObject *__pyx_t_31 = NULL; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__X,&__pyx_n_s__Y,&__pyx_n_s__n_fold,&__pyx_n_s__svm_type,&__pyx_n_s__kernel,&__pyx_n_s__degree,&__pyx_n_s__gamma,&__pyx_n_s__coef0,&__pyx_n_s__tol,&__pyx_n_s__C,&__pyx_n_s__nu,&__pyx_n_s__epsilon,&__pyx_n_s__class_weight_label,&__pyx_n_s__class_weight,&__pyx_n_s__sample_weight,&__pyx_n_s__shrinking,&__pyx_n_s__probability,&__pyx_n_s__cache_size,0}; __Pyx_RefNannySetupContext("cross_validation"); __pyx_self = __pyx_self; @@ -5053,10 +5244,10 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_cross_validation(PyObject *__pyx Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[18] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; values[3] = ((PyObject *)__pyx_int_0); - values[4] = ((PyObject *)__pyx_n_s__rbf); - values[12] = (PyObject *)__pyx_k_23; - values[13] = (PyObject *)__pyx_k_24; - values[14] = (PyObject *)__pyx_k_25; + values[4] = ((PyObject*)__pyx_n_s__rbf); + values[12] = (PyObject *)__pyx_k_27; + values[13] = (PyObject *)__pyx_k_28; + values[14] = (PyObject *)__pyx_k_29; switch (PyTuple_GET_SIZE(__pyx_args)) { case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17); case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16); @@ -5179,7 +5370,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_cross_validation(PyObject *__pyx __pyx_v_Y = ((PyArrayObject *)values[1]); __pyx_v_n_fold = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_n_fold == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_svm_type = values[3]; - __pyx_v_kernel = ((PyObject *)values[4]); + __pyx_v_kernel = ((PyObject*)values[4]); if (values[5]) { __pyx_v_degree = __Pyx_PyInt_AsInt(values[5]); if (unlikely((__pyx_v_degree == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { @@ -5189,7 +5380,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_cross_validation(PyObject *__pyx __pyx_v_gamma = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_gamma == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":443 + /* "scikits/learn/svm/libsvm.pyx":443 * np.ndarray[np.float64_t, ndim=1, mode='c'] Y, * int n_fold, svm_type=0, str kernel='rbf', int degree=3, * double gamma=0.1, double coef0=0., double tol=1e-3, # <<<<<<<<<<<<<< @@ -5212,7 +5403,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_cross_validation(PyObject *__pyx __pyx_v_C = __pyx_PyFloat_AsDouble(values[9]); if (unlikely((__pyx_v_C == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":444 + /* "scikits/learn/svm/libsvm.pyx":444 * int n_fold, svm_type=0, str kernel='rbf', int degree=3, * double gamma=0.1, double coef0=0., double tol=1e-3, * double C=1., double nu=0.5, double epsilon=0.1, # <<<<<<<<<<<<<< @@ -5248,7 +5439,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_cross_validation(PyObject *__pyx __pyx_v_cache_size = __pyx_PyFloat_AsDouble(values[17]); if (unlikely((__pyx_v_cache_size == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":451 + /* "scikits/learn/svm/libsvm.pyx":451 * np.ndarray[np.float64_t, ndim=1, mode='c'] * sample_weight=np.empty(0), * int shrinking=0, int probability=0, double cache_size=100.): # <<<<<<<<<<<<<< @@ -5259,10 +5450,10 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_cross_validation(PyObject *__pyx } } else { __pyx_v_svm_type = ((PyObject *)__pyx_int_0); - __pyx_v_kernel = ((PyObject *)__pyx_n_s__rbf); + __pyx_v_kernel = ((PyObject*)__pyx_n_s__rbf); __pyx_v_degree = ((int)3); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":443 + /* "scikits/learn/svm/libsvm.pyx":443 * np.ndarray[np.float64_t, ndim=1, mode='c'] Y, * int n_fold, svm_type=0, str kernel='rbf', int degree=3, * double gamma=0.1, double coef0=0., double tol=1e-3, # <<<<<<<<<<<<<< @@ -5273,7 +5464,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_cross_validation(PyObject *__pyx __pyx_v_coef0 = ((double)0.); __pyx_v_tol = ((double)1e-3); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":444 + /* "scikits/learn/svm/libsvm.pyx":444 * int n_fold, svm_type=0, str kernel='rbf', int degree=3, * double gamma=0.1, double coef0=0., double tol=1e-3, * double C=1., double nu=0.5, double epsilon=0.1, # <<<<<<<<<<<<<< @@ -5283,13 +5474,13 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_cross_validation(PyObject *__pyx __pyx_v_C = ((double)1.); __pyx_v_nu = ((double)0.5); __pyx_v_epsilon = ((double)0.1); - __pyx_v_class_weight_label = __pyx_k_23; - __pyx_v_class_weight = __pyx_k_24; - __pyx_v_sample_weight = __pyx_k_25; + __pyx_v_class_weight_label = __pyx_k_27; + __pyx_v_class_weight = __pyx_k_28; + __pyx_v_sample_weight = __pyx_k_29; __pyx_v_shrinking = ((int)0); __pyx_v_probability = ((int)0); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":451 + /* "scikits/learn/svm/libsvm.pyx":451 * np.ndarray[np.float64_t, ndim=1, mode='c'] * sample_weight=np.empty(0), * int shrinking=0, int probability=0, double cache_size=100.): # <<<<<<<<<<<<<< @@ -5325,7 +5516,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_cross_validation(PyObject *__pyx case 6: __pyx_v_degree = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 5)); if (unlikely((__pyx_v_degree == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L3_error;} case 5: - __pyx_v_kernel = ((PyObject *)PyTuple_GET_ITEM(__pyx_args, 4)); + __pyx_v_kernel = ((PyObject*)PyTuple_GET_ITEM(__pyx_args, 4)); case 4: __pyx_v_svm_type = PyTuple_GET_ITEM(__pyx_args, 3); case 3: @@ -5340,7 +5531,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_cross_validation(PyObject *__pyx __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("cross_validation", 0, 3, 18, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("sklearn.svm.libsvm.cross_validation"); + __Pyx_AddTraceback("scikits.learn.svm.libsvm.cross_validation"); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; @@ -5355,7 +5546,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_cross_validation(PyObject *__pyx __pyx_bstruct_sample_weight.buf = NULL; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_X), __pyx_ptype_5numpy_ndarray, 1, "X", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_Y), __pyx_ptype_5numpy_ndarray, 1, "Y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kernel), &PyString_Type, 1, "kernel", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kernel), (&PyString_Type), 1, "kernel", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_class_weight_label), __pyx_ptype_5numpy_ndarray, 1, "class_weight_label", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_class_weight), __pyx_ptype_5numpy_ndarray, 1, "class_weight", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sample_weight), __pyx_ptype_5numpy_ndarray, 1, "sample_weight", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -5390,50 +5581,53 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_cross_validation(PyObject *__pyx __pyx_bstride_0_sample_weight = __pyx_bstruct_sample_weight.strides[0]; __pyx_bshape_0_sample_weight = __pyx_bstruct_sample_weight.shape[0]; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":504 + /* "scikits/learn/svm/libsvm.pyx":504 * cdef np.npy_intp nr * * if len(sample_weight) == 0: # <<<<<<<<<<<<<< * sample_weight = np.ones(X.shape[0], dtype=np.float64) * else: */ - __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_sample_weight)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = (__pyx_t_1 == 0); - if (__pyx_t_2) { + __pyx_t_1 = ((PyObject *)__pyx_v_sample_weight); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_t_2 == 0); + if (__pyx_t_3) { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":505 + /* "scikits/learn/svm/libsvm.pyx":505 * * if len(sample_weight) == 0: * sample_weight = np.ones(X.shape[0], dtype=np.float64) # <<<<<<<<<<<<<< * else: * assert sample_weight.shape[0] == X.shape[0], \ */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__ones); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__ones); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_to_py_Py_intptr_t((__pyx_v_X->dimensions[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_to_py_Py_intptr_t((__pyx_v_X->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __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 = 0; - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyEval_CallObjectWithKeywords(__pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyEval_CallObjectWithKeywords(__pyx_t_4, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = ((PyArrayObject *)__pyx_t_7); { @@ -5461,17 +5655,17 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_cross_validation(PyObject *__pyx } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":507 + /* "scikits/learn/svm/libsvm.pyx":507 * sample_weight = np.ones(X.shape[0], dtype=np.float64) * else: * assert sample_weight.shape[0] == X.shape[0], \ # <<<<<<<<<<<<<< * "sample_weight and X have incompatible shapes: " + \ * "sample_weight has %s samples while X has %s" % \ */ - #ifndef PYREX_WITHOUT_ASSERTIONS + #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!((__pyx_v_sample_weight->dimensions[0]) == (__pyx_v_X->dimensions[0])))) { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":510 + /* "scikits/learn/svm/libsvm.pyx":510 * "sample_weight and X have incompatible shapes: " + \ * "sample_weight has %s samples while X has %s" % \ * (sample_weight.shape[0], X.shape[0]) # <<<<<<<<<<<<<< @@ -5480,22 +5674,22 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_cross_validation(PyObject *__pyx */ __pyx_t_7 = __Pyx_PyInt_to_py_Py_intptr_t((__pyx_v_sample_weight->dimensions[0])); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = __Pyx_PyInt_to_py_Py_intptr_t((__pyx_v_X->dimensions[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyInt_to_py_Py_intptr_t((__pyx_v_X->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); __pyx_t_7 = 0; - __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_5), __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Add(((PyObject *)__pyx_kp_s_4), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_5), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + __pyx_t_5 = PyNumber_Add(((PyObject *)__pyx_kp_s_4), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_t_5)); __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -5504,125 +5698,143 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_cross_validation(PyObject *__pyx } __pyx_L6:; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":512 + /* "scikits/learn/svm/libsvm.pyx":512 * (sample_weight.shape[0], X.shape[0]) * * if X.shape[0] < n_fold: # <<<<<<<<<<<<<< * raise ValueError("Number of samples is less than number of folds") * */ - __pyx_t_2 = ((__pyx_v_X->dimensions[0]) < __pyx_v_n_fold); - if (__pyx_t_2) { + __pyx_t_3 = ((__pyx_v_X->dimensions[0]) < __pyx_v_n_fold); + if (__pyx_t_3) { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":513 + /* "scikits/learn/svm/libsvm.pyx":513 * * if X.shape[0] < n_fold: * raise ValueError("Number of samples is less than number of folds") # <<<<<<<<<<<<<< * * # set problem */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_31), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_26)); - PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_26)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_26)); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L7; } __pyx_L7:; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":516 + /* "scikits/learn/svm/libsvm.pyx":516 * * # set problem * kernel_index = LIBSVM_KERNEL_TYPES.index(kernel) # <<<<<<<<<<<<<< * set_problem( * &problem, X.data, Y.data, sample_weight.data, X.shape, kernel_index) */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__LIBSVM_KERNEL_TYPES); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__index); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__LIBSVM_KERNEL_TYPES); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); __Pyx_INCREF(((PyObject *)__pyx_v_kernel)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_kernel)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_kernel)); __Pyx_GIVEREF(((PyObject *)__pyx_v_kernel)); - __pyx_t_7 = PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_v_kernel_index); __pyx_v_kernel_index = __pyx_t_7; __pyx_t_7 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":518 + /* "scikits/learn/svm/libsvm.pyx":518 * kernel_index = LIBSVM_KERNEL_TYPES.index(kernel) * set_problem( * &problem, X.data, Y.data, sample_weight.data, X.shape, kernel_index) # <<<<<<<<<<<<<< * if problem.x == NULL: * raise MemoryError("Seems we've run out of of memory") */ + __pyx_t_13 = (&__pyx_v_problem); + __pyx_t_14 = __pyx_v_X->data; + __pyx_t_15 = __pyx_v_Y->data; + __pyx_t_16 = __pyx_v_sample_weight->data; + __pyx_t_17 = __pyx_v_X->dimensions; __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_v_kernel_index); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - set_problem((&__pyx_v_problem), __pyx_v_X->data, __pyx_v_Y->data, __pyx_v_sample_weight->data, __pyx_v_X->dimensions, __pyx_t_9); + set_problem(__pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_t_9); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":519 + /* "scikits/learn/svm/libsvm.pyx":519 * set_problem( * &problem, X.data, Y.data, sample_weight.data, X.shape, kernel_index) * if problem.x == NULL: # <<<<<<<<<<<<<< * raise MemoryError("Seems we've run out of of memory") * */ - __pyx_t_2 = (__pyx_v_problem.x == NULL); - if (__pyx_t_2) { + __pyx_t_3 = (__pyx_v_problem.x == NULL); + if (__pyx_t_3) { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":520 + /* "scikits/learn/svm/libsvm.pyx":520 * &problem, X.data, Y.data, sample_weight.data, X.shape, kernel_index) * if problem.x == NULL: * raise MemoryError("Seems we've run out of of memory") # <<<<<<<<<<<<<< * * # set parameters */ - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_6)); - PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_kp_s_6)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_6)); - __pyx_t_3 = PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L8; } __pyx_L8:; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":524 + /* "scikits/learn/svm/libsvm.pyx":524 * # set parameters * set_parameter( * ¶m, svm_type, kernel_index, degree, gamma, coef0, nu, cache_size, # <<<<<<<<<<<<<< * C, tol, tol, shrinking, probability, <int> * class_weight.shape[0], class_weight_label.data, */ + __pyx_t_18 = (&__pyx_v_param); __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_v_svm_type); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_13 = __Pyx_PyInt_AsInt(__pyx_v_kernel_index); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = __Pyx_PyInt_AsInt(__pyx_v_kernel_index); if (unlikely((__pyx_t_19 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_20 = __pyx_v_degree; + __pyx_t_21 = __pyx_v_gamma; + __pyx_t_22 = __pyx_v_coef0; + __pyx_t_23 = __pyx_v_nu; + __pyx_t_24 = __pyx_v_cache_size; + + /* "scikits/learn/svm/libsvm.pyx":525 + * set_parameter( + * ¶m, svm_type, kernel_index, degree, gamma, coef0, nu, cache_size, + * C, tol, tol, shrinking, probability, <int> # <<<<<<<<<<<<<< + * class_weight.shape[0], class_weight_label.data, + * class_weight.data) + */ + __pyx_t_25 = __pyx_v_C; + __pyx_t_26 = __pyx_v_tol; + __pyx_t_27 = __pyx_v_tol; + __pyx_t_28 = __pyx_v_shrinking; + __pyx_t_29 = __pyx_v_probability; + + /* "scikits/learn/svm/libsvm.pyx":526 + * ¶m, svm_type, kernel_index, degree, gamma, coef0, nu, cache_size, + * C, tol, tol, shrinking, probability, <int> + * class_weight.shape[0], class_weight_label.data, # <<<<<<<<<<<<<< + * class_weight.data) + * + */ + __pyx_t_30 = ((int)(__pyx_v_class_weight->dimensions[0])); + __pyx_t_16 = __pyx_v_class_weight_label->data; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":527 + /* "scikits/learn/svm/libsvm.pyx":527 * C, tol, tol, shrinking, probability, <int> * class_weight.shape[0], class_weight_label.data, * class_weight.data) # <<<<<<<<<<<<<< * * error_msg = svm_check_parameter(&problem, ¶m); */ - set_parameter((&__pyx_v_param), __pyx_t_9, __pyx_t_13, __pyx_v_degree, __pyx_v_gamma, __pyx_v_coef0, __pyx_v_nu, __pyx_v_cache_size, __pyx_v_C, __pyx_v_tol, __pyx_v_tol, __pyx_v_shrinking, __pyx_v_probability, ((int)(__pyx_v_class_weight->dimensions[0])), __pyx_v_class_weight_label->data, __pyx_v_class_weight->data); + set_parameter(__pyx_t_18, __pyx_t_9, __pyx_t_19, __pyx_t_20, __pyx_t_21, __pyx_t_22, __pyx_t_23, __pyx_t_24, __pyx_t_25, __pyx_t_26, __pyx_t_27, __pyx_t_28, __pyx_t_29, __pyx_t_30, __pyx_t_16, __pyx_v_class_weight->data); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":529 + /* "scikits/learn/svm/libsvm.pyx":529 * class_weight.data) * * error_msg = svm_check_parameter(&problem, ¶m); # <<<<<<<<<<<<<< @@ -5631,80 +5843,80 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_cross_validation(PyObject *__pyx */ __pyx_v_error_msg = svm_check_parameter((&__pyx_v_problem), (&__pyx_v_param)); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":530 + /* "scikits/learn/svm/libsvm.pyx":530 * * error_msg = svm_check_parameter(&problem, ¶m); * if error_msg: # <<<<<<<<<<<<<< * raise ValueError(error_msg) * */ - __pyx_t_2 = (__pyx_v_error_msg != 0); - if (__pyx_t_2) { + __pyx_t_3 = (__pyx_v_error_msg != 0); + if (__pyx_t_3) { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":531 + /* "scikits/learn/svm/libsvm.pyx":531 * error_msg = svm_check_parameter(&problem, ¶m); * if error_msg: * raise ValueError(error_msg) # <<<<<<<<<<<<<< * * cdef np.ndarray[np.float64_t, ndim=1, mode='c'] target */ - __pyx_t_3 = PyBytes_FromString(__pyx_v_error_msg); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyBytes_FromString(__pyx_v_error_msg); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_7)); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_7)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_7)); + __pyx_t_7 = 0; + __pyx_t_7 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_7, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L9; } __pyx_L9:; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":534 + /* "scikits/learn/svm/libsvm.pyx":534 * * cdef np.ndarray[np.float64_t, ndim=1, mode='c'] target * target = np.empty((X.shape[0]), dtype=np.float64) # <<<<<<<<<<<<<< * svm_cross_validation(&problem, ¶m, n_fold, <double *> target.data) * */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__empty); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_to_py_Py_intptr_t((__pyx_v_X->dimensions[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __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 = 0; - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyInt_to_py_Py_intptr_t((__pyx_v_X->dimensions[0])); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_7)); __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_7, __pyx_t_5, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_5, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_14 = ((PyArrayObject *)__pyx_t_6); + __pyx_t_31 = ((PyArrayObject *)__pyx_t_6); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_target); - __pyx_t_13 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_target, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack); - if (unlikely(__pyx_t_13 < 0)) { + __pyx_t_30 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_target, (PyObject*)__pyx_t_31, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_30 < 0)) { PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_target, (PyObject*)__pyx_v_target, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) { Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); @@ -5715,14 +5927,14 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_cross_validation(PyObject *__pyx } __pyx_bstride_0_target = __pyx_bstruct_target.strides[0]; __pyx_bshape_0_target = __pyx_bstruct_target.shape[0]; - if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_30 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_14 = 0; + __pyx_t_31 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_target)); __pyx_v_target = ((PyArrayObject *)__pyx_t_6); __pyx_t_6 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":535 + /* "scikits/learn/svm/libsvm.pyx":535 * cdef np.ndarray[np.float64_t, ndim=1, mode='c'] target * target = np.empty((X.shape[0]), dtype=np.float64) * svm_cross_validation(&problem, ¶m, n_fold, <double *> target.data) # <<<<<<<<<<<<<< @@ -5731,7 +5943,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_cross_validation(PyObject *__pyx */ svm_cross_validation((&__pyx_v_problem), (&__pyx_v_param), __pyx_v_n_fold, ((double *)__pyx_v_target->data)); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":537 + /* "scikits/learn/svm/libsvm.pyx":537 * svm_cross_validation(&problem, ¶m, n_fold, <double *> target.data) * * free(problem.x) # <<<<<<<<<<<<<< @@ -5740,7 +5952,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_cross_validation(PyObject *__pyx */ free(__pyx_v_problem.x); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":538 + /* "scikits/learn/svm/libsvm.pyx":538 * * free(problem.x) * return target # <<<<<<<<<<<<<< @@ -5755,7 +5967,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_cross_validation(PyObject *__pyx __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); @@ -5769,7 +5981,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_cross_validation(PyObject *__pyx __Pyx_SafeReleaseBuffer(&__pyx_bstruct_X); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_target); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("sklearn.svm.libsvm.cross_validation"); + __Pyx_AddTraceback("scikits.learn.svm.libsvm.cross_validation"); __pyx_r = NULL; goto __pyx_L2; __pyx_L0:; @@ -5788,7 +6000,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_cross_validation(PyObject *__pyx return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":540 +/* "scikits/learn/svm/libsvm.pyx":540 * return target * * def set_verbosity_wrap(int verbosity): # <<<<<<<<<<<<<< @@ -5796,9 +6008,10 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_cross_validation(PyObject *__pyx * Control verbosity of libsvm library */ -static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_set_verbosity_wrap(PyObject *__pyx_self, PyObject *__pyx_arg_verbosity); /*proto*/ -static char __pyx_doc_7sklearn_3svm_6libsvm_set_verbosity_wrap[] = "\n Control verbosity of libsvm library\n "; -static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_set_verbosity_wrap(PyObject *__pyx_self, PyObject *__pyx_arg_verbosity) { +static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_5set_verbosity_wrap(PyObject *__pyx_self, PyObject *__pyx_arg_verbosity); /*proto*/ +static char __pyx_doc_7scikits_5learn_3svm_6libsvm_5set_verbosity_wrap[] = "\n Control verbosity of libsvm library\n "; +static PyMethodDef __pyx_mdef_7scikits_5learn_3svm_6libsvm_5set_verbosity_wrap = {__Pyx_NAMESTR("set_verbosity_wrap"), (PyCFunction)__pyx_pf_7scikits_5learn_3svm_6libsvm_5set_verbosity_wrap, METH_O, __Pyx_DOCSTR(__pyx_doc_7scikits_5learn_3svm_6libsvm_5set_verbosity_wrap)}; +static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_5set_verbosity_wrap(PyObject *__pyx_self, PyObject *__pyx_arg_verbosity) { int __pyx_v_verbosity; PyObject *__pyx_r = NULL; __Pyx_RefNannySetupContext("set_verbosity_wrap"); @@ -5808,12 +6021,12 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_set_verbosity_wrap(PyObject *__p } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - __Pyx_AddTraceback("sklearn.svm.libsvm.set_verbosity_wrap"); + __Pyx_AddTraceback("scikits.learn.svm.libsvm.set_verbosity_wrap"); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":544 + /* "scikits/learn/svm/libsvm.pyx":544 * Control verbosity of libsvm library * """ * set_verbosity(verbosity) # <<<<<<<<<<<<<< @@ -5826,7 +6039,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_set_verbosity_wrap(PyObject *__p return __pyx_r; } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":188 +/* "numpy.pxd":188 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -5847,21 +6060,21 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ int __pyx_v_offset; int __pyx_v_hasfields; int __pyx_r; - int __pyx_t_1; + PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; + int __pyx_t_4; + int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; - int __pyx_t_8; + PyObject *__pyx_t_8 = NULL; char *__pyx_t_9; __Pyx_RefNannySetupContext("__getbuffer__"); if (__pyx_v_info == NULL) return 0; __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(__pyx_v_info->obj); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":194 + /* "numpy.pxd":194 * # of flags * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -5870,7 +6083,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_endian_detector = 1; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":195 + /* "numpy.pxd":195 * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -5879,26 +6092,29 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":197 + /* "numpy.pxd":197 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) * * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< * * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - __pyx_v_ndim = PyArray_NDIM(((PyArrayObject *)__pyx_v_self)); + __pyx_t_1 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_ndim = PyArray_NDIM(((PyArrayObject *)__pyx_t_1)); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":199 + /* "numpy.pxd":199 * 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))); - if (__pyx_t_1) { + __pyx_t_2 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); + if (__pyx_t_2) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":200 + /* "numpy.pxd":200 * * if sizeof(npy_intp) != sizeof(Py_ssize_t): * copy_shape = 1 # <<<<<<<<<<<<<< @@ -5910,7 +6126,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } /*else*/ { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":202 + /* "numpy.pxd":202 * copy_shape = 1 * else: * copy_shape = 0 # <<<<<<<<<<<<<< @@ -5921,108 +6137,105 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } __pyx_L5:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":204 + /* "numpy.pxd":204 * 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_1 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS); - if (__pyx_t_1) { + __pyx_t_2 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS); + if (__pyx_t_2) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":205 + /* "numpy.pxd":205 * * 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(((PyArrayObject *)__pyx_v_self), NPY_C_CONTIGUOUS)); - __pyx_t_3 = __pyx_t_2; + __pyx_t_1 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_t_1), NPY_C_CONTIGUOUS)); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __pyx_t_3; } else { - __pyx_t_3 = __pyx_t_1; + __pyx_t_4 = __pyx_t_2; } - if (__pyx_t_3) { + if (__pyx_t_4) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":206 + /* "numpy.pxd":206 * 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_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(((PyObject *)__pyx_kp_u_27)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_u_27)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_27)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_33), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[1]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":208 + /* "numpy.pxd":208 * 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_3 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS); - if (__pyx_t_3) { + __pyx_t_4 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS); + if (__pyx_t_4) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":209 + /* "numpy.pxd":209 * * 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_1 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_v_self), NPY_F_CONTIGUOUS)); - __pyx_t_2 = __pyx_t_1; + __pyx_t_1 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_t_1), NPY_F_CONTIGUOUS)); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __pyx_t_2; } else { - __pyx_t_2 = __pyx_t_3; + __pyx_t_3 = __pyx_t_4; } - if (__pyx_t_2) { + if (__pyx_t_3) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":210 + /* "numpy.pxd":210 * 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_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_INCREF(((PyObject *)__pyx_kp_u_28)); - PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_u_28)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_28)); - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_35), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[1]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L7; } __pyx_L7:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":212 + /* "numpy.pxd":212 * 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(((PyArrayObject *)__pyx_v_self)); + __pyx_t_1 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_info->buf = PyArray_DATA(((PyArrayObject *)__pyx_t_1)); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":213 + /* "numpy.pxd":213 * * info.buf = PyArray_DATA(self) * info.ndim = ndim # <<<<<<<<<<<<<< @@ -6031,7 +6244,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->ndim = __pyx_v_ndim; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":214 + /* "numpy.pxd":214 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if copy_shape: # <<<<<<<<<<<<<< @@ -6040,7 +6253,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ if (__pyx_v_copy_shape) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":217 + /* "numpy.pxd":217 * # Allocate new buffer for strides and shape info. This is allocated * # as one block, strides first. * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< @@ -6049,7 +6262,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * __pyx_v_ndim) * 2))); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":218 + /* "numpy.pxd":218 * # as one block, strides first. * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) * info.shape = info.strides + ndim # <<<<<<<<<<<<<< @@ -6058,60 +6271,72 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":219 + /* "numpy.pxd":219 * info.strides = <Py_ssize_t*>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_6 = __pyx_v_ndim; - for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { - __pyx_v_i = __pyx_t_7; + __pyx_t_5 = __pyx_v_ndim; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":220 + /* "numpy.pxd":220 * 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(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]); + __pyx_t_1 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_1); + (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(((PyArrayObject *)__pyx_t_1))[__pyx_v_i]); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":221 + /* "numpy.pxd":221 * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< * else: * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) */ - (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]); + __pyx_t_1 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_1); + (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(((PyArrayObject *)__pyx_t_1))[__pyx_v_i]); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } goto __pyx_L8; } /*else*/ { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":223 + /* "numpy.pxd":223 * info.shape[i] = PyArray_DIMS(self)[i] * else: * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) # <<<<<<<<<<<<<< * info.shape = <Py_ssize_t*>PyArray_DIMS(self) * info.suboffsets = NULL */ - __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(((PyArrayObject *)__pyx_v_self))); + __pyx_t_1 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(((PyArrayObject *)__pyx_t_1))); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":224 + /* "numpy.pxd":224 * else: * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) * info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<< * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) */ - __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(((PyArrayObject *)__pyx_v_self))); + __pyx_t_1 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(((PyArrayObject *)__pyx_t_1))); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L8:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":225 + /* "numpy.pxd":225 * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) * info.shape = <Py_ssize_t*>PyArray_DIMS(self) * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -6120,25 +6345,31 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->suboffsets = NULL; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":226 + /* "numpy.pxd":226 * info.shape = <Py_ssize_t*>PyArray_DIMS(self) * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< * info.readonly = not PyArray_ISWRITEABLE(self) * */ - __pyx_v_info->itemsize = PyArray_ITEMSIZE(((PyArrayObject *)__pyx_v_self)); + __pyx_t_1 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_info->itemsize = PyArray_ITEMSIZE(((PyArrayObject *)__pyx_t_1)); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":227 + /* "numpy.pxd":227 * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< * * cdef int t */ - __pyx_v_info->readonly = (!PyArray_ISWRITEABLE(((PyArrayObject *)__pyx_v_self))); + __pyx_t_1 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_info->readonly = (!PyArray_ISWRITEABLE(((PyArrayObject *)__pyx_t_1))); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":230 + /* "numpy.pxd":230 * * cdef int t * cdef char* f = NULL # <<<<<<<<<<<<<< @@ -6147,7 +6378,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_f = NULL; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":231 + /* "numpy.pxd":231 * cdef int t * cdef char* f = NULL * cdef dtype descr = self.descr # <<<<<<<<<<<<<< @@ -6157,7 +6388,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_self)->descr)); __pyx_v_descr = ((PyArrayObject *)__pyx_v_self)->descr; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":235 + /* "numpy.pxd":235 * cdef int offset * * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< @@ -6166,23 +6397,23 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":237 + /* "numpy.pxd":237 * 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); - if (__pyx_t_2) { - __pyx_t_3 = (!__pyx_v_copy_shape); - __pyx_t_1 = __pyx_t_3; + __pyx_t_3 = (!__pyx_v_hasfields); + if (__pyx_t_3) { + __pyx_t_4 = (!__pyx_v_copy_shape); + __pyx_t_2 = __pyx_t_4; } else { - __pyx_t_1 = __pyx_t_2; + __pyx_t_2 = __pyx_t_3; } - if (__pyx_t_1) { + if (__pyx_t_2) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":239 + /* "numpy.pxd":239 * if not hasfields and not copy_shape: * # do not call releasebuffer * info.obj = None # <<<<<<<<<<<<<< @@ -6198,7 +6429,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } /*else*/ { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":242 + /* "numpy.pxd":242 * else: * # need to call releasebuffer * info.obj = self # <<<<<<<<<<<<<< @@ -6213,17 +6444,17 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } __pyx_L11:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":244 + /* "numpy.pxd":244 * info.obj = self * * if not hasfields: # <<<<<<<<<<<<<< * t = descr.type_num * if ((descr.byteorder == '>' and little_endian) or */ - __pyx_t_1 = (!__pyx_v_hasfields); - if (__pyx_t_1) { + __pyx_t_2 = (!__pyx_v_hasfields); + if (__pyx_t_2) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":245 + /* "numpy.pxd":245 * * if not hasfields: * t = descr.type_num # <<<<<<<<<<<<<< @@ -6232,312 +6463,306 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_t = __pyx_v_descr->type_num; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":246 + /* "numpy.pxd":246 * if not hasfields: * t = descr.type_num * if ((descr.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< * (descr.byteorder == '<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") */ - __pyx_t_1 = (__pyx_v_descr->byteorder == '>'); - if (__pyx_t_1) { - __pyx_t_2 = __pyx_v_little_endian; + __pyx_t_2 = (__pyx_v_descr->byteorder == '>'); + if (__pyx_t_2) { + __pyx_t_3 = __pyx_v_little_endian; } else { - __pyx_t_2 = __pyx_t_1; + __pyx_t_3 = __pyx_t_2; } - if (!__pyx_t_2) { + if (!__pyx_t_3) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":247 + /* "numpy.pxd":247 * t = descr.type_num * if ((descr.byteorder == '>' and little_endian) or * (descr.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" */ - __pyx_t_1 = (__pyx_v_descr->byteorder == '<'); - if (__pyx_t_1) { - __pyx_t_3 = (!__pyx_v_little_endian); - __pyx_t_8 = __pyx_t_3; + __pyx_t_2 = (__pyx_v_descr->byteorder == '<'); + if (__pyx_t_2) { + __pyx_t_4 = (!__pyx_v_little_endian); + __pyx_t_7 = __pyx_t_4; } else { - __pyx_t_8 = __pyx_t_1; + __pyx_t_7 = __pyx_t_2; } - __pyx_t_1 = __pyx_t_8; + __pyx_t_2 = __pyx_t_7; } else { - __pyx_t_1 = __pyx_t_2; + __pyx_t_2 = __pyx_t_3; } - if (__pyx_t_1) { + if (__pyx_t_2) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":248 + /* "numpy.pxd":248 * if ((descr.byteorder == '>' and little_endian) or * (descr.byteorder == '<' 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_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(((PyObject *)__pyx_kp_u_29)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_u_29)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_29)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_37), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[1]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L13; } __pyx_L13:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":249 + /* "numpy.pxd":249 * (descr.byteorder == '<' 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_BYTE); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_BYTE); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__b; goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":250 + /* "numpy.pxd":250 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_UBYTE); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_UBYTE); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__B; goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":251 + /* "numpy.pxd":251 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_SHORT); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_SHORT); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__h; goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":252 + /* "numpy.pxd":252 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_USHORT); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_USHORT); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__H; goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":253 + /* "numpy.pxd":253 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_INT); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_INT); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__i; goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":254 + /* "numpy.pxd":254 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_UINT); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_UINT); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__I; goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":255 + /* "numpy.pxd":255 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_LONG); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_LONG); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__l; goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":256 + /* "numpy.pxd":256 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_ULONG); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_ULONG); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__L; goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":257 + /* "numpy.pxd":257 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_LONGLONG); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_LONGLONG); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__q; goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":258 + /* "numpy.pxd":258 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_ULONGLONG); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_ULONGLONG); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__Q; goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":259 + /* "numpy.pxd":259 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_FLOAT); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_FLOAT); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__f; goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":260 + /* "numpy.pxd":260 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_DOUBLE); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_DOUBLE); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__d; goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":261 + /* "numpy.pxd":261 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_LONGDOUBLE); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_LONGDOUBLE); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__g; goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":262 + /* "numpy.pxd":262 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_CFLOAT); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_CFLOAT); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__Zf; goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":263 + /* "numpy.pxd":263 * 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" */ - __pyx_t_1 = (__pyx_v_t == NPY_CDOUBLE); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_CDOUBLE); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__Zd; goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":264 + /* "numpy.pxd":264 * 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: */ - __pyx_t_1 = (__pyx_v_t == NPY_CLONGDOUBLE); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_CLONGDOUBLE); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__Zg; goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":265 + /* "numpy.pxd":265 * 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) */ - __pyx_t_1 = (__pyx_v_t == NPY_OBJECT); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_t == NPY_OBJECT); + if (__pyx_t_2) { __pyx_v_f = __pyx_k__O; goto __pyx_L14; } /*else*/ { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":267 + /* "numpy.pxd":267 * elif t == NPY_OBJECT: f = "O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< * info.format = f * return */ - __pyx_t_5 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_30), __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_4)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_38), __pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_8)); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_8)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_8)); + __pyx_t_8 = 0; + __pyx_t_8 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_8, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L14:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":268 + /* "numpy.pxd":268 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f # <<<<<<<<<<<<<< @@ -6546,7 +6771,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->format = __pyx_v_f; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":269 + /* "numpy.pxd":269 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f * return # <<<<<<<<<<<<<< @@ -6559,7 +6784,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } /*else*/ { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":271 + /* "numpy.pxd":271 * return * else: * info.format = <char*>stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< @@ -6568,7 +6793,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->format = ((char *)malloc(255)); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":272 + /* "numpy.pxd":272 * else: * info.format = <char*>stdlib.malloc(_buffer_format_string_len) * info.format[0] = '^' # Native data types, manual alignment # <<<<<<<<<<<<<< @@ -6577,7 +6802,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ (__pyx_v_info->format[0]) = '^'; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":273 + /* "numpy.pxd":273 * info.format = <char*>stdlib.malloc(_buffer_format_string_len) * info.format[0] = '^' # Native data types, manual alignment * offset = 0 # <<<<<<<<<<<<<< @@ -6586,7 +6811,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_offset = 0; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":276 + /* "numpy.pxd":276 * f = _util_dtypestring(descr, info.format + 1, * info.format + _buffer_format_string_len, * &offset) # <<<<<<<<<<<<<< @@ -6596,7 +6821,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ __pyx_t_9 = __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_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_f = __pyx_t_9; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":277 + /* "numpy.pxd":277 * info.format + _buffer_format_string_len, * &offset) * f[0] = 0 # Terminate format string # <<<<<<<<<<<<<< @@ -6610,8 +6835,8 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("numpy.ndarray.__getbuffer__"); __pyx_r = -1; __Pyx_GOTREF(__pyx_v_info->obj); @@ -6628,7 +6853,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ return __pyx_r; } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":279 +/* "numpy.pxd":279 * f[0] = 0 # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -6636,22 +6861,26 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ * stdlib.free(info.format) */ -static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ -static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { - int __pyx_t_1; +static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray_1__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ +static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray_1__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; __Pyx_RefNannySetupContext("__releasebuffer__"); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":280 + /* "numpy.pxd":280 * * 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(((PyArrayObject *)__pyx_v_self)); - if (__pyx_t_1) { + __pyx_t_1 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = PyArray_HASFIELDS(((PyArrayObject *)__pyx_t_1)); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":281 + /* "numpy.pxd":281 * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): * stdlib.free(info.format) # <<<<<<<<<<<<<< @@ -6663,17 +6892,17 @@ static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *_ } __pyx_L5:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":282 + /* "numpy.pxd":282 * 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))); - if (__pyx_t_1) { + __pyx_t_2 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); + if (__pyx_t_2) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":283 + /* "numpy.pxd":283 * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): * stdlib.free(info.strides) # <<<<<<<<<<<<<< @@ -6688,7 +6917,7 @@ static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *_ __Pyx_RefNannyFinishContext(); } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":756 +/* "numpy.pxd":756 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -6701,7 +6930,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1"); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":757 + /* "numpy.pxd":757 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<< @@ -6727,7 +6956,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":759 +/* "numpy.pxd":759 * return PyArray_MultiIterNew(1, <void*>a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -6740,7 +6969,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2"); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":760 + /* "numpy.pxd":760 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<< @@ -6766,7 +6995,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":762 +/* "numpy.pxd":762 * return PyArray_MultiIterNew(2, <void*>a, <void*>b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -6779,7 +7008,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3"); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":763 + /* "numpy.pxd":763 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<< @@ -6805,7 +7034,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":765 +/* "numpy.pxd":765 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -6818,7 +7047,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4"); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":766 + /* "numpy.pxd":766 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<< @@ -6844,7 +7073,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":768 +/* "numpy.pxd":768 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -6857,7 +7086,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5"); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":769 + /* "numpy.pxd":769 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<< @@ -6883,7 +7112,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":771 +/* "numpy.pxd":771 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -6909,15 +7138,16 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx int __pyx_t_7; int __pyx_t_8; int __pyx_t_9; - char *__pyx_t_10; + long __pyx_t_10; + char *__pyx_t_11; __Pyx_RefNannySetupContext("_util_dtypestring"); __pyx_v_child = ((PyArray_Descr *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_fields = ((PyObject *)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_fields = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); __pyx_v_childname = Py_None; __Pyx_INCREF(Py_None); __pyx_v_new_offset = Py_None; __Pyx_INCREF(Py_None); __pyx_v_t = Py_None; __Pyx_INCREF(Py_None); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":778 + /* "numpy.pxd":778 * cdef int delta_offset * cdef tuple i * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -6926,7 +7156,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_endian_detector = 1; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":779 + /* "numpy.pxd":779 * cdef tuple i * cdef int endian_detector = 1 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -6935,18 +7165,17 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":782 + /* "numpy.pxd":782 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< * fields = descr.fields[childname] * child, new_offset = fields */ - if (likely(((PyObject *)__pyx_v_descr->names) != Py_None)) { - __pyx_t_1 = 0; __pyx_t_2 = ((PyObject *)__pyx_v_descr->names); __Pyx_INCREF(__pyx_t_2); - } else { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_v_descr->names == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_1 = 0; __pyx_t_2 = ((PyObject *)__pyx_v_descr->names); __Pyx_INCREF(__pyx_t_2); for (;;) { if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break; __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; @@ -6954,7 +7183,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_v_childname = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":783 + /* "numpy.pxd":783 * * for childname in descr.names: * fields = descr.fields[childname] # <<<<<<<<<<<<<< @@ -6965,10 +7194,10 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_GOTREF(__pyx_t_3); if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_fields)); - __pyx_v_fields = ((PyObject *)__pyx_t_3); + __pyx_v_fields = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":784 + /* "numpy.pxd":784 * for childname in descr.names: * fields = descr.fields[childname] * child, new_offset = fields # <<<<<<<<<<<<<< @@ -6991,7 +7220,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx {__pyx_filename = __pyx_f[1]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":786 + /* "numpy.pxd":786 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< @@ -7016,29 +7245,23 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":787 + /* "numpy.pxd":787 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< * * if ((child.byteorder == '>' and little_endian) or */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_40), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_INCREF(((PyObject *)__pyx_kp_u_31)); - PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_u_31)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_31)); - __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L5; } __pyx_L5:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":789 + /* "numpy.pxd":789 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< @@ -7053,7 +7276,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } if (!__pyx_t_7) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":790 + /* "numpy.pxd":790 * * if ((child.byteorder == '>' and little_endian) or * (child.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< @@ -7073,21 +7296,15 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } if (__pyx_t_6) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":791 + /* "numpy.pxd":791 * if ((child.byteorder == '>' and little_endian) or * (child.byteorder == '<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(((PyObject *)__pyx_kp_u_29)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_u_29)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_29)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_41), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[1]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -7095,7 +7312,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L6:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":801 + /* "numpy.pxd":801 * * # Output padding bytes * while offset[0] < new_offset: # <<<<<<<<<<<<<< @@ -7112,7 +7329,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_6) break; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":802 + /* "numpy.pxd":802 * # Output padding bytes * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< @@ -7121,35 +7338,37 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ (__pyx_v_f[0]) = 120; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":803 + /* "numpy.pxd":803 * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte * f += 1 # <<<<<<<<<<<<<< * offset[0] += 1 * */ - __pyx_v_f += 1; + __pyx_v_f = (__pyx_v_f + 1); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":804 + /* "numpy.pxd":804 * f[0] = 120 # "x"; pad byte * f += 1 * offset[0] += 1 # <<<<<<<<<<<<<< * * offset[0] += child.itemsize */ - (__pyx_v_offset[0]) += 1; + __pyx_t_10 = 0; + (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + 1); } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":806 + /* "numpy.pxd":806 * offset[0] += 1 * * offset[0] += child.itemsize # <<<<<<<<<<<<<< * * if not PyDataType_HASFIELDS(child): */ - (__pyx_v_offset[0]) += __pyx_v_child->elsize; + __pyx_t_10 = 0; + (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + __pyx_v_child->elsize); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":808 + /* "numpy.pxd":808 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -7159,7 +7378,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = (!PyDataType_HASFIELDS(__pyx_v_child)); if (__pyx_t_6) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":809 + /* "numpy.pxd":809 * * if not PyDataType_HASFIELDS(child): * t = child.type_num # <<<<<<<<<<<<<< @@ -7172,7 +7391,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_v_t = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":810 + /* "numpy.pxd":810 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -7182,408 +7401,402 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = ((__pyx_v_end - __pyx_v_f) < 5); if (__pyx_t_6) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":811 + /* "numpy.pxd":811 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_43), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(((PyObject *)__pyx_kp_u_32)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_u_32)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_32)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[1]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L10; } __pyx_L10:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":814 + /* "numpy.pxd":814 * * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" */ - __pyx_t_5 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 98; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":815 + /* "numpy.pxd":815 * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" */ - __pyx_t_3 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 66; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":816 + /* "numpy.pxd":816 * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" */ - __pyx_t_5 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 104; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":817 + /* "numpy.pxd":817 * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" */ - __pyx_t_3 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 72; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":818 + /* "numpy.pxd":818 * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" */ - __pyx_t_5 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 105; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":819 + /* "numpy.pxd":819 * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" */ - __pyx_t_3 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 73; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":820 + /* "numpy.pxd":820 * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" */ - __pyx_t_5 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 108; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":821 + /* "numpy.pxd":821 * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" */ - __pyx_t_3 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 76; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":822 + /* "numpy.pxd":822 * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" */ - __pyx_t_5 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 113; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":823 + /* "numpy.pxd":823 * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" */ - __pyx_t_3 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 81; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":824 + /* "numpy.pxd":824 * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" */ - __pyx_t_5 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 102; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":825 + /* "numpy.pxd":825 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf */ - __pyx_t_3 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 100; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":826 + /* "numpy.pxd":826 * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd */ - __pyx_t_5 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 103; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":827 + /* "numpy.pxd":827 * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg */ - __pyx_t_3 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; (__pyx_v_f[1]) = 102; - __pyx_v_f += 1; + __pyx_v_f = (__pyx_v_f + 1); goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":828 + /* "numpy.pxd":828 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg * elif t == NPY_OBJECT: f[0] = 79 #"O" */ - __pyx_t_5 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; (__pyx_v_f[1]) = 100; - __pyx_v_f += 1; + __pyx_v_f = (__pyx_v_f + 1); goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":829 + /* "numpy.pxd":829 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: */ - __pyx_t_3 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; (__pyx_v_f[1]) = 103; - __pyx_v_f += 1; + __pyx_v_f = (__pyx_v_f + 1); goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":830 + /* "numpy.pxd":830 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) */ - __pyx_t_5 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 79; goto __pyx_L11; } /*else*/ { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":832 + /* "numpy.pxd":832 * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< * f += 1 * else: */ - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_30), __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_38), __pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_5)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_5)); + __pyx_t_5 = 0; + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L11:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":833 + /* "numpy.pxd":833 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * f += 1 # <<<<<<<<<<<<<< * else: * # Cython ignores struct boundary information ("T{...}"), */ - __pyx_v_f += 1; + __pyx_v_f = (__pyx_v_f + 1); goto __pyx_L9; } /*else*/ { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":837 + /* "numpy.pxd":837 * # Cython ignores struct boundary information ("T{...}"), * # so don't output it * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< * return f * */ - __pyx_t_10 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_f = __pyx_t_10; + __pyx_t_11 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_f = __pyx_t_11; } __pyx_L9:; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":838 + /* "numpy.pxd":838 * # so don't output it * f = _util_dtypestring(child, f, end, offset) * return f # <<<<<<<<<<<<<< @@ -7612,7 +7825,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx return __pyx_r; } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":953 +/* "numpy.pxd":953 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -7623,9 +7836,10 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { PyObject *__pyx_v_baseptr; int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("set_array_base"); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":955 + /* "numpy.pxd":955 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -7635,7 +7849,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __pyx_t_1 = (__pyx_v_base == Py_None); if (__pyx_t_1) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":956 + /* "numpy.pxd":956 * cdef PyObject* baseptr * if base is None: * baseptr = NULL # <<<<<<<<<<<<<< @@ -7647,16 +7861,19 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } /*else*/ { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":958 + /* "numpy.pxd":958 * baseptr = NULL * else: * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< * baseptr = <PyObject*>base * Py_XDECREF(arr.base) */ - Py_INCREF(__pyx_v_base); + __pyx_t_2 = __pyx_v_base; + __Pyx_INCREF(__pyx_t_2); + Py_INCREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":959 + /* "numpy.pxd":959 * else: * Py_INCREF(base) # important to do this before decref below! * baseptr = <PyObject*>base # <<<<<<<<<<<<<< @@ -7667,7 +7884,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } __pyx_L3:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":960 + /* "numpy.pxd":960 * Py_INCREF(base) # important to do this before decref below! * baseptr = <PyObject*>base * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< @@ -7676,7 +7893,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_XDECREF(__pyx_v_arr->base); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":961 + /* "numpy.pxd":961 * baseptr = <PyObject*>base * Py_XDECREF(arr.base) * arr.base = baseptr # <<<<<<<<<<<<<< @@ -7688,7 +7905,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyFinishContext(); } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":963 +/* "numpy.pxd":963 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -7701,7 +7918,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base"); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":964 + /* "numpy.pxd":964 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -7711,7 +7928,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_t_1 = (__pyx_v_arr->base == NULL); if (__pyx_t_1) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":965 + /* "numpy.pxd":965 * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: * return None # <<<<<<<<<<<<<< @@ -7726,7 +7943,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py } /*else*/ { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":967 + /* "numpy.pxd":967 * return None * else: * return <object>arr.base # <<<<<<<<<<<<<< @@ -7746,12 +7963,6 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py } static PyMethodDef __pyx_methods[] = { - {__Pyx_NAMESTR("fit"), (PyCFunction)__pyx_pf_7sklearn_3svm_6libsvm_fit, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7sklearn_3svm_6libsvm_fit)}, - {__Pyx_NAMESTR("predict"), (PyCFunction)__pyx_pf_7sklearn_3svm_6libsvm_predict, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7sklearn_3svm_6libsvm_predict)}, - {__Pyx_NAMESTR("predict_proba"), (PyCFunction)__pyx_pf_7sklearn_3svm_6libsvm_predict_proba, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7sklearn_3svm_6libsvm_predict_proba)}, - {__Pyx_NAMESTR("decision_function"), (PyCFunction)__pyx_pf_7sklearn_3svm_6libsvm_decision_function, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7sklearn_3svm_6libsvm_decision_function)}, - {__Pyx_NAMESTR("cross_validation"), (PyCFunction)__pyx_pf_7sklearn_3svm_6libsvm_cross_validation, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7sklearn_3svm_6libsvm_cross_validation)}, - {__Pyx_NAMESTR("set_verbosity_wrap"), (PyCFunction)__pyx_pf_7sklearn_3svm_6libsvm_set_verbosity_wrap, METH_O, __Pyx_DOCSTR(__pyx_doc_7sklearn_3svm_6libsvm_set_verbosity_wrap)}, {0, 0, 0, 0} }; @@ -7759,7 +7970,7 @@ static PyMethodDef __pyx_methods[] = { static struct PyModuleDef __pyx_moduledef = { PyModuleDef_HEAD_INIT, __Pyx_NAMESTR("libsvm"), - __Pyx_DOCSTR(__pyx_k_33), /* m_doc */ + __Pyx_DOCSTR(__pyx_k_44), /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ @@ -7770,23 +7981,16 @@ static struct PyModuleDef __pyx_moduledef = { #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp_s_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 0, 1, 0}, - {&__pyx_kp_s_26, __pyx_k_26, sizeof(__pyx_k_26), 0, 0, 1, 0}, - {&__pyx_kp_u_27, __pyx_k_27, sizeof(__pyx_k_27), 0, 1, 0, 0}, - {&__pyx_kp_u_28, __pyx_k_28, sizeof(__pyx_k_28), 0, 1, 0, 0}, - {&__pyx_kp_u_29, __pyx_k_29, sizeof(__pyx_k_29), 0, 1, 0, 0}, - {&__pyx_kp_u_30, __pyx_k_30, sizeof(__pyx_k_30), 0, 1, 0, 0}, - {&__pyx_kp_u_31, __pyx_k_31, sizeof(__pyx_k_31), 0, 1, 0, 0}, + {&__pyx_kp_s_30, __pyx_k_30, sizeof(__pyx_k_30), 0, 0, 1, 0}, {&__pyx_kp_u_32, __pyx_k_32, sizeof(__pyx_k_32), 0, 1, 0, 0}, {&__pyx_kp_u_34, __pyx_k_34, sizeof(__pyx_k_34), 0, 1, 0, 0}, - {&__pyx_kp_u_35, __pyx_k_35, sizeof(__pyx_k_35), 0, 1, 0, 0}, {&__pyx_kp_u_36, __pyx_k_36, sizeof(__pyx_k_36), 0, 1, 0, 0}, - {&__pyx_kp_u_37, __pyx_k_37, sizeof(__pyx_k_37), 0, 1, 0, 0}, {&__pyx_kp_u_38, __pyx_k_38, sizeof(__pyx_k_38), 0, 1, 0, 0}, {&__pyx_kp_u_39, __pyx_k_39, sizeof(__pyx_k_39), 0, 1, 0, 0}, {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0}, + {&__pyx_kp_u_42, __pyx_k_42, sizeof(__pyx_k_42), 0, 1, 0, 0}, + {&__pyx_n_s_48, __pyx_k_48, sizeof(__pyx_k_48), 0, 0, 1, 1}, {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0}, - {&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0}, {&__pyx_n_s__C, __pyx_k__C, sizeof(__pyx_k__C), 0, 0, 1, 1}, {&__pyx_n_s__LIBSVM_KERNEL_TYPES, __pyx_k__LIBSVM_KERNEL_TYPES, sizeof(__pyx_k__LIBSVM_KERNEL_TYPES), 0, 0, 1, 1}, {&__pyx_n_s__MemoryError, __pyx_k__MemoryError, sizeof(__pyx_k__MemoryError), 0, 0, 1, 1}, @@ -7868,45 +8072,524 @@ static int __Pyx_InitCachedBuiltins(void) { return -1; } -static int __Pyx_InitGlobals(void) { - if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - return 0; - __pyx_L1_error:; - return -1; -} +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants"); -#if PY_MAJOR_VERSION < 3 -PyMODINIT_FUNC initlibsvm(void); /*proto*/ -PyMODINIT_FUNC initlibsvm(void) -#else -PyMODINIT_FUNC PyInit_libsvm(void); /*proto*/ -PyMODINIT_FUNC PyInit_libsvm(void) -#endif -{ - 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; - #if CYTHON_REFNANNY - void* __pyx_refnanny = NULL; - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); - if (!__Pyx_RefNanny) { - PyErr_Clear(); - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); - if (!__Pyx_RefNanny) - Py_FatalError("failed to import 'refnanny' module"); - } - __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit_libsvm(void)", __LINE__, __FILE__); - #endif - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #ifdef __pyx_binding_PyCFunctionType_USED + /* "scikits/learn/svm/libsvm.pyx":184 + * cdef np.ndarray[np.float64_t, ndim=2, mode='c'] support_vectors + * if kernel_index == 4: + * support_vectors = np.empty((0, 0), dtype=np.float64) # <<<<<<<<<<<<<< + * else: + * support_vectors = np.empty((SV_len, X.shape[1]), dtype=np.float64) + */ + __pyx_k_tuple_6 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_6)); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_k_tuple_6, 0, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_k_tuple_6, 1, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_6)); + __pyx_k_tuple_7 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_7)); + __Pyx_INCREF(((PyObject *)__pyx_k_tuple_6)); + PyTuple_SET_ITEM(__pyx_k_tuple_7, 0, ((PyObject *)__pyx_k_tuple_6)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_6)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_7)); + + /* "scikits/learn/svm/libsvm.pyx":209 + * copy_probB(probB.data, model, probB.shape) + * else: + * probA = np.empty(1, dtype=np.float64) # <<<<<<<<<<<<<< + * probB = np.empty(0, dtype=np.float64) + * copy_probA(probA.data, model, probA.shape) + */ + __pyx_k_tuple_8 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_8)); + __Pyx_INCREF(__pyx_int_1); + PyTuple_SET_ITEM(__pyx_k_tuple_8, 0, __pyx_int_1); + __Pyx_GIVEREF(__pyx_int_1); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_8)); + + /* "scikits/learn/svm/libsvm.pyx":210 + * else: + * probA = np.empty(1, dtype=np.float64) + * probB = np.empty(0, dtype=np.float64) # <<<<<<<<<<<<<< + * copy_probA(probA.data, model, probA.shape) + * else: + */ + __pyx_k_tuple_9 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_9)); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_k_tuple_9, 0, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_9)); + + /* "scikits/learn/svm/libsvm.pyx":213 + * copy_probA(probA.data, model, probA.shape) + * else: + * probA = np.empty(0, dtype=np.float64) # <<<<<<<<<<<<<< + * probA = np.empty(0, dtype=np.float64) + * + */ + __pyx_k_tuple_10 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_10)); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_k_tuple_10, 0, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_10)); + + /* "scikits/learn/svm/libsvm.pyx":214 + * else: + * probA = np.empty(0, dtype=np.float64) + * probA = np.empty(0, dtype=np.float64) # <<<<<<<<<<<<<< + * + * # memory deallocation + */ + __pyx_k_tuple_11 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_11)); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_k_tuple_11, 0, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_11)); + + /* "scikits/learn/svm/libsvm.pyx":513 + * + * if X.shape[0] < n_fold: + * raise ValueError("Number of samples is less than number of folds") # <<<<<<<<<<<<<< + * + * # set problem + */ + __pyx_k_tuple_31 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_31)); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_30)); + PyTuple_SET_ITEM(__pyx_k_tuple_31, 0, ((PyObject *)__pyx_kp_s_30)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_30)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_31)); + + /* "numpy.pxd":206 + * 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_k_tuple_33 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_33)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_33)); + __Pyx_INCREF(((PyObject *)__pyx_kp_u_32)); + PyTuple_SET_ITEM(__pyx_k_tuple_33, 0, ((PyObject *)__pyx_kp_u_32)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_32)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_33)); + + /* "numpy.pxd":210 + * 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_k_tuple_35 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_35)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_35)); + __Pyx_INCREF(((PyObject *)__pyx_kp_u_34)); + PyTuple_SET_ITEM(__pyx_k_tuple_35, 0, ((PyObject *)__pyx_kp_u_34)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_34)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_35)); + + /* "numpy.pxd":248 + * if ((descr.byteorder == '>' and little_endian) or + * (descr.byteorder == '<' 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_k_tuple_37 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_37)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_37)); + __Pyx_INCREF(((PyObject *)__pyx_kp_u_36)); + PyTuple_SET_ITEM(__pyx_k_tuple_37, 0, ((PyObject *)__pyx_kp_u_36)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_36)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_37)); + + /* "numpy.pxd":787 + * + * if (end - f) - (new_offset - offset[0]) < 15: + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + * + * if ((child.byteorder == '>' and little_endian) or + */ + __pyx_k_tuple_40 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_40)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_40)); + __Pyx_INCREF(((PyObject *)__pyx_kp_u_39)); + PyTuple_SET_ITEM(__pyx_k_tuple_40, 0, ((PyObject *)__pyx_kp_u_39)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_39)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_40)); + + /* "numpy.pxd":791 + * if ((child.byteorder == '>' and little_endian) or + * (child.byteorder == '<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_k_tuple_41 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_41)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_41)); + __Pyx_INCREF(((PyObject *)__pyx_kp_u_36)); + PyTuple_SET_ITEM(__pyx_k_tuple_41, 0, ((PyObject *)__pyx_kp_u_36)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_36)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_41)); + + /* "numpy.pxd":811 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_k_tuple_43 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_43)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_43)); + __Pyx_INCREF(((PyObject *)__pyx_kp_u_42)); + PyTuple_SET_ITEM(__pyx_k_tuple_43, 0, ((PyObject *)__pyx_kp_u_42)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_42)); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_43)); + + /* "scikits/learn/svm/libsvm.pyx":54 + * double C=1., double nu=0.5, double epsilon=0.1, + * np.ndarray[np.int32_t, ndim=1, mode='c'] + * class_weight_label=np.empty(0, dtype=np.int32), # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1, mode='c'] + * class_weight=np.empty(0), + */ + __pyx_k_tuple_45 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_45)); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_k_tuple_45, 0, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_45)); + + /* "scikits/learn/svm/libsvm.pyx":56 + * class_weight_label=np.empty(0, dtype=np.int32), + * np.ndarray[np.float64_t, ndim=1, mode='c'] + * class_weight=np.empty(0), # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1, mode='c'] + * sample_weight=np.empty(0), + */ + __pyx_k_tuple_46 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_46)); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_k_tuple_46, 0, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_46)); + + /* "scikits/learn/svm/libsvm.pyx":58 + * class_weight=np.empty(0), + * np.ndarray[np.float64_t, ndim=1, mode='c'] + * sample_weight=np.empty(0), # <<<<<<<<<<<<<< + * int shrinking=1, int probability=0, + * double cache_size=100.): + */ + __pyx_k_tuple_47 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_47)); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_k_tuple_47, 0, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_47)); + + /* "scikits/learn/svm/libsvm.pyx":230 + * np.ndarray[np.float64_t, ndim=1, mode='c'] intercept, + * np.ndarray[np.int32_t, ndim=1, mode='c'] label, + * np.ndarray[np.float64_t, ndim=1, mode='c'] probA=np.empty(0), # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1, mode='c'] probB=np.empty(0), + * int svm_type=0, str kernel='rbf', int degree=3, + */ + __pyx_k_tuple_49 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_49)); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_k_tuple_49, 0, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_49)); + + /* "scikits/learn/svm/libsvm.pyx":231 + * np.ndarray[np.int32_t, ndim=1, mode='c'] label, + * np.ndarray[np.float64_t, ndim=1, mode='c'] probA=np.empty(0), + * np.ndarray[np.float64_t, ndim=1, mode='c'] probB=np.empty(0), # <<<<<<<<<<<<<< + * int svm_type=0, str kernel='rbf', int degree=3, + * double gamma=0.1, double coef0=0., double tol=1e-3, + */ + __pyx_k_tuple_50 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_50)); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_k_tuple_50, 0, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_50)); + + /* "scikits/learn/svm/libsvm.pyx":236 + * double C=1., double nu=0.5, double epsilon=0.1, + * np.ndarray[np.int32_t, ndim=1, mode='c'] + * class_weight_label=np.empty(0, dtype=np.int32), # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1, mode='c'] + * class_weight=np.empty(0), + */ + __pyx_k_tuple_51 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_51)); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_k_tuple_51, 0, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_51)); + + /* "scikits/learn/svm/libsvm.pyx":238 + * class_weight_label=np.empty(0, dtype=np.int32), + * np.ndarray[np.float64_t, ndim=1, mode='c'] + * class_weight=np.empty(0), # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1, mode='c'] + * sample_weight=np.empty(0), + */ + __pyx_k_tuple_52 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_52)); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_k_tuple_52, 0, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_52)); + + /* "scikits/learn/svm/libsvm.pyx":240 + * class_weight=np.empty(0), + * np.ndarray[np.float64_t, ndim=1, mode='c'] + * sample_weight=np.empty(0), # <<<<<<<<<<<<<< + * int shrinking=0, int probability=0, + * double cache_size=100.): + */ + __pyx_k_tuple_53 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_53)); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_k_tuple_53, 0, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_53)); + + /* "scikits/learn/svm/libsvm.pyx":316 + * np.ndarray[np.float64_t, ndim=1, mode='c'] intercept, + * np.ndarray[np.int32_t, ndim=1, mode='c'] label, + * np.ndarray[np.float64_t, ndim=1, mode='c'] probA=np.empty(0), # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1, mode='c'] probB=np.empty(0), + * int svm_type=0, str kernel='rbf', int degree=3, + */ + __pyx_k_tuple_54 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_54)); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_k_tuple_54, 0, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_54)); + + /* "scikits/learn/svm/libsvm.pyx":317 + * np.ndarray[np.int32_t, ndim=1, mode='c'] label, + * np.ndarray[np.float64_t, ndim=1, mode='c'] probA=np.empty(0), + * np.ndarray[np.float64_t, ndim=1, mode='c'] probB=np.empty(0), # <<<<<<<<<<<<<< + * int svm_type=0, str kernel='rbf', int degree=3, + * double gamma=0.1, double coef0=0., double tol=1e-3, + */ + __pyx_k_tuple_55 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_55)); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_k_tuple_55, 0, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_55)); + + /* "scikits/learn/svm/libsvm.pyx":322 + * double C=1., double nu=0.5, double epsilon=0.1, + * np.ndarray[np.int32_t, ndim=1, mode='c'] + * class_weight_label=np.empty(0, dtype=np.int32), # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1, mode='c'] + * class_weight=np.empty(0), + */ + __pyx_k_tuple_56 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_56)); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_k_tuple_56, 0, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_56)); + + /* "scikits/learn/svm/libsvm.pyx":324 + * class_weight_label=np.empty(0, dtype=np.int32), + * np.ndarray[np.float64_t, ndim=1, mode='c'] + * class_weight=np.empty(0), # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1, mode='c'] + * sample_weight=np.empty(0), + */ + __pyx_k_tuple_57 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_57)); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_k_tuple_57, 0, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_57)); + + /* "scikits/learn/svm/libsvm.pyx":326 + * class_weight=np.empty(0), + * np.ndarray[np.float64_t, ndim=1, mode='c'] + * sample_weight=np.empty(0), # <<<<<<<<<<<<<< + * int shrinking=0, int probability=0, + * double cache_size=100.): + */ + __pyx_k_tuple_58 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_58)); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_k_tuple_58, 0, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_58)); + + /* "scikits/learn/svm/libsvm.pyx":390 + * np.ndarray[np.float64_t, ndim=1, mode='c'] intercept, + * np.ndarray[np.int32_t, ndim=1, mode='c'] label, + * np.ndarray[np.float64_t, ndim=1, mode='c'] probA=np.empty(0), # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1, mode='c'] probB=np.empty(0), + * int svm_type=0, str kernel='rbf', int degree=3, + */ + __pyx_k_tuple_59 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_59)); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_k_tuple_59, 0, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_59)); + + /* "scikits/learn/svm/libsvm.pyx":391 + * np.ndarray[np.int32_t, ndim=1, mode='c'] label, + * np.ndarray[np.float64_t, ndim=1, mode='c'] probA=np.empty(0), + * np.ndarray[np.float64_t, ndim=1, mode='c'] probB=np.empty(0), # <<<<<<<<<<<<<< + * int svm_type=0, str kernel='rbf', int degree=3, + * double gamma=0.1, double coef0=0., double tol=1e-3, + */ + __pyx_k_tuple_60 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_60)); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_k_tuple_60, 0, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_60)); + + /* "scikits/learn/svm/libsvm.pyx":396 + * double C=1., double nu=0.5, double epsilon=0.1, + * np.ndarray[np.int32_t, ndim=1, mode='c'] + * class_weight_label=np.empty(0, dtype=np.int32), # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1, mode='c'] + * class_weight=np.empty(0), + */ + __pyx_k_tuple_61 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_61)); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_k_tuple_61, 0, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_61)); + + /* "scikits/learn/svm/libsvm.pyx":398 + * class_weight_label=np.empty(0, dtype=np.int32), + * np.ndarray[np.float64_t, ndim=1, mode='c'] + * class_weight=np.empty(0), # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1, mode='c'] + * sample_weight=np.empty(0), + */ + __pyx_k_tuple_62 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_62)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_62)); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_k_tuple_62, 0, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_62)); + + /* "scikits/learn/svm/libsvm.pyx":400 + * class_weight=np.empty(0), + * np.ndarray[np.float64_t, ndim=1, mode='c'] + * sample_weight=np.empty(0), # <<<<<<<<<<<<<< + * int shrinking=0, int probability=0, + * double cache_size=100.): + */ + __pyx_k_tuple_63 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_63)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_63)); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_k_tuple_63, 0, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_63)); + + /* "scikits/learn/svm/libsvm.pyx":446 + * double C=1., double nu=0.5, double epsilon=0.1, + * np.ndarray[np.int32_t, ndim=1, mode='c'] + * class_weight_label=np.empty(0, dtype=np.int32), # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1, mode='c'] + * class_weight=np.empty(0), + */ + __pyx_k_tuple_64 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_64)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_64)); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_k_tuple_64, 0, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_64)); + + /* "scikits/learn/svm/libsvm.pyx":448 + * class_weight_label=np.empty(0, dtype=np.int32), + * np.ndarray[np.float64_t, ndim=1, mode='c'] + * class_weight=np.empty(0), # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=1, mode='c'] + * sample_weight=np.empty(0), + */ + __pyx_k_tuple_65 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_65)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_65)); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_k_tuple_65, 0, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_65)); + + /* "scikits/learn/svm/libsvm.pyx":450 + * class_weight=np.empty(0), + * np.ndarray[np.float64_t, ndim=1, mode='c'] + * sample_weight=np.empty(0), # <<<<<<<<<<<<<< + * int shrinking=0, int probability=0, double cache_size=100.): + * """ + */ + __pyx_k_tuple_66 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_66)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_66)); + __Pyx_INCREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_k_tuple_66, 0, __pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_66)); + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + return 0; + __pyx_L1_error:; + return -1; +} + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC initlibsvm(void); /*proto*/ +PyMODINIT_FUNC initlibsvm(void) +#else +PyMODINIT_FUNC PyInit_libsvm(void); /*proto*/ +PyMODINIT_FUNC PyInit_libsvm(void) +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + #if CYTHON_REFNANNY + void* __pyx_refnanny = NULL; + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } + __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit_libsvm(void)", __LINE__, __FILE__); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #ifdef __pyx_binding_PyCFunctionType_USED if (__pyx_binding_PyCFunctionType_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ @@ -7918,7 +8601,7 @@ PyMODINIT_FUNC PyInit_libsvm(void) #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4(__Pyx_NAMESTR("libsvm"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_33), 0, PYTHON_API_VERSION); + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("libsvm"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_44), 0, PYTHON_API_VERSION); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif @@ -7931,11 +8614,13 @@ PyMODINIT_FUNC PyInit_libsvm(void) if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_module_is_main_sklearn__svm__libsvm) { + if (__pyx_module_is_main_scikits__learn__svm__libsvm) { if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; } /*--- Builtin init code ---*/ if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /*--- Constants init code ---*/ + if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ @@ -7948,7 +8633,7 @@ PyMODINIT_FUNC PyInit_libsvm(void) /*--- Function import code ---*/ /*--- Execution code ---*/ - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":33 + /* "scikits/learn/svm/libsvm.pyx":33 * """ * * import numpy as np # <<<<<<<<<<<<<< @@ -7960,7 +8645,7 @@ PyMODINIT_FUNC PyInit_libsvm(void) if (PyObject_SetAttr(__pyx_m, __pyx_n_s__np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":41 + /* "scikits/learn/svm/libsvm.pyx":41 * ################################################################################ * # Internal variables * LIBSVM_KERNEL_TYPES = ['linear', 'poly', 'rbf', 'sigmoid', 'precomputed'] # <<<<<<<<<<<<<< @@ -7987,7 +8672,7 @@ PyMODINIT_FUNC PyInit_libsvm(void) if (PyObject_SetAttr(__pyx_m, __pyx_n_s__LIBSVM_KERNEL_TYPES, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":54 + /* "scikits/learn/svm/libsvm.pyx":54 * double C=1., double nu=0.5, double epsilon=0.1, * np.ndarray[np.int32_t, ndim=1, mode='c'] * class_weight_label=np.empty(0, dtype=np.int32), # <<<<<<<<<<<<<< @@ -7999,223 +8684,199 @@ PyMODINIT_FUNC PyInit_libsvm(void) __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __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 = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__int32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_2, __pyx_t_1, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_k_tuple_45), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __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(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_k_1 = ((PyArrayObject *)__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); - __pyx_t_5 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_1 = ((PyArrayObject *)__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":56 + /* "scikits/learn/svm/libsvm.pyx":56 * class_weight_label=np.empty(0, dtype=np.int32), * np.ndarray[np.float64_t, ndim=1, mode='c'] * class_weight=np.empty(0), # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1, mode='c'] * sample_weight=np.empty(0), */ - __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __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_5); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_k_2 = ((PyArrayObject *)__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_46), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_2 = ((PyArrayObject *)__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":58 + /* "scikits/learn/svm/libsvm.pyx":58 * class_weight=np.empty(0), * np.ndarray[np.float64_t, ndim=1, mode='c'] * sample_weight=np.empty(0), # <<<<<<<<<<<<<< * int shrinking=1, int probability=0, * double cache_size=100.): */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __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 = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_3 = PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_47), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_k_3 = ((PyArrayObject *)__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_3 = ((PyArrayObject *)__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + + /* "scikits/learn/svm/libsvm.pyx":47 + * # Wrapper functions + * + * def fit( # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=2, mode='c'] X, + * np.ndarray[np.float64_t, ndim=1, mode='c'] Y, + */ + __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_7scikits_5learn_3svm_6libsvm_fit, NULL, __pyx_n_s_48); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__fit, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":230 + /* "scikits/learn/svm/libsvm.pyx":230 * np.ndarray[np.float64_t, ndim=1, mode='c'] intercept, * np.ndarray[np.int32_t, ndim=1, mode='c'] label, * np.ndarray[np.float64_t, ndim=1, mode='c'] probA=np.empty(0), # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1, mode='c'] probB=np.empty(0), * int svm_type=0, str kernel='rbf', int degree=3, */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_5 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_49), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_k_7 = ((PyArrayObject *)__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); - __pyx_t_5 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_12 = ((PyArrayObject *)__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":231 + /* "scikits/learn/svm/libsvm.pyx":231 * np.ndarray[np.int32_t, ndim=1, mode='c'] label, * np.ndarray[np.float64_t, ndim=1, mode='c'] probA=np.empty(0), * np.ndarray[np.float64_t, ndim=1, mode='c'] probB=np.empty(0), # <<<<<<<<<<<<<< * int svm_type=0, str kernel='rbf', int degree=3, * double gamma=0.1, double coef0=0., double tol=1e-3, */ - __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __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_5); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_k_8 = ((PyArrayObject *)__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_50), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_13 = ((PyArrayObject *)__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":236 + /* "scikits/learn/svm/libsvm.pyx":236 * double C=1., double nu=0.5, double epsilon=0.1, * np.ndarray[np.int32_t, ndim=1, mode='c'] * class_weight_label=np.empty(0, dtype=np.int32), # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1, mode='c'] * class_weight=np.empty(0), */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __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 = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__int32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__int32); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_5, __pyx_t_1, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_k_tuple_51), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_k_9 = ((PyArrayObject *)__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_14 = ((PyArrayObject *)__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":238 + /* "scikits/learn/svm/libsvm.pyx":238 * class_weight_label=np.empty(0, dtype=np.int32), * np.ndarray[np.float64_t, ndim=1, mode='c'] * class_weight=np.empty(0), # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1, mode='c'] * sample_weight=np.empty(0), */ - __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __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 = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __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_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_52), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_k_10 = ((PyArrayObject *)__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_15 = ((PyArrayObject *)__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":240 + /* "scikits/learn/svm/libsvm.pyx":240 * class_weight=np.empty(0), * np.ndarray[np.float64_t, ndim=1, mode='c'] * sample_weight=np.empty(0), # <<<<<<<<<<<<<< * int shrinking=0, int probability=0, * double cache_size=100.): */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __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 = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_3 = PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_53), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_16 = ((PyArrayObject *)__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + + /* "scikits/learn/svm/libsvm.pyx":223 + * + * + * def predict(np.ndarray[np.float64_t, ndim=2, mode='c'] X, # <<<<<<<<<<<<<< + * np.ndarray[np.int32_t, ndim=1, mode='c'] support, + * np.ndarray[np.float64_t, ndim=2, mode='c'] SV, + */ + __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_7scikits_5learn_3svm_6libsvm_1predict, NULL, __pyx_n_s_48); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_k_11 = ((PyArrayObject *)__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__predict, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":316 + /* "scikits/learn/svm/libsvm.pyx":316 * np.ndarray[np.float64_t, ndim=1, mode='c'] intercept, * np.ndarray[np.int32_t, ndim=1, mode='c'] label, * np.ndarray[np.float64_t, ndim=1, mode='c'] probA=np.empty(0), # <<<<<<<<<<<<<< @@ -8224,86 +8885,68 @@ PyMODINIT_FUNC PyInit_libsvm(void) */ __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_4 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_k_13 = ((PyArrayObject *)__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; + __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_54), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_17 = ((PyArrayObject *)__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":317 + /* "scikits/learn/svm/libsvm.pyx":317 * np.ndarray[np.int32_t, ndim=1, mode='c'] label, * np.ndarray[np.float64_t, ndim=1, mode='c'] probA=np.empty(0), * np.ndarray[np.float64_t, ndim=1, mode='c'] probB=np.empty(0), # <<<<<<<<<<<<<< * int svm_type=0, str kernel='rbf', int degree=3, * double gamma=0.1, double coef0=0., double tol=1e-3, */ - __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __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 = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __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_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_55), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_k_14 = ((PyArrayObject *)__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_18 = ((PyArrayObject *)__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":322 + /* "scikits/learn/svm/libsvm.pyx":322 * double C=1., double nu=0.5, double epsilon=0.1, * np.ndarray[np.int32_t, ndim=1, mode='c'] * class_weight_label=np.empty(0, dtype=np.int32), # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1, mode='c'] * class_weight=np.empty(0), */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __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 = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__int32); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__int32); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyEval_CallObjectWithKeywords(__pyx_t_4, __pyx_t_1, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyEval_CallObjectWithKeywords(__pyx_t_4, ((PyObject *)__pyx_k_tuple_56), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_k_15 = ((PyArrayObject *)__pyx_t_2); + __pyx_k_19 = ((PyArrayObject *)__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":324 + /* "scikits/learn/svm/libsvm.pyx":324 * class_weight_label=np.empty(0, dtype=np.int32), * np.ndarray[np.float64_t, ndim=1, mode='c'] * class_weight=np.empty(0), # <<<<<<<<<<<<<< @@ -8315,73 +8958,67 @@ PyMODINIT_FUNC PyInit_libsvm(void) __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_57), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __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_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_k_16 = ((PyArrayObject *)__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_20 = ((PyArrayObject *)__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":326 + /* "scikits/learn/svm/libsvm.pyx":326 * class_weight=np.empty(0), * np.ndarray[np.float64_t, ndim=1, mode='c'] * sample_weight=np.empty(0), # <<<<<<<<<<<<<< * int shrinking=0, int probability=0, * double cache_size=100.): */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __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 = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_k_17 = ((PyArrayObject *)__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_58), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_21 = ((PyArrayObject *)__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "scikits/learn/svm/libsvm.pyx":308 + * + * + * def predict_proba( # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=2, mode='c'] X, + * np.ndarray[np.int32_t, ndim=1, mode='c'] support, + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7scikits_5learn_3svm_6libsvm_2predict_proba, NULL, __pyx_n_s_48); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__predict_proba, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":390 + /* "scikits/learn/svm/libsvm.pyx":390 * np.ndarray[np.float64_t, ndim=1, mode='c'] intercept, * np.ndarray[np.int32_t, ndim=1, mode='c'] label, * np.ndarray[np.float64_t, ndim=1, mode='c'] probA=np.empty(0), # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1, mode='c'] probB=np.empty(0), * int svm_type=0, str kernel='rbf', int degree=3, */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_59), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_k_18 = ((PyArrayObject *)__pyx_t_2); + __pyx_k_22 = ((PyArrayObject *)__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":391 + /* "scikits/learn/svm/libsvm.pyx":391 * np.ndarray[np.int32_t, ndim=1, mode='c'] label, * np.ndarray[np.float64_t, ndim=1, mode='c'] probA=np.empty(0), * np.ndarray[np.float64_t, ndim=1, mode='c'] probB=np.empty(0), # <<<<<<<<<<<<<< @@ -8393,83 +9030,65 @@ PyMODINIT_FUNC PyInit_libsvm(void) __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_60), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __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_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_k_19 = ((PyArrayObject *)__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_23 = ((PyArrayObject *)__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":396 + /* "scikits/learn/svm/libsvm.pyx":396 * double C=1., double nu=0.5, double epsilon=0.1, * np.ndarray[np.int32_t, ndim=1, mode='c'] * class_weight_label=np.empty(0, dtype=np.int32), # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1, mode='c'] * class_weight=np.empty(0), */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __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 = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__int32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_2, __pyx_t_1, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_k_20 = ((PyArrayObject *)__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); - __pyx_t_5 = 0; + __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_k_tuple_61), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_24 = ((PyArrayObject *)__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":398 + /* "scikits/learn/svm/libsvm.pyx":398 * class_weight_label=np.empty(0, dtype=np.int32), * np.ndarray[np.float64_t, ndim=1, mode='c'] * class_weight=np.empty(0), # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1, mode='c'] * sample_weight=np.empty(0), */ - __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __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_5); __pyx_t_5 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_62), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_k_21 = ((PyArrayObject *)__pyx_t_1); + __pyx_k_25 = ((PyArrayObject *)__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":400 + /* "scikits/learn/svm/libsvm.pyx":400 * class_weight=np.empty(0), * np.ndarray[np.float64_t, ndim=1, mode='c'] * sample_weight=np.empty(0), # <<<<<<<<<<<<<< @@ -8478,60 +9097,60 @@ PyMODINIT_FUNC PyInit_libsvm(void) */ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __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 = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_63), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_3 = PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_26 = ((PyArrayObject *)__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "scikits/learn/svm/libsvm.pyx":382 + * + * + * def decision_function( # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=2, mode='c'] X, + * np.ndarray[np.int32_t, ndim=1, mode='c'] support, + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7scikits_5learn_3svm_6libsvm_3decision_function, NULL, __pyx_n_s_48); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__decision_function, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_k_22 = ((PyArrayObject *)__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":446 + /* "scikits/learn/svm/libsvm.pyx":446 * double C=1., double nu=0.5, double epsilon=0.1, * np.ndarray[np.int32_t, ndim=1, mode='c'] * class_weight_label=np.empty(0, dtype=np.int32), # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1, mode='c'] * class_weight=np.empty(0), */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__int32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__int32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_1, __pyx_t_3, ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_k_tuple_64), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_k_23 = ((PyArrayObject *)__pyx_t_4); + __pyx_k_27 = ((PyArrayObject *)__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":448 + /* "scikits/learn/svm/libsvm.pyx":448 * class_weight_label=np.empty(0, dtype=np.int32), * np.ndarray[np.float64_t, ndim=1, mode='c'] * class_weight=np.empty(0), # <<<<<<<<<<<<<< @@ -8540,102 +9159,72 @@ PyMODINIT_FUNC PyInit_libsvm(void) */ __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __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 = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_65), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_3 = PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_k_24 = ((PyArrayObject *)__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_28 = ((PyArrayObject *)__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":450 + /* "scikits/learn/svm/libsvm.pyx":450 * class_weight=np.empty(0), * np.ndarray[np.float64_t, ndim=1, mode='c'] * sample_weight=np.empty(0), # <<<<<<<<<<<<<< * int shrinking=0, int probability=0, double cache_size=100.): * """ */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_5 = PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __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_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_k_25 = ((PyArrayObject *)__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); - __pyx_t_5 = 0; + __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_66), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_29 = ((PyArrayObject *)__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":1 - * """ # <<<<<<<<<<<<<< - * Binding for libsvm_skl - * ---------------------- + /* "scikits/learn/svm/libsvm.pyx":439 + * + * + * def cross_validation( # <<<<<<<<<<<<<< + * np.ndarray[np.float64_t, ndim=2, mode='c'] X, + * np.ndarray[np.float64_t, ndim=1, mode='c'] Y, */ - __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s__fit); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_kp_u_34), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__predict); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_kp_u_35), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s__predict_proba); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_kp_u_36), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__decision_function); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_kp_u_37), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s__cross_validation); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_7scikits_5learn_3svm_6libsvm_4cross_validation, NULL, __pyx_n_s_48); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_kp_u_38), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__cross_validation, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__set_verbosity_wrap); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "scikits/learn/svm/libsvm.pyx":540 + * return target + * + * def set_verbosity_wrap(int verbosity): # <<<<<<<<<<<<<< + * """ + * Control verbosity of libsvm library + */ + __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_7scikits_5learn_3svm_6libsvm_5set_verbosity_wrap, NULL, __pyx_n_s_48); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__set_verbosity_wrap, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_kp_u_39), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_5)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":963 + /* "scikits/learn/svm/libsvm.pyx":1 + * """ # <<<<<<<<<<<<<< + * Binding for libsvm_skl + * ---------------------- + */ + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_4)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + + /* "numpy.pxd":963 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -8648,12 +9237,11 @@ PyMODINIT_FUNC PyInit_libsvm(void) __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); if (__pyx_m) { - __Pyx_AddTraceback("init sklearn.svm.libsvm"); + __Pyx_AddTraceback("init scikits.learn.svm.libsvm"); Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init sklearn.svm.libsvm"); + PyErr_SetString(PyExc_ImportError, "init scikits.learn.svm.libsvm"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); @@ -8674,19 +9262,6 @@ static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { return result; } -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, - PyObject* kw_name) -{ - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION >= 3 - "%s() got multiple values for keyword argument '%U'", func_name, kw_name); - #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AS_STRING(kw_name)); - #endif -} - static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, @@ -8712,9 +9287,22 @@ static void __Pyx_RaiseArgtupleInvalid( #if PY_VERSION_HEX < 0x02050000 "%s() takes %s %d positional argument%s (%d given)", #else - "%s() takes %s %zd positional argument%s (%zd given)", + "%s() takes %s %zd positional argument%s (%zd given)", + #endif + func_name, more_or_less, num_expected, number, num_found); +} + +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AS_STRING(kw_name)); #endif - func_name, more_or_less, num_expected, number, num_found); } static int __Pyx_ParseOptionalKeywords( @@ -8935,7 +9523,7 @@ static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) { default: { __Pyx_BufFmt_RaiseUnexpectedChar(ch); return 0; - } + } } } @@ -8979,7 +9567,7 @@ static size_t __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) { default: { __Pyx_BufFmt_RaiseUnexpectedChar(ch); return 0; - } + } } } @@ -9016,7 +9604,7 @@ static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { do { __Pyx_StructField* field = ctx->head->field; __Pyx_TypeInfo* type = field->type; - + if (ctx->packmode == '@' || ctx->packmode == '^') { size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex); } else { @@ -9039,7 +9627,7 @@ static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { ctx->head->parent_offset = parent_offset; continue; } - + __Pyx_BufFmt_RaiseExpected(ctx); return -1; } @@ -9053,7 +9641,7 @@ static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { } ctx->fmt_offset += size; - + --ctx->enc_count; /* Consume from buffer string */ /* Done checking, move to next field, pushing or popping struct stack if needed */ @@ -9086,7 +9674,7 @@ static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { } while (ctx->enc_count); ctx->enc_type = 0; ctx->is_complex = 0; - return 0; + return 0; } static int __Pyx_BufFmt_FirstPack(__Pyx_BufFmt_Context* ctx) { @@ -9208,7 +9796,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha return NULL; } } - + } } } @@ -9305,6 +9893,116 @@ static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyOb } +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { + Py_XINCREF(type); + Py_XINCREF(value); + Py_XINCREF(tb); + /* First, check the traceback argument, replacing None with NULL. */ + if (tb == Py_None) { + Py_DECREF(tb); + tb = 0; + } + else if (tb != NULL && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + /* Next, replace a missing value with None */ + if (value == NULL) { + value = Py_None; + Py_INCREF(value); + } + #if PY_VERSION_HEX < 0x02050000 + if (!PyClass_Check(type)) + #else + if (!PyType_Check(type)) + #endif + { + /* Raising an instance. The value should be a dummy. */ + if (value != Py_None) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + /* Normalize to raise <class>, <instance> */ + Py_DECREF(value); + value = type; + #if PY_VERSION_HEX < 0x02050000 + if (PyInstance_Check(type)) { + type = (PyObject*) ((PyInstanceObject*)type)->in_class; + Py_INCREF(type); + } + else { + type = 0; + PyErr_SetString(PyExc_TypeError, + "raise: exception must be an old-style class or instance"); + goto raise_error; + } + #else + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + #endif + } + + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} + +#else /* Python 3+ */ + +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (!PyExceptionClass_Check(type)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + + PyErr_SetObject(type, value); + + if (tb) { + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } + } + +bad: + return; +} +#endif + static CYTHON_INLINE long __Pyx_div_long(long a, long b) { long q = a / b; long r = a - q*b; @@ -9361,7 +10059,7 @@ static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { static void __Pyx_ReleaseBuffer(Py_buffer *view) { PyObject* obj = view->obj; if (obj) { -if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pf_5numpy_7ndarray___releasebuffer__(obj, view); +if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pf_5numpy_7ndarray_1__releasebuffer__(obj, view); Py_DECREF(obj); view->obj = NULL; } @@ -9427,116 +10125,6 @@ static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_Py_intptr_t(Py_intptr_t val) { } } -#if PY_MAJOR_VERSION < 3 -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { - Py_XINCREF(type); - Py_XINCREF(value); - Py_XINCREF(tb); - /* First, check the traceback argument, replacing None with NULL. */ - if (tb == Py_None) { - Py_DECREF(tb); - tb = 0; - } - else if (tb != NULL && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - /* Next, replace a missing value with None */ - if (value == NULL) { - value = Py_None; - Py_INCREF(value); - } - #if PY_VERSION_HEX < 0x02050000 - if (!PyClass_Check(type)) - #else - if (!PyType_Check(type)) - #endif - { - /* Raising an instance. The value should be a dummy. */ - if (value != Py_None) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto raise_error; - } - /* Normalize to raise <class>, <instance> */ - Py_DECREF(value); - value = type; - #if PY_VERSION_HEX < 0x02050000 - if (PyInstance_Check(type)) { - type = (PyObject*) ((PyInstanceObject*)type)->in_class; - Py_INCREF(type); - } - else { - type = 0; - PyErr_SetString(PyExc_TypeError, - "raise: exception must be an old-style class or instance"); - goto raise_error; - } - #else - type = (PyObject*) Py_TYPE(type); - Py_INCREF(type); - if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto raise_error; - } - #endif - } - - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; -} - -#else /* Python 3+ */ - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { - if (tb == Py_None) { - tb = 0; - } else if (tb && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto bad; - } - if (value == Py_None) - value = 0; - - if (PyExceptionInstance_Check(type)) { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto bad; - } - value = type; - type = (PyObject*) Py_TYPE(value); - } else if (!PyExceptionClass_Check(type)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto bad; - } - - PyErr_SetObject(type, value); - - if (tb) { - PyThreadState *tstate = PyThreadState_GET(); - PyObject* tmp_tb = tstate->curexc_traceback; - if (tb != tmp_tb) { - Py_INCREF(tb); - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_tb); - } - } - -bad: - return; -} -#endif - #if CYTHON_CCOMPLEX #ifdef __cplusplus static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { @@ -9601,15 +10189,60 @@ bad: z.imag = -a.imag; return z; } -/* - static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) { -#if HAVE_HYPOT - return hypotf(z.real, z.imag); -#else - return sqrtf(z.real*z.real + z.imag*z.imag); -#endif - } -*/ + #if 1 + static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrtf(z.real*z.real + z.imag*z.imag); + #else + return hypotf(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + float denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(a, a); + case 3: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(z, a); + case 4: + z = __Pyx_c_prodf(a, a); + return __Pyx_c_prodf(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } + r = a.real; + theta = 0; + } else { + r = __Pyx_c_absf(a); + theta = atan2f(a.imag, a.real); + } + lnr = logf(r); + z_r = expf(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cosf(z_theta); + z.imag = z_r * sinf(z_theta); + return z; + } + #endif #endif #if CYTHON_CCOMPLEX @@ -9676,15 +10309,60 @@ bad: z.imag = -a.imag; return z; } -/* - static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) { -#if HAVE_HYPOT - return hypot(z.real, z.imag); -#else - return sqrt(z.real*z.real + z.imag*z.imag); -#endif - } -*/ + #if 1 + static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrt(z.real*z.real + z.imag*z.imag); + #else + return hypot(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + double denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(a, a); + case 3: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(z, a); + case 4: + z = __Pyx_c_prod(a, a); + return __Pyx_c_prod(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } + r = a.real; + theta = 0; + } else { + r = __Pyx_c_abs(a); + theta = atan2(a.imag, a.real); + } + lnr = log(r); + z_r = exp(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cos(z_theta); + z.imag = z_r * sin(z_theta); + return z; + } + #endif #endif static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) { @@ -10115,13 +10793,13 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class if (!result) goto bad; if (!PyType_Check(result)) { - PyErr_Format(PyExc_TypeError, + PyErr_Format(PyExc_TypeError, "%s.%s is not a type object", module_name, class_name); goto bad; } if (!strict && ((PyTypeObject *)result)->tp_basicsize > size) { - PyOS_snprintf(warning, sizeof(warning), + PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility", module_name, class_name); #if PY_VERSION_HEX < 0x02050000 @@ -10131,7 +10809,7 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class #endif } else if (((PyTypeObject *)result)->tp_basicsize != size) { - PyErr_Format(PyExc_ValueError, + PyErr_Format(PyExc_ValueError, "%s.%s has the wrong size, try recompiling", module_name, class_name); goto bad; diff --git a/sklearn/svm/libsvm.pxd b/scikits/learn/svm/libsvm.pxd similarity index 100% rename from sklearn/svm/libsvm.pxd rename to scikits/learn/svm/libsvm.pxd diff --git a/sklearn/svm/libsvm.pyx b/scikits/learn/svm/libsvm.pyx similarity index 100% rename from sklearn/svm/libsvm.pyx rename to scikits/learn/svm/libsvm.pyx diff --git a/sklearn/svm/setup.py b/scikits/learn/svm/setup.py similarity index 100% rename from sklearn/svm/setup.py rename to scikits/learn/svm/setup.py diff --git a/sklearn/svm/sparse/__init__.py b/scikits/learn/svm/sparse/__init__.py similarity index 90% rename from sklearn/svm/sparse/__init__.py rename to scikits/learn/svm/sparse/__init__.py index 1e246e136584ff6c2f2c13ad4303f89f4329a5fe..99c102121e4820efd990c53cb5b6668b24ddfd35 100644 --- a/sklearn/svm/sparse/__init__.py +++ b/scikits/learn/svm/sparse/__init__.py @@ -1,7 +1,7 @@ """ Support Vector Machine algorithms for sparse matrices. -This module should have the same API as :mod:`sklearn.svm`, except +This module should have the same API as :mod:`scikits.learn.svm`, except that matrices are expected to be in some sparse format supported by scipy.sparse. diff --git a/sklearn/svm/sparse/base.py b/scikits/learn/svm/sparse/base.py similarity index 100% rename from sklearn/svm/sparse/base.py rename to scikits/learn/svm/sparse/base.py diff --git a/sklearn/svm/sparse/classes.py b/scikits/learn/svm/sparse/classes.py similarity index 93% rename from sklearn/svm/sparse/classes.py rename to scikits/learn/svm/sparse/classes.py index 95cb431b0d0c38a722d66ed5b68b34cf525b4b18..16ed1a51a32880dc043724616a0bcb502289b201 100644 --- a/sklearn/svm/sparse/classes.py +++ b/scikits/learn/svm/sparse/classes.py @@ -7,7 +7,7 @@ from ...linear_model.sparse.base import CoefSelectTransformerMixin class SVC(SparseBaseLibSVM, ClassifierMixin): """SVC for sparse matrices (csr). - See :class:`sklearn.svm.SVC` for a complete list of parameters + See :class:`scikits.learn.svm.SVC` for a complete list of parameters Notes ----- @@ -20,7 +20,7 @@ class SVC(SparseBaseLibSVM, ClassifierMixin): >>> import numpy as np >>> X = np.array([[-1, -1], [-2, -1], [1, 1], [2, 1]]) >>> y = np.array([1, 1, 2, 2]) - >>> from sklearn.svm.sparse import SVC + >>> from scikits.learn.svm.sparse import SVC >>> clf = SVC() >>> clf.fit(X, y) SVC(C=1.0, coef0=0.0, degree=3, gamma=0.25, kernel='rbf', probability=False, @@ -42,7 +42,7 @@ class SVC(SparseBaseLibSVM, ClassifierMixin): class NuSVC (SparseBaseLibSVM, ClassifierMixin): """NuSVC for sparse matrices (csr). - See :class:`sklearn.svm.NuSVC` for a complete list of parameters + See :class:`scikits.learn.svm.NuSVC` for a complete list of parameters Notes ----- @@ -55,7 +55,7 @@ class NuSVC (SparseBaseLibSVM, ClassifierMixin): >>> import numpy as np >>> X = np.array([[-1, -1], [-2, -1], [1, 1], [2, 1]]) >>> y = np.array([1, 1, 2, 2]) - >>> from sklearn.svm.sparse import NuSVC + >>> from scikits.learn.svm.sparse import NuSVC >>> clf = NuSVC() >>> clf.fit(X, y) NuSVC(coef0=0.0, degree=3, gamma=0.25, kernel='rbf', nu=0.5, @@ -79,7 +79,7 @@ class NuSVC (SparseBaseLibSVM, ClassifierMixin): class SVR (SparseBaseLibSVM, RegressorMixin): """SVR for sparse matrices (csr) - See :class:`sklearn.svm.SVR` for a complete list of parameters + See :class:`scikits.learn.svm.SVR` for a complete list of parameters Notes ----- @@ -89,7 +89,7 @@ class SVR (SparseBaseLibSVM, RegressorMixin): Examples -------- - >>> from sklearn.svm.sparse import SVR + >>> from scikits.learn.svm.sparse import SVR >>> import numpy as np >>> n_samples, n_features = 10, 5 >>> np.random.seed(0) @@ -116,7 +116,7 @@ class SVR (SparseBaseLibSVM, RegressorMixin): class NuSVR (SparseBaseLibSVM, RegressorMixin): """NuSVR for sparse matrices (csr) - See :class:`sklearn.svm.NuSVC` for a complete list of parameters + See :class:`scikits.learn.svm.NuSVC` for a complete list of parameters Notes ----- @@ -126,7 +126,7 @@ class NuSVR (SparseBaseLibSVM, RegressorMixin): Examples -------- - >>> from sklearn.svm.sparse import NuSVR + >>> from scikits.learn.svm.sparse import NuSVR >>> import numpy as np >>> n_samples, n_features = 10, 5 >>> np.random.seed(0) @@ -151,7 +151,7 @@ class NuSVR (SparseBaseLibSVM, RegressorMixin): class OneClassSVM (SparseBaseLibSVM): """NuSVR for sparse matrices (csr) - See :class:`sklearn.svm.NuSVC` for a complete list of parameters + See :class:`scikits.learn.svm.NuSVC` for a complete list of parameters Notes ----- diff --git a/sklearn/svm/sparse/libsvm.c b/scikits/learn/svm/sparse/libsvm.c similarity index 89% rename from sklearn/svm/sparse/libsvm.c rename to scikits/learn/svm/sparse/libsvm.c index 3887dce84b6d868aec78436f02778a3090ec9000..769e7fb7f9eab36e15df91d800d08c797a3424a8 100644 --- a/sklearn/svm/sparse/libsvm.c +++ b/scikits/learn/svm/sparse/libsvm.c @@ -1,39 +1,18 @@ -/* Generated by Cython 0.13 on Fri Sep 2 11:25:52 2011 */ +/* Generated by Cython 0.12.1 on Mon May 16 14:50:27 2011 */ #define PY_SSIZE_T_CLEAN #include "Python.h" +#include "structmember.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #else -#include <stddef.h> /* For offsetof */ -#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 +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif - -#ifndef PY_LONG_LONG - #define PY_LONG_LONG LONG_LONG -#endif - #if PY_VERSION_HEX < 0x02040000 #define METH_COEXIST 0 #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type) @@ -103,35 +82,11 @@ #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_VERSION_HEX < 0x02060000 - #define PyBytesObject PyStringObject +#else #define PyBytes_Type PyString_Type - #define PyBytes_Check PyString_Check #define PyBytes_CheckExact PyString_CheckExact - #define PyBytes_FromString PyString_FromString - #define PyBytes_FromStringAndSize PyString_FromStringAndSize - #define PyBytes_FromFormat PyString_FromFormat - #define PyBytes_DecodeEscape PyString_DecodeEscape - #define PyBytes_AsString PyString_AsString - #define PyBytes_AsStringAndSize PyString_AsStringAndSize - #define PyBytes_Size PyString_Size - #define PyBytes_AS_STRING PyString_AS_STRING - #define PyBytes_GET_SIZE PyString_GET_SIZE - #define PyBytes_Repr PyString_Repr - #define PyBytes_Concat PyString_Concat - #define PyBytes_ConcatAndDel PyString_ConcatAndDel - #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) - #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) -#endif - -#ifndef PySet_CheckExact -# define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #if PY_MAJOR_VERSION >= 3 @@ -148,23 +103,30 @@ #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask -#endif - -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#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 #if PY_MAJOR_VERSION >= 3 - #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) + #define PyMethod_New(func, self, klass) PyInstanceMethod_New(func) +#endif + +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#else + #define _USE_MATH_DEFINES #endif #if PY_VERSION_HEX < 0x02050000 @@ -184,65 +146,114 @@ #define __Pyx_NAMESTR(n) (n) #define __Pyx_DOCSTR(n) (n) #endif - #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif - -#if defined(WIN32) || defined(MS_WINDOWS) -#define _USE_MATH_DEFINES -#endif #include <math.h> -#define __PYX_HAVE_API__sklearn__svm__sparse__libsvm -#include "stdio.h" +#define __PYX_HAVE_API__scikits__learn__svm__sparse__libsvm #include "stdlib.h" +#include "stdio.h" #include "numpy/arrayobject.h" #include "numpy/ufuncobject.h" #include "svm.h" #include "libsvm_sparse_helper.c" -/* inline attribute */ #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 -/* unused attribute */ -#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) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -#endif - typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ /* Type Conversion Predeclarations */ -#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s) -#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) PyBytes_AsString(s)) +#if PY_MAJOR_VERSION < 3 +#define __Pyx_PyBytes_FromString PyString_FromString +#define __Pyx_PyBytes_FromStringAndSize PyString_FromStringAndSize +#define __Pyx_PyBytes_AsString PyString_AsString +#else +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +#define __Pyx_PyBytes_AsString PyBytes_AsString +#endif + +#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s) +#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) __Pyx_PyBytes_AsString(s)) #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); +#if !defined(T_PYSSIZET) +#if PY_VERSION_HEX < 0x02050000 +#define T_PYSSIZET T_INT +#elif !defined(T_LONGLONG) +#define T_PYSSIZET \ + ((sizeof(Py_ssize_t) == sizeof(int)) ? T_INT : \ + ((sizeof(Py_ssize_t) == sizeof(long)) ? T_LONG : -1)) +#else +#define T_PYSSIZET \ + ((sizeof(Py_ssize_t) == sizeof(int)) ? T_INT : \ + ((sizeof(Py_ssize_t) == sizeof(long)) ? T_LONG : \ + ((sizeof(Py_ssize_t) == sizeof(PY_LONG_LONG)) ? T_LONGLONG : -1))) +#endif +#endif + + +#if !defined(T_ULONGLONG) +#define __Pyx_T_UNSIGNED_INT(x) \ + ((sizeof(x) == sizeof(unsigned char)) ? T_UBYTE : \ + ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \ + ((sizeof(x) == sizeof(unsigned int)) ? T_UINT : \ + ((sizeof(x) == sizeof(unsigned long)) ? T_ULONG : -1)))) +#else +#define __Pyx_T_UNSIGNED_INT(x) \ + ((sizeof(x) == sizeof(unsigned char)) ? T_UBYTE : \ + ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \ + ((sizeof(x) == sizeof(unsigned int)) ? T_UINT : \ + ((sizeof(x) == sizeof(unsigned long)) ? T_ULONG : \ + ((sizeof(x) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1))))) +#endif +#if !defined(T_LONGLONG) +#define __Pyx_T_SIGNED_INT(x) \ + ((sizeof(x) == sizeof(char)) ? T_BYTE : \ + ((sizeof(x) == sizeof(short)) ? T_SHORT : \ + ((sizeof(x) == sizeof(int)) ? T_INT : \ + ((sizeof(x) == sizeof(long)) ? T_LONG : -1)))) +#else +#define __Pyx_T_SIGNED_INT(x) \ + ((sizeof(x) == sizeof(char)) ? T_BYTE : \ + ((sizeof(x) == sizeof(short)) ? T_SHORT : \ + ((sizeof(x) == sizeof(int)) ? T_INT : \ + ((sizeof(x) == sizeof(long)) ? T_LONG : \ + ((sizeof(x) == sizeof(PY_LONG_LONG)) ? T_LONGLONG : -1))))) +#endif + +#define __Pyx_T_FLOATING(x) \ + ((sizeof(x) == sizeof(float)) ? T_FLOAT : \ + ((sizeof(x) == sizeof(double)) ? T_DOUBLE : -1)) + +#if !defined(T_SIZET) +#if !defined(T_ULONGLONG) +#define T_SIZET \ + ((sizeof(size_t) == sizeof(unsigned int)) ? T_UINT : \ + ((sizeof(size_t) == sizeof(unsigned long)) ? T_ULONG : -1)) +#else +#define T_SIZET \ + ((sizeof(size_t) == sizeof(unsigned int)) ? T_UINT : \ + ((sizeof(size_t) == sizeof(unsigned long)) ? T_ULONG : \ + ((sizeof(size_t) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1))) +#endif +#endif + static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); @@ -252,7 +263,7 @@ static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); #ifdef __GNUC__ /* Test for GCC > 2.95 */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) +#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* __GNUC__ > 2 ... */ @@ -272,6 +283,7 @@ static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; +static const char **__pyx_f; #if !defined(CYTHON_CCOMPLEX) @@ -297,11 +309,6 @@ static const char *__pyx_filename; #define _Complex_I 1.0fj #endif -static const char *__pyx_f[] = { - "libsvm.pyx", - "numpy.pxd", -}; - typedef npy_int8 __pyx_t_5numpy_int8_t; typedef npy_int16 __pyx_t_5numpy_int16_t; @@ -416,8 +423,6 @@ typedef npy_cdouble __pyx_t_5numpy_complex_t; #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0) -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ - static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name); /*proto*/ @@ -426,9 +431,6 @@ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/ -static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact); /*proto*/ - /* Run-time type information about structs used with buffers */ struct __Pyx_StructField_; @@ -451,8 +453,8 @@ typedef struct { } __Pyx_BufFmt_StackElem; -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); +static int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ @@ -463,13 +465,19 @@ static CYTHON_INLINE long __Pyx_div_long(long, long); /* proto */ static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ -static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); - static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(void); + +static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); /*proto*/ +static int __Pyx_EndUnpack(PyObject *); /*proto*/ + +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /*proto*/ + +static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact); /*proto*/ #if PY_MAJOR_VERSION < 3 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); static void __Pyx_ReleaseBuffer(Py_buffer *view); @@ -483,7 +491,9 @@ Py_ssize_t __Pyx_minusones[] = {-1, -1}; static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ -static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_Py_intptr_t(Py_intptr_t); +static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ + +static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_npy_intp(npy_intp); static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ @@ -586,8 +596,6 @@ static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *); static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *); -static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *); - static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *); static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *); @@ -607,15 +615,13 @@ static PyObject *__Pyx_ImportModule(const char *name); /*proto*/ static void __Pyx_AddTraceback(const char *funcname); /*proto*/ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ -/* Module declarations from cpython.buffer */ +/* Module declarations from python_buffer */ -/* Module declarations from cpython.ref */ +/* Module declarations from python_ref */ -/* Module declarations from libc.stdio */ +/* Module declarations from stdlib */ -/* Module declarations from cpython.object */ - -/* Module declarations from libc.stdlib */ +/* Module declarations from stdio */ /* Module declarations from numpy */ @@ -634,14 +640,14 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *, static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *, PyObject *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *); /*proto*/ -/* Module declarations from sklearn.svm.sparse.libsvm */ +/* Module declarations from scikits.learn.svm.sparse.libsvm */ -static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), 'R' }; -static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t = { "int32_t", NULL, sizeof(__pyx_t_5numpy_int32_t), 'I' }; -#define __Pyx_MODULE_NAME "sklearn.svm.sparse.libsvm" -int __pyx_module_is_main_sklearn__svm__sparse__libsvm = 0; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "numpy.float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), 'R' }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t = { "numpy.int32_t", NULL, sizeof(__pyx_t_5numpy_int32_t), 'I' }; +#define __Pyx_MODULE_NAME "scikits.learn.svm.sparse.libsvm" +int __pyx_module_is_main_scikits__learn__svm__sparse__libsvm = 0; -/* Implementation of sklearn.svm.sparse.libsvm */ +/* Implementation of scikits.learn.svm.sparse.libsvm */ static PyObject *__pyx_builtin_MemoryError; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_range; @@ -833,7 +839,7 @@ static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; static PyObject *__pyx_int_15; -/* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":58 +/* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":58 * * * def libsvm_sparse_train ( int n_features, # <<<<<<<<<<<<<< @@ -841,9 +847,9 @@ static PyObject *__pyx_int_15; * np.ndarray[np.int32_t, ndim=1, mode='c'] indices, */ -static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train[] = "\n Wrap svm_train from libsvm using a scipy.sparse.csr matrix\n\n Work in progress.\n\n Parameters\n ----------\n n_features : number of features.\n XXX: can we retrieve this from any other parameter ?\n\n X: array-like, dtype=float, size=[N, D]\n\n Y: array, dtype=float, size=[N]\n target vector\n\n ...\n\n Notes\n -------------------\n See scikits.learn.svm.predict for a complete list of parameters.\n\n "; -static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_train[] = "\n Wrap svm_train from libsvm using a scipy.sparse.csr matrix\n\n Work in progress.\n\n Parameters\n ----------\n n_features : number of features.\n XXX: can we retrieve this from any other parameter ?\n\n X: array-like, dtype=float, size=[N, D]\n\n Y: array, dtype=float, size=[N]\n target vector\n\n ...\n\n Notes\n -------------------\n See scikits.learn.svm.predict for a complete list of parameters.\n\n "; +static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_v_n_features; PyArrayObject *__pyx_v_values = 0; PyArrayObject *__pyx_v_indices = 0; @@ -1201,11 +1207,22 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("libsvm_sparse_train", 1, 26, 26, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("sklearn.svm.sparse.libsvm.libsvm_sparse_train"); - __Pyx_RefNannyFinishContext(); + __Pyx_AddTraceback("scikits.learn.svm.sparse.libsvm.libsvm_sparse_train"); return NULL; __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF((PyObject *)__pyx_v_values); + __Pyx_INCREF((PyObject *)__pyx_v_indices); + __Pyx_INCREF((PyObject *)__pyx_v_indptr); + __Pyx_INCREF((PyObject *)__pyx_v_Y); + __Pyx_INCREF((PyObject *)__pyx_v_SV_data); + __Pyx_INCREF((PyObject *)__pyx_v_SV_indices); + __Pyx_INCREF((PyObject *)__pyx_v_SV_indptr); + __Pyx_INCREF((PyObject *)__pyx_v_sv_coef_data); + __Pyx_INCREF((PyObject *)__pyx_v_intercept); + __Pyx_INCREF((PyObject *)__pyx_v_weight_label); + __Pyx_INCREF((PyObject *)__pyx_v_weight); __Pyx_INCREF((PyObject *)__pyx_v_sample_weight); + __Pyx_INCREF((PyObject *)__pyx_v_nclass_SV); __pyx_v_label = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_probA = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_probB = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); @@ -1317,7 +1334,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb __pyx_bstride_0_nclass_SV = __pyx_bstruct_nclass_SV.strides[0]; __pyx_bshape_0_nclass_SV = __pyx_bstruct_nclass_SV.shape[0]; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":104 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":104 * cdef char *error_msg * * if len(sample_weight) == 0: # <<<<<<<<<<<<<< @@ -1328,7 +1345,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb __pyx_t_2 = (__pyx_t_1 == 0); if (__pyx_t_2) { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":105 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":105 * * if len(sample_weight) == 0: * sample_weight = np.ones(Y.shape[0], dtype=np.float64) # <<<<<<<<<<<<<< @@ -1340,7 +1357,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__ones); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_to_py_Py_intptr_t((__pyx_v_Y->dimensions[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_to_py_npy_intp((__pyx_v_Y->dimensions[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); @@ -1388,7 +1405,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":107 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":107 * sample_weight = np.ones(Y.shape[0], dtype=np.float64) * else: * assert sample_weight.shape[0] == indptr.shape[0] - 1, \ # <<<<<<<<<<<<<< @@ -1398,14 +1415,14 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb #ifndef PYREX_WITHOUT_ASSERTIONS if (unlikely(!((__pyx_v_sample_weight->dimensions[0]) == ((__pyx_v_indptr->dimensions[0]) - 1)))) { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":110 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":110 * "sample_weight and X have incompatible shapes: " + \ * "sample_weight has %s samples while X has %s" % \ * (sample_weight.shape[0], indptr.shape[0] - 1) # <<<<<<<<<<<<<< * * # set libsvm problem */ - __pyx_t_7 = __Pyx_PyInt_to_py_Py_intptr_t((__pyx_v_sample_weight->dimensions[0])); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyInt_to_py_npy_intp((__pyx_v_sample_weight->dimensions[0])); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = PyInt_FromLong(((__pyx_v_indptr->dimensions[0]) - 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); @@ -1418,20 +1435,20 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb __pyx_t_7 = 0; __pyx_t_3 = 0; __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_2), __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyNumber_Add(((PyObject *)__pyx_kp_s_1), __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + PyErr_SetObject(PyExc_AssertionError, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Add(((PyObject *)__pyx_kp_s_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_t_5)); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #endif } __pyx_L6:; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":115 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":115 * problem = csr_set_problem(values.data, indices.shape, indices.data, * indptr.shape, indptr.data, Y.data, * sample_weight.data, kernel_type) # <<<<<<<<<<<<<< @@ -1440,7 +1457,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb */ __pyx_v_problem = csr_set_problem(__pyx_v_values->data, __pyx_v_indices->dimensions, __pyx_v_indices->data, __pyx_v_indptr->dimensions, __pyx_v_indptr->data, __pyx_v_Y->data, __pyx_v_sample_weight->data, __pyx_v_kernel_type); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":121 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":121 * nu, cache_size, C, eps, p, shrinking, * probability, <int> weight.shape[0], * weight_label.data, weight.data) # <<<<<<<<<<<<<< @@ -1449,7 +1466,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb */ __pyx_v_param = set_parameter(__pyx_v_svm_type, __pyx_v_kernel_type, __pyx_v_degree, __pyx_v_gamma, __pyx_v_coef0, __pyx_v_nu, __pyx_v_cache_size, __pyx_v_C, __pyx_v_eps, __pyx_v_p, __pyx_v_shrinking, __pyx_v_probability, ((int)(__pyx_v_weight->dimensions[0])), __pyx_v_weight_label->data, __pyx_v_weight->data); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":124 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":124 * * # check parameters * if (param == NULL or problem == NULL): # <<<<<<<<<<<<<< @@ -1465,7 +1482,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb } if (__pyx_t_14) { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":125 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":125 * # check parameters * if (param == NULL or problem == NULL): * raise MemoryError("Seems we've run out of of memory") # <<<<<<<<<<<<<< @@ -1487,7 +1504,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb } __pyx_L7:; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":126 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":126 * if (param == NULL or problem == NULL): * raise MemoryError("Seems we've run out of of memory") * error_msg = svm_csr_check_parameter(problem, param); # <<<<<<<<<<<<<< @@ -1496,7 +1513,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb */ __pyx_v_error_msg = svm_csr_check_parameter(__pyx_v_problem, __pyx_v_param); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":127 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":127 * raise MemoryError("Seems we've run out of of memory") * error_msg = svm_csr_check_parameter(problem, param); * if error_msg: # <<<<<<<<<<<<<< @@ -1506,7 +1523,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb __pyx_t_14 = (__pyx_v_error_msg != 0); if (__pyx_t_14) { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":128 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":128 * error_msg = svm_csr_check_parameter(problem, param); * if error_msg: * free_problem(problem) # <<<<<<<<<<<<<< @@ -1515,7 +1532,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb */ free_problem(__pyx_v_problem); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":129 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":129 * if error_msg: * free_problem(problem) * free_param(param) # <<<<<<<<<<<<<< @@ -1524,14 +1541,14 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb */ free_param(__pyx_v_param); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":130 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":130 * free_problem(problem) * free_param(param) * raise ValueError(error_msg) # <<<<<<<<<<<<<< * * # call svm_train, this does the real work */ - __pyx_t_3 = PyBytes_FromString(__pyx_v_error_msg); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_error_msg); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); @@ -1548,7 +1565,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb } __pyx_L8:; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":133 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":133 * * # call svm_train, this does the real work * model = svm_csr_train(problem, param) # <<<<<<<<<<<<<< @@ -1557,7 +1574,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb */ __pyx_v_model = svm_csr_train(__pyx_v_problem, __pyx_v_param); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":135 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":135 * model = svm_csr_train(problem, param) * * cdef np.npy_intp SV_len = get_l(model) # <<<<<<<<<<<<<< @@ -1566,7 +1583,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb */ __pyx_v_SV_len = get_l(__pyx_v_model); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":136 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":136 * * cdef np.npy_intp SV_len = get_l(model) * cdef np.npy_intp n_class = get_nr(model) # <<<<<<<<<<<<<< @@ -1575,7 +1592,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb */ __pyx_v_n_class = get_nr(__pyx_v_model); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":141 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":141 * # we create a new array instead of resizing, otherwise * # it would not erase previous information * sv_coef_data.resize ((n_class-1)*SV_len, refcheck=False) # <<<<<<<<<<<<<< @@ -1604,7 +1621,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":142 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":142 * # it would not erase previous information * sv_coef_data.resize ((n_class-1)*SV_len, refcheck=False) * copy_sv_coef (sv_coef_data.data, model) # <<<<<<<<<<<<<< @@ -1613,7 +1630,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb */ copy_sv_coef(__pyx_v_sv_coef_data->data, __pyx_v_model); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":146 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":146 * # copy model.rho into the intercept * # the intercept is just model.rho but with sign changed * intercept.resize (n_class*(n_class-1)/2, refcheck=False) # <<<<<<<<<<<<<< @@ -1642,7 +1659,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":147 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":147 * # the intercept is just model.rho but with sign changed * intercept.resize (n_class*(n_class-1)/2, refcheck=False) * copy_intercept (intercept.data, model, intercept.shape) # <<<<<<<<<<<<<< @@ -1651,7 +1668,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb */ copy_intercept(__pyx_v_intercept->data, __pyx_v_model, __pyx_v_intercept->dimensions); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":153 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":153 * # TODO: custom kernel * cdef np.npy_intp nonzero_SV * nonzero_SV = get_nonzero_SV (model) # <<<<<<<<<<<<<< @@ -1660,7 +1677,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb */ __pyx_v_nonzero_SV = get_nonzero_SV(__pyx_v_model); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":156 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":156 * * # SV_data.resize((0,0), refcheck=False) # why is this needed ? * SV_data.resize (nonzero_SV, refcheck=False) # <<<<<<<<<<<<<< @@ -1669,7 +1686,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb */ __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_SV_data), __pyx_n_s__resize); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyInt_to_py_Py_intptr_t(__pyx_v_nonzero_SV); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_to_py_npy_intp(__pyx_v_nonzero_SV); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); @@ -1689,7 +1706,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":157 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":157 * # SV_data.resize((0,0), refcheck=False) # why is this needed ? * SV_data.resize (nonzero_SV, refcheck=False) * SV_indices.resize (nonzero_SV, refcheck=False) # <<<<<<<<<<<<<< @@ -1698,7 +1715,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb */ __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_SV_indices), __pyx_n_s__resize); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyInt_to_py_Py_intptr_t(__pyx_v_nonzero_SV); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_to_py_npy_intp(__pyx_v_nonzero_SV); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); @@ -1718,7 +1735,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":158 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":158 * SV_data.resize (nonzero_SV, refcheck=False) * SV_indices.resize (nonzero_SV, refcheck=False) * SV_indptr.resize (<np.npy_intp> SV_len + 1, refcheck=False) # <<<<<<<<<<<<<< @@ -1727,7 +1744,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb */ __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_SV_indptr), __pyx_n_s__resize); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyInt_FromLong((__pyx_v_SV_len + 1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong((((npy_intp)__pyx_v_SV_len) + 1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); @@ -1747,7 +1764,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":160 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":160 * SV_indptr.resize (<np.npy_intp> SV_len + 1, refcheck=False) * csr_copy_SV(SV_data.data, SV_indices.shape, SV_indices.data, * SV_indptr.shape, SV_indptr.data, model, n_features) # <<<<<<<<<<<<<< @@ -1756,7 +1773,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb */ csr_copy_SV(__pyx_v_SV_data->data, __pyx_v_SV_indices->dimensions, __pyx_v_SV_indices->data, __pyx_v_SV_indptr->dimensions, __pyx_v_SV_indptr->data, __pyx_v_model, __pyx_v_n_features); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":164 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":164 * # copy model.nSV * # TODO: do only in classification * nclass_SV.resize(n_class, refcheck=False) # <<<<<<<<<<<<<< @@ -1765,7 +1782,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb */ __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_nclass_SV), __pyx_n_s__resize); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyInt_to_py_Py_intptr_t(__pyx_v_n_class); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_to_py_npy_intp(__pyx_v_n_class); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); @@ -1785,7 +1802,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":165 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":165 * # TODO: do only in classification * nclass_SV.resize(n_class, refcheck=False) * copy_nSV(nclass_SV.data, model) # <<<<<<<<<<<<<< @@ -1794,7 +1811,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb */ copy_nSV(__pyx_v_nclass_SV->data, __pyx_v_model); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":169 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":169 * # # copy label * cdef np.ndarray[np.int32_t, ndim=1, mode='c'] label * label = np.empty((n_class), dtype=np.int32) # <<<<<<<<<<<<<< @@ -1806,7 +1823,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_to_py_Py_intptr_t(__pyx_v_n_class); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_to_py_npy_intp(__pyx_v_n_class); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); @@ -1851,7 +1868,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb __pyx_v_label = ((PyArrayObject *)__pyx_t_6); __pyx_t_6 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":170 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":170 * cdef np.ndarray[np.int32_t, ndim=1, mode='c'] label * label = np.empty((n_class), dtype=np.int32) * copy_label(label.data, model) # <<<<<<<<<<<<<< @@ -1860,7 +1877,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb */ copy_label(__pyx_v_label->data, __pyx_v_model); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":175 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":175 * cdef np.ndarray[np.float64_t, ndim=1, mode='c'] probA * cdef np.ndarray[np.float64_t, ndim=1, mode='c'] probB * if probability != 0: # <<<<<<<<<<<<<< @@ -1870,7 +1887,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb __pyx_t_14 = (__pyx_v_probability != 0); if (__pyx_t_14) { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":176 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":176 * cdef np.ndarray[np.float64_t, ndim=1, mode='c'] probB * if probability != 0: * if svm_type < 2: # SVC and NuSVC # <<<<<<<<<<<<<< @@ -1880,7 +1897,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb __pyx_t_14 = (__pyx_v_svm_type < 2); if (__pyx_t_14) { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":177 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":177 * if probability != 0: * if svm_type < 2: # SVC and NuSVC * probA = np.empty(n_class*(n_class-1)/2, dtype=np.float64) # <<<<<<<<<<<<<< @@ -1937,7 +1954,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb __pyx_v_probA = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":178 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":178 * if svm_type < 2: # SVC and NuSVC * probA = np.empty(n_class*(n_class-1)/2, dtype=np.float64) * probB = np.empty(n_class*(n_class-1)/2, dtype=np.float64) # <<<<<<<<<<<<<< @@ -1994,7 +2011,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb __pyx_v_probB = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":179 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":179 * probA = np.empty(n_class*(n_class-1)/2, dtype=np.float64) * probB = np.empty(n_class*(n_class-1)/2, dtype=np.float64) * copy_probB(probB.data, model, probB.shape) # <<<<<<<<<<<<<< @@ -2006,7 +2023,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb } /*else*/ { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":181 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":181 * copy_probB(probB.data, model, probB.shape) * else: * probA = np.empty(1, dtype=np.float64) # <<<<<<<<<<<<<< @@ -2061,7 +2078,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb __pyx_v_probA = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":182 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":182 * else: * probA = np.empty(1, dtype=np.float64) * probB = np.empty(0, dtype=np.float64) # <<<<<<<<<<<<<< @@ -2118,7 +2135,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb } __pyx_L10:; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":183 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":183 * probA = np.empty(1, dtype=np.float64) * probB = np.empty(0, dtype=np.float64) * copy_probA(probA.data, model, probA.shape) # <<<<<<<<<<<<<< @@ -2130,7 +2147,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb } __pyx_L9:; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":185 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":185 * copy_probA(probA.data, model, probA.shape) * * svm_csr_free_and_destroy_model (&model) # <<<<<<<<<<<<<< @@ -2139,7 +2156,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb */ svm_csr_free_and_destroy_model((&__pyx_v_model)); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":186 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":186 * * svm_csr_free_and_destroy_model (&model) * free_problem(problem) # <<<<<<<<<<<<<< @@ -2148,7 +2165,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb */ free_problem(__pyx_v_problem); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":187 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":187 * svm_csr_free_and_destroy_model (&model) * free_problem(problem) * free_param(param) # <<<<<<<<<<<<<< @@ -2157,7 +2174,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb */ free_param(__pyx_v_param); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":189 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":189 * free_param(param) * * return label, probA, probB # <<<<<<<<<<<<<< @@ -2207,7 +2224,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_indices); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("sklearn.svm.sparse.libsvm.libsvm_sparse_train"); + __Pyx_AddTraceback("scikits.learn.svm.sparse.libsvm.libsvm_sparse_train"); __pyx_r = NULL; goto __pyx_L2; __pyx_L0:; @@ -2231,13 +2248,25 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb __Pyx_DECREF((PyObject *)__pyx_v_label); __Pyx_DECREF((PyObject *)__pyx_v_probA); __Pyx_DECREF((PyObject *)__pyx_v_probB); + __Pyx_DECREF((PyObject *)__pyx_v_values); + __Pyx_DECREF((PyObject *)__pyx_v_indices); + __Pyx_DECREF((PyObject *)__pyx_v_indptr); + __Pyx_DECREF((PyObject *)__pyx_v_Y); + __Pyx_DECREF((PyObject *)__pyx_v_SV_data); + __Pyx_DECREF((PyObject *)__pyx_v_SV_indices); + __Pyx_DECREF((PyObject *)__pyx_v_SV_indptr); + __Pyx_DECREF((PyObject *)__pyx_v_sv_coef_data); + __Pyx_DECREF((PyObject *)__pyx_v_intercept); + __Pyx_DECREF((PyObject *)__pyx_v_weight_label); + __Pyx_DECREF((PyObject *)__pyx_v_weight); __Pyx_DECREF((PyObject *)__pyx_v_sample_weight); + __Pyx_DECREF((PyObject *)__pyx_v_nclass_SV); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":193 +/* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":193 * * * def libsvm_sparse_predict (np.ndarray[np.float64_t, ndim=1, mode='c'] T_data, # <<<<<<<<<<<<<< @@ -2245,9 +2274,9 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train(PyOb * np.ndarray[np.int32_t, ndim=1, mode='c'] T_indptr, */ -static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_predict(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_predict[] = "\n Predict values T given a model.\n\n For speed, all real work is done at the C level in function\n copy_predict (libsvm_helper.c).\n\n We have to reconstruct model and parameters to make sure we stay\n in sync with the python object.\n\n Parameters\n ----------\n X: array-like, dtype=float\n Y: array\n target vector\n\n Optional Parameters\n -------------------\n See scikits.learn.svm.predict for a complete list of parameters.\n\n Return\n ------\n dec_values : array\n predicted values.\n "; -static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_predict(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_predict(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_predict[] = "\n Predict values T given a model.\n\n For speed, all real work is done at the C level in function\n copy_predict (libsvm_helper.c).\n\n We have to reconstruct model and parameters to make sure we stay\n in sync with the python object.\n\n Parameters\n ----------\n X: array-like, dtype=float\n Y: array\n target vector\n\n Optional Parameters\n -------------------\n See scikits.learn.svm.predict for a complete list of parameters.\n\n Return\n ------\n dec_values : array\n predicted values.\n "; +static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_predict(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyArrayObject *__pyx_v_T_data = 0; PyArrayObject *__pyx_v_T_indices = 0; PyArrayObject *__pyx_v_T_indptr = 0; @@ -2577,10 +2606,23 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_predict(Py __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict", 1, 25, 25, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("sklearn.svm.sparse.libsvm.libsvm_sparse_predict"); - __Pyx_RefNannyFinishContext(); + __Pyx_AddTraceback("scikits.learn.svm.sparse.libsvm.libsvm_sparse_predict"); return NULL; __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF((PyObject *)__pyx_v_T_data); + __Pyx_INCREF((PyObject *)__pyx_v_T_indices); + __Pyx_INCREF((PyObject *)__pyx_v_T_indptr); + __Pyx_INCREF((PyObject *)__pyx_v_SV_data); + __Pyx_INCREF((PyObject *)__pyx_v_SV_indices); + __Pyx_INCREF((PyObject *)__pyx_v_SV_indptr); + __Pyx_INCREF((PyObject *)__pyx_v_sv_coef); + __Pyx_INCREF((PyObject *)__pyx_v_intercept); + __Pyx_INCREF((PyObject *)__pyx_v_weight_label); + __Pyx_INCREF((PyObject *)__pyx_v_weight); + __Pyx_INCREF((PyObject *)__pyx_v_nSV); + __Pyx_INCREF((PyObject *)__pyx_v_label); + __Pyx_INCREF((PyObject *)__pyx_v_probA); + __Pyx_INCREF((PyObject *)__pyx_v_probB); __pyx_v_dec_values = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_dec_values.buf = NULL; __pyx_bstruct_T_data.buf = NULL; @@ -2696,16 +2738,16 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_predict(Py __pyx_bstride_0_probB = __pyx_bstruct_probB.strides[0]; __pyx_bshape_0_probB = __pyx_bstruct_probB.shape[0]; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":244 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":244 * C, eps, p, shrinking, * probability, <int> weight.shape[0], weight_label.data, * weight.data) # <<<<<<<<<<<<<< * * model = csr_set_model(param, <int> nSV.shape[0], SV_data.data, */ - __pyx_v_param = set_parameter(__pyx_v_svm_type, __pyx_v_kernel_type, __pyx_v_degree, __pyx_v_gamma, __pyx_v_coef0, __pyx_v_nu, 100., __pyx_v_C, __pyx_v_eps, __pyx_v_p, __pyx_v_shrinking, __pyx_v_probability, ((int)(__pyx_v_weight->dimensions[0])), __pyx_v_weight_label->data, __pyx_v_weight->data); + __pyx_v_param = set_parameter(__pyx_v_svm_type, __pyx_v_kernel_type, __pyx_v_degree, __pyx_v_gamma, __pyx_v_coef0, __pyx_v_nu, 100.0, __pyx_v_C, __pyx_v_eps, __pyx_v_p, __pyx_v_shrinking, __pyx_v_probability, ((int)(__pyx_v_weight->dimensions[0])), __pyx_v_weight_label->data, __pyx_v_weight->data); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":250 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":250 * SV_indptr.shape, SV_indptr.data, * sv_coef.data, intercept.data, * nSV.data, label.data, probA.data, probB.data) # <<<<<<<<<<<<<< @@ -2714,7 +2756,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_predict(Py */ __pyx_v_model = csr_set_model(__pyx_v_param, ((int)(__pyx_v_nSV->dimensions[0])), __pyx_v_SV_data->data, __pyx_v_SV_indices->dimensions, __pyx_v_SV_indices->data, __pyx_v_SV_indptr->dimensions, __pyx_v_SV_indptr->data, __pyx_v_sv_coef->data, __pyx_v_intercept->data, __pyx_v_nSV->data, __pyx_v_label->data, __pyx_v_probA->data, __pyx_v_probB->data); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":252 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":252 * nSV.data, label.data, probA.data, probB.data) * #TODO: use check_model * dec_values = np.empty(T_indptr.shape[0]-1) # <<<<<<<<<<<<<< @@ -2761,7 +2803,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_predict(Py __pyx_v_dec_values = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":256 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":256 * T_indices.shape, T_indices.data, * T_indptr.shape, T_indptr.data, * model, dec_values.data) < 0: # <<<<<<<<<<<<<< @@ -2771,7 +2813,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_predict(Py __pyx_t_9 = (csr_copy_predict(__pyx_v_T_data->dimensions, __pyx_v_T_data->data, __pyx_v_T_indices->dimensions, __pyx_v_T_indices->data, __pyx_v_T_indptr->dimensions, __pyx_v_T_indptr->data, __pyx_v_model, __pyx_v_dec_values->data) < 0); if (__pyx_t_9) { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":257 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":257 * T_indptr.shape, T_indptr.data, * model, dec_values.data) < 0: * raise MemoryError("We've run out of of memory") # <<<<<<<<<<<<<< @@ -2793,7 +2835,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_predict(Py } __pyx_L6:; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":259 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":259 * raise MemoryError("We've run out of of memory") * # free model and param * free_model_SV(model) # <<<<<<<<<<<<<< @@ -2802,7 +2844,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_predict(Py */ free_model_SV(__pyx_v_model); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":260 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":260 * # free model and param * free_model_SV(model) * free_model(model) # <<<<<<<<<<<<<< @@ -2811,7 +2853,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_predict(Py */ free_model(__pyx_v_model); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":261 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":261 * free_model_SV(model) * free_model(model) * free_param(param) # <<<<<<<<<<<<<< @@ -2820,7 +2862,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_predict(Py */ free_param(__pyx_v_param); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":262 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":262 * free_model(model) * free_param(param) * return dec_values # <<<<<<<<<<<<<< @@ -2856,7 +2898,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_predict(Py __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nSV); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_T_indptr); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("sklearn.svm.sparse.libsvm.libsvm_sparse_predict"); + __Pyx_AddTraceback("scikits.learn.svm.sparse.libsvm.libsvm_sparse_predict"); __pyx_r = NULL; goto __pyx_L2; __pyx_L0:; @@ -2877,12 +2919,26 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_predict(Py __Pyx_SafeReleaseBuffer(&__pyx_bstruct_T_indptr); __pyx_L2:; __Pyx_DECREF((PyObject *)__pyx_v_dec_values); + __Pyx_DECREF((PyObject *)__pyx_v_T_data); + __Pyx_DECREF((PyObject *)__pyx_v_T_indices); + __Pyx_DECREF((PyObject *)__pyx_v_T_indptr); + __Pyx_DECREF((PyObject *)__pyx_v_SV_data); + __Pyx_DECREF((PyObject *)__pyx_v_SV_indices); + __Pyx_DECREF((PyObject *)__pyx_v_SV_indptr); + __Pyx_DECREF((PyObject *)__pyx_v_sv_coef); + __Pyx_DECREF((PyObject *)__pyx_v_intercept); + __Pyx_DECREF((PyObject *)__pyx_v_weight_label); + __Pyx_DECREF((PyObject *)__pyx_v_weight); + __Pyx_DECREF((PyObject *)__pyx_v_nSV); + __Pyx_DECREF((PyObject *)__pyx_v_label); + __Pyx_DECREF((PyObject *)__pyx_v_probA); + __Pyx_DECREF((PyObject *)__pyx_v_probB); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":267 +/* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":267 * * * def libsvm_sparse_predict_proba( # <<<<<<<<<<<<<< @@ -2890,9 +2946,9 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_predict(Py * np.ndarray[np.int32_t, ndim=1, mode='c'] T_indices, */ -static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_predict_proba(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_predict_proba[] = "\n Predict values T given a model.\n "; -static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_predict_proba(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_predict_proba(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_predict_proba[] = "\n Predict values T given a model.\n "; +static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_predict_proba(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyArrayObject *__pyx_v_T_data = 0; PyArrayObject *__pyx_v_T_indices = 0; PyArrayObject *__pyx_v_T_indptr = 0; @@ -3227,10 +3283,23 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_predict_pr __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 25, 25, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("sklearn.svm.sparse.libsvm.libsvm_sparse_predict_proba"); - __Pyx_RefNannyFinishContext(); + __Pyx_AddTraceback("scikits.learn.svm.sparse.libsvm.libsvm_sparse_predict_proba"); return NULL; __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF((PyObject *)__pyx_v_T_data); + __Pyx_INCREF((PyObject *)__pyx_v_T_indices); + __Pyx_INCREF((PyObject *)__pyx_v_T_indptr); + __Pyx_INCREF((PyObject *)__pyx_v_SV_data); + __Pyx_INCREF((PyObject *)__pyx_v_SV_indices); + __Pyx_INCREF((PyObject *)__pyx_v_SV_indptr); + __Pyx_INCREF((PyObject *)__pyx_v_sv_coef); + __Pyx_INCREF((PyObject *)__pyx_v_intercept); + __Pyx_INCREF((PyObject *)__pyx_v_weight_label); + __Pyx_INCREF((PyObject *)__pyx_v_weight); + __Pyx_INCREF((PyObject *)__pyx_v_nSV); + __Pyx_INCREF((PyObject *)__pyx_v_label); + __Pyx_INCREF((PyObject *)__pyx_v_probA); + __Pyx_INCREF((PyObject *)__pyx_v_probB); __pyx_v_dec_values = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_dec_values.buf = NULL; __pyx_bstruct_T_data.buf = NULL; @@ -3346,16 +3415,16 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_predict_pr __pyx_bstride_0_probB = __pyx_bstruct_probB.strides[0]; __pyx_bshape_0_probB = __pyx_bstruct_probB.shape[0]; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":297 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":297 * C, eps, p, shrinking, * probability, <int> weight.shape[0], weight_label.data, * weight.data) # <<<<<<<<<<<<<< * * model = csr_set_model(param, <int> nSV.shape[0], SV_data.data, */ - __pyx_v_param = set_parameter(__pyx_v_svm_type, __pyx_v_kernel_type, __pyx_v_degree, __pyx_v_gamma, __pyx_v_coef0, __pyx_v_nu, 100., __pyx_v_C, __pyx_v_eps, __pyx_v_p, __pyx_v_shrinking, __pyx_v_probability, ((int)(__pyx_v_weight->dimensions[0])), __pyx_v_weight_label->data, __pyx_v_weight->data); + __pyx_v_param = set_parameter(__pyx_v_svm_type, __pyx_v_kernel_type, __pyx_v_degree, __pyx_v_gamma, __pyx_v_coef0, __pyx_v_nu, 100.0, __pyx_v_C, __pyx_v_eps, __pyx_v_p, __pyx_v_shrinking, __pyx_v_probability, ((int)(__pyx_v_weight->dimensions[0])), __pyx_v_weight_label->data, __pyx_v_weight->data); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":303 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":303 * SV_indptr.shape, SV_indptr.data, * sv_coef.data, intercept.data, * nSV.data, label.data, probA.data, probB.data) # <<<<<<<<<<<<<< @@ -3364,7 +3433,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_predict_pr */ __pyx_v_model = csr_set_model(__pyx_v_param, ((int)(__pyx_v_nSV->dimensions[0])), __pyx_v_SV_data->data, __pyx_v_SV_indices->dimensions, __pyx_v_SV_indices->data, __pyx_v_SV_indptr->dimensions, __pyx_v_SV_indptr->data, __pyx_v_sv_coef->data, __pyx_v_intercept->data, __pyx_v_nSV->data, __pyx_v_label->data, __pyx_v_probA->data, __pyx_v_probB->data); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":305 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":305 * nSV.data, label.data, probA.data, probB.data) * #TODO: use check_model * cdef np.npy_intp n_class = get_nr(model) # <<<<<<<<<<<<<< @@ -3373,7 +3442,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_predict_pr */ __pyx_v_n_class = get_nr(__pyx_v_model); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":306 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":306 * #TODO: use check_model * cdef np.npy_intp n_class = get_nr(model) * dec_values = np.empty((T_indptr.shape[0]-1, n_class), dtype=np.float64) # <<<<<<<<<<<<<< @@ -3387,7 +3456,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_predict_pr __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyInt_FromLong(((__pyx_v_T_indptr->dimensions[0]) - 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_to_py_Py_intptr_t(__pyx_v_n_class); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_to_py_npy_intp(__pyx_v_n_class); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); @@ -3440,7 +3509,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_predict_pr __pyx_v_dec_values = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":310 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":310 * T_indices.shape, T_indices.data, * T_indptr.shape, T_indptr.data, * model, dec_values.data) < 0: # <<<<<<<<<<<<<< @@ -3450,7 +3519,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_predict_pr __pyx_t_11 = (csr_copy_predict_proba(__pyx_v_T_data->dimensions, __pyx_v_T_data->data, __pyx_v_T_indices->dimensions, __pyx_v_T_indices->data, __pyx_v_T_indptr->dimensions, __pyx_v_T_indptr->data, __pyx_v_model, __pyx_v_dec_values->data) < 0); if (__pyx_t_11) { - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":311 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":311 * T_indptr.shape, T_indptr.data, * model, dec_values.data) < 0: * raise MemoryError("We've run out of of memory") # <<<<<<<<<<<<<< @@ -3472,7 +3541,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_predict_pr } __pyx_L6:; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":313 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":313 * raise MemoryError("We've run out of of memory") * # free model and param * free_model_SV(model) # <<<<<<<<<<<<<< @@ -3481,7 +3550,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_predict_pr */ free_model_SV(__pyx_v_model); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":314 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":314 * # free model and param * free_model_SV(model) * free_model(model) # <<<<<<<<<<<<<< @@ -3490,7 +3559,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_predict_pr */ free_model(__pyx_v_model); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":315 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":315 * free_model_SV(model) * free_model(model) * free_param(param) # <<<<<<<<<<<<<< @@ -3499,7 +3568,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_predict_pr */ free_param(__pyx_v_param); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":316 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":316 * free_model(model) * free_param(param) * return dec_values # <<<<<<<<<<<<<< @@ -3537,7 +3606,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_predict_pr __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nSV); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_T_indptr); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("sklearn.svm.sparse.libsvm.libsvm_sparse_predict_proba"); + __Pyx_AddTraceback("scikits.learn.svm.sparse.libsvm.libsvm_sparse_predict_proba"); __pyx_r = NULL; goto __pyx_L2; __pyx_L0:; @@ -3558,12 +3627,26 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_predict_pr __Pyx_SafeReleaseBuffer(&__pyx_bstruct_T_indptr); __pyx_L2:; __Pyx_DECREF((PyObject *)__pyx_v_dec_values); + __Pyx_DECREF((PyObject *)__pyx_v_T_data); + __Pyx_DECREF((PyObject *)__pyx_v_T_indices); + __Pyx_DECREF((PyObject *)__pyx_v_T_indptr); + __Pyx_DECREF((PyObject *)__pyx_v_SV_data); + __Pyx_DECREF((PyObject *)__pyx_v_SV_indices); + __Pyx_DECREF((PyObject *)__pyx_v_SV_indptr); + __Pyx_DECREF((PyObject *)__pyx_v_sv_coef); + __Pyx_DECREF((PyObject *)__pyx_v_intercept); + __Pyx_DECREF((PyObject *)__pyx_v_weight_label); + __Pyx_DECREF((PyObject *)__pyx_v_weight); + __Pyx_DECREF((PyObject *)__pyx_v_nSV); + __Pyx_DECREF((PyObject *)__pyx_v_label); + __Pyx_DECREF((PyObject *)__pyx_v_probA); + __Pyx_DECREF((PyObject *)__pyx_v_probB); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":320 +/* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":320 * * * def set_verbosity_wrap(int verbosity): # <<<<<<<<<<<<<< @@ -3571,9 +3654,9 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_predict_pr * Control verbosity of libsvm library */ -static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_set_verbosity_wrap(PyObject *__pyx_self, PyObject *__pyx_arg_verbosity); /*proto*/ -static char __pyx_doc_7sklearn_3svm_6sparse_6libsvm_set_verbosity_wrap[] = "\n Control verbosity of libsvm library\n "; -static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_set_verbosity_wrap(PyObject *__pyx_self, PyObject *__pyx_arg_verbosity) { +static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_set_verbosity_wrap(PyObject *__pyx_self, PyObject *__pyx_arg_verbosity); /*proto*/ +static char __pyx_doc_7scikits_5learn_3svm_6sparse_6libsvm_set_verbosity_wrap[] = "\n Control verbosity of libsvm library\n "; +static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_set_verbosity_wrap(PyObject *__pyx_self, PyObject *__pyx_arg_verbosity) { int __pyx_v_verbosity; PyObject *__pyx_r = NULL; __Pyx_RefNannySetupContext("set_verbosity_wrap"); @@ -3583,12 +3666,11 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_set_verbosity_wrap(PyObj } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - __Pyx_AddTraceback("sklearn.svm.sparse.libsvm.set_verbosity_wrap"); - __Pyx_RefNannyFinishContext(); + __Pyx_AddTraceback("scikits.learn.svm.sparse.libsvm.set_verbosity_wrap"); return NULL; __pyx_L4_argument_unpacking_done:; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":324 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":324 * Control verbosity of libsvm library * """ * set_verbosity(verbosity) # <<<<<<<<<<<<<< @@ -3601,7 +3683,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_set_verbosity_wrap(PyObj return __pyx_r; } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":188 +/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":187 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -3609,8 +3691,8 @@ static PyObject *__pyx_pf_7sklearn_3svm_6sparse_6libsvm_set_verbosity_wrap(PyObj * # requirements, and does not yet fullfill the PEP. */ -static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ -static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__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; @@ -3635,8 +3717,9 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ if (__pyx_v_info == NULL) return 0; __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(__pyx_v_info->obj); + __Pyx_INCREF((PyObject *)__pyx_v_self); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":194 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":193 * # of flags * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -3645,7 +3728,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_endian_detector = 1; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":195 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":194 * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -3654,7 +3737,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":197 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":196 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) * * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< @@ -3663,7 +3746,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_ndim = PyArray_NDIM(((PyArrayObject *)__pyx_v_self)); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":199 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":198 * ndim = PyArray_NDIM(self) * * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -3673,7 +3756,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); if (__pyx_t_1) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":200 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":199 * * if sizeof(npy_intp) != sizeof(Py_ssize_t): * copy_shape = 1 # <<<<<<<<<<<<<< @@ -3685,7 +3768,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } /*else*/ { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":202 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":201 * copy_shape = 1 * else: * copy_shape = 0 # <<<<<<<<<<<<<< @@ -3696,7 +3779,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } __pyx_L5:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":204 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":203 * copy_shape = 0 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -3706,7 +3789,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ __pyx_t_1 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS); if (__pyx_t_1) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":205 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":204 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -3720,29 +3803,29 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } if (__pyx_t_3) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":206 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":205 * 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_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_kp_u_5)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_u_5)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_5)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":208 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":207 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -3752,7 +3835,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ __pyx_t_3 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS); if (__pyx_t_3) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":209 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":208 * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -3766,29 +3849,29 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } if (__pyx_t_2) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":210 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":209 * 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_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_kp_u_6)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_u_6)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_6)); - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L7; } __pyx_L7:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":212 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":211 * raise ValueError(u"ndarray is not Fortran contiguous") * * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< @@ -3797,7 +3880,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->buf = PyArray_DATA(((PyArrayObject *)__pyx_v_self)); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":213 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":212 * * info.buf = PyArray_DATA(self) * info.ndim = ndim # <<<<<<<<<<<<<< @@ -3806,16 +3889,17 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->ndim = __pyx_v_ndim; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":214 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":213 * 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. */ - if (__pyx_v_copy_shape) { + __pyx_t_6 = __pyx_v_copy_shape; + if (__pyx_t_6) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":217 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":216 * # Allocate new buffer for strides and shape info. This is allocated * # as one block, strides first. * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< @@ -3824,7 +3908,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * __pyx_v_ndim) * 2))); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":218 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":217 * # as one block, strides first. * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) * info.shape = info.strides + ndim # <<<<<<<<<<<<<< @@ -3833,7 +3917,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":219 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":218 * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) * info.shape = info.strides + ndim * for i in range(ndim): # <<<<<<<<<<<<<< @@ -3844,7 +3928,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":220 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":219 * info.shape = info.strides + ndim * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< @@ -3853,7 +3937,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":221 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":220 * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< @@ -3866,7 +3950,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } /*else*/ { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":223 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":222 * info.shape[i] = PyArray_DIMS(self)[i] * else: * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) # <<<<<<<<<<<<<< @@ -3875,7 +3959,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(((PyArrayObject *)__pyx_v_self))); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":224 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":223 * else: * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) * info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<< @@ -3886,7 +3970,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } __pyx_L8:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":225 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":224 * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) * info.shape = <Py_ssize_t*>PyArray_DIMS(self) * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -3895,7 +3979,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->suboffsets = NULL; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":226 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":225 * info.shape = <Py_ssize_t*>PyArray_DIMS(self) * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< @@ -3904,7 +3988,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->itemsize = PyArray_ITEMSIZE(((PyArrayObject *)__pyx_v_self)); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":227 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":226 * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< @@ -3913,7 +3997,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->readonly = (!PyArray_ISWRITEABLE(((PyArrayObject *)__pyx_v_self))); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":230 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":229 * * cdef int t * cdef char* f = NULL # <<<<<<<<<<<<<< @@ -3922,7 +4006,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_f = NULL; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":231 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":230 * cdef int t * cdef char* f = NULL * cdef dtype descr = self.descr # <<<<<<<<<<<<<< @@ -3932,7 +4016,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_self)->descr)); __pyx_v_descr = ((PyArrayObject *)__pyx_v_self)->descr; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":235 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":234 * cdef int offset * * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< @@ -3941,7 +4025,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":237 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":236 * cdef bint hasfields = PyDataType_HASFIELDS(descr) * * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< @@ -3957,7 +4041,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } if (__pyx_t_1) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":239 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":238 * if not hasfields and not copy_shape: * # do not call releasebuffer * info.obj = None # <<<<<<<<<<<<<< @@ -3973,7 +4057,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } /*else*/ { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":242 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":241 * else: * # need to call releasebuffer * info.obj = self # <<<<<<<<<<<<<< @@ -3988,7 +4072,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } __pyx_L11:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":244 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":243 * info.obj = self * * if not hasfields: # <<<<<<<<<<<<<< @@ -3998,7 +4082,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ __pyx_t_1 = (!__pyx_v_hasfields); if (__pyx_t_1) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":245 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":244 * * if not hasfields: * t = descr.type_num # <<<<<<<<<<<<<< @@ -4007,7 +4091,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_t = __pyx_v_descr->type_num; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":246 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":245 * if not hasfields: * t = descr.type_num * if ((descr.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< @@ -4022,7 +4106,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } if (!__pyx_t_2) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":247 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":246 * t = descr.type_num * if ((descr.byteorder == '>' and little_endian) or * (descr.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< @@ -4042,29 +4126,29 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } if (__pyx_t_1) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":248 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":247 * if ((descr.byteorder == '>' and little_endian) or * (descr.byteorder == '<' 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_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_kp_u_7)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_u_7)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_7)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L13; } __pyx_L13:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":249 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":248 * (descr.byteorder == '<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< @@ -4077,7 +4161,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":250 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":249 * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< @@ -4090,7 +4174,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":251 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":250 * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< @@ -4103,7 +4187,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":252 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":251 * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< @@ -4116,7 +4200,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":253 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":252 * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< @@ -4129,7 +4213,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":254 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":253 * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< @@ -4142,7 +4226,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":255 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":254 * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< @@ -4155,7 +4239,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":256 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":255 * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< @@ -4168,7 +4252,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":257 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":256 * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< @@ -4181,7 +4265,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":258 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":257 * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< @@ -4194,7 +4278,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":259 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":258 * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< @@ -4207,7 +4291,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":260 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":259 * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< @@ -4220,7 +4304,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":261 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":260 * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< @@ -4233,7 +4317,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":262 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":261 * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< @@ -4246,7 +4330,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":263 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":262 * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< @@ -4259,7 +4343,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":264 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":263 * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< @@ -4272,7 +4356,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ goto __pyx_L14; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":265 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":264 * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< @@ -4286,33 +4370,33 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } /*else*/ { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":267 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":266 * elif t == NPY_OBJECT: f = "O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< * info.format = f * return */ - __pyx_t_5 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_8), __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_8), __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_4)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L14:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":268 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":267 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f # <<<<<<<<<<<<<< @@ -4321,7 +4405,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->format = __pyx_v_f; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":269 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":268 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f * return # <<<<<<<<<<<<<< @@ -4334,7 +4418,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } /*else*/ { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":271 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":270 * return * else: * info.format = <char*>stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< @@ -4343,7 +4427,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->format = ((char *)malloc(255)); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":272 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":271 * else: * info.format = <char*>stdlib.malloc(_buffer_format_string_len) * info.format[0] = '^' # Native data types, manual alignment # <<<<<<<<<<<<<< @@ -4352,7 +4436,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ (__pyx_v_info->format[0]) = '^'; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":273 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":272 * info.format = <char*>stdlib.malloc(_buffer_format_string_len) * info.format[0] = '^' # Native data types, manual alignment * offset = 0 # <<<<<<<<<<<<<< @@ -4361,17 +4445,17 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_offset = 0; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":276 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":275 * f = _util_dtypestring(descr, info.format + 1, * info.format + _buffer_format_string_len, * &offset) # <<<<<<<<<<<<<< * f[0] = 0 # Terminate format string * */ - __pyx_t_9 = __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_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __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_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_f = __pyx_t_9; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":277 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":276 * info.format + _buffer_format_string_len, * &offset) * f[0] = 0 # Terminate format string # <<<<<<<<<<<<<< @@ -4399,11 +4483,12 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } __pyx_L2:; __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":279 +/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":278 * f[0] = 0 # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -4411,12 +4496,13 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ * stdlib.free(info.format) */ -static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ -static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { +static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ +static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { int __pyx_t_1; __Pyx_RefNannySetupContext("__releasebuffer__"); + __Pyx_INCREF((PyObject *)__pyx_v_self); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":280 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":279 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -4426,7 +4512,7 @@ static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *_ __pyx_t_1 = PyArray_HASFIELDS(((PyArrayObject *)__pyx_v_self)); if (__pyx_t_1) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":281 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":280 * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): * stdlib.free(info.format) # <<<<<<<<<<<<<< @@ -4438,7 +4524,7 @@ static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *_ } __pyx_L5:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":282 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":281 * if PyArray_HASFIELDS(self): * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -4448,7 +4534,7 @@ static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *_ __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); if (__pyx_t_1) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":283 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":282 * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): * stdlib.free(info.strides) # <<<<<<<<<<<<<< @@ -4460,10 +4546,11 @@ static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *_ } __pyx_L6:; + __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_RefNannyFinishContext(); } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":756 +/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":755 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -4476,7 +4563,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1"); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":757 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":756 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<< @@ -4484,7 +4571,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ * 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 = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -4502,7 +4589,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":759 +/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":758 * return PyArray_MultiIterNew(1, <void*>a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -4515,7 +4602,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2"); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":760 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":759 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<< @@ -4523,7 +4610,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ * 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 = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -4541,7 +4628,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":762 +/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":761 * return PyArray_MultiIterNew(2, <void*>a, <void*>b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -4554,7 +4641,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3"); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":763 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":762 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<< @@ -4562,7 +4649,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ * 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 = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -4580,7 +4667,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":765 +/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":764 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -4593,7 +4680,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4"); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":766 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":765 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<< @@ -4601,7 +4688,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ * 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 = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -4619,7 +4706,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":768 +/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":767 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -4632,7 +4719,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5"); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":769 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":768 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<< @@ -4640,7 +4727,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ * 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 = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -4658,7 +4745,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":771 +/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":770 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -4686,13 +4773,14 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx int __pyx_t_9; char *__pyx_t_10; __Pyx_RefNannySetupContext("_util_dtypestring"); + __Pyx_INCREF((PyObject *)__pyx_v_descr); __pyx_v_child = ((PyArray_Descr *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_fields = ((PyObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_childname = Py_None; __Pyx_INCREF(Py_None); __pyx_v_new_offset = Py_None; __Pyx_INCREF(Py_None); __pyx_v_t = Py_None; __Pyx_INCREF(Py_None); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":778 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":777 * cdef int delta_offset * cdef tuple i * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -4701,7 +4789,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_endian_detector = 1; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":779 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":778 * cdef tuple i * cdef int endian_detector = 1 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -4710,7 +4798,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":782 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":781 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -4720,7 +4808,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx if (likely(((PyObject *)__pyx_v_descr->names) != Py_None)) { __pyx_t_1 = 0; __pyx_t_2 = ((PyObject *)__pyx_v_descr->names); __Pyx_INCREF(__pyx_t_2); } else { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } for (;;) { if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break; @@ -4729,21 +4817,21 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_v_childname = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":783 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":782 * * for childname in descr.names: * fields = descr.fields[childname] # <<<<<<<<<<<<<< * child, new_offset = fields * */ - __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (!__pyx_t_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (!__pyx_t_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_fields)); __pyx_v_fields = ((PyObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":784 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":783 * for childname in descr.names: * fields = descr.fields[childname] * child, new_offset = fields # <<<<<<<<<<<<<< @@ -4753,7 +4841,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx if (likely(((PyObject *)__pyx_v_fields) != Py_None) && likely(PyTuple_GET_SIZE(((PyObject *)__pyx_v_fields)) == 2)) { PyObject* tuple = ((PyObject *)__pyx_v_fields); __pyx_t_3 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_4); __Pyx_DECREF(((PyObject *)__pyx_v_child)); __pyx_v_child = ((PyArray_Descr *)__pyx_t_3); @@ -4763,57 +4851,57 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_4 = 0; } else { __Pyx_UnpackTupleError(((PyObject *)__pyx_v_fields), 2); - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":786 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":785 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * */ - __pyx_t_4 = PyInt_FromLong((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":787 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":786 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< * * if ((child.byteorder == '>' and little_endian) or */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_kp_u_9)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_u_9)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_9)); - __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L5; } __pyx_L5:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":789 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":788 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< @@ -4828,7 +4916,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } if (!__pyx_t_7) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":790 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":789 * * if ((child.byteorder == '>' and little_endian) or * (child.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< @@ -4848,29 +4936,29 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } if (__pyx_t_6) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":791 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":790 * if ((child.byteorder == '>' and little_endian) or * (child.byteorder == '<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_kp_u_7)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_u_7)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_7)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":801 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":800 * * # Output padding bytes * while offset[0] < new_offset: # <<<<<<<<<<<<<< @@ -4878,16 +4966,16 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx * f += 1 */ while (1) { - __pyx_t_5 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_6) break; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":802 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":801 * # Output padding bytes * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< @@ -4896,7 +4984,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ (__pyx_v_f[0]) = 120; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":803 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":802 * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte * f += 1 # <<<<<<<<<<<<<< @@ -4905,7 +4993,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f += 1; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":804 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":803 * f[0] = 120 # "x"; pad byte * f += 1 * offset[0] += 1 # <<<<<<<<<<<<<< @@ -4915,7 +5003,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx (__pyx_v_offset[0]) += 1; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":806 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":805 * offset[0] += 1 * * offset[0] += child.itemsize # <<<<<<<<<<<<<< @@ -4924,7 +5012,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ (__pyx_v_offset[0]) += __pyx_v_child->elsize; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":808 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":807 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -4934,20 +5022,20 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = (!PyDataType_HASFIELDS(__pyx_v_child)); if (__pyx_t_6) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":809 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":808 * * if not PyDataType_HASFIELDS(child): * t = child.type_num # <<<<<<<<<<<<<< * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") */ - __pyx_t_3 = PyInt_FromLong(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_v_t); __pyx_v_t = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":810 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":809 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -4957,288 +5045,288 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = ((__pyx_v_end - __pyx_v_f) < 5); if (__pyx_t_6) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":811 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":810 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_kp_u_10)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_u_10)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_10)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L10; } __pyx_L10:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":814 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":813 * * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" */ - __pyx_t_5 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 98; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":815 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":814 * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" */ - __pyx_t_3 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 66; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":816 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":815 * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" */ - __pyx_t_5 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 104; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":817 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":816 * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" */ - __pyx_t_3 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 72; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":818 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":817 * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" */ - __pyx_t_5 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 105; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":819 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":818 * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" */ - __pyx_t_3 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 73; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":820 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":819 * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" */ - __pyx_t_5 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 108; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":821 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":820 * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" */ - __pyx_t_3 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 76; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":822 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":821 * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" */ - __pyx_t_5 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 113; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":823 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":822 * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" */ - __pyx_t_3 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 81; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":824 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":823 * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" */ - __pyx_t_5 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 102; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":825 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":824 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf */ - __pyx_t_3 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 100; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":826 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":825 * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd */ - __pyx_t_5 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 103; goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":827 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":826 * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg */ - __pyx_t_3 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -5247,19 +5335,19 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":828 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":827 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg * elif t == NPY_OBJECT: f[0] = 79 #"O" */ - __pyx_t_5 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -5268,19 +5356,19 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":829 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":828 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: */ - __pyx_t_3 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -5289,19 +5377,19 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":830 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":829 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) */ - __pyx_t_5 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 79; @@ -5309,30 +5397,30 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } /*else*/ { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":832 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":831 * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< * f += 1 * else: */ - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_8), __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_8), __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L11:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":833 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":832 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * f += 1 # <<<<<<<<<<<<<< @@ -5344,21 +5432,21 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } /*else*/ { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":837 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":836 * # Cython ignores struct boundary information ("T{...}"), * # so don't output it * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< * return f * */ - __pyx_t_10 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_f = __pyx_t_10; } __pyx_L9:; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":838 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":837 * # so don't output it * f = _util_dtypestring(child, f, end, offset) * return f # <<<<<<<<<<<<<< @@ -5383,11 +5471,12 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_v_childname); __Pyx_DECREF(__pyx_v_new_offset); __Pyx_DECREF(__pyx_v_t); + __Pyx_DECREF((PyObject *)__pyx_v_descr); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":953 +/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":952 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -5399,8 +5488,10 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a PyObject *__pyx_v_baseptr; int __pyx_t_1; __Pyx_RefNannySetupContext("set_array_base"); + __Pyx_INCREF((PyObject *)__pyx_v_arr); + __Pyx_INCREF(__pyx_v_base); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":955 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":954 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -5410,7 +5501,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __pyx_t_1 = (__pyx_v_base == Py_None); if (__pyx_t_1) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":956 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":955 * cdef PyObject* baseptr * if base is None: * baseptr = NULL # <<<<<<<<<<<<<< @@ -5422,7 +5513,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } /*else*/ { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":958 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":957 * baseptr = NULL * else: * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< @@ -5431,7 +5522,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_INCREF(__pyx_v_base); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":959 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":958 * else: * Py_INCREF(base) # important to do this before decref below! * baseptr = <PyObject*>base # <<<<<<<<<<<<<< @@ -5442,7 +5533,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } __pyx_L3:; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":960 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":959 * Py_INCREF(base) # important to do this before decref below! * baseptr = <PyObject*>base * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< @@ -5451,7 +5542,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_XDECREF(__pyx_v_arr->base); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":961 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":960 * baseptr = <PyObject*>base * Py_XDECREF(arr.base) * arr.base = baseptr # <<<<<<<<<<<<<< @@ -5460,10 +5551,12 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ __pyx_v_arr->base = __pyx_v_baseptr; + __Pyx_DECREF((PyObject *)__pyx_v_arr); + __Pyx_DECREF(__pyx_v_base); __Pyx_RefNannyFinishContext(); } -/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":963 +/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":962 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -5475,8 +5568,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py PyObject *__pyx_r = NULL; int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base"); + __Pyx_INCREF((PyObject *)__pyx_v_arr); - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":964 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":963 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -5486,7 +5580,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_t_1 = (__pyx_v_arr->base == NULL); if (__pyx_t_1) { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":965 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":964 * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: * return None # <<<<<<<<<<<<<< @@ -5501,7 +5595,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py } /*else*/ { - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":967 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":966 * return None * else: * return <object>arr.base # <<<<<<<<<<<<<< @@ -5515,19 +5609,22 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = Py_None; __Pyx_INCREF(Py_None); __pyx_L0:; + __Pyx_DECREF((PyObject *)__pyx_v_arr); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyMethodDef __pyx_methods[] = { - {__Pyx_NAMESTR("libsvm_sparse_train"), (PyCFunction)__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_train)}, - {__Pyx_NAMESTR("libsvm_sparse_predict"), (PyCFunction)__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_predict, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_predict)}, - {__Pyx_NAMESTR("libsvm_sparse_predict_proba"), (PyCFunction)__pyx_pf_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_predict_proba, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7sklearn_3svm_6sparse_6libsvm_libsvm_sparse_predict_proba)}, - {__Pyx_NAMESTR("set_verbosity_wrap"), (PyCFunction)__pyx_pf_7sklearn_3svm_6sparse_6libsvm_set_verbosity_wrap, METH_O, __Pyx_DOCSTR(__pyx_doc_7sklearn_3svm_6sparse_6libsvm_set_verbosity_wrap)}, +static struct PyMethodDef __pyx_methods[] = { + {__Pyx_NAMESTR("libsvm_sparse_train"), (PyCFunction)__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_train, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_train)}, + {__Pyx_NAMESTR("libsvm_sparse_predict"), (PyCFunction)__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_predict, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_predict)}, + {__Pyx_NAMESTR("libsvm_sparse_predict_proba"), (PyCFunction)__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_predict_proba, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_predict_proba)}, + {__Pyx_NAMESTR("set_verbosity_wrap"), (PyCFunction)__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_set_verbosity_wrap, METH_O, __Pyx_DOCSTR(__pyx_doc_7scikits_5learn_3svm_6sparse_6libsvm_set_verbosity_wrap)}, {0, 0, 0, 0} }; +static void __pyx_init_filenames(void); /*proto*/ + #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { PyModuleDef_HEAD_INIT, @@ -5631,8 +5728,8 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_MemoryError = __Pyx_GetName(__pyx_b, __pyx_n_s__MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; @@ -5670,10 +5767,12 @@ PyMODINIT_FUNC PyInit_libsvm(void) } __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit_libsvm(void)", __LINE__, __FILE__); #endif + __pyx_init_filenames(); __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if PY_MAJOR_VERSION < 3 + __pyx_empty_bytes = PyString_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #ifdef __pyx_binding_PyCFunctionType_USED - if (__pyx_binding_PyCFunctionType_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ @@ -5697,7 +5796,7 @@ PyMODINIT_FUNC PyInit_libsvm(void) if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_module_is_main_sklearn__svm__sparse__libsvm) { + if (__pyx_module_is_main_scikits__learn__svm__sparse__libsvm) { if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; } /*--- Builtin init code ---*/ @@ -5706,15 +5805,15 @@ PyMODINIT_FUNC PyInit_libsvm(void) /*--- Function export code ---*/ /*--- Type init code ---*/ /*--- Type import code ---*/ - __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Function import code ---*/ /*--- Execution code ---*/ - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":2 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":2 * * import numpy as np # <<<<<<<<<<<<<< * cimport numpy as np @@ -5725,7 +5824,7 @@ PyMODINIT_FUNC PyInit_libsvm(void) if (PyObject_SetAttr(__pyx_m, __pyx_n_s__np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":320 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":320 * * * def set_verbosity_wrap(int verbosity): # <<<<<<<<<<<<<< @@ -5735,7 +5834,7 @@ PyMODINIT_FUNC PyInit_libsvm(void) __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":2 + /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":2 * * import numpy as np # <<<<<<<<<<<<<< * cimport numpy as np @@ -5743,28 +5842,28 @@ PyMODINIT_FUNC PyInit_libsvm(void) */ __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__libsvm_sparse_train); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_2, "__doc__"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_2, "__doc__"); __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_11), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s_13); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_12), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s_15); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_2, "__doc__"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_2, "__doc__"); __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_14), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s__set_verbosity_wrap); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_16), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -5772,10 +5871,10 @@ PyMODINIT_FUNC PyInit_libsvm(void) if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/libc/stdio.pxd":1 - * # 7.19 Input/output <stdio.h> # <<<<<<<<<<<<<< - * - * cdef extern from *: + /* "/usr/lib/pymodules/python2.6/Cython/Includes/python_ref.pxd":1 + * cdef extern from "Python.h": # <<<<<<<<<<<<<< + * ctypedef struct PyTypeObject + * ctypedef struct PyObject: */ goto __pyx_L0; __pyx_L1_error:; @@ -5783,10 +5882,10 @@ PyMODINIT_FUNC PyInit_libsvm(void) __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); if (__pyx_m) { - __Pyx_AddTraceback("init sklearn.svm.sparse.libsvm"); + __Pyx_AddTraceback("init scikits.learn.svm.sparse.libsvm"); Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init sklearn.svm.sparse.libsvm"); + PyErr_SetString(PyExc_ImportError, "init scikits.learn.svm.sparse.libsvm"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); @@ -5797,14 +5896,15 @@ PyMODINIT_FUNC PyInit_libsvm(void) #endif } +static const char *__pyx_filenames[] = { + "libsvm.pyx", + "numpy.pxd", +}; + /* Runtime support code */ -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { - PyObject *result; - result = PyObject_GetAttr(dict, name); - if (!result) - PyErr_SetObject(PyExc_NameError, name); - return result; +static void __pyx_init_filenames(void) { + __pyx_f = __pyx_filenames; } static void __Pyx_RaiseDoubleKeywordsError( @@ -5929,26 +6029,6 @@ bad: return -1; } -static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact) -{ - if (!type) { - PyErr_Format(PyExc_SystemError, "Missing type object"); - return 0; - } - if (none_allowed && obj == Py_None) return 1; - else if (exact) { - if (Py_TYPE(obj) == type) return 1; - } - else { - if (PyObject_TypeCheck(obj, type)) return 1; - } - PyErr_Format(PyExc_TypeError, - "Argument '%s' has incorrect type (expected %s, got %s)", - name, type->tp_name, Py_TYPE(obj)->tp_name); - return 0; -} - static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { unsigned int n = 1; return *(unsigned char*)(&n) != 0; @@ -6354,7 +6434,7 @@ static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) { buf->suboffsets = __Pyx_minusones; } -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 int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack) { if (obj == Py_None) { __Pyx_ZeroBuffer(buf); return 0; @@ -6445,10 +6525,6 @@ static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyOb } -static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); -} - static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, #if PY_VERSION_HEX < 0x02050000 @@ -6459,13 +6535,35 @@ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { (index == 1) ? "" : "s"); } -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { - PyErr_Format(PyExc_ValueError, - #if PY_VERSION_HEX < 0x02050000 - "too many values to unpack (expected %d)", (int)expected); - #else - "too many values to unpack (expected %zd)", expected); - #endif +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(void) { + PyErr_SetString(PyExc_ValueError, "too many values to unpack"); +} + +static PyObject *__Pyx_UnpackItem(PyObject *iter, Py_ssize_t index) { + PyObject *item; + if (!(item = PyIter_Next(iter))) { + if (!PyErr_Occurred()) { + __Pyx_RaiseNeedMoreValuesError(index); + } + } + return item; +} + +static int __Pyx_EndUnpack(PyObject *iter) { + PyObject *item; + if ((item = PyIter_Next(iter))) { + Py_DECREF(item); + __Pyx_RaiseTooManyValuesError(); + return -1; + } + else if (!PyErr_Occurred()) + return 0; + else + return -1; +} + +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { @@ -6474,8 +6572,28 @@ static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { } else if (PyTuple_GET_SIZE(t) < index) { __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); } else { - __Pyx_RaiseTooManyValuesError(index); + __Pyx_RaiseTooManyValuesError(); + } +} + +static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact) +{ + if (!type) { + PyErr_Format(PyExc_SystemError, "Missing type object"); + return 0; + } + if (none_allowed && obj == Py_None) return 1; + else if (exact) { + if (Py_TYPE(obj) == type) return 1; } + else { + if (PyObject_TypeCheck(obj, type)) return 1; + } + PyErr_Format(PyExc_TypeError, + "Argument '%s' has incorrect type (expected %s, got %s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); + return 0; } #if PY_MAJOR_VERSION < 3 @@ -6503,14 +6621,14 @@ if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pf_5numpy_7ndarra #endif static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) { - PyObject *py_import = 0; + PyObject *__import__ = 0; PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; - py_import = __Pyx_GetAttrString(__pyx_b, "__import__"); - if (!py_import) + __import__ = __Pyx_GetAttrString(__pyx_b, "__import__"); + if (!__import__) goto bad; if (from_list) list = from_list; @@ -6526,37 +6644,38 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) { empty_dict = PyDict_New(); if (!empty_dict) goto bad; - module = PyObject_CallFunctionObjArgs(py_import, + module = PyObject_CallFunctionObjArgs(__import__, name, global_dict, empty_dict, list, NULL); bad: Py_XDECREF(empty_list); - Py_XDECREF(py_import); + Py_XDECREF(__import__); Py_XDECREF(empty_dict); return module; } -static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_Py_intptr_t(Py_intptr_t val) { - const Py_intptr_t neg_one = (Py_intptr_t)-1, const_zero = (Py_intptr_t)0; - const int is_unsigned = const_zero < neg_one; - if ((sizeof(Py_intptr_t) == sizeof(char)) || - (sizeof(Py_intptr_t) == sizeof(short))) { +static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { + PyObject *result; + result = PyObject_GetAttr(dict, name); + if (!result) + PyErr_SetObject(PyExc_NameError, name); + return result; +} + +static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_npy_intp(npy_intp val) { + const npy_intp neg_one = (npy_intp)-1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (sizeof(npy_intp) < sizeof(long)) { return PyInt_FromLong((long)val); - } else if ((sizeof(Py_intptr_t) == sizeof(int)) || - (sizeof(Py_intptr_t) == sizeof(long))) { + } else if (sizeof(npy_intp) == sizeof(long)) { if (is_unsigned) return PyLong_FromUnsignedLong((unsigned long)val); else return PyInt_FromLong((long)val); - } else if (sizeof(Py_intptr_t) == sizeof(PY_LONG_LONG)) { + } else { /* (sizeof(npy_intp) > sizeof(long)) */ if (is_unsigned) return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val); else return PyLong_FromLongLong((PY_LONG_LONG)val); - } else { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - return _PyLong_FromByteArray(bytes, sizeof(Py_intptr_t), - little, !is_unsigned); } } @@ -6991,25 +7110,6 @@ static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) { return (signed int)__Pyx_PyInt_AsSignedLong(x); } -static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) { - const int neg_one = (int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to int" : - "value too large to convert to int"); - } - return (int)-1; - } - return (int)val; - } - return (int)__Pyx_PyInt_AsLong(x); -} - static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) { const unsigned long neg_one = (unsigned long)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; @@ -7257,11 +7357,7 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility", module_name, class_name); - #if PY_VERSION_HEX < 0x02050000 - PyErr_Warn(NULL, warning); - #else PyErr_WarnEx(NULL, warning, 0); - #endif } else if (((PyTypeObject *)result)->tp_basicsize != size) { PyErr_Format(PyExc_ValueError, @@ -7402,8 +7498,8 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { /* Type Conversion Functions */ static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - int is_true = x == Py_True; - if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + if (x == Py_True) return 1; + else if ((x == Py_False) | (x == Py_None)) return 0; else return PyObject_IsTrue(x); } diff --git a/sklearn/svm/sparse/libsvm.pyx b/scikits/learn/svm/sparse/libsvm.pyx similarity index 100% rename from sklearn/svm/sparse/libsvm.pyx rename to scikits/learn/svm/sparse/libsvm.pyx diff --git a/sklearn/svm/sparse/setup.py b/scikits/learn/svm/sparse/setup.py similarity index 100% rename from sklearn/svm/sparse/setup.py rename to scikits/learn/svm/sparse/setup.py diff --git a/sklearn/svm/src/blas/Makefile b/scikits/learn/svm/src/blas/Makefile similarity index 100% rename from sklearn/svm/src/blas/Makefile rename to scikits/learn/svm/src/blas/Makefile diff --git a/sklearn/svm/src/blas/blas.h b/scikits/learn/svm/src/blas/blas.h similarity index 100% rename from sklearn/svm/src/blas/blas.h rename to scikits/learn/svm/src/blas/blas.h diff --git a/sklearn/svm/src/blas/blasp.h b/scikits/learn/svm/src/blas/blasp.h similarity index 100% rename from sklearn/svm/src/blas/blasp.h rename to scikits/learn/svm/src/blas/blasp.h diff --git a/sklearn/svm/src/blas/daxpy.c b/scikits/learn/svm/src/blas/daxpy.c similarity index 100% rename from sklearn/svm/src/blas/daxpy.c rename to scikits/learn/svm/src/blas/daxpy.c diff --git a/sklearn/svm/src/blas/ddot.c b/scikits/learn/svm/src/blas/ddot.c similarity index 100% rename from sklearn/svm/src/blas/ddot.c rename to scikits/learn/svm/src/blas/ddot.c diff --git a/sklearn/svm/src/blas/dnrm2.c b/scikits/learn/svm/src/blas/dnrm2.c similarity index 100% rename from sklearn/svm/src/blas/dnrm2.c rename to scikits/learn/svm/src/blas/dnrm2.c diff --git a/sklearn/svm/src/blas/dscal.c b/scikits/learn/svm/src/blas/dscal.c similarity index 100% rename from sklearn/svm/src/blas/dscal.c rename to scikits/learn/svm/src/blas/dscal.c diff --git a/sklearn/svm/src/liblinear/COPYRIGHT b/scikits/learn/svm/src/liblinear/COPYRIGHT similarity index 100% rename from sklearn/svm/src/liblinear/COPYRIGHT rename to scikits/learn/svm/src/liblinear/COPYRIGHT diff --git a/sklearn/svm/src/liblinear/LIBLINEAR_CHANGES b/scikits/learn/svm/src/liblinear/LIBLINEAR_CHANGES similarity index 100% rename from sklearn/svm/src/liblinear/LIBLINEAR_CHANGES rename to scikits/learn/svm/src/liblinear/LIBLINEAR_CHANGES diff --git a/sklearn/svm/src/liblinear/liblinear_helper.c b/scikits/learn/svm/src/liblinear/liblinear_helper.c similarity index 100% rename from sklearn/svm/src/liblinear/liblinear_helper.c rename to scikits/learn/svm/src/liblinear/liblinear_helper.c diff --git a/sklearn/svm/src/liblinear/linear.cpp b/scikits/learn/svm/src/liblinear/linear.cpp similarity index 100% rename from sklearn/svm/src/liblinear/linear.cpp rename to scikits/learn/svm/src/liblinear/linear.cpp diff --git a/sklearn/svm/src/liblinear/linear.h b/scikits/learn/svm/src/liblinear/linear.h similarity index 100% rename from sklearn/svm/src/liblinear/linear.h rename to scikits/learn/svm/src/liblinear/linear.h diff --git a/sklearn/svm/src/liblinear/tron.cpp b/scikits/learn/svm/src/liblinear/tron.cpp similarity index 100% rename from sklearn/svm/src/liblinear/tron.cpp rename to scikits/learn/svm/src/liblinear/tron.cpp diff --git a/sklearn/svm/src/liblinear/tron.h b/scikits/learn/svm/src/liblinear/tron.h similarity index 100% rename from sklearn/svm/src/liblinear/tron.h rename to scikits/learn/svm/src/liblinear/tron.h diff --git a/sklearn/svm/src/libsvm/LIBSVM_CHANGES b/scikits/learn/svm/src/libsvm/LIBSVM_CHANGES similarity index 100% rename from sklearn/svm/src/libsvm/LIBSVM_CHANGES rename to scikits/learn/svm/src/libsvm/LIBSVM_CHANGES diff --git a/sklearn/svm/src/libsvm/_libsvm_sparse.c b/scikits/learn/svm/src/libsvm/_libsvm_sparse.c similarity index 100% rename from sklearn/svm/src/libsvm/_libsvm_sparse.c rename to scikits/learn/svm/src/libsvm/_libsvm_sparse.c diff --git a/sklearn/svm/src/libsvm/libsvm_helper.c b/scikits/learn/svm/src/libsvm/libsvm_helper.c similarity index 100% rename from sklearn/svm/src/libsvm/libsvm_helper.c rename to scikits/learn/svm/src/libsvm/libsvm_helper.c diff --git a/sklearn/svm/src/libsvm/libsvm_sparse_helper.c b/scikits/learn/svm/src/libsvm/libsvm_sparse_helper.c similarity index 100% rename from sklearn/svm/src/libsvm/libsvm_sparse_helper.c rename to scikits/learn/svm/src/libsvm/libsvm_sparse_helper.c diff --git a/sklearn/svm/src/libsvm/libsvm_template.cpp b/scikits/learn/svm/src/libsvm/libsvm_template.cpp similarity index 100% rename from sklearn/svm/src/libsvm/libsvm_template.cpp rename to scikits/learn/svm/src/libsvm/libsvm_template.cpp diff --git a/sklearn/svm/src/libsvm/svm.cpp b/scikits/learn/svm/src/libsvm/svm.cpp similarity index 100% rename from sklearn/svm/src/libsvm/svm.cpp rename to scikits/learn/svm/src/libsvm/svm.cpp diff --git a/sklearn/svm/src/libsvm/svm.h b/scikits/learn/svm/src/libsvm/svm.h similarity index 100% rename from sklearn/svm/src/libsvm/svm.h rename to scikits/learn/svm/src/libsvm/svm.h diff --git a/sklearn/svm/tests/__init__.py b/scikits/learn/svm/tests/__init__.py similarity index 100% rename from sklearn/svm/tests/__init__.py rename to scikits/learn/svm/tests/__init__.py diff --git a/sklearn/svm/tests/test_bounds.py b/scikits/learn/svm/tests/test_bounds.py similarity index 87% rename from sklearn/svm/tests/test_bounds.py rename to scikits/learn/svm/tests/test_bounds.py index 2ed8d94a4d9c8cb2d621e4b7033b3d68a28474e9..141171e292f35b028dfc1d16543f9349bde51e52 100644 --- a/sklearn/svm/tests/test_bounds.py +++ b/scikits/learn/svm/tests/test_bounds.py @@ -3,11 +3,11 @@ import nose import numpy as np from scipy import sparse as sp -from sklearn.svm.bounds import l1_min_c -from sklearn.svm import LinearSVC -from sklearn.linear_model.logistic import LogisticRegression -from sklearn.svm.sparse import LinearSVC as SparseSVC -from sklearn.linear_model.sparse.logistic import LogisticRegression as \ +from scikits.learn.svm.bounds import l1_min_c +from scikits.learn.svm import LinearSVC +from scikits.learn.linear_model.logistic import LogisticRegression +from scikits.learn.svm.sparse import LinearSVC as SparseSVC +from scikits.learn.linear_model.sparse.logistic import LogisticRegression as \ SparseLogRegression diff --git a/sklearn/svm/tests/test_sparse.py b/scikits/learn/svm/tests/test_sparse.py similarity index 98% rename from sklearn/svm/tests/test_sparse.py rename to scikits/learn/svm/tests/test_sparse.py index fd5f3335e8881da7e2b81fa8ce310c4a7c352786..39bed65f294c006e8890f18aaff78208aa23e0e9 100644 --- a/sklearn/svm/tests/test_sparse.py +++ b/scikits/learn/svm/tests/test_sparse.py @@ -1,11 +1,11 @@ import numpy as np import scipy.sparse -from sklearn import datasets, svm, linear_model +from scikits.learn import datasets, svm, linear_model from numpy.testing import assert_array_almost_equal, \ assert_array_equal, assert_equal from nose.tools import assert_raises -from sklearn.datasets.samples_generator import make_classification +from scikits.learn.datasets.samples_generator import make_classification from . import test_svm # test sample 1 diff --git a/sklearn/svm/tests/test_svm.py b/scikits/learn/svm/tests/test_svm.py similarity index 97% rename from sklearn/svm/tests/test_svm.py rename to scikits/learn/svm/tests/test_svm.py index 2f9d42bd7f05c104f3389aafa790b724da3b818f..6f200757c3c89fbda1e82dd57ddc5f3f818da1c6 100644 --- a/sklearn/svm/tests/test_svm.py +++ b/scikits/learn/svm/tests/test_svm.py @@ -1,5 +1,5 @@ """ -Testing for Support Vector Machine module (sklearn.svm) +Testing for Support Vector Machine module (scikits.learn.svm) TODO: remove hard coded numerical results when possible """ @@ -9,8 +9,8 @@ from numpy.testing import assert_array_equal, assert_array_almost_equal, \ assert_almost_equal from nose.tools import assert_raises -from sklearn import svm, linear_model, datasets, metrics -from sklearn.datasets.samples_generator import make_classification +from scikits.learn import svm, linear_model, datasets, metrics +from scikits.learn.datasets.samples_generator import make_classification # toy sample X = [[-2, -1], [-1, -1], [-1, -2], [1, 1], [1, 2], [2, 1]] @@ -279,11 +279,11 @@ def test_sample_weights(): def test_auto_weight(): """Test class weights for imbalanced data""" - from sklearn.linear_model import LogisticRegression + from scikits.learn.linear_model import LogisticRegression # we take as dataset a the two-dimensional projection of iris so # that it is not separable and remove half of predictors from # class 1 - from sklearn.svm.base import _get_class_weight + from scikits.learn.svm.base import _get_class_weight X, y = iris.data[:, :2], iris.target unbalanced = np.delete(np.arange(y.size), np.where(y > 1)[0][::2]) diff --git a/sklearn/tests/__init__.py b/scikits/learn/tests/__init__.py similarity index 100% rename from sklearn/tests/__init__.py rename to scikits/learn/tests/__init__.py diff --git a/sklearn/tests/test_base.py b/scikits/learn/tests/test_base.py similarity index 95% rename from sklearn/tests/test_base.py rename to scikits/learn/tests/test_base.py index a19650b32d9d84dc75381b363e9fe3c94e72b9f7..4d1fb4ab572b3b7e9797b2f64c0de3fb91a42375 100644 --- a/sklearn/tests/test_base.py +++ b/scikits/learn/tests/test_base.py @@ -40,7 +40,7 @@ def test_clone(): and check that the obtained copy is a correct deep copy. """ - from sklearn.feature_selection import SelectFpr, f_classif + from scikits.learn.feature_selection import SelectFpr, f_classif selector = SelectFpr(f_classif, alpha=0.1) new_selector = clone(selector) @@ -56,7 +56,7 @@ def test_clone_2(): the specific attribute we manually added to the initial estimator. """ - from sklearn.feature_selection import SelectFpr, f_classif + from scikits.learn.feature_selection import SelectFpr, f_classif selector = SelectFpr(f_classif, alpha=0.1) selector.own_attribute = "test" diff --git a/sklearn/tests/test_cross_val.py b/scikits/learn/tests/test_cross_val.py similarity index 100% rename from sklearn/tests/test_cross_val.py rename to scikits/learn/tests/test_cross_val.py diff --git a/sklearn/tests/test_grid_search.py b/scikits/learn/tests/test_grid_search.py similarity index 88% rename from sklearn/tests/test_grid_search.py rename to scikits/learn/tests/test_grid_search.py index 3cef223727319e9307605dfc12daa3286cdfb966..83e18ab46766ddf0bbfc928c47db1db50312e4d0 100644 --- a/sklearn/tests/test_grid_search.py +++ b/scikits/learn/tests/test_grid_search.py @@ -1,5 +1,5 @@ """ -Testing for grid search module (sklearn.grid_search) +Testing for grid search module (scikits.learn.grid_search) """ from nose.tools import assert_equal, assert_raises @@ -8,12 +8,12 @@ from numpy.testing import assert_array_equal import numpy as np import scipy.sparse as sp -from sklearn.base import BaseEstimator -from sklearn.grid_search import GridSearchCV -from sklearn.datasets.samples_generator import make_classification -from sklearn.svm import LinearSVC -from sklearn.svm.sparse import LinearSVC as SparseLinearSVC -from sklearn.metrics import f1_score +from scikits.learn.base import BaseEstimator +from scikits.learn.grid_search import GridSearchCV +from scikits.learn.datasets.samples_generator import make_classification +from scikits.learn.svm import LinearSVC +from scikits.learn.svm.sparse import LinearSVC as SparseLinearSVC +from scikits.learn.metrics import f1_score class MockClassifier(BaseEstimator): diff --git a/sklearn/tests/test_hmm.py b/scikits/learn/tests/test_hmm.py similarity index 99% rename from sklearn/tests/test_hmm.py rename to scikits/learn/tests/test_hmm.py index 7a4e9f755b2ea84b34aaafa71651fc4cd3d53b0a..3400b2695fcaa36a1797e81328ff3798e8cdc9cc 100644 --- a/sklearn/tests/test_hmm.py +++ b/scikits/learn/tests/test_hmm.py @@ -3,9 +3,9 @@ import numpy as np from numpy.testing import assert_array_equal, assert_array_almost_equal from unittest import TestCase -from sklearn.datasets.samples_generator import make_spd_matrix -from sklearn import hmm -from sklearn.utils.extmath import logsum +from scikits.learn.datasets.samples_generator import make_spd_matrix +from scikits.learn import hmm +from scikits.learn.utils.extmath import logsum np.seterr(all='warn') @@ -522,7 +522,7 @@ class TestMultinomialHMM(MultinomialHMMParams, def create_random_gmm(n_mix, n_features, cvtype, prng=prng): - from sklearn import mixture + from scikits.learn import mixture g = mixture.GMM(n_mix, cvtype=cvtype) g.means = prng.randint(-20, 20, (n_mix, n_features)) diff --git a/sklearn/tests/test_init.py b/scikits/learn/tests/test_init.py similarity index 94% rename from sklearn/tests/test_init.py rename to scikits/learn/tests/test_init.py index 18fb44b2a0601732fef3be269a53da7913158f99..ece6bbd0e6df8d776d99ac3ddcedb1c463a3798b 100644 --- a/sklearn/tests/test_init.py +++ b/scikits/learn/tests/test_init.py @@ -10,7 +10,7 @@ __license__ = 'BSD' from nose.tools import assert_equal try: - from sklearn import * + from scikits.learn import * _top_import_error = None except Exception, e: _top_import_error = e diff --git a/sklearn/tests/test_lda.py b/scikits/learn/tests/test_lda.py similarity index 100% rename from sklearn/tests/test_lda.py rename to scikits/learn/tests/test_lda.py diff --git a/sklearn/tests/test_multiclass.py b/scikits/learn/tests/test_multiclass.py similarity index 89% rename from sklearn/tests/test_multiclass.py rename to scikits/learn/tests/test_multiclass.py index d386f24fe5c49e70d00022ce508f18b11be19462..e1a28dd2f1520f576da5ab246ab8e539d17b59e8 100644 --- a/sklearn/tests/test_multiclass.py +++ b/scikits/learn/tests/test_multiclass.py @@ -7,13 +7,13 @@ from nose.tools import assert_equal from nose.tools import assert_true from nose.tools import assert_raises -from sklearn.multiclass import OneVsRestClassifier -from sklearn.multiclass import OneVsOneClassifier -from sklearn.multiclass import OutputCodeClassifier -from sklearn.svm import LinearSVC -from sklearn.naive_bayes import MultinomialNB -from sklearn.grid_search import GridSearchCV -from sklearn import datasets +from scikits.learn.multiclass import OneVsRestClassifier +from scikits.learn.multiclass import OneVsOneClassifier +from scikits.learn.multiclass import OutputCodeClassifier +from scikits.learn.svm import LinearSVC +from scikits.learn.naive_bayes import MultinomialNB +from scikits.learn.grid_search import GridSearchCV +from scikits.learn import datasets iris = datasets.load_iris() perm = np.random.permutation(iris.target.size) diff --git a/sklearn/tests/test_naive_bayes.py b/scikits/learn/tests/test_naive_bayes.py similarity index 100% rename from sklearn/tests/test_naive_bayes.py rename to scikits/learn/tests/test_naive_bayes.py diff --git a/sklearn/tests/test_neighbors.py b/scikits/learn/tests/test_neighbors.py similarity index 99% rename from sklearn/tests/test_neighbors.py rename to scikits/learn/tests/test_neighbors.py index df1d1a7881385ef80c10eb6066c723444eca2a24..be5d228fc5c88347b3ccd5f2941dcb93d8332bdb 100644 --- a/sklearn/tests/test_neighbors.py +++ b/scikits/learn/tests/test_neighbors.py @@ -3,7 +3,7 @@ from numpy.testing import assert_array_almost_equal, assert_array_equal from scipy.sparse import (bsr_matrix, coo_matrix, csc_matrix, csr_matrix, dok_matrix, lil_matrix) -from sklearn import neighbors, datasets, ball_tree +from scikits.learn import neighbors, datasets, ball_tree # load and shuffle iris dataset iris = datasets.load_iris() diff --git a/sklearn/tests/test_pipeline.py b/scikits/learn/tests/test_pipeline.py similarity index 100% rename from sklearn/tests/test_pipeline.py rename to scikits/learn/tests/test_pipeline.py diff --git a/sklearn/tests/test_pls.py b/scikits/learn/tests/test_pls.py similarity index 98% rename from sklearn/tests/test_pls.py rename to scikits/learn/tests/test_pls.py index 8d51c090f5666e7e5105e9a3f0e8191de5136633..b227337caf02f4a9b88ca1cd4c86eea604872bd2 100644 --- a/sklearn/tests/test_pls.py +++ b/scikits/learn/tests/test_pls.py @@ -1,7 +1,7 @@ import numpy as np from numpy.testing import assert_array_almost_equal -from sklearn.datasets import load_linnerud -from sklearn import pls +from scikits.learn.datasets import load_linnerud +from scikits.learn import pls d = load_linnerud() X = d['data_exercise'] diff --git a/sklearn/tests/test_qda.py b/scikits/learn/tests/test_qda.py similarity index 100% rename from sklearn/tests/test_qda.py rename to scikits/learn/tests/test_qda.py diff --git a/sklearn/utils/__init__.py b/scikits/learn/utils/__init__.py similarity index 97% rename from sklearn/utils/__init__.py rename to scikits/learn/utils/__init__.py index 4d4dac86e033b2c93aa914a604ac0c0175233394..4921a34e80175cfa1ccc07fe62d8279feef1fbb5 100644 --- a/sklearn/utils/__init__.py +++ b/scikits/learn/utils/__init__.py @@ -166,7 +166,7 @@ class deprecated(object): and the docstring. Note: to use this with the default value for extra, put in an empty of parentheses: - >>> from sklearn.utils import deprecated + >>> from scikits.learn.utils import deprecated >>> @deprecated() ... def some_function(): pass @@ -271,7 +271,7 @@ def resample(*arrays, **options): >>> from scipy.sparse import coo_matrix >>> X_sparse = coo_matrix(X) - >>> from sklearn.utils import resample + >>> from scikits.learn.utils import resample >>> X, X_sparse, y = resample(X, X_sparse, y, random_state=0) >>> X array([[ 1., 0.], @@ -296,8 +296,8 @@ def resample(*arrays, **options): See also -------- - :class:`sklearn.cross_val.Bootstrap` - :func:`sklearn.utils.shuffle` + :class:`scikits.learn.cross_val.Bootstrap` + :func:`scikits.learn.utils.shuffle` """ random_state = check_random_state(options.pop('random_state', None)) replace = options.pop('replace', True) @@ -374,7 +374,7 @@ def shuffle(*arrays, **options): >>> from scipy.sparse import coo_matrix >>> X_sparse = coo_matrix(X) - >>> from sklearn.utils import shuffle + >>> from scikits.learn.utils import shuffle >>> X, X_sparse, y = shuffle(X, X_sparse, y, random_state=0) >>> X array([[ 0., 0.], @@ -398,7 +398,7 @@ def shuffle(*arrays, **options): See also -------- - :func:`sklearn.utils.resample` + :func:`scikits.learn.utils.resample` """ options['replace'] = False return resample(*arrays, **options) @@ -409,7 +409,7 @@ def gen_even_slices(n, n_packs): Examples -------- - >>> from sklearn.utils import gen_even_slices + >>> from scikits.learn.utils import gen_even_slices >>> list(gen_even_slices(10, 1)) [slice(0, 10, None)] >>> list(gen_even_slices(10, 10)) #doctest: +ELLIPSIS diff --git a/sklearn/utils/_csgraph.py b/scikits/learn/utils/_csgraph.py similarity index 100% rename from sklearn/utils/_csgraph.py rename to scikits/learn/utils/_csgraph.py diff --git a/sklearn/utils/arpack.py b/scikits/learn/utils/arpack.py similarity index 99% rename from sklearn/utils/arpack.py rename to scikits/learn/utils/arpack.py index c1a90a38ef33f465d36cb35b9823e616658fc3dd..d0814c1ec30e338e9fe84a468e729bf92327d524 100644 --- a/sklearn/utils/arpack.py +++ b/scikits/learn/utils/arpack.py @@ -1161,7 +1161,7 @@ def eigs(A, k=6, M=None, sigma=None, which='LM', v0=None, -------- Find 6 eigenvectors of the identity matrix: - >>> from sklearn.utils.arpack import eigs + >>> from scikits.learn.utils.arpack import eigs >>> id = np.identity(13) >>> vals, vecs = eigs(id, k=6) >>> vals @@ -1399,7 +1399,7 @@ def eigsh(A, k=6, M=None, sigma=None, which='LM', v0=None, Examples -------- - >>> from sklearn.utils.arpack import eigsh + >>> from scikits.learn.utils.arpack import eigsh >>> id = np.identity(13) >>> vals, vecs = eigsh(id, k=6) >>> vals # doctest: +SKIP diff --git a/sklearn/utils/arrayfuncs.c b/scikits/learn/utils/arrayfuncs.c similarity index 100% rename from sklearn/utils/arrayfuncs.c rename to scikits/learn/utils/arrayfuncs.c diff --git a/sklearn/utils/arrayfuncs.pyx b/scikits/learn/utils/arrayfuncs.pyx similarity index 100% rename from sklearn/utils/arrayfuncs.pyx rename to scikits/learn/utils/arrayfuncs.pyx diff --git a/sklearn/utils/bench.py b/scikits/learn/utils/bench.py similarity index 100% rename from sklearn/utils/bench.py rename to scikits/learn/utils/bench.py diff --git a/sklearn/utils/extmath.py b/scikits/learn/utils/extmath.py similarity index 99% rename from sklearn/utils/extmath.py rename to scikits/learn/utils/extmath.py index 1cb006e38c62f1dccfdfda221ad2a14af35c1bab..b4a085c2f118533ac94c090fcc86f7ffb66f85fa 100644 --- a/sklearn/utils/extmath.py +++ b/scikits/learn/utils/extmath.py @@ -220,7 +220,7 @@ def logsum(arr, axis=0): ======== >>> import numpy as np - >>> from sklearn.utils.extmath import logsum + >>> from scikits.learn.utils.extmath import logsum >>> a = np.arange(10) >>> np.log(np.sum(np.exp(a))) 9.4586297444267107 diff --git a/sklearn/utils/fixes.py b/scikits/learn/utils/fixes.py similarity index 100% rename from sklearn/utils/fixes.py rename to scikits/learn/utils/fixes.py diff --git a/sklearn/utils/graph.py b/scikits/learn/utils/graph.py similarity index 98% rename from sklearn/utils/graph.py rename to scikits/learn/utils/graph.py index 59fabf4105f2805d8ce0b093e147df0474ee8479..11266ed74f88c6f1bd9023ef702dc61598f2be0e 100644 --- a/sklearn/utils/graph.py +++ b/scikits/learn/utils/graph.py @@ -34,7 +34,7 @@ def single_source_shortest_path_length(graph, source, cutoff=None): Examples -------- - >>> from sklearn.utils.graph import single_source_shortest_path_length + >>> from scikits.learn.utils.graph import single_source_shortest_path_length >>> import numpy as np >>> graph = np.array([[ 0, 1, 0, 0], ... [ 1, 0, 1, 0], diff --git a/sklearn/utils/graph_shortest_path.c b/scikits/learn/utils/graph_shortest_path.c similarity index 100% rename from sklearn/utils/graph_shortest_path.c rename to scikits/learn/utils/graph_shortest_path.c diff --git a/sklearn/utils/graph_shortest_path.pyx b/scikits/learn/utils/graph_shortest_path.pyx similarity index 100% rename from sklearn/utils/graph_shortest_path.pyx rename to scikits/learn/utils/graph_shortest_path.pyx diff --git a/sklearn/utils/setup.py b/scikits/learn/utils/setup.py similarity index 100% rename from sklearn/utils/setup.py rename to scikits/learn/utils/setup.py diff --git a/sklearn/utils/sparsetools/README b/scikits/learn/utils/sparsetools/README similarity index 100% rename from sklearn/utils/sparsetools/README rename to scikits/learn/utils/sparsetools/README diff --git a/sklearn/utils/sparsetools/__init__.py b/scikits/learn/utils/sparsetools/__init__.py similarity index 100% rename from sklearn/utils/sparsetools/__init__.py rename to scikits/learn/utils/sparsetools/__init__.py diff --git a/sklearn/utils/sparsetools/complex_ops.h b/scikits/learn/utils/sparsetools/complex_ops.h similarity index 100% rename from sklearn/utils/sparsetools/complex_ops.h rename to scikits/learn/utils/sparsetools/complex_ops.h diff --git a/sklearn/utils/sparsetools/csgraph.h b/scikits/learn/utils/sparsetools/csgraph.h similarity index 100% rename from sklearn/utils/sparsetools/csgraph.h rename to scikits/learn/utils/sparsetools/csgraph.h diff --git a/sklearn/utils/sparsetools/csgraph.i b/scikits/learn/utils/sparsetools/csgraph.i similarity index 100% rename from sklearn/utils/sparsetools/csgraph.i rename to scikits/learn/utils/sparsetools/csgraph.i diff --git a/sklearn/utils/sparsetools/csgraph.py b/scikits/learn/utils/sparsetools/csgraph.py similarity index 100% rename from sklearn/utils/sparsetools/csgraph.py rename to scikits/learn/utils/sparsetools/csgraph.py diff --git a/sklearn/utils/sparsetools/csgraph_wrap.cxx b/scikits/learn/utils/sparsetools/csgraph_wrap.cxx similarity index 100% rename from sklearn/utils/sparsetools/csgraph_wrap.cxx rename to scikits/learn/utils/sparsetools/csgraph_wrap.cxx diff --git a/sklearn/utils/sparsetools/npy_3kcompat.h b/scikits/learn/utils/sparsetools/npy_3kcompat.h similarity index 100% rename from sklearn/utils/sparsetools/npy_3kcompat.h rename to scikits/learn/utils/sparsetools/npy_3kcompat.h diff --git a/sklearn/utils/sparsetools/py3k.h b/scikits/learn/utils/sparsetools/py3k.h similarity index 100% rename from sklearn/utils/sparsetools/py3k.h rename to scikits/learn/utils/sparsetools/py3k.h diff --git a/sklearn/utils/sparsetools/setup.py b/scikits/learn/utils/sparsetools/setup.py similarity index 100% rename from sklearn/utils/sparsetools/setup.py rename to scikits/learn/utils/sparsetools/setup.py diff --git a/sklearn/utils/src/cholesky_delete.c b/scikits/learn/utils/src/cholesky_delete.c similarity index 100% rename from sklearn/utils/src/cholesky_delete.c rename to scikits/learn/utils/src/cholesky_delete.c diff --git a/sklearn/utils/testing.py b/scikits/learn/utils/testing.py similarity index 100% rename from sklearn/utils/testing.py rename to scikits/learn/utils/testing.py diff --git a/sklearn/utils/tests/__init__.py b/scikits/learn/utils/tests/__init__.py similarity index 100% rename from sklearn/utils/tests/__init__.py rename to scikits/learn/utils/tests/__init__.py diff --git a/sklearn/utils/tests/test___init__.py b/scikits/learn/utils/tests/test___init__.py similarity index 100% rename from sklearn/utils/tests/test___init__.py rename to scikits/learn/utils/tests/test___init__.py diff --git a/sklearn/utils/tests/test_fixes.py b/scikits/learn/utils/tests/test_fixes.py similarity index 100% rename from sklearn/utils/tests/test_fixes.py rename to scikits/learn/utils/tests/test_fixes.py diff --git a/sklearn/utils/tests/test_graph.py b/scikits/learn/utils/tests/test_graph.py similarity index 100% rename from sklearn/utils/tests/test_graph.py rename to scikits/learn/utils/tests/test_graph.py diff --git a/sklearn/utils/tests/test_shortest_path.py b/scikits/learn/utils/tests/test_shortest_path.py similarity index 95% rename from sklearn/utils/tests/test_shortest_path.py rename to scikits/learn/utils/tests/test_shortest_path.py index ec1dfd0df7be3e5531f6c204afc87ba77011360a..23676887f6b8e73a0271fb65c48f07395d55f11c 100644 --- a/sklearn/utils/tests/test_shortest_path.py +++ b/scikits/learn/utils/tests/test_shortest_path.py @@ -1,6 +1,6 @@ import numpy as np from numpy.testing import assert_array_almost_equal -from sklearn.utils.graph_shortest_path import graph_shortest_path +from scikits.learn.utils.graph_shortest_path import graph_shortest_path def FloydWarshallSlow(graph, directed=False): diff --git a/sklearn/utils/tests/test_svd.py b/scikits/learn/utils/tests/test_svd.py similarity index 97% rename from sklearn/utils/tests/test_svd.py rename to scikits/learn/utils/tests/test_svd.py index 2c10e5c43de519a464ddb482dfb55197d688dd13..e04a0cb0007b2b475bc766aa5453e0e0ae2c0761 100644 --- a/sklearn/utils/tests/test_svd.py +++ b/scikits/learn/utils/tests/test_svd.py @@ -8,8 +8,8 @@ from scipy import linalg from numpy.testing import assert_equal from numpy.testing import assert_almost_equal -from sklearn.utils.extmath import fast_svd -from sklearn.datasets.samples_generator import make_low_rank_matrix +from scikits.learn.utils.extmath import fast_svd +from scikits.learn.datasets.samples_generator import make_low_rank_matrix def test_fast_svd_low_rank(): diff --git a/sklearn/utils/tests/test_utils.py b/scikits/learn/utils/tests/test_utils.py similarity index 91% rename from sklearn/utils/tests/test_utils.py rename to scikits/learn/utils/tests/test_utils.py index d52265a5821d928fb9c1c4bb7d0e8b4b3eceba4a..f9605c340494606dee4633d3a4767be0d8340113 100644 --- a/sklearn/utils/tests/test_utils.py +++ b/scikits/learn/utils/tests/test_utils.py @@ -1,8 +1,8 @@ import numpy as np -from sklearn.utils import check_arrays -from sklearn.utils import check_random_state -from sklearn.utils import resample +from scikits.learn.utils import check_arrays +from scikits.learn.utils import check_random_state +from scikits.learn.utils import resample from nose.tools import assert_raises diff --git a/setup.py b/setup.py index de1328500f46b9344d2ee8951a05b1110fb9d071..3fcdba9aaa39e46202262d20777de097dddfe743 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ import sys import os import shutil -DISTNAME = 'sklearn' +DISTNAME = 'scikits.learn' DESCRIPTION = 'A set of python modules for machine learning and data mining' LONG_DESCRIPTION = open('README.rst').read() MAINTAINER = 'Fabian Pedregosa' @@ -34,8 +34,6 @@ def configuration(parent_package='', top_path=None): config.add_subpackage('scikits.learn') config.add_data_files('scikits/__init__.py') - config.add_subpackage('sklearn') - return config if __name__ == "__main__":