From ddf4b7210979b60265efbcc81f86d053c50c5ce2 Mon Sep 17 00:00:00 2001 From: Fabian Pedregosa Date: Fri, 2 Sep 2011 11:00:02 +0200 Subject: [PATCH] Move project directory from scikits.learn to sklearn --- Makefile | 2 +- doc/install.rst | 18 +- doc/modules/classes.rst | 108 +- doc/modules/clustering.rst | 16 +- doc/modules/covariance.rst | 8 +- doc/modules/cross_validation.rst | 32 +- doc/modules/decomposition.rst | 2 +- doc/modules/dp-derivation.rst | 2 +- doc/modules/feature_extraction.rst | 10 +- doc/modules/feature_selection.rst | 4 +- doc/modules/gaussian_process.rst | 4 +- doc/modules/grid_search.rst | 2 +- doc/modules/hmm.rst | 2 +- doc/modules/linear_model.rst | 14 +- doc/modules/manifold.rst | 8 +- doc/modules/mixture.rst | 12 +- doc/modules/multiclass.rst | 20 +- doc/modules/naive_bayes.rst | 2 +- doc/modules/neighbors.rst | 2 +- doc/modules/pls.rst | 2 +- doc/modules/preprocessing.rst | 16 +- doc/modules/sgd.rst | 8 +- doc/modules/svm.rst | 10 +- doc/tutorial.rst | 14 +- doc/whats_new.rst | 8 +- examples/applications/face_recognition.py | 14 +- .../plot_species_distribution_modeling.py | 8 +- examples/applications/stock_market.py | 2 +- examples/applications/svm_gui.py | 2 +- .../topics_extraction_with_nmf.py | 6 +- .../wikipedia_principal_eigenvector.py | 4 +- examples/cluster/plot_affinity_propagation.py | 6 +- examples/cluster/plot_color_quantization.py | 8 +- examples/cluster/plot_dbscan.py | 6 +- ...e_agglomeration_vs_univariate_selection.py | 16 +- examples/cluster/plot_kmeans_digits.py | 10 +- examples/cluster/plot_lena_segmentation.py | 4 +- .../cluster/plot_lena_ward_segmentation.py | 4 +- examples/cluster/plot_mean_shift.py | 4 +- examples/cluster/plot_mini_batch_kmeans.py | 6 +- examples/cluster/plot_segmentation_toy.py | 4 +- .../plot_ward_structured_vs_unstructured.py | 6 +- .../covariance/plot_covariance_estimation.py | 2 +- examples/covariance/plot_lw_vs_oas.py | 2 +- .../decomposition/plot_faces_decomposition.py | 8 +- .../plot_ica_blind_source_separation.py | 2 +- examples/decomposition/plot_ica_vs_pca.py | 2 +- examples/decomposition/plot_kernel_pca.py | 2 +- examples/decomposition/plot_pca_vs_lda.py | 6 +- .../document_classification_20newsgroups.py | 18 +- examples/document_clustering.py | 12 +- examples/feature_selection_pipeline.py | 8 +- examples/gaussian_naive_bayes.py | 4 +- .../gaussian_process/gp_diabetes_dataset.py | 6 +- ...ilistic_classification_after_regression.py | 2 +- .../gaussian_process/plot_gp_regression.py | 2 +- examples/grid_search_digits.py | 14 +- .../grid_search_text_feature_extraction.py | 12 +- examples/linear_model/lasso_and_elasticnet.py | 4 +- .../lasso_dense_vs_sparse_data.py | 4 +- .../linear_model/logistic_l1_l2_sparsity.py | 4 +- examples/linear_model/plot_ard.py | 2 +- examples/linear_model/plot_bayesian_ridge.py | 2 +- .../plot_lasso_coordinate_descent_path.py | 4 +- examples/linear_model/plot_lasso_lars.py | 4 +- .../plot_lasso_model_selection.py | 4 +- examples/linear_model/plot_logistic_path.py | 6 +- examples/linear_model/plot_ols.py | 2 +- examples/linear_model/plot_omp.py | 4 +- .../plot_polynomial_interpolation.py | 2 +- examples/linear_model/plot_ridge_path.py | 4 +- examples/linear_model/plot_sgd_iris.py | 4 +- .../linear_model/plot_sgd_loss_functions.py | 4 +- examples/linear_model/plot_sgd_ols.py | 2 +- examples/linear_model/plot_sgd_penalties.py | 2 +- .../plot_sgd_separating_hyperplane.py | 2 +- .../linear_model/plot_sgd_weighted_classes.py | 2 +- .../linear_model/plot_sgd_weighted_samples.py | 2 +- examples/manifold/plot_compare_methods.py | 2 +- examples/manifold/plot_lle_digits.py | 4 +- examples/manifold/plot_swissroll.py | 2 +- examples/mixture/plot_gmm.py | 2 +- examples/mixture/plot_gmm_classifier.py | 6 +- examples/mixture/plot_gmm_pdf.py | 2 +- examples/mixture/plot_gmm_sin.py | 2 +- .../mlcomp_sparse_document_classification.py | 12 +- examples/plot_classification_probability.py | 6 +- examples/plot_confusion_matrix.py | 4 +- examples/plot_digits_classification.py | 2 +- examples/plot_feature_selection.py | 4 +- examples/plot_lda_qda.py | 4 +- examples/plot_lda_vs_qda.py | 6 +- examples/plot_neighbors.py | 2 +- examples/plot_neighbors_regression.py | 2 +- ...lot_permutation_test_for_classification.py | 8 +- examples/plot_pls.py | 2 +- examples/plot_precision_recall.py | 6 +- examples/plot_rfe_digits.py | 6 +- examples/plot_rfe_with_cross_validation.py | 10 +- examples/plot_roc.py | 6 +- examples/plot_roc_crossval.py | 6 +- examples/plot_train_error_vs_test_error.py | 2 +- examples/svm/plot_custom_kernel.py | 2 +- examples/svm/plot_iris.py | 2 +- examples/svm/plot_oneclass.py | 2 +- examples/svm/plot_separating_hyperplane.py | 2 +- .../plot_separating_hyperplane_unbalanced.py | 2 +- examples/svm/plot_svm_anova.py | 4 +- examples/svm/plot_svm_nonlinear.py | 2 +- examples/svm/plot_svm_regression.py | 2 +- examples/svm/plot_weighted_samples.py | 2 +- setup.py | 4 +- {scikits/learn => sklearn}/__init__.py | 2 +- {scikits/learn => sklearn}/ball_tree.c | 5592 ++++++++--------- {scikits/learn => sklearn}/ball_tree.pyx | 0 {scikits/learn => sklearn}/base.py | 0 .../learn => sklearn}/check_build/__init__.py | 0 .../check_build/_check_build.c | 0 .../check_build/_check_build.pyx | 0 .../learn => sklearn}/check_build/setup.py | 0 .../learn => sklearn}/cluster/__init__.py | 0 .../cluster/_feature_agglomeration.py | 0 {scikits/learn => sklearn}/cluster/_inertia.c | 0 .../learn => sklearn}/cluster/_inertia.pyx | 0 {scikits/learn => sklearn}/cluster/_k_means.c | 0 .../learn => sklearn}/cluster/_k_means.pyx | 0 .../cluster/affinity_propagation_.py | 0 {scikits/learn => sklearn}/cluster/dbscan_.py | 0 .../learn => sklearn}/cluster/hierarchical.py | 0 .../learn => sklearn}/cluster/k_means_.py | 0 .../learn => sklearn}/cluster/mean_shift_.py | 0 {scikits/learn => sklearn}/cluster/setup.py | 0 .../learn => sklearn}/cluster/spectral.py | 0 .../cluster/tests/__init__.py | 0 .../learn => sklearn}/cluster/tests/common.py | 0 .../tests/test_affinity_propagation.py | 0 .../cluster/tests/test_dbscan.py | 2 +- .../cluster/tests/test_hierarchical.py | 6 +- .../cluster/tests/test_k_means.py | 0 .../cluster/tests/test_mean_shift.py | 0 .../cluster/tests/test_spectral.py | 0 .../learn => sklearn}/covariance/__init__.py | 2 +- .../covariance/empirical_covariance_.py | 0 .../covariance/shrunk_covariance_.py | 0 .../covariance/tests/__init__.py | 0 .../covariance/tests/test_covariance.py | 2 +- {scikits/learn => sklearn}/cross_val.py | 30 +- .../datasets/DATASET_PROPOSAL.txt | 0 .../learn => sklearn}/datasets/__init__.py | 4 +- {scikits/learn => sklearn}/datasets/base.py | 10 +- .../datasets/data/boston_house_prices.csv | 0 .../datasets/data/diabetes_data.csv.gz | Bin .../datasets/data/diabetes_target.csv.gz | Bin .../datasets/data/digits.csv.gz | Bin .../learn => sklearn}/datasets/data/iris.csv | 0 .../datasets/data/linnerud_exercise.csv | 0 .../datasets/data/linnerud_physiological.csv | 0 .../datasets/descr/boston_house_prices.rst | 0 .../datasets/descr/diabetes.rst | 0 .../datasets/descr/digits.rst | 0 .../learn => sklearn}/datasets/descr/iris.rst | 0 .../datasets/descr/linnerud.rst | 0 .../datasets/images/README.txt | 0 .../datasets/images/china.jpg | Bin .../datasets/images/flower.jpg | Bin {scikits/learn => sklearn}/datasets/lfw.py | 2 +- {scikits/learn => sklearn}/datasets/mlcomp.py | 2 +- {scikits/learn => sklearn}/datasets/mldata.py | 8 +- .../datasets/olivetti_faces.py | 0 .../datasets/samples_generator.py | 2 +- {scikits/learn => sklearn}/datasets/setup.py | 0 .../datasets/svmlight_format.py | 0 .../datasets/tests/__init__.py | 0 .../tests/data/svmlight_classification.txt | 0 .../datasets/tests/data/svmlight_invalid.txt | 0 .../datasets/tests/test_20news.py | 2 +- .../datasets/tests/test_base.py | 4 +- .../datasets/tests/test_lfw.py | 6 +- .../datasets/tests/test_mldata.py | 6 +- .../datasets/tests/test_samples_generator.py | 0 .../datasets/tests/test_svmlight_format.py | 2 +- .../datasets/twenty_newsgroups.py | 0 .../decomposition/__init__.py | 0 .../decomposition/fastica_.py | 0 .../decomposition/kernel_pca.py | 0 .../learn => sklearn}/decomposition/nmf.py | 2 +- .../learn => sklearn}/decomposition/pca.py | 4 +- .../decomposition/sparse_pca.py | 0 .../decomposition/tests/__init__.py | 0 .../decomposition/tests/test_fastica.py | 0 .../decomposition/tests/test_kernel_pca.py | 0 .../decomposition/tests/test_nmf.py | 0 .../decomposition/tests/test_pca.py | 0 .../decomposition/tests/test_sparse_pca.py | 4 +- {scikits/learn => sklearn}/externals/README | 0 .../learn => sklearn}/externals/__init__.py | 0 .../externals/copy_joblib.sh | 0 .../externals/joblib/__init__.py | 4 +- .../externals/joblib/disk.py | 0 .../externals/joblib/format_stack.py | 0 .../externals/joblib/func_inspect.py | 0 .../externals/joblib/hashing.py | 0 .../externals/joblib/logger.py | 0 .../externals/joblib/memory.py | 0 .../externals/joblib/my_exceptions.py | 0 .../externals/joblib/numpy_pickle.py | 0 .../externals/joblib/parallel.py | 10 +- .../externals/joblib/test/__init__.py | 0 .../externals/joblib/test/common.py | 0 .../joblib/test/test_format_stack.py | 0 .../joblib/test/test_func_inspect.py | 0 .../externals/joblib/test/test_hashing.py | 0 .../externals/joblib/test/test_logger.py | 0 .../externals/joblib/test/test_memory.py | 0 .../joblib/test/test_my_exceptions.py | 0 .../joblib/test/test_numpy_pickle.py | 0 .../externals/joblib/test/test_parallel.py | 0 .../externals/joblib/testing.py | 0 {scikits/learn => sklearn}/externals/setup.py | 0 .../externals/test_externals_setup.py | 0 .../feature_extraction/__init__.py | 0 .../feature_extraction/image.py | 0 .../feature_extraction/tests/__init__.py | 0 .../feature_extraction/tests/test_image.py | 0 .../feature_extraction/tests/test_text.py | 24 +- .../feature_extraction/text.py | 0 .../feature_selection/__init__.py | 0 .../feature_selection/rfe.py | 0 .../feature_selection/tests/__init__.py | 0 .../feature_selection/tests/test_chi2.py | 0 .../tests/test_feature_select.py | 2 +- .../feature_selection/tests/test_rfe.py | 0 .../feature_selection/univariate_selection.py | 0 .../gaussian_process/__init__.py | 0 .../gaussian_process/correlation_models.py | 0 .../gaussian_process/gaussian_process.py | 2 +- .../gaussian_process/regression_models.py | 0 .../gaussian_process/tests/__init__.py | 0 .../tests/test_gaussian_process.py | 2 +- {scikits/learn => sklearn}/grid_search.py | 6 +- {scikits/learn => sklearn}/hmm.py | 6 +- {scikits/learn => sklearn}/lda.py | 2 +- .../linear_model/__init__.py | 2 +- .../learn => sklearn}/linear_model/base.py | 2 +- .../learn => sklearn}/linear_model/bayes.py | 4 +- .../learn => sklearn}/linear_model/cd_fast.c | 0 .../linear_model/cd_fast.pyx | 0 .../linear_model/coordinate_descent.py | 6 +- .../linear_model/least_angle.py | 10 +- .../linear_model/logistic.py | 0 .../learn => sklearn}/linear_model/omp.py | 0 .../learn => sklearn}/linear_model/ridge.py | 2 +- .../learn => sklearn}/linear_model/setup.py | 0 .../learn => sklearn}/linear_model/sgd_fast.c | 4104 ++++++------ .../linear_model/sgd_fast.pxd | 0 .../linear_model/sgd_fast.pyx | 0 .../linear_model/sgd_fast_sparse.c | 2736 ++++---- .../linear_model/sgd_fast_sparse.pyx | 0 .../linear_model/sparse/__init__.py | 4 +- .../linear_model/sparse/base.py | 0 .../linear_model/sparse/coordinate_descent.py | 0 .../linear_model/sparse/logistic.py | 2 +- .../linear_model/sparse/setup.py | 0 .../linear_model/sparse/src/cd_fast_sparse.c | 1114 ++-- .../sparse/src/cd_fast_sparse.pyx | 0 .../sparse/stochastic_gradient.py | 4 +- .../linear_model/sparse/tests/__init__.py | 0 .../sparse/tests/test_coordinate_descent.py | 8 +- .../sparse/tests/test_logistic.py | 4 +- .../linear_model/stochastic_gradient.py | 4 +- .../linear_model/tests/__init__.py | 0 .../linear_model/tests/test_base.py | 0 .../linear_model/tests/test_bayes.py | 2 +- .../tests/test_coordinate_descent.py | 0 .../linear_model/tests/test_least_angle.py | 2 +- .../linear_model/tests/test_logistic.py | 4 +- .../linear_model/tests/test_omp.py | 0 .../linear_model/tests/test_ridge.py | 18 +- .../linear_model/tests/test_sgd.py | 4 +- .../learn => sklearn}/manifold/__init__.py | 0 {scikits/learn => sklearn}/manifold/isomap.py | 2 +- .../manifold/locally_linear.py | 0 .../manifold/tests/test_isomap.py | 12 +- .../manifold/tests/test_locally_linear.py | 6 +- .../learn => sklearn}/metrics/__init__.py | 0 {scikits/learn => sklearn}/metrics/cluster.py | 6 +- {scikits/learn => sklearn}/metrics/metrics.py | 4 +- .../learn => sklearn}/metrics/pairwise.py | 4 +- .../metrics/tests/__init__.py | 0 .../metrics/tests/test_cluster.py | 10 +- .../metrics/tests/test_metrics.py | 0 .../metrics/tests/test_pairwise.py | 0 .../learn => sklearn}/mixture/__init__.py | 0 {scikits/learn => sklearn}/mixture/dpgmm.py | 0 {scikits/learn => sklearn}/mixture/gmm.py | 2 +- .../mixture/tests/__init__.py | 0 .../mixture/tests/test_dpgmm.py | 4 +- .../mixture/tests/test_gmm.py | 4 +- {scikits/learn => sklearn}/multiclass.py | 0 {scikits/learn => sklearn}/naive_bayes.py | 6 +- {scikits/learn => sklearn}/neighbors.py | 10 +- {scikits/learn => sklearn}/pipeline.py | 10 +- {scikits/learn => sklearn}/pls.py | 8 +- .../preprocessing/__init__.py | 22 +- .../learn => sklearn}/preprocessing/setup.py | 0 .../preprocessing/src/_preprocessing.c | 0 .../preprocessing/src/_preprocessing.pyx | 0 .../preprocessing/tests/__init__.py | 0 .../preprocessing/tests/test_preprocessing.py | 20 +- {scikits/learn => sklearn}/qda.py | 2 +- {scikits/learn => sklearn}/setup.py | 0 .../src/cblas/ATL_drefcopy.c | 0 .../learn => sklearn}/src/cblas/ATL_drefrot.c | 0 .../src/cblas/ATL_drefrotg.c | 0 .../src/cblas/ATL_dreftrsv.c | 0 .../src/cblas/ATL_dreftrsvLNN.c | 0 .../src/cblas/ATL_dreftrsvLNU.c | 0 .../src/cblas/ATL_dreftrsvLTN.c | 0 .../src/cblas/ATL_dreftrsvLTU.c | 0 .../src/cblas/ATL_dreftrsvUNN.c | 0 .../src/cblas/ATL_dreftrsvUNU.c | 0 .../src/cblas/ATL_dreftrsvUTN.c | 0 .../src/cblas/ATL_dreftrsvUTU.c | 0 .../src/cblas/ATL_srefcopy.c | 0 .../learn => sklearn}/src/cblas/ATL_srefrot.c | 0 .../src/cblas/ATL_srefrotg.c | 0 .../src/cblas/ATL_sreftrsv.c | 0 .../src/cblas/ATL_sreftrsvLNN.c | 0 .../src/cblas/ATL_sreftrsvLNU.c | 0 .../src/cblas/ATL_sreftrsvLTN.c | 0 .../src/cblas/ATL_sreftrsvLTU.c | 0 .../src/cblas/ATL_sreftrsvUNN.c | 0 .../src/cblas/ATL_sreftrsvUNU.c | 0 .../src/cblas/ATL_sreftrsvUTN.c | 0 .../src/cblas/ATL_sreftrsvUTU.c | 0 .../learn => sklearn}/src/cblas/README.txt | 0 .../learn => sklearn}/src/cblas/atlas_aux.h | 0 .../src/cblas/atlas_dsysinfo.h | 0 .../learn => sklearn}/src/cblas/atlas_enum.h | 0 .../src/cblas/atlas_level1.h | 0 .../src/cblas/atlas_level2.h | 0 .../learn => sklearn}/src/cblas/atlas_misc.h | 0 .../src/cblas/atlas_refalias1.h | 0 .../src/cblas/atlas_refalias2.h | 0 .../src/cblas/atlas_reflevel1.h | 0 .../src/cblas/atlas_reflevel2.h | 0 .../src/cblas/atlas_reflvl2.h | 0 .../src/cblas/atlas_refmisc.h | 0 .../src/cblas/atlas_ssysinfo.h | 0 .../learn => sklearn}/src/cblas/atlas_type.h | 0 {scikits/learn => sklearn}/src/cblas/cblas.h | 0 .../learn => sklearn}/src/cblas/cblas_daxpy.c | 0 .../learn => sklearn}/src/cblas/cblas_dcopy.c | 0 .../learn => sklearn}/src/cblas/cblas_ddot.c | 0 .../learn => sklearn}/src/cblas/cblas_dnrm2.c | 0 .../learn => sklearn}/src/cblas/cblas_drot.c | 0 .../learn => sklearn}/src/cblas/cblas_drotg.c | 0 .../learn => sklearn}/src/cblas/cblas_dscal.c | 0 .../learn => sklearn}/src/cblas/cblas_dtrsv.c | 0 .../src/cblas/cblas_errprn.c | 0 .../learn => sklearn}/src/cblas/cblas_scopy.c | 0 .../learn => sklearn}/src/cblas/cblas_srot.c | 0 .../learn => sklearn}/src/cblas/cblas_srotg.c | 0 .../learn => sklearn}/src/cblas/cblas_strsv.c | 0 .../src/cblas/cblas_xerbla.c | 0 {scikits/learn => sklearn}/svm/__init__.py | 0 {scikits/learn => sklearn}/svm/base.py | 0 {scikits/learn => sklearn}/svm/bounds.py | 0 {scikits/learn => sklearn}/svm/classes.py | 8 +- {scikits/learn => sklearn}/svm/liblinear.c | 1557 +++-- {scikits/learn => sklearn}/svm/liblinear.pyx | 0 {scikits/learn => sklearn}/svm/libsvm.c | 4716 ++++++-------- {scikits/learn => sklearn}/svm/libsvm.pxd | 0 {scikits/learn => sklearn}/svm/libsvm.pyx | 0 {scikits/learn => sklearn}/svm/setup.py | 0 .../learn => sklearn}/svm/sparse/__init__.py | 2 +- {scikits/learn => sklearn}/svm/sparse/base.py | 0 .../learn => sklearn}/svm/sparse/classes.py | 18 +- .../learn => sklearn}/svm/sparse/libsvm.c | 1238 ++-- .../learn => sklearn}/svm/sparse/libsvm.pyx | 0 .../learn => sklearn}/svm/sparse/setup.py | 0 .../learn => sklearn}/svm/src/blas/Makefile | 0 .../learn => sklearn}/svm/src/blas/blas.h | 0 .../learn => sklearn}/svm/src/blas/blasp.h | 0 .../learn => sklearn}/svm/src/blas/daxpy.c | 0 .../learn => sklearn}/svm/src/blas/ddot.c | 0 .../learn => sklearn}/svm/src/blas/dnrm2.c | 0 .../learn => sklearn}/svm/src/blas/dscal.c | 0 .../svm/src/liblinear/COPYRIGHT | 0 .../svm/src/liblinear/LIBLINEAR_CHANGES | 0 .../svm/src/liblinear/liblinear_helper.c | 0 .../svm/src/liblinear/linear.cpp | 0 .../svm/src/liblinear/linear.h | 0 .../svm/src/liblinear/tron.cpp | 0 .../svm/src/liblinear/tron.h | 0 .../svm/src/libsvm/LIBSVM_CHANGES | 0 .../svm/src/libsvm/_libsvm_sparse.c | 0 .../svm/src/libsvm/libsvm_helper.c | 0 .../svm/src/libsvm/libsvm_sparse_helper.c | 0 .../svm/src/libsvm/libsvm_template.cpp | 0 .../learn => sklearn}/svm/src/libsvm/svm.cpp | 0 .../learn => sklearn}/svm/src/libsvm/svm.h | 0 .../learn => sklearn}/svm/tests/__init__.py | 0 .../svm/tests/test_bounds.py | 10 +- .../svm/tests/test_sparse.py | 4 +- .../learn => sklearn}/svm/tests/test_svm.py | 10 +- {scikits/learn => sklearn}/tests/__init__.py | 0 {scikits/learn => sklearn}/tests/test_base.py | 4 +- .../learn => sklearn}/tests/test_cross_val.py | 0 .../tests/test_grid_search.py | 14 +- {scikits/learn => sklearn}/tests/test_hmm.py | 8 +- {scikits/learn => sklearn}/tests/test_init.py | 2 +- {scikits/learn => sklearn}/tests/test_lda.py | 0 .../tests/test_multiclass.py | 14 +- .../tests/test_naive_bayes.py | 0 .../learn => sklearn}/tests/test_neighbors.py | 2 +- .../learn => sklearn}/tests/test_pipeline.py | 0 {scikits/learn => sklearn}/tests/test_pls.py | 4 +- {scikits/learn => sklearn}/tests/test_qda.py | 0 {scikits/learn => sklearn}/utils/__init__.py | 14 +- {scikits/learn => sklearn}/utils/_csgraph.py | 0 {scikits/learn => sklearn}/utils/arpack.py | 4 +- {scikits/learn => sklearn}/utils/arrayfuncs.c | 0 .../learn => sklearn}/utils/arrayfuncs.pyx | 0 {scikits/learn => sklearn}/utils/bench.py | 0 {scikits/learn => sklearn}/utils/extmath.py | 2 +- {scikits/learn => sklearn}/utils/fixes.py | 0 {scikits/learn => sklearn}/utils/graph.py | 2 +- .../utils/graph_shortest_path.c | 0 .../utils/graph_shortest_path.pyx | 0 {scikits/learn => sklearn}/utils/setup.py | 0 .../utils/sparsetools/README | 0 .../utils/sparsetools/__init__.py | 0 .../utils/sparsetools/complex_ops.h | 0 .../utils/sparsetools/csgraph.h | 0 .../utils/sparsetools/csgraph.i | 0 .../utils/sparsetools/csgraph.py | 0 .../utils/sparsetools/csgraph_wrap.cxx | 0 .../utils/sparsetools/npy_3kcompat.h | 0 .../utils/sparsetools/py3k.h | 0 .../utils/sparsetools/setup.py | 0 .../utils/src/cholesky_delete.c | 0 {scikits/learn => sklearn}/utils/testing.py | 0 .../learn => sklearn}/utils/tests/__init__.py | 0 .../utils/tests/test___init__.py | 0 .../utils/tests/test_fixes.py | 0 .../utils/tests/test_graph.py | 0 .../utils/tests/test_shortest_path.py | 2 +- .../learn => sklearn}/utils/tests/test_svd.py | 4 +- .../utils/tests/test_utils.py | 6 +- 450 files changed, 10208 insertions(+), 12091 deletions(-) rename {scikits/learn => sklearn}/__init__.py (96%) rename {scikits/learn => sklearn}/ball_tree.c (69%) rename {scikits/learn => sklearn}/ball_tree.pyx (100%) rename {scikits/learn => sklearn}/base.py (100%) rename {scikits/learn => sklearn}/check_build/__init__.py (100%) rename {scikits/learn => sklearn}/check_build/_check_build.c (100%) rename {scikits/learn => sklearn}/check_build/_check_build.pyx (100%) rename {scikits/learn => sklearn}/check_build/setup.py (100%) rename {scikits/learn => sklearn}/cluster/__init__.py (100%) rename {scikits/learn => sklearn}/cluster/_feature_agglomeration.py (100%) rename {scikits/learn => sklearn}/cluster/_inertia.c (100%) rename {scikits/learn => sklearn}/cluster/_inertia.pyx (100%) rename {scikits/learn => sklearn}/cluster/_k_means.c (100%) rename {scikits/learn => sklearn}/cluster/_k_means.pyx (100%) rename {scikits/learn => sklearn}/cluster/affinity_propagation_.py (100%) rename {scikits/learn => sklearn}/cluster/dbscan_.py (100%) rename {scikits/learn => sklearn}/cluster/hierarchical.py (100%) rename {scikits/learn => sklearn}/cluster/k_means_.py (100%) rename {scikits/learn => sklearn}/cluster/mean_shift_.py (100%) rename {scikits/learn => sklearn}/cluster/setup.py (100%) rename {scikits/learn => sklearn}/cluster/spectral.py (100%) rename {scikits/learn => sklearn}/cluster/tests/__init__.py (100%) rename {scikits/learn => sklearn}/cluster/tests/common.py (100%) rename {scikits/learn => sklearn}/cluster/tests/test_affinity_propagation.py (100%) rename {scikits/learn => sklearn}/cluster/tests/test_dbscan.py (98%) rename {scikits/learn => sklearn}/cluster/tests/test_hierarchical.py (94%) rename {scikits/learn => sklearn}/cluster/tests/test_k_means.py (100%) rename {scikits/learn => sklearn}/cluster/tests/test_mean_shift.py (100%) rename {scikits/learn => sklearn}/cluster/tests/test_spectral.py (100%) rename {scikits/learn => sklearn}/covariance/__init__.py (88%) rename {scikits/learn => sklearn}/covariance/empirical_covariance_.py (100%) rename {scikits/learn => sklearn}/covariance/shrunk_covariance_.py (100%) rename {scikits/learn => sklearn}/covariance/tests/__init__.py (100%) rename {scikits/learn => sklearn}/covariance/tests/test_covariance.py (99%) rename {scikits/learn => sklearn}/cross_val.py (97%) rename {scikits/learn => sklearn}/datasets/DATASET_PROPOSAL.txt (100%) rename {scikits/learn => sklearn}/datasets/__init__.py (91%) rename {scikits/learn => sklearn}/datasets/base.py (97%) rename {scikits/learn => sklearn}/datasets/data/boston_house_prices.csv (100%) rename {scikits/learn => sklearn}/datasets/data/diabetes_data.csv.gz (100%) rename {scikits/learn => sklearn}/datasets/data/diabetes_target.csv.gz (100%) rename {scikits/learn => sklearn}/datasets/data/digits.csv.gz (100%) rename {scikits/learn => sklearn}/datasets/data/iris.csv (100%) rename {scikits/learn => sklearn}/datasets/data/linnerud_exercise.csv (100%) rename {scikits/learn => sklearn}/datasets/data/linnerud_physiological.csv (100%) rename {scikits/learn => sklearn}/datasets/descr/boston_house_prices.rst (100%) rename {scikits/learn => sklearn}/datasets/descr/diabetes.rst (100%) rename {scikits/learn => sklearn}/datasets/descr/digits.rst (100%) rename {scikits/learn => sklearn}/datasets/descr/iris.rst (100%) rename {scikits/learn => sklearn}/datasets/descr/linnerud.rst (100%) rename {scikits/learn => sklearn}/datasets/images/README.txt (100%) rename {scikits/learn => sklearn}/datasets/images/china.jpg (100%) rename {scikits/learn => sklearn}/datasets/images/flower.jpg (100%) rename {scikits/learn => sklearn}/datasets/lfw.py (99%) rename {scikits/learn => sklearn}/datasets/mlcomp.py (98%) rename {scikits/learn => sklearn}/datasets/mldata.py (96%) rename {scikits/learn => sklearn}/datasets/olivetti_faces.py (100%) rename {scikits/learn => sklearn}/datasets/samples_generator.py (99%) rename {scikits/learn => sklearn}/datasets/setup.py (100%) rename {scikits/learn => sklearn}/datasets/svmlight_format.py (100%) rename {scikits/learn => sklearn}/datasets/tests/__init__.py (100%) rename {scikits/learn => sklearn}/datasets/tests/data/svmlight_classification.txt (100%) rename {scikits/learn => sklearn}/datasets/tests/data/svmlight_invalid.txt (100%) rename {scikits/learn => sklearn}/datasets/tests/test_20news.py (97%) rename {scikits/learn => sklearn}/datasets/tests/test_base.py (90%) rename {scikits/learn => sklearn}/datasets/tests/test_lfw.py (97%) rename {scikits/learn => sklearn}/datasets/tests/test_mldata.py (96%) rename {scikits/learn => sklearn}/datasets/tests/test_samples_generator.py (100%) rename {scikits/learn => sklearn}/datasets/tests/test_svmlight_format.py (97%) rename {scikits/learn => sklearn}/datasets/twenty_newsgroups.py (100%) rename {scikits/learn => sklearn}/decomposition/__init__.py (100%) rename {scikits/learn => sklearn}/decomposition/fastica_.py (100%) rename {scikits/learn => sklearn}/decomposition/kernel_pca.py (100%) rename {scikits/learn => sklearn}/decomposition/nmf.py (99%) rename {scikits/learn => sklearn}/decomposition/pca.py (99%) rename {scikits/learn => sklearn}/decomposition/sparse_pca.py (100%) rename {scikits/learn => sklearn}/decomposition/tests/__init__.py (100%) rename {scikits/learn => sklearn}/decomposition/tests/test_fastica.py (100%) rename {scikits/learn => sklearn}/decomposition/tests/test_kernel_pca.py (100%) rename {scikits/learn => sklearn}/decomposition/tests/test_nmf.py (100%) rename {scikits/learn => sklearn}/decomposition/tests/test_pca.py (100%) rename {scikits/learn => sklearn}/decomposition/tests/test_sparse_pca.py (97%) rename {scikits/learn => sklearn}/externals/README (100%) rename {scikits/learn => sklearn}/externals/__init__.py (100%) rename {scikits/learn => sklearn}/externals/copy_joblib.sh (100%) rename {scikits/learn => sklearn}/externals/joblib/__init__.py (96%) rename {scikits/learn => sklearn}/externals/joblib/disk.py (100%) rename {scikits/learn => sklearn}/externals/joblib/format_stack.py (100%) rename {scikits/learn => sklearn}/externals/joblib/func_inspect.py (100%) rename {scikits/learn => sklearn}/externals/joblib/hashing.py (100%) rename {scikits/learn => sklearn}/externals/joblib/logger.py (100%) rename {scikits/learn => sklearn}/externals/joblib/memory.py (100%) rename {scikits/learn => sklearn}/externals/joblib/my_exceptions.py (100%) rename {scikits/learn => sklearn}/externals/joblib/numpy_pickle.py (100%) rename {scikits/learn => sklearn}/externals/joblib/parallel.py (97%) rename {scikits/learn => sklearn}/externals/joblib/test/__init__.py (100%) rename {scikits/learn => sklearn}/externals/joblib/test/common.py (100%) rename {scikits/learn => sklearn}/externals/joblib/test/test_format_stack.py (100%) rename {scikits/learn => sklearn}/externals/joblib/test/test_func_inspect.py (100%) rename {scikits/learn => sklearn}/externals/joblib/test/test_hashing.py (100%) rename {scikits/learn => sklearn}/externals/joblib/test/test_logger.py (100%) rename {scikits/learn => sklearn}/externals/joblib/test/test_memory.py (100%) rename {scikits/learn => sklearn}/externals/joblib/test/test_my_exceptions.py (100%) rename {scikits/learn => sklearn}/externals/joblib/test/test_numpy_pickle.py (100%) rename {scikits/learn => sklearn}/externals/joblib/test/test_parallel.py (100%) rename {scikits/learn => sklearn}/externals/joblib/testing.py (100%) rename {scikits/learn => sklearn}/externals/setup.py (100%) rename {scikits/learn => sklearn}/externals/test_externals_setup.py (100%) rename {scikits/learn => sklearn}/feature_extraction/__init__.py (100%) rename {scikits/learn => sklearn}/feature_extraction/image.py (100%) rename {scikits/learn => sklearn}/feature_extraction/tests/__init__.py (100%) rename {scikits/learn => sklearn}/feature_extraction/tests/test_image.py (100%) rename {scikits/learn => sklearn}/feature_extraction/tests/test_text.py (94%) rename {scikits/learn => sklearn}/feature_extraction/text.py (100%) rename {scikits/learn => sklearn}/feature_selection/__init__.py (100%) rename {scikits/learn => sklearn}/feature_selection/rfe.py (100%) rename {scikits/learn => sklearn}/feature_selection/tests/__init__.py (100%) rename {scikits/learn => sklearn}/feature_selection/tests/test_chi2.py (100%) rename {scikits/learn => sklearn}/feature_selection/tests/test_feature_select.py (99%) rename {scikits/learn => sklearn}/feature_selection/tests/test_rfe.py (100%) rename {scikits/learn => sklearn}/feature_selection/univariate_selection.py (100%) rename {scikits/learn => sklearn}/gaussian_process/__init__.py (100%) rename {scikits/learn => sklearn}/gaussian_process/correlation_models.py (100%) rename {scikits/learn => sklearn}/gaussian_process/gaussian_process.py (99%) rename {scikits/learn => sklearn}/gaussian_process/regression_models.py (100%) rename {scikits/learn => sklearn}/gaussian_process/tests/__init__.py (100%) rename {scikits/learn => sklearn}/gaussian_process/tests/test_gaussian_process.py (97%) rename {scikits/learn => sklearn}/grid_search.py (98%) rename {scikits/learn => sklearn}/hmm.py (99%) rename {scikits/learn => sklearn}/lda.py (99%) rename {scikits/learn => sklearn}/linear_model/__init__.py (93%) rename {scikits/learn => sklearn}/linear_model/base.py (99%) rename {scikits/learn => sklearn}/linear_model/bayes.py (99%) rename {scikits/learn => sklearn}/linear_model/cd_fast.c (100%) rename {scikits/learn => sklearn}/linear_model/cd_fast.pyx (100%) rename {scikits/learn => sklearn}/linear_model/coordinate_descent.py (99%) rename {scikits/learn => sklearn}/linear_model/least_angle.py (99%) rename {scikits/learn => sklearn}/linear_model/logistic.py (100%) rename {scikits/learn => sklearn}/linear_model/omp.py (100%) rename {scikits/learn => sklearn}/linear_model/ridge.py (99%) rename {scikits/learn => sklearn}/linear_model/setup.py (100%) rename {scikits/learn => sklearn}/linear_model/sgd_fast.c (74%) rename {scikits/learn => sklearn}/linear_model/sgd_fast.pxd (100%) rename {scikits/learn => sklearn}/linear_model/sgd_fast.pyx (100%) rename {scikits/learn => sklearn}/linear_model/sgd_fast_sparse.c (77%) rename {scikits/learn => sklearn}/linear_model/sgd_fast_sparse.pyx (100%) rename {scikits/learn => sklearn}/linear_model/sparse/__init__.py (60%) rename {scikits/learn => sklearn}/linear_model/sparse/base.py (100%) rename {scikits/learn => sklearn}/linear_model/sparse/coordinate_descent.py (100%) rename {scikits/learn => sklearn}/linear_model/sparse/logistic.py (98%) rename {scikits/learn => sklearn}/linear_model/sparse/setup.py (100%) rename {scikits/learn => sklearn}/linear_model/sparse/src/cd_fast_sparse.c (86%) rename {scikits/learn => sklearn}/linear_model/sparse/src/cd_fast_sparse.pyx (100%) rename {scikits/learn => sklearn}/linear_model/sparse/stochastic_gradient.py (99%) rename {scikits/learn => sklearn}/linear_model/sparse/tests/__init__.py (100%) rename {scikits/learn => sklearn}/linear_model/sparse/tests/test_coordinate_descent.py (94%) rename {scikits/learn => sklearn}/linear_model/sparse/tests/test_logistic.py (95%) rename {scikits/learn => sklearn}/linear_model/stochastic_gradient.py (99%) rename {scikits/learn => sklearn}/linear_model/tests/__init__.py (100%) rename {scikits/learn => sklearn}/linear_model/tests/test_base.py (100%) rename {scikits/learn => sklearn}/linear_model/tests/test_bayes.py (97%) rename {scikits/learn => sklearn}/linear_model/tests/test_coordinate_descent.py (100%) rename {scikits/learn => sklearn}/linear_model/tests/test_least_angle.py (99%) rename {scikits/learn => sklearn}/linear_model/tests/test_logistic.py (96%) rename {scikits/learn => sklearn}/linear_model/tests/test_omp.py (100%) rename {scikits/learn => sklearn}/linear_model/tests/test_ridge.py (94%) rename {scikits/learn => sklearn}/linear_model/tests/test_sgd.py (99%) rename {scikits/learn => sklearn}/manifold/__init__.py (100%) rename {scikits/learn => sklearn}/manifold/isomap.py (99%) rename {scikits/learn => sklearn}/manifold/locally_linear.py (100%) rename {scikits/learn => sklearn}/manifold/tests/test_isomap.py (94%) rename {scikits/learn => sklearn}/manifold/tests/test_locally_linear.py (95%) rename {scikits/learn => sklearn}/metrics/__init__.py (100%) rename {scikits/learn => sklearn}/metrics/cluster.py (98%) rename {scikits/learn => sklearn}/metrics/metrics.py (99%) rename {scikits/learn => sklearn}/metrics/pairwise.py (98%) rename {scikits/learn => sklearn}/metrics/tests/__init__.py (100%) rename {scikits/learn => sklearn}/metrics/tests/test_cluster.py (88%) rename {scikits/learn => sklearn}/metrics/tests/test_metrics.py (100%) rename {scikits/learn => sklearn}/metrics/tests/test_pairwise.py (100%) rename {scikits/learn => sklearn}/mixture/__init__.py (100%) rename {scikits/learn => sklearn}/mixture/dpgmm.py (100%) rename {scikits/learn => sklearn}/mixture/gmm.py (99%) rename {scikits/learn => sklearn}/mixture/tests/__init__.py (100%) rename {scikits/learn => sklearn}/mixture/tests/test_dpgmm.py (93%) rename {scikits/learn => sklearn}/mixture/tests/test_gmm.py (98%) rename {scikits/learn => sklearn}/multiclass.py (100%) rename {scikits/learn => sklearn}/naive_bayes.py (98%) rename {scikits/learn => sklearn}/neighbors.py (98%) rename {scikits/learn => sklearn}/pipeline.py (95%) rename {scikits/learn => sklearn}/pls.py (99%) rename {scikits/learn => sklearn}/preprocessing/__init__.py (96%) rename {scikits/learn => sklearn}/preprocessing/setup.py (100%) rename {scikits/learn => sklearn}/preprocessing/src/_preprocessing.c (100%) rename {scikits/learn => sklearn}/preprocessing/src/_preprocessing.pyx (100%) rename {scikits/learn => sklearn}/preprocessing/tests/__init__.py (100%) rename {scikits/learn => sklearn}/preprocessing/tests/test_preprocessing.py (96%) rename {scikits/learn => sklearn}/qda.py (99%) rename {scikits/learn => sklearn}/setup.py (100%) rename {scikits/learn => sklearn}/src/cblas/ATL_drefcopy.c (100%) rename {scikits/learn => sklearn}/src/cblas/ATL_drefrot.c (100%) rename {scikits/learn => sklearn}/src/cblas/ATL_drefrotg.c (100%) rename {scikits/learn => sklearn}/src/cblas/ATL_dreftrsv.c (100%) rename {scikits/learn => sklearn}/src/cblas/ATL_dreftrsvLNN.c (100%) rename {scikits/learn => sklearn}/src/cblas/ATL_dreftrsvLNU.c (100%) rename {scikits/learn => sklearn}/src/cblas/ATL_dreftrsvLTN.c (100%) rename {scikits/learn => sklearn}/src/cblas/ATL_dreftrsvLTU.c (100%) rename {scikits/learn => sklearn}/src/cblas/ATL_dreftrsvUNN.c (100%) rename {scikits/learn => sklearn}/src/cblas/ATL_dreftrsvUNU.c (100%) rename {scikits/learn => sklearn}/src/cblas/ATL_dreftrsvUTN.c (100%) rename {scikits/learn => sklearn}/src/cblas/ATL_dreftrsvUTU.c (100%) rename {scikits/learn => sklearn}/src/cblas/ATL_srefcopy.c (100%) rename {scikits/learn => sklearn}/src/cblas/ATL_srefrot.c (100%) rename {scikits/learn => sklearn}/src/cblas/ATL_srefrotg.c (100%) rename {scikits/learn => sklearn}/src/cblas/ATL_sreftrsv.c (100%) rename {scikits/learn => sklearn}/src/cblas/ATL_sreftrsvLNN.c (100%) rename {scikits/learn => sklearn}/src/cblas/ATL_sreftrsvLNU.c (100%) rename {scikits/learn => sklearn}/src/cblas/ATL_sreftrsvLTN.c (100%) rename {scikits/learn => sklearn}/src/cblas/ATL_sreftrsvLTU.c (100%) rename {scikits/learn => sklearn}/src/cblas/ATL_sreftrsvUNN.c (100%) rename {scikits/learn => sklearn}/src/cblas/ATL_sreftrsvUNU.c (100%) rename {scikits/learn => sklearn}/src/cblas/ATL_sreftrsvUTN.c (100%) rename {scikits/learn => sklearn}/src/cblas/ATL_sreftrsvUTU.c (100%) rename {scikits/learn => sklearn}/src/cblas/README.txt (100%) rename {scikits/learn => sklearn}/src/cblas/atlas_aux.h (100%) rename {scikits/learn => sklearn}/src/cblas/atlas_dsysinfo.h (100%) rename {scikits/learn => sklearn}/src/cblas/atlas_enum.h (100%) rename {scikits/learn => sklearn}/src/cblas/atlas_level1.h (100%) rename {scikits/learn => sklearn}/src/cblas/atlas_level2.h (100%) rename {scikits/learn => sklearn}/src/cblas/atlas_misc.h (100%) rename {scikits/learn => sklearn}/src/cblas/atlas_refalias1.h (100%) rename {scikits/learn => sklearn}/src/cblas/atlas_refalias2.h (100%) rename {scikits/learn => sklearn}/src/cblas/atlas_reflevel1.h (100%) rename {scikits/learn => sklearn}/src/cblas/atlas_reflevel2.h (100%) rename {scikits/learn => sklearn}/src/cblas/atlas_reflvl2.h (100%) rename {scikits/learn => sklearn}/src/cblas/atlas_refmisc.h (100%) rename {scikits/learn => sklearn}/src/cblas/atlas_ssysinfo.h (100%) rename {scikits/learn => sklearn}/src/cblas/atlas_type.h (100%) rename {scikits/learn => sklearn}/src/cblas/cblas.h (100%) rename {scikits/learn => sklearn}/src/cblas/cblas_daxpy.c (100%) rename {scikits/learn => sklearn}/src/cblas/cblas_dcopy.c (100%) rename {scikits/learn => sklearn}/src/cblas/cblas_ddot.c (100%) rename {scikits/learn => sklearn}/src/cblas/cblas_dnrm2.c (100%) rename {scikits/learn => sklearn}/src/cblas/cblas_drot.c (100%) rename {scikits/learn => sklearn}/src/cblas/cblas_drotg.c (100%) rename {scikits/learn => sklearn}/src/cblas/cblas_dscal.c (100%) rename {scikits/learn => sklearn}/src/cblas/cblas_dtrsv.c (100%) rename {scikits/learn => sklearn}/src/cblas/cblas_errprn.c (100%) rename {scikits/learn => sklearn}/src/cblas/cblas_scopy.c (100%) rename {scikits/learn => sklearn}/src/cblas/cblas_srot.c (100%) rename {scikits/learn => sklearn}/src/cblas/cblas_srotg.c (100%) rename {scikits/learn => sklearn}/src/cblas/cblas_strsv.c (100%) rename {scikits/learn => sklearn}/src/cblas/cblas_xerbla.c (100%) rename {scikits/learn => sklearn}/svm/__init__.py (100%) rename {scikits/learn => sklearn}/svm/base.py (100%) rename {scikits/learn => sklearn}/svm/bounds.py (100%) rename {scikits/learn => sklearn}/svm/classes.py (99%) rename {scikits/learn => sklearn}/svm/liblinear.c (88%) rename {scikits/learn => sklearn}/svm/liblinear.pyx (100%) rename {scikits/learn => sklearn}/svm/libsvm.c (77%) rename {scikits/learn => sklearn}/svm/libsvm.pxd (100%) rename {scikits/learn => sklearn}/svm/libsvm.pyx (100%) rename {scikits/learn => sklearn}/svm/setup.py (100%) rename {scikits/learn => sklearn}/svm/sparse/__init__.py (90%) rename {scikits/learn => sklearn}/svm/sparse/base.py (100%) rename {scikits/learn => sklearn}/svm/sparse/classes.py (93%) rename {scikits/learn => sklearn}/svm/sparse/libsvm.c (89%) rename {scikits/learn => sklearn}/svm/sparse/libsvm.pyx (100%) rename {scikits/learn => sklearn}/svm/sparse/setup.py (100%) rename {scikits/learn => sklearn}/svm/src/blas/Makefile (100%) rename {scikits/learn => sklearn}/svm/src/blas/blas.h (100%) rename {scikits/learn => sklearn}/svm/src/blas/blasp.h (100%) rename {scikits/learn => sklearn}/svm/src/blas/daxpy.c (100%) rename {scikits/learn => sklearn}/svm/src/blas/ddot.c (100%) rename {scikits/learn => sklearn}/svm/src/blas/dnrm2.c (100%) rename {scikits/learn => sklearn}/svm/src/blas/dscal.c (100%) rename {scikits/learn => sklearn}/svm/src/liblinear/COPYRIGHT (100%) rename {scikits/learn => sklearn}/svm/src/liblinear/LIBLINEAR_CHANGES (100%) rename {scikits/learn => sklearn}/svm/src/liblinear/liblinear_helper.c (100%) rename {scikits/learn => sklearn}/svm/src/liblinear/linear.cpp (100%) rename {scikits/learn => sklearn}/svm/src/liblinear/linear.h (100%) rename {scikits/learn => sklearn}/svm/src/liblinear/tron.cpp (100%) rename {scikits/learn => sklearn}/svm/src/liblinear/tron.h (100%) rename {scikits/learn => sklearn}/svm/src/libsvm/LIBSVM_CHANGES (100%) rename {scikits/learn => sklearn}/svm/src/libsvm/_libsvm_sparse.c (100%) rename {scikits/learn => sklearn}/svm/src/libsvm/libsvm_helper.c (100%) rename {scikits/learn => sklearn}/svm/src/libsvm/libsvm_sparse_helper.c (100%) rename {scikits/learn => sklearn}/svm/src/libsvm/libsvm_template.cpp (100%) rename {scikits/learn => sklearn}/svm/src/libsvm/svm.cpp (100%) rename {scikits/learn => sklearn}/svm/src/libsvm/svm.h (100%) rename {scikits/learn => sklearn}/svm/tests/__init__.py (100%) rename {scikits/learn => sklearn}/svm/tests/test_bounds.py (87%) rename {scikits/learn => sklearn}/svm/tests/test_sparse.py (98%) rename {scikits/learn => sklearn}/svm/tests/test_svm.py (97%) rename {scikits/learn => sklearn}/tests/__init__.py (100%) rename {scikits/learn => sklearn}/tests/test_base.py (95%) rename {scikits/learn => sklearn}/tests/test_cross_val.py (100%) rename {scikits/learn => sklearn}/tests/test_grid_search.py (88%) rename {scikits/learn => sklearn}/tests/test_hmm.py (99%) rename {scikits/learn => sklearn}/tests/test_init.py (94%) rename {scikits/learn => sklearn}/tests/test_lda.py (100%) rename {scikits/learn => sklearn}/tests/test_multiclass.py (89%) rename {scikits/learn => sklearn}/tests/test_naive_bayes.py (100%) rename {scikits/learn => sklearn}/tests/test_neighbors.py (99%) rename {scikits/learn => sklearn}/tests/test_pipeline.py (100%) rename {scikits/learn => sklearn}/tests/test_pls.py (98%) rename {scikits/learn => sklearn}/tests/test_qda.py (100%) rename {scikits/learn => sklearn}/utils/__init__.py (97%) rename {scikits/learn => sklearn}/utils/_csgraph.py (100%) rename {scikits/learn => sklearn}/utils/arpack.py (99%) rename {scikits/learn => sklearn}/utils/arrayfuncs.c (100%) rename {scikits/learn => sklearn}/utils/arrayfuncs.pyx (100%) rename {scikits/learn => sklearn}/utils/bench.py (100%) rename {scikits/learn => sklearn}/utils/extmath.py (99%) rename {scikits/learn => sklearn}/utils/fixes.py (100%) rename {scikits/learn => sklearn}/utils/graph.py (98%) rename {scikits/learn => sklearn}/utils/graph_shortest_path.c (100%) rename {scikits/learn => sklearn}/utils/graph_shortest_path.pyx (100%) rename {scikits/learn => sklearn}/utils/setup.py (100%) rename {scikits/learn => sklearn}/utils/sparsetools/README (100%) rename {scikits/learn => sklearn}/utils/sparsetools/__init__.py (100%) rename {scikits/learn => sklearn}/utils/sparsetools/complex_ops.h (100%) rename {scikits/learn => sklearn}/utils/sparsetools/csgraph.h (100%) rename {scikits/learn => sklearn}/utils/sparsetools/csgraph.i (100%) rename {scikits/learn => sklearn}/utils/sparsetools/csgraph.py (100%) rename {scikits/learn => sklearn}/utils/sparsetools/csgraph_wrap.cxx (100%) rename {scikits/learn => sklearn}/utils/sparsetools/npy_3kcompat.h (100%) rename {scikits/learn => sklearn}/utils/sparsetools/py3k.h (100%) rename {scikits/learn => sklearn}/utils/sparsetools/setup.py (100%) rename {scikits/learn => sklearn}/utils/src/cholesky_delete.c (100%) rename {scikits/learn => sklearn}/utils/testing.py (100%) rename {scikits/learn => sklearn}/utils/tests/__init__.py (100%) rename {scikits/learn => sklearn}/utils/tests/test___init__.py (100%) rename {scikits/learn => sklearn}/utils/tests/test_fixes.py (100%) rename {scikits/learn => sklearn}/utils/tests/test_graph.py (100%) rename {scikits/learn => sklearn}/utils/tests/test_shortest_path.py (95%) rename {scikits/learn => sklearn}/utils/tests/test_svd.py (97%) rename {scikits/learn => sklearn}/utils/tests/test_utils.py (91%) diff --git a/Makefile b/Makefile index edfa8c72f704b..45647eaebc483 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ inplace: $(PYTHON) setup.py build_ext -i test-code: in - $(NOSETESTS) -s scikits/learn + $(NOSETESTS) -s sklearn 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 c599df284dcae..0d77ccb352766 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 scikits.learn + pip install -U sklearn or:: - easy_install -U scikits.learn + easy_install -U sklearn 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-scikits-learn and can be install +The Debian package is named python-sklearn and can be install using the following commands with root privileges:: - apt-get install python-scikits-learn + apt-get install python-sklearn Python(x, y) @@ -170,17 +170,17 @@ version. Macports -------- -The macport's package is named py26-scikits-learn and can be installed +The macport's package is named py26-sklearn and can be installed by typing the following command:: - sudo port install py26-scikits-learn + sudo port install py26-sklearn NetBSD ------ scikit-learn is available via `pkgsrc-wip `_: - http://pkgsrc.se/wip/py-scikits_learn + http://pkgsrc.se/wip/py-sklearn .. _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 scikits.learn as skl; skl.test()" + python -c "import sklearn 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 scikits/learn/ + nosetests sklearn/ 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 76b856de140af..08b5f4957ada4 100644 --- a/doc/modules/classes.rst +++ b/doc/modules/classes.rst @@ -10,11 +10,11 @@ Support Vector Machines ======================= -.. automodule:: scikits.learn.svm +.. automodule:: sklearn.svm :no-members: :no-inherited-members: -.. currentmodule:: scikits.learn +.. currentmodule:: sklearn .. autosummary:: :toctree: generated/ @@ -37,11 +37,11 @@ Support Vector Machines For sparse data --------------- -.. automodule:: scikits.learn.svm.sparse +.. automodule:: sklearn.svm.sparse :no-members: :no-inherited-members: -.. currentmodule:: scikits.learn +.. currentmodule:: sklearn .. autosummary:: :toctree: generated/ @@ -73,11 +73,11 @@ Low-level methods Generalized Linear Models ========================= -.. automodule:: scikits.learn.linear_model +.. automodule:: sklearn.linear_model :no-members: :no-inherited-members: -.. currentmodule:: scikits.learn +.. currentmodule:: sklearn .. autosummary:: :toctree: generated/ @@ -116,11 +116,11 @@ Generalized Linear Models For sparse data --------------- -.. automodule:: scikits.learn.linear_model.sparse +.. automodule:: sklearn.linear_model.sparse :no-members: :no-inherited-members: -.. currentmodule:: scikits.learn +.. currentmodule:: sklearn .. autosummary:: :toctree: generated/ @@ -136,11 +136,11 @@ For sparse data Naive Bayes =========== -.. automodule:: scikits.learn.naive_bayes +.. automodule:: sklearn.naive_bayes :no-members: :no-inherited-members: -.. currentmodule:: scikits.learn +.. currentmodule:: sklearn .. autosummary:: :toctree: generated/ @@ -154,11 +154,11 @@ Naive Bayes Nearest Neighbors ================= -.. automodule:: scikits.learn.neighbors +.. automodule:: sklearn.neighbors :no-members: :no-inherited-members: -.. currentmodule:: scikits.learn +.. currentmodule:: sklearn .. autosummary:: :toctree: generated/ @@ -179,11 +179,11 @@ Nearest Neighbors Gaussian Mixture Models ======================= -.. automodule:: scikits.learn.mixture +.. automodule:: sklearn.mixture :no-members: :no-inherited-members: -.. currentmodule:: scikits.learn +.. currentmodule:: sklearn .. autosummary:: :toctree: generated/ @@ -197,11 +197,11 @@ Gaussian Mixture Models Hidden Markov Models ==================== -.. automodule:: scikits.learn.hmm +.. automodule:: sklearn.hmm :no-members: :no-inherited-members: -.. currentmodule:: scikits.learn +.. currentmodule:: sklearn .. autosummary:: :toctree: generated/ @@ -215,11 +215,11 @@ Hidden Markov Models Clustering ========== -.. automodule:: scikits.learn.cluster +.. automodule:: sklearn.cluster :no-members: :no-inherited-members: -.. currentmodule:: scikits.learn +.. currentmodule:: sklearn .. autosummary:: :toctree: generated/ @@ -240,11 +240,11 @@ Metrics Classification metrics ---------------------- -.. automodule:: scikits.learn.metrics +.. automodule:: sklearn.metrics :no-members: :no-inherited-members: -.. currentmodule:: scikits.learn +.. currentmodule:: sklearn .. autosummary:: :toctree: generated/ @@ -268,11 +268,11 @@ Classification metrics Regression metrics ------------------ -.. automodule:: scikits.learn.metrics +.. automodule:: sklearn.metrics :no-members: :no-inherited-members: -.. currentmodule:: scikits.learn +.. currentmodule:: sklearn .. autosummary:: :toctree: generated/ @@ -285,11 +285,11 @@ Regression metrics Clustering metrics ------------------ -.. automodule:: scikits.learn.metrics.cluster +.. automodule:: sklearn.metrics.cluster :no-members: :no-inherited-members: -.. currentmodule:: scikits.learn +.. currentmodule:: sklearn .. autosummary:: :toctree: generated/ @@ -303,11 +303,11 @@ Clustering metrics Pairwise metrics ---------------- -.. automodule:: scikits.learn.metrics.pairwise +.. automodule:: sklearn.metrics.pairwise :no-members: :no-inherited-members: -.. currentmodule:: scikits.learn +.. currentmodule:: sklearn .. autosummary:: :toctree: generated/ @@ -323,11 +323,11 @@ Pairwise metrics Covariance Estimators ===================== -.. automodule:: scikits.learn.covariance +.. automodule:: sklearn.covariance :no-members: :no-inherited-members: -.. currentmodule:: scikits.learn +.. currentmodule:: sklearn .. autosummary:: :toctree: generated/ @@ -351,11 +351,11 @@ Covariance Estimators Signal Decomposition ==================== -.. automodule:: scikits.learn.decomposition +.. automodule:: sklearn.decomposition :no-members: :no-inherited-members: -.. currentmodule:: scikits.learn +.. currentmodule:: sklearn .. autosummary:: :toctree: generated/ @@ -393,11 +393,11 @@ Linear Discriminant Analysis Partial Least Squares ===================== -.. automodule:: scikits.learn.pls +.. automodule:: sklearn.pls :no-members: :no-inherited-members: -.. currentmodule:: scikits.learn +.. currentmodule:: sklearn .. autosummary:: :toctree: generated/ @@ -412,11 +412,11 @@ Partial Least Squares Cross Validation ================ -.. automodule:: scikits.learn.cross_val +.. automodule:: sklearn.cross_val :no-members: :no-inherited-members: -.. currentmodule:: scikits.learn +.. currentmodule:: sklearn .. autosummary:: :toctree: generated/ @@ -435,11 +435,11 @@ Cross Validation Grid Search =========== -.. automodule:: scikits.learn.grid_search +.. automodule:: sklearn.grid_search :no-members: :no-inherited-members: -.. currentmodule:: scikits.learn +.. currentmodule:: sklearn .. autosummary:: :toctree: generated/ @@ -454,11 +454,11 @@ Grid Search Feature Selection ================= -.. automodule:: scikits.learn.feature_selection +.. automodule:: sklearn.feature_selection :no-members: :no-inherited-members: -.. currentmodule:: scikits.learn +.. currentmodule:: sklearn .. autosummary:: :toctree: generated/ @@ -474,20 +474,20 @@ Feature Selection Feature Extraction ================== -.. automodule:: scikits.learn.feature_extraction +.. automodule:: sklearn.feature_extraction :no-members: :no-inherited-members: -.. currentmodule:: scikits.learn +.. currentmodule:: sklearn From images ------------- -.. automodule:: scikits.learn.feature_extraction.image +.. automodule:: sklearn.feature_extraction.image :no-members: :no-inherited-members: -.. currentmodule:: scikits.learn +.. currentmodule:: sklearn .. autosummary:: :toctree: generated/ @@ -506,11 +506,11 @@ From images From text --------- -.. automodule:: scikits.learn.feature_extraction.text +.. automodule:: sklearn.feature_extraction.text :no-members: :no-inherited-members: -.. currentmodule:: scikits.learn +.. currentmodule:: sklearn .. autosummary:: :toctree: generated/ @@ -527,11 +527,11 @@ From text Preprocessing and normalization =============================== -.. automodule:: scikits.learn.preprocessing +.. automodule:: sklearn.preprocessing :no-members: :no-inherited-members: -.. currentmodule:: scikits.learn +.. currentmodule:: sklearn .. autosummary:: :toctree: generated/ @@ -577,11 +577,11 @@ Datasets Loaders ------- -.. automodule:: scikits.learn.datasets +.. automodule:: sklearn.datasets :no-members: :no-inherited-members: -.. currentmodule:: scikits.learn +.. currentmodule:: sklearn .. autosummary:: :toctree: generated/ @@ -602,11 +602,11 @@ Loaders Samples generator ----------------- -.. automodule:: scikits.learn.datasets +.. automodule:: sklearn.datasets :no-members: :no-inherited-members: -.. currentmodule:: scikits.learn +.. currentmodule:: sklearn .. autosummary:: :toctree: generated/ @@ -629,11 +629,11 @@ Samples generator Pipeline ======== -.. automodule:: scikits.learn.pipeline +.. automodule:: sklearn.pipeline :no-members: :no-inherited-members: -.. currentmodule:: scikits.learn +.. currentmodule:: sklearn .. autosummary:: :toctree: generated/ @@ -645,11 +645,11 @@ Pipeline Utilities ========= -.. automodule:: scikits.learn.utils +.. automodule:: sklearn.utils :no-members: :no-inherited-members: -.. currentmodule:: scikits.learn +.. currentmodule:: sklearn .. autosummary:: :toctree: generated/ diff --git a/doc/modules/clustering.rst b/doc/modules/clustering.rst index 418aaf6771bfa..f7a1925bded4b 100644 --- a/doc/modules/clustering.rst +++ b/doc/modules/clustering.rst @@ -5,7 +5,7 @@ Clustering ========== `Clustering `__ of -unlabeled data can be performed with the module :mod:`scikits.learn.cluster`. +unlabeled data can be performed with the module :mod:`sklearn.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:: scikits.learn.cluster +.. currentmodule:: sklearn.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:`scikits.learn.feature_extraction` module. On the other hand, + the :mod:`sklearn.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:`scikits.learn.metrics.pairwise` + obtained from the functions in the :mod:`sklearn.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:`scikits.learn.neighbors.kneighbors_graph` to restrict +using :func:`sklearn.neighbors.kneighbors_graph` to restrict merging to nearest neighbors as in the :ref:`swiss roll ` example, or -using :func:`scikits.learn.feature_extraction.image.grid_to_graph` to +using :func:`sklearn.feature_extraction.image.grid_to_graph` to enable only merging of neighboring pixels on an image, as in the :ref:`Lena ` 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:: scikits.learn.metrics +.. currentmodule:: sklearn.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 scikits.learn import metrics + >>> from sklearn 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 b02d4a4082a83..46027c881c7f1 100644 --- a/doc/modules/covariance.rst +++ b/doc/modules/covariance.rst @@ -4,7 +4,7 @@ Covariance estimation =================================================== -.. currentmodule:: scikits.learn.covariance +.. currentmodule:: sklearn.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 -`scikits.learn.covariance` package aims at providing tools affording +`sklearn.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 -`scikits.learn.covariance` package, or it can be otherwise obtained by +`sklearn.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 `scikits.learn.covariance` +with the :meth:`oas` function of the `sklearn.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 0db1ad2133834..96d6167ccf782 100644 --- a/doc/modules/cross_validation.rst +++ b/doc/modules/cross_validation.rst @@ -2,7 +2,7 @@ Cross-Validation ================ -.. currentmodule:: scikits.learn.cross_val +.. currentmodule:: sklearn.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 scikits.learn.cross_val import LeaveOneOut + >>> from sklearn.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 - scikits.learn.cross_val.LeaveOneOut(n=4) + sklearn.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 scikits.learn.cross_val import LeaveOneOut + >>> from sklearn.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 - scikits.learn.cross_val.LeaveOneOut(n=4) + sklearn.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 scikits.learn.cross_val import LeavePOut + >>> from sklearn.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 - scikits.learn.cross_val.LeavePOut(n=4, p=2) + sklearn.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 scikits.learn.cross_val import KFold + >>> from sklearn.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 - scikits.learn.cross_val.KFold(n=4, k=2) + sklearn.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 scikits.learn.cross_val import StratifiedKFold + >>> from sklearn.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 - scikits.learn.cross_val.StratifiedKFold(labels=[0 0 0 1 1 1 0], k=2) + sklearn.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 scikits.learn.cross_val import LeaveOneLabelOut + >>> from sklearn.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 - scikits.learn.cross_val.LeaveOneLabelOut(labels=[1, 1, 2, 2]) + sklearn.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 scikits.learn.cross_val import LeavePLabelOut + >>> from sklearn.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 - scikits.learn.cross_val.LeavePLabelOut(labels=[1, 1, 2, 2, 3, 3], p=2) + sklearn.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 scikits.learn import cross_val + >>> from sklearn 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 0d1e42094e028..4b5633003c7ed 100644 --- a/doc/modules/decomposition.rst +++ b/doc/modules/decomposition.rst @@ -5,7 +5,7 @@ Decomposing signals in components (matrix factorization problems) ================================================================= -.. currentmodule:: scikits.learn.decomposition +.. currentmodule:: sklearn.decomposition .. _PCA: diff --git a/doc/modules/dp-derivation.rst b/doc/modules/dp-derivation.rst index 50ac37666e0cd..6c35079c68869 100644 --- a/doc/modules/dp-derivation.rst +++ b/doc/modules/dp-derivation.rst @@ -1,7 +1,7 @@ .. _dpgmm: -.. currentmodule:: scikits.learn.mixture +.. currentmodule:: sklearn.mixture Variational Gaussian Mixture Models diff --git a/doc/modules/feature_extraction.rst b/doc/modules/feature_extraction.rst index 7916e698e222d..afa09358b4858 100644 --- a/doc/modules/feature_extraction.rst +++ b/doc/modules/feature_extraction.rst @@ -5,9 +5,9 @@ Feature extraction ================== -.. currentmodule:: scikits.learn.feature_extraction +.. currentmodule:: sklearn.feature_extraction -The :mod:`scikits.learn.feature_extraction` module can be used to extract +The :mod:`sklearn.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:: scikits.learn.feature_extraction.text +.. currentmodule:: sklearn.feature_extraction.text XXX: a lot to do here @@ -23,7 +23,7 @@ XXX: a lot to do here Image feature extraction ======================== -.. currentmodule:: scikits.learn.feature_extraction.image +.. currentmodule:: sklearn.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 scikits.learn.feature_extraction import image + >>> from sklearn.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 d9864469575f3..76415528fc427 100644 --- a/doc/modules/feature_selection.rst +++ b/doc/modules/feature_selection.rst @@ -5,12 +5,12 @@ Feature selection ================= -The classes in the ``scikits.learn.feature_selection`` module can be used +The classes in the ``sklearn.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:: scikits.learn.feature_selection +.. currentmodule:: sklearn.feature_selection Univariate feature selection ============================ diff --git a/doc/modules/gaussian_process.rst b/doc/modules/gaussian_process.rst index 07d7396ad52e5..63d615baacaa8 100644 --- a/doc/modules/gaussian_process.rst +++ b/doc/modules/gaussian_process.rst @@ -6,7 +6,7 @@ Gaussian Processes ================== -.. currentmodule:: scikits.learn.gaussian_process +.. currentmodule:: sklearn.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 scikits.learn import gaussian_process + >>> from sklearn 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 811ede07ddbf7..40b6e44f917ed 100644 --- a/doc/modules/grid_search.rst +++ b/doc/modules/grid_search.rst @@ -2,7 +2,7 @@ Grid Search =================================================== -.. currentmodule:: scikits.learn.grid_search +.. currentmodule:: sklearn.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 629f215537b47..d1ca443f8da4f 100644 --- a/doc/modules/hmm.rst +++ b/doc/modules/hmm.rst @@ -9,7 +9,7 @@ Hidden Markov Models the mailing list. -.. currentmodule:: scikits.learn.hmm +.. currentmodule:: sklearn.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 0dc5c15dd959a..1d1da635f0915 100644 --- a/doc/modules/linear_model.rst +++ b/doc/modules/linear_model.rst @@ -5,7 +5,7 @@ Generalized Linear Models ========================= -.. currentmodule:: scikits.learn.linear_model +.. currentmodule:: sklearn.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 scikits.learn import linear_model + >>> from sklearn 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 scikits.learn import linear_model + >>> from sklearn 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 scikits.learn import linear_model + >>> from sklearn 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 scikits.learn import linear_model + >>> from sklearn 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 scikits.learn import linear_model + >>> from sklearn 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:`scikits.learn.svm.l1_min_c` allows to calculate +For L1 penalization :func:`sklearn.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 ecf22534a8133..9fbba304072ea 100644 --- a/doc/modules/manifold.rst +++ b/doc/modules/manifold.rst @@ -1,7 +1,7 @@ .. _manifold: -.. currentmodule:: scikits.learn.manifold +.. currentmodule:: sklearn.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 scikits-learn are +The manifold learning implementations available in sklearn are summarized below Isomap @@ -114,7 +114,7 @@ Complexity The Isomap algorithm comprises three stages: 1. **Nearest neighbor search.** Isomap uses - :class:`scikits.learn.neighbors.BallTree` for efficient neighbor search. + :class:`sklearn.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, ``scikits-learn`` implements some algorithmic +scaling with data size, ``sklearn`` 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 d645a098aa036..dbf2db9d5ff7e 100644 --- a/doc/modules/mixture.rst +++ b/doc/modules/mixture.rst @@ -4,9 +4,9 @@ Gaussian mixture models =================================================== -.. currentmodule:: scikits.learn.mixture +.. currentmodule:: sklearn.mixture -`scikits.learn.mixture` is a package which enables one to learn +`sklearn.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 `scikits.learn` we implement +or some other external criterion. Here in `sklearn` 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 `scikits.learn` this algorithm in +to a local optimum. In the `sklearn` 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:: scikits.learn.mixture +.. currentmodule:: sklearn.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:: scikits.learn.mixture +.. currentmodule:: sklearn.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 767fdf75a50c9..e657335a064c7 100644 --- a/doc/modules/multiclass.rst +++ b/doc/modules/multiclass.rst @@ -2,7 +2,7 @@ Multiclass algorithms ===================== -.. currentmodule:: scikits.learn.multiclass +.. currentmodule:: sklearn.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 scikits.learn import datasets - >>> from scikits.learn.multiclass import OneVsRestClassifier - >>> from scikits.learn.svm import LinearSVC + >>> from sklearn import datasets + >>> from sklearn.multiclass import OneVsRestClassifier + >>> from sklearn.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 scikits.learn import datasets - >>> from scikits.learn.multiclass import OneVsOneClassifier - >>> from scikits.learn.svm import LinearSVC + >>> from sklearn import datasets + >>> from sklearn.multiclass import OneVsOneClassifier + >>> from sklearn.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 scikits.learn import datasets - >>> from scikits.learn.multiclass import OutputCodeClassifier - >>> from scikits.learn.svm import LinearSVC + >>> from sklearn import datasets + >>> from sklearn.multiclass import OutputCodeClassifier + >>> from sklearn.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 b77c0bedef856..9bad53492a537 100644 --- a/doc/modules/naive_bayes.rst +++ b/doc/modules/naive_bayes.rst @@ -2,7 +2,7 @@ Naive Bayes =========== -.. currentmodule:: scikits.learn.naive_bayes +.. currentmodule:: sklearn.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 0f5115267ef9e..4b61ba192a22a 100644 --- a/doc/modules/neighbors.rst +++ b/doc/modules/neighbors.rst @@ -2,7 +2,7 @@ Nearest Neighbors ================= -.. currentmodule:: scikits.learn.neighbors +.. currentmodule:: sklearn.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 d0a4943060929..668332461c4f5 100644 --- a/doc/modules/pls.rst +++ b/doc/modules/pls.rst @@ -4,7 +4,7 @@ Partial Least Squares ====================== -.. currentmodule:: scikits.learn.pls +.. currentmodule:: sklearn.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 76c7836f74e16..4901bd4ee9f5a 100644 --- a/doc/modules/preprocessing.rst +++ b/doc/modules/preprocessing.rst @@ -4,9 +4,9 @@ Preprocessing data ================== -.. currentmodule:: scikits.learn.preprocessing +.. currentmodule:: sklearn.preprocessing -The ``scikits.learn.preprocessing`` package provides several common +The ``sklearn.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 scikits.learn import preprocessing + >>> from sklearn 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:`scikits.learn.pipeline.Pipeline`:: +:class:`sklearn.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:`scikits.learn.decomposition.PCA` - or :class:`scikits.learn.decomposition.RandomizedPCA` with ``whiten=True`` + To address this issue you can use :class:`sklearn.decomposition.PCA` + or :class:`sklearn.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:`scikits.learn.pipeline.Pipeline`:: +:class:`sklearn.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:`scikits.learn.pipeline.Pipeline`. The ``fit`` method does nothing +:class:`sklearn.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 e3f435a58946d..1b0b6cedc68f7 100644 --- a/doc/modules/sgd.rst +++ b/doc/modules/sgd.rst @@ -5,7 +5,7 @@ Stochastic Gradient Descent =========================== -.. currentmodule:: scikits.learn.linear_model +.. currentmodule:: sklearn.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 scikits.learn.linear_model import SGDClassifier + >>> from sklearn.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:: scikits.learn.linear_model.sparse +.. currentmodule:: sklearn.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 scikits.learn.preprocessing import Scaler + from sklearn.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 697b0abd1a37f..8696cdc4b004c 100644 --- a/doc/modules/svm.rst +++ b/doc/modules/svm.rst @@ -5,7 +5,7 @@ Support Vector Machines ======================= -.. currentmodule:: scikits.learn.svm +.. currentmodule:: sklearn.svm **Support vector machines (SVMs)** are a set of supervised learning methods used for :ref:`classification `, @@ -74,7 +74,7 @@ of integer values, size [n_samples], holding the class labels for the training samples:: - >>> from scikits.learn import svm + >>> from sklearn 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 scikits.learn import svm + >>> from sklearn 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:: scikits.learn.svm.sparse +.. currentmodule:: sklearn.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 scikits.learn import svm + >>> from sklearn import svm >>> def my_kernel(x, y): ... return np.dot(x, y.T) ... diff --git a/doc/tutorial.rst b/doc/tutorial.rst index cc90d8d9768cb..a1c64d5cd6077 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 `_ for regression.:: - >>> from scikits.learn import datasets + >>> from sklearn 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`. -``scikits.learn`` also offers the possibility to reuse external datasets coming +``sklearn`` 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 ``scikits.learn.svm.SVC`` that +An example of estimator is the class ``sklearn.svm.SVC`` that implements `Support Vector Classification `_. 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 scikits.learn import svm +>>> from sklearn 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 `_. ->>> from scikits.learn import svm ->>> from scikits.learn import datasets +>>> from sklearn import svm +>>> from sklearn 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 scikits.learn.externals import joblib +>>> from sklearn.externals import joblib >>> joblib.dump(clf, 'filename.pkl') # doctest: +SKIP diff --git a/doc/whats_new.rst b/doc/whats_new.rst index 098117050eea3..ee1d060bf4c5e 100644 --- a/doc/whats_new.rst +++ b/doc/whats_new.rst @@ -1,5 +1,5 @@ -.. currentmodule:: scikits.learn +.. currentmodule:: sklearn .. _changes_0_8: @@ -257,7 +257,7 @@ Changelog - Improved sparse matrix support, both in main classes (:class:`grid_search.GridSearchCV`) as in modules - scikits.learn.svm.sparse and scikits.learn.linear_model.sparse. + sklearn.svm.sparse and sklearn.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 `) - - New FastICA algorithm in module scikits.learn.fastica + - New FastICA algorithm in module sklearn.fastica Documentation @@ -397,7 +397,7 @@ External dependencies ~~~~~~~~~~~~~~~~~~~~~ - Joblib is now a dependencie of this package, although it is - shipped with (scikits.learn.externals.joblib). + shipped with (sklearn.externals.joblib). Removed modules ~~~~~~~~~~~~~~~ diff --git a/examples/applications/face_recognition.py b/examples/applications/face_recognition.py index 5251f0cfcdbbd..a9e3efe1fa6d7 100644 --- a/examples/applications/face_recognition.py +++ b/examples/applications/face_recognition.py @@ -36,13 +36,13 @@ import logging import pylab as pl -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 +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 # 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 9d70ec02a11f8..c7f1d5dd5ad24 100644 --- a/examples/applications/plot_species_distribution_modeling.py +++ b/examples/applications/plot_species_distribution_modeling.py @@ -10,7 +10,7 @@ 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 `scikits.learn.svm` as our modeling tool. +by the package `sklearn.svm` as our modeling tool. The dataset is provided by Phillips et. al. (2006). If available, the example uses `basemap `_ to plot the coast lines and national boundaries of South America. @@ -54,9 +54,9 @@ except ImportError: basemap = False -from scikits.learn import svm -from scikits.learn.metrics import roc_curve, auc -from scikits.learn.datasets.base import Bunch +from sklearn import svm +from sklearn.metrics import roc_curve, auc +from sklearn.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 25a1ef61dbc7e..c45351683c615 100644 --- a/examples/applications/stock_market.py +++ b/examples/applications/stock_market.py @@ -15,7 +15,7 @@ from matplotlib import finance import numpy as np -from scikits.learn import cluster +from sklearn 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 9667d9d0ff04c..a8b5836e95c1f 100644 --- a/examples/applications/svm_gui.py +++ b/examples/applications/svm_gui.py @@ -33,7 +33,7 @@ import sys import numpy as np -from scikits.learn import svm +from sklearn 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 f446d46466404..14246e0967782 100644 --- a/examples/applications/topics_extraction_with_nmf.py +++ b/examples/applications/topics_extraction_with_nmf.py @@ -36,9 +36,9 @@ """ from time import time -from scikits.learn.feature_extraction import text -from scikits.learn import decomposition -from scikits.learn import datasets +from sklearn.feature_extraction import text +from sklearn import decomposition +from sklearn 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 12a49c6df9040..50ec843d35598 100644 --- a/examples/applications/wikipedia_principal_eigenvector.py +++ b/examples/applications/wikipedia_principal_eigenvector.py @@ -43,8 +43,8 @@ from scipy import sparse -from scikits.learn.utils.extmath import fast_svd -from scikits.learn.externals.joblib import Memory +from sklearn.utils.extmath import fast_svd +from sklearn.externals.joblib import Memory ################################################################################ diff --git a/examples/cluster/plot_affinity_propagation.py b/examples/cluster/plot_affinity_propagation.py index 69ff4475a2100..2dc630bc75282 100644 --- a/examples/cluster/plot_affinity_propagation.py +++ b/examples/cluster/plot_affinity_propagation.py @@ -11,9 +11,9 @@ print __doc__ import numpy as np -from scikits.learn.cluster import AffinityPropagation -from scikits.learn import metrics -from scikits.learn.datasets.samples_generator import make_blobs +from sklearn.cluster import AffinityPropagation +from sklearn import metrics +from sklearn.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 36afcf1441329..518376e86b816 100644 --- a/examples/cluster/plot_color_quantization.py +++ b/examples/cluster/plot_color_quantization.py @@ -27,10 +27,10 @@ print __doc__ import numpy as np import pylab as pl -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 sklearn.cluster import KMeans +from sklearn.metrics import euclidean_distances +from sklearn.datasets import load_sample_image +from sklearn.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 175f9eb96b4d6..38a32f53d31e3 100644 --- a/examples/cluster/plot_dbscan.py +++ b/examples/cluster/plot_dbscan.py @@ -11,9 +11,9 @@ import numpy as np from scipy.spatial import distance -from scikits.learn.cluster import DBSCAN -from scikits.learn import metrics -from scikits.learn.datasets.samples_generator import make_blobs +from sklearn.cluster import DBSCAN +from sklearn import metrics +from sklearn.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 951a4f2c6c71f..c23b944db31ae 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 pylab as pl from scipy import linalg, ndimage -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 +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 ############################################################################### # Generate data diff --git a/examples/cluster/plot_kmeans_digits.py b/examples/cluster/plot_kmeans_digits.py index 76440884a3584..77925a5d133c0 100644 --- a/examples/cluster/plot_kmeans_digits.py +++ b/examples/cluster/plot_kmeans_digits.py @@ -16,11 +16,11 @@ import numpy as np import pylab as pl -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 +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 np.random.seed(42) diff --git a/examples/cluster/plot_lena_segmentation.py b/examples/cluster/plot_lena_segmentation.py index 2c11c4bb06f7e..bc637fb31b1c5 100644 --- a/examples/cluster/plot_lena_segmentation.py +++ b/examples/cluster/plot_lena_segmentation.py @@ -19,8 +19,8 @@ import scipy as sp import pylab as pl -from scikits.learn.feature_extraction import image -from scikits.learn.cluster import spectral_clustering +from sklearn.feature_extraction import image +from sklearn.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 03374ba5caec3..a4e99d998a9d7 100644 --- a/examples/cluster/plot_lena_ward_segmentation.py +++ b/examples/cluster/plot_lena_ward_segmentation.py @@ -18,8 +18,8 @@ import numpy as np import scipy as sp import pylab as pl -from scikits.learn.feature_extraction.image import grid_to_graph -from scikits.learn.cluster import Ward +from sklearn.feature_extraction.image import grid_to_graph +from sklearn.cluster import Ward ############################################################################### # Generate data diff --git a/examples/cluster/plot_mean_shift.py b/examples/cluster/plot_mean_shift.py index 13fdbdfeb4e7f..b310378a940d3 100644 --- a/examples/cluster/plot_mean_shift.py +++ b/examples/cluster/plot_mean_shift.py @@ -13,8 +13,8 @@ print __doc__ import numpy as np -from scikits.learn.cluster import MeanShift, estimate_bandwidth -from scikits.learn.datasets.samples_generator import make_blobs +from sklearn.cluster import MeanShift, estimate_bandwidth +from sklearn.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 7a876bd056854..8415c2a1585bb 100644 --- a/examples/cluster/plot_mini_batch_kmeans.py +++ b/examples/cluster/plot_mini_batch_kmeans.py @@ -19,9 +19,9 @@ import numpy as np import pylab as pl -from scikits.learn.cluster import MiniBatchKMeans, KMeans -from scikits.learn.metrics.pairwise import euclidean_distances -from scikits.learn.datasets.samples_generator import make_blobs +from sklearn.cluster import MiniBatchKMeans, KMeans +from sklearn.metrics.pairwise import euclidean_distances +from sklearn.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 e810c25b2bfd4..82ba430c1ae10 100644 --- a/examples/cluster/plot_segmentation_toy.py +++ b/examples/cluster/plot_segmentation_toy.py @@ -33,8 +33,8 @@ import numpy as np import pylab as pl -from scikits.learn.feature_extraction import image -from scikits.learn.cluster import spectral_clustering +from sklearn.feature_extraction import image +from sklearn.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 b5651fded6a68..95c37277b8c7c 100644 --- a/examples/cluster/plot_ward_structured_vs_unstructured.py +++ b/examples/cluster/plot_ward_structured_vs_unstructured.py @@ -28,8 +28,8 @@ import numpy as np import pylab as pl import mpl_toolkits.mplot3d.axes3d as p3 -from scikits.learn.cluster import Ward -from scikits.learn.datasets.samples_generator import make_swiss_roll +from sklearn.cluster import Ward +from sklearn.datasets.samples_generator import make_swiss_roll ############################################################################### # Generate data (swiss roll dataset) @@ -61,7 +61,7 @@ ############################################################################### # Define the structure A of the data. Here a 10 nearest neighbors -from scikits.learn.neighbors import kneighbors_graph +from sklearn.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 178caceecfe2c..306244c35d882 100644 --- a/examples/covariance/plot_covariance_estimation.py +++ b/examples/covariance/plot_covariance_estimation.py @@ -42,7 +42,7 @@ ############################################################################### # Compute Ledoit-Wolf and Covariances on a grid of shrinkages -from scikits.learn.covariance import LedoitWolf, OAS, ShrunkCovariance, \ +from sklearn.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 1e13c185bbe32..dc2965732c2fd 100644 --- a/examples/covariance/plot_lw_vs_oas.py +++ b/examples/covariance/plot_lw_vs_oas.py @@ -26,7 +26,7 @@ import pylab as pl from scipy.linalg import toeplitz, cholesky -from scikits.learn.covariance import LedoitWolf, OAS +from sklearn.covariance import LedoitWolf, OAS ############################################################################### n_features = 100 diff --git a/examples/decomposition/plot_faces_decomposition.py b/examples/decomposition/plot_faces_decomposition.py index 43290b1654685..e3aebb64ea29b 100644 --- a/examples/decomposition/plot_faces_decomposition.py +++ b/examples/decomposition/plot_faces_decomposition.py @@ -5,7 +5,7 @@ This example applies to :doc:`/datasets/olivetti_faces` different unsupervised matrix decomposition (dimension reduction) methods from the -module :py:mod:`scikits.learn.decomposition` (see the documentation +module :py:mod:`sklearn.decomposition` (see the documentation chapter :ref:`decompositions`) . """ @@ -19,9 +19,9 @@ import pylab as pl -from scikits.learn.datasets import fetch_olivetti_faces -from scikits.learn.cluster import MiniBatchKMeans -from scikits.learn import decomposition +from sklearn.datasets import fetch_olivetti_faces +from sklearn.cluster import MiniBatchKMeans +from sklearn 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 2cb57048e65e0..c864f6c180a56 100644 --- a/examples/decomposition/plot_ica_blind_source_separation.py +++ b/examples/decomposition/plot_ica_blind_source_separation.py @@ -13,7 +13,7 @@ import numpy as np import pylab as pl -from scikits.learn.decomposition import FastICA +from sklearn.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 863eb8c6ebf09..acbbf5cc42c01 100644 --- a/examples/decomposition/plot_ica_vs_pca.py +++ b/examples/decomposition/plot_ica_vs_pca.py @@ -33,7 +33,7 @@ import numpy as np import pylab as pl -from scikits.learn.decomposition import PCA, FastICA +from sklearn.decomposition import PCA, FastICA ############################################################################### # Generate sample data diff --git a/examples/decomposition/plot_kernel_pca.py b/examples/decomposition/plot_kernel_pca.py index 4f53e90361ec2..385dd61b8064a 100644 --- a/examples/decomposition/plot_kernel_pca.py +++ b/examples/decomposition/plot_kernel_pca.py @@ -14,7 +14,7 @@ import numpy as np import pylab as pl -from scikits.learn.decomposition import PCA, KernelPCA +from sklearn.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 29d96937057e7..963bb47e958b5 100644 --- a/examples/decomposition/plot_pca_vs_lda.py +++ b/examples/decomposition/plot_pca_vs_lda.py @@ -20,9 +20,9 @@ import pylab as pl -from scikits.learn import datasets -from scikits.learn.decomposition import PCA -from scikits.learn.lda import LDA +from sklearn import datasets +from sklearn.decomposition import PCA +from sklearn.lda import LDA iris = datasets.load_iris() diff --git a/examples/document_classification_20newsgroups.py b/examples/document_classification_20newsgroups.py index 786680f2faf9e..56843d1501e54 100644 --- a/examples/document_classification_20newsgroups.py +++ b/examples/document_classification_20newsgroups.py @@ -29,15 +29,15 @@ import sys from time import time -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 +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 # Display progress logs on stdout diff --git a/examples/document_clustering.py b/examples/document_clustering.py index 0ed83867289a6..98eb84968cab2 100644 --- a/examples/document_clustering.py +++ b/examples/document_clustering.py @@ -17,14 +17,14 @@ import logging import numpy as np -from scikits.learn.datasets import fetch_20newsgroups -from scikits.learn.feature_extraction.text import Vectorizer -from scikits.learn import metrics +from sklearn.datasets import fetch_20newsgroups +from sklearn.feature_extraction.text import Vectorizer +from sklearn import metrics -from scikits.learn.cluster import MiniBatchKMeans -from scikits.learn.cluster import randindex +from sklearn.cluster import MiniBatchKMeans +from sklearn.cluster import randindex -from scikits.learn.preprocessing import Normalizer +from sklearn.preprocessing import Normalizer # Display progress logs on stdout diff --git a/examples/feature_selection_pipeline.py b/examples/feature_selection_pipeline.py index a0343e783cd1d..025e2c4d671fe 100644 --- a/examples/feature_selection_pipeline.py +++ b/examples/feature_selection_pipeline.py @@ -8,10 +8,10 @@ """ print __doc__ -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 +from sklearn import svm +from sklearn.datasets import samples_generator +from sklearn.feature_selection import SelectKBest, f_regression +from sklearn.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 7c61ae2c1bb3a..3f23e3d047cd2 100644 --- a/examples/gaussian_naive_bayes.py +++ b/examples/gaussian_naive_bayes.py @@ -11,7 +11,7 @@ # import some data to play with # The IRIS dataset -from scikits.learn import datasets +from sklearn import datasets iris = datasets.load_iris() X = iris.data @@ -19,7 +19,7 @@ ################################################################################ # GaussianNB -from scikits.learn.naive_bayes import GaussianNB +from sklearn.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 c601c9f6998ba..f3d1e46cdf041 100644 --- a/examples/gaussian_process/gp_diabetes_dataset.py +++ b/examples/gaussian_process/gp_diabetes_dataset.py @@ -23,9 +23,9 @@ # Author: Vincent Dubourg # License: BSD style -from scikits.learn import datasets -from scikits.learn.gaussian_process import GaussianProcess -from scikits.learn.cross_val import cross_val_score, KFold +from sklearn import datasets +from sklearn.gaussian_process import GaussianProcess +from sklearn.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 329f2cf932246..3ab6cba276ae4 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 @@ import numpy as np from scipy import stats -from scikits.learn.gaussian_process import GaussianProcess +from sklearn.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 66c27fe493080..06d7801b2b493 100644 --- a/examples/gaussian_process/plot_gp_regression.py +++ b/examples/gaussian_process/plot_gp_regression.py @@ -19,7 +19,7 @@ # License: BSD style import numpy as np -from scikits.learn.gaussian_process import GaussianProcess +from sklearn.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 4bb1543ae769e..3ebd27d769488 100644 --- a/examples/grid_search_digits.py +++ b/examples/grid_search_digits.py @@ -16,13 +16,13 @@ from pprint import pprint import numpy as np -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 +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 ################################################################################ # Loading the Digits dataset diff --git a/examples/grid_search_text_feature_extraction.py b/examples/grid_search_text_feature_extraction.py index 08dfb2e5172fa..c89381afdb5fe 100644 --- a/examples/grid_search_text_feature_extraction.py +++ b/examples/grid_search_text_feature_extraction.py @@ -52,12 +52,12 @@ import os import logging -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 +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 # 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 6434f004de4e9..a760b141c14f5 100644 --- a/examples/linear_model/lasso_and_elasticnet.py +++ b/examples/linear_model/lasso_and_elasticnet.py @@ -27,7 +27,7 @@ ################################################################################ # Lasso -from scikits.learn.linear_model import Lasso +from sklearn.linear_model import Lasso alpha = 0.1 lasso = Lasso(alpha=alpha) @@ -39,7 +39,7 @@ ################################################################################ # ElasticNet -from scikits.learn.linear_model import ElasticNet +from sklearn.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 6f4a96e6f4f1e..c756906eff77b 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 @@ from scipy import sparse from scipy import linalg -from scikits.learn.linear_model.sparse import Lasso as SparseLasso -from scikits.learn.linear_model import Lasso as DenseLasso +from sklearn.linear_model.sparse import Lasso as SparseLasso +from sklearn.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 f550ecd40f23a..c74ebcf7dd73a 100644 --- a/examples/linear_model/logistic_l1_l2_sparsity.py +++ b/examples/linear_model/logistic_l1_l2_sparsity.py @@ -18,8 +18,8 @@ import numpy as np -from scikits.learn.linear_model import LogisticRegression -from scikits.learn import datasets +from sklearn.linear_model import LogisticRegression +from sklearn 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 b196732ee4e08..c0610210f8830 100644 --- a/examples/linear_model/plot_ard.py +++ b/examples/linear_model/plot_ard.py @@ -20,7 +20,7 @@ import pylab as pl from scipy import stats -from scikits.learn.linear_model import ARDRegression, LinearRegression +from sklearn.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 b3fb2d5845e69..7296bb02a21df 100644 --- a/examples/linear_model/plot_bayesian_ridge.py +++ b/examples/linear_model/plot_bayesian_ridge.py @@ -20,7 +20,7 @@ import pylab as pl from scipy import stats -from scikits.learn.linear_model import BayesianRidge, LinearRegression +from sklearn.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 f107a4d94eb6f..60e6214e8f6c4 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 @@ import numpy as np import pylab as pl -from scikits.learn.linear_model import lasso_path, enet_path -from scikits.learn import datasets +from sklearn.linear_model import lasso_path, enet_path +from sklearn 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 d4557e979b6a1..dfd2c2406167f 100644 --- a/examples/linear_model/plot_lasso_lars.py +++ b/examples/linear_model/plot_lasso_lars.py @@ -17,8 +17,8 @@ import numpy as np import pylab as pl -from scikits.learn import linear_model -from scikits.learn import datasets +from sklearn import linear_model +from sklearn 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 8ccca80e3813b..133cfa67114cb 100644 --- a/examples/linear_model/plot_lasso_model_selection.py +++ b/examples/linear_model/plot_lasso_model_selection.py @@ -51,8 +51,8 @@ import numpy as np import pylab as pl -from scikits.learn.linear_model import LassoCV, LassoLarsCV, LassoLarsIC -from scikits.learn import datasets +from sklearn.linear_model import LassoCV, LassoLarsCV, LassoLarsIC +from sklearn 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 9bcf0a78c5978..9a26683c54ddb 100644 --- a/examples/linear_model/plot_logistic_path.py +++ b/examples/linear_model/plot_logistic_path.py @@ -16,9 +16,9 @@ import numpy as np import pylab as pl -from scikits.learn import linear_model -from scikits.learn import datasets -from scikits.learn.svm import l1_min_c +from sklearn import linear_model +from sklearn import datasets +from sklearn.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 96c4e5ae02960..db05f4e1a76eb 100644 --- a/examples/linear_model/plot_ols.py +++ b/examples/linear_model/plot_ols.py @@ -11,7 +11,7 @@ import numpy as np import pylab as pl -from scikits.learn import linear_model +from sklearn 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 7713fd44cc63f..1f6e8073c17c8 100644 --- a/examples/linear_model/plot_omp.py +++ b/examples/linear_model/plot_omp.py @@ -10,8 +10,8 @@ import pylab as pl import numpy as np -from scikits.learn.linear_model import orthogonal_mp -from scikits.learn.datasets import make_sparse_coded_signal +from sklearn.linear_model import orthogonal_mp +from sklearn.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 efdda3b470a5f..e02db52380d2c 100644 --- a/examples/linear_model/plot_polynomial_interpolation.py +++ b/examples/linear_model/plot_polynomial_interpolation.py @@ -29,7 +29,7 @@ import numpy as np import pylab as pl -from scikits.learn.linear_model import Ridge +from sklearn.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 b323e10a7e5a7..d3d9bae64ab0e 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:: scikits.learn.linear_model +.. currentmodule:: sklearn.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 @@ import numpy as np import pylab as pl -from scikits.learn import linear_model +from sklearn 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 3d77fda2990c0..d63b44783a108 100644 --- a/examples/linear_model/plot_sgd_iris.py +++ b/examples/linear_model/plot_sgd_iris.py @@ -12,8 +12,8 @@ import numpy as np import pylab as pl -from scikits.learn import datasets -from scikits.learn.linear_model import SGDClassifier +from sklearn import datasets +from sklearn.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 2b906f369f38a..c1a1039f151d1 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 `scikits.learn.linear_model.stochastic_gradient`. +Plot the convex loss functions supported by `sklearn.linear_model.stochastic_gradient`. """ print __doc__ import numpy as np import pylab as pl -from scikits.learn.linear_model.sgd_fast import Hinge, \ +from sklearn.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 aff62b561b735..dde2030ee00e3 100644 --- a/examples/linear_model/plot_sgd_ols.py +++ b/examples/linear_model/plot_sgd_ols.py @@ -12,7 +12,7 @@ import numpy as np import pylab as pl -from scikits.learn.linear_model import SGDRegressor +from sklearn.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 552cbb6a9fc4b..597e0b784b0de 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 `scikits.learn.linear_model.stochastic_gradient`. +Plot the contours of the three penalties supported by `sklearn.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 5ace2030955e0..9080e25553391 100644 --- a/examples/linear_model/plot_sgd_separating_hyperplane.py +++ b/examples/linear_model/plot_sgd_separating_hyperplane.py @@ -11,7 +11,7 @@ import numpy as np import pylab as pl -from scikits.learn.linear_model import SGDClassifier +from sklearn.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 42e319e1d56fb..aab147d9a2970 100644 --- a/examples/linear_model/plot_sgd_weighted_classes.py +++ b/examples/linear_model/plot_sgd_weighted_classes.py @@ -11,7 +11,7 @@ import numpy as np import pylab as pl -from scikits.learn.linear_model import SGDClassifier +from sklearn.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 680a424978aed..c0cdcb3228a86 100644 --- a/examples/linear_model/plot_sgd_weighted_samples.py +++ b/examples/linear_model/plot_sgd_weighted_samples.py @@ -10,7 +10,7 @@ import numpy as np import pylab as pl -from scikits.learn import linear_model +from sklearn 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 d6416f51b259d..8be3de5d40323 100644 --- a/examples/manifold/plot_compare_methods.py +++ b/examples/manifold/plot_compare_methods.py @@ -20,7 +20,7 @@ from mpl_toolkits.mplot3d import Axes3D from matplotlib.ticker import NullFormatter -from scikits.learn import manifold, datasets +from sklearn 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 03148070d2d77..c0e7eb230d218 100644 --- a/examples/manifold/plot_lle_digits.py +++ b/examples/manifold/plot_lle_digits.py @@ -17,8 +17,8 @@ import numpy as np import pylab as pl from matplotlib import offsetbox -from scikits.learn.utils.fixes import qr_economic -from scikits.learn import manifold, datasets, decomposition, lda +from sklearn.utils.fixes import qr_economic +from sklearn 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 e91ed9a0d6063..0ce92160d8e61 100644 --- a/examples/manifold/plot_swissroll.py +++ b/examples/manifold/plot_swissroll.py @@ -19,7 +19,7 @@ #---------------------------------------------------------------------- # Locally linear embedding of the swiss roll -from scikits.learn import manifold, datasets +from sklearn 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 a3e6998526f83..662675c481a7c 100644 --- a/examples/mixture/plot_gmm.py +++ b/examples/mixture/plot_gmm.py @@ -28,7 +28,7 @@ import pylab as pl import matplotlib as mpl -from scikits.learn import mixture +from sklearn 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 a5fa655b02297..c71ce06d2f49c 100644 --- a/examples/mixture/plot_gmm_classifier.py +++ b/examples/mixture/plot_gmm_classifier.py @@ -30,9 +30,9 @@ import matplotlib as mpl import numpy as np -from scikits.learn import datasets -from scikits.learn.cross_val import StratifiedKFold -from scikits.learn.mixture import GMM +from sklearn import datasets +from sklearn.cross_val import StratifiedKFold +from sklearn.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 10b9a645f5900..396a550252ab4 100644 --- a/examples/mixture/plot_gmm_pdf.py +++ b/examples/mixture/plot_gmm_pdf.py @@ -10,7 +10,7 @@ import numpy as np import pylab as pl -from scikits.learn import mixture +from sklearn import mixture n_samples = 300 diff --git a/examples/mixture/plot_gmm_sin.py b/examples/mixture/plot_gmm_sin.py index 302b275c0099e..078f121dd8684 100644 --- a/examples/mixture/plot_gmm_sin.py +++ b/examples/mixture/plot_gmm_sin.py @@ -21,7 +21,7 @@ import pylab as pl import matplotlib as mpl -from scikits.learn import mixture +from sklearn 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 c773ab9ed6caa..48b9d6125c6cd 100644 --- a/examples/mlcomp_sparse_document_classification.py +++ b/examples/mlcomp_sparse_document_classification.py @@ -45,12 +45,12 @@ import scipy.sparse as sp import pylab as pl -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 +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 if 'MLCOMP_DATASETS_HOME' not in os.environ: diff --git a/examples/plot_classification_probability.py b/examples/plot_classification_probability.py index a6a8cfde238a4..e03773f66e7b1 100644 --- a/examples/plot_classification_probability.py +++ b/examples/plot_classification_probability.py @@ -18,9 +18,9 @@ class dataset, and we classify it with a Support Vector classifier, as import pylab as pl import numpy as np -from scikits.learn.linear_model import LogisticRegression -from scikits.learn.svm import SVC -from scikits.learn import datasets +from sklearn.linear_model import LogisticRegression +from sklearn.svm import SVC +from sklearn 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 6bb69a09f8f6c..825df7fd20e0a 100644 --- a/examples/plot_confusion_matrix.py +++ b/examples/plot_confusion_matrix.py @@ -10,8 +10,8 @@ import random import pylab as pl -from scikits.learn import svm, datasets -from scikits.learn.metrics import confusion_matrix +from sklearn import svm, datasets +from sklearn.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 f6b9736cf8fa7..67da225d19b4f 100644 --- a/examples/plot_digits_classification.py +++ b/examples/plot_digits_classification.py @@ -19,7 +19,7 @@ import pylab as pl # Import datasets, classifiers and performance metrics -from scikits.learn import datasets, svm, metrics +from sklearn 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 1d5dfd18b41b7..28bbd05b41707 100644 --- a/examples/plot_feature_selection.py +++ b/examples/plot_feature_selection.py @@ -27,7 +27,7 @@ # import some data to play with # The IRIS dataset -from scikits.learn import datasets, svm +from sklearn import datasets, svm iris = datasets.load_iris() # Some noisy data not correlated @@ -45,7 +45,7 @@ ################################################################################ # Univariate feature selection -from scikits.learn.feature_selection import SelectFpr, f_classif +from sklearn.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 c5c6872ac8e58..e9891c59e8b5d 100644 --- a/examples/plot_lda_qda.py +++ b/examples/plot_lda_qda.py @@ -13,8 +13,8 @@ import matplotlib as mpl from matplotlib import colors -from scikits.learn.lda import LDA -from scikits.learn.qda import QDA +from sklearn.lda import LDA +from sklearn.qda import QDA ############################################################################### # colormap diff --git a/examples/plot_lda_vs_qda.py b/examples/plot_lda_vs_qda.py index 246684326c8be..2ae60cda1d5b2 100644 --- a/examples/plot_lda_vs_qda.py +++ b/examples/plot_lda_vs_qda.py @@ -12,12 +12,12 @@ import pylab as pl import matplotlib as mpl -from scikits.learn.lda import LDA -from scikits.learn.qda import QDA +from sklearn.lda import LDA +from sklearn.qda import QDA ################################################################################ # load sample dataset -from scikits.learn.datasets import load_iris +from sklearn.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 7df3695254f9f..16c0d5a1db2d9 100644 --- a/examples/plot_neighbors.py +++ b/examples/plot_neighbors.py @@ -10,7 +10,7 @@ import numpy as np import pylab as pl -from scikits.learn import neighbors, datasets +from sklearn 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 e9bf38e283673..ed937a38e47fc 100644 --- a/examples/plot_neighbors_regression.py +++ b/examples/plot_neighbors_regression.py @@ -20,7 +20,7 @@ # Generate sample data import numpy as np import pylab as pl -from scikits.learn import neighbors +from sklearn 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 d41eb0c3c78d2..1ec9205af9761 100644 --- a/examples/plot_permutation_test_for_classification.py +++ b/examples/plot_permutation_test_for_classification.py @@ -19,10 +19,10 @@ import numpy as np import pylab as pl -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 +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 ############################################################################## diff --git a/examples/plot_pls.py b/examples/plot_pls.py index d585a7a15eb23..fe8948daf7b11 100644 --- a/examples/plot_pls.py +++ b/examples/plot_pls.py @@ -22,7 +22,7 @@ import numpy as np import pylab as pl -from scikits.learn.pls import PLSCanonical, PLSRegression, CCA +from sklearn.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 8d4f1a9a0ea5e..b0bc8b7c86cd8 100644 --- a/examples/plot_precision_recall.py +++ b/examples/plot_precision_recall.py @@ -11,9 +11,9 @@ import random import pylab as pl import numpy as np -from scikits.learn import svm, datasets -from scikits.learn.metrics import precision_recall_curve -from scikits.learn.metrics import auc +from sklearn import svm, datasets +from sklearn.metrics import precision_recall_curve +from sklearn.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 69df66122ba84..6f2ed16028115 100644 --- a/examples/plot_rfe_digits.py +++ b/examples/plot_rfe_digits.py @@ -7,9 +7,9 @@ """ print __doc__ -from scikits.learn.svm import SVC -from scikits.learn import datasets -from scikits.learn.feature_selection import RFE +from sklearn.svm import SVC +from sklearn import datasets +from sklearn.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 a42ec30edc5f0..c810aa5cc927c 100644 --- a/examples/plot_rfe_with_cross_validation.py +++ b/examples/plot_rfe_with_cross_validation.py @@ -9,11 +9,11 @@ print __doc__ import numpy as np -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 +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 ################################################################################ # Loading a dataset diff --git a/examples/plot_roc.py b/examples/plot_roc.py index b7c529c041a01..994c63856847b 100644 --- a/examples/plot_roc.py +++ b/examples/plot_roc.py @@ -10,9 +10,9 @@ import numpy as np import pylab as pl -from scikits.learn import svm, datasets -from scikits.learn.utils import shuffle -from scikits.learn.metrics import roc_curve, auc +from sklearn import svm, datasets +from sklearn.utils import shuffle +from sklearn.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 cd9ea9668b7fd..46a45fbdb76dd 100644 --- a/examples/plot_roc_crossval.py +++ b/examples/plot_roc_crossval.py @@ -13,9 +13,9 @@ from scipy import interp import pylab as pl -from scikits.learn import svm, datasets -from scikits.learn.metrics import roc_curve, auc -from scikits.learn.cross_val import StratifiedKFold +from sklearn import svm, datasets +from sklearn.metrics import roc_curve, auc +from sklearn.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 12da0c8edcd50..ab7eb0430c9ca 100644 --- a/examples/plot_train_error_vs_test_error.py +++ b/examples/plot_train_error_vs_test_error.py @@ -17,7 +17,7 @@ # License: BSD Style. import numpy as np -from scikits.learn import linear_model +from sklearn import linear_model ############################################################################### # Generate sample data diff --git a/examples/svm/plot_custom_kernel.py b/examples/svm/plot_custom_kernel.py index a33670f581980..891e71497848b 100644 --- a/examples/svm/plot_custom_kernel.py +++ b/examples/svm/plot_custom_kernel.py @@ -11,7 +11,7 @@ import numpy as np import pylab as pl -from scikits.learn import svm, datasets +from sklearn 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 1a7e65ed36da3..3b662f7978959 100644 --- a/examples/svm/plot_iris.py +++ b/examples/svm/plot_iris.py @@ -11,7 +11,7 @@ import numpy as np import pylab as pl -from scikits.learn import svm, datasets +from sklearn 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 89ac5dbd132e3..43d96dbd83b6c 100644 --- a/examples/svm/plot_oneclass.py +++ b/examples/svm/plot_oneclass.py @@ -10,7 +10,7 @@ import numpy as np import pylab as pl -from scikits.learn import svm +from sklearn 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 fec1d76cab97f..8d927dbcc38a4 100644 --- a/examples/svm/plot_separating_hyperplane.py +++ b/examples/svm/plot_separating_hyperplane.py @@ -11,7 +11,7 @@ import numpy as np import pylab as pl -from scikits.learn import svm +from sklearn 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 19b58967963f1..5f3b643a924ee 100644 --- a/examples/svm/plot_separating_hyperplane_unbalanced.py +++ b/examples/svm/plot_separating_hyperplane_unbalanced.py @@ -14,7 +14,7 @@ import numpy as np import pylab as pl -from scikits.learn import svm +from sklearn 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 100cd0593f67c..e1e3ac04b08f0 100644 --- a/examples/svm/plot_svm_anova.py +++ b/examples/svm/plot_svm_anova.py @@ -10,8 +10,8 @@ import numpy as np import pylab as pl -from scikits.learn import svm, datasets, feature_selection, cross_val -from scikits.learn.pipeline import Pipeline +from sklearn import svm, datasets, feature_selection, cross_val +from sklearn.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 8d21c670ebfbd..eba532ad0de79 100644 --- a/examples/svm/plot_svm_nonlinear.py +++ b/examples/svm/plot_svm_nonlinear.py @@ -12,7 +12,7 @@ import numpy as np import pylab as pl -from scikits.learn import svm +from sklearn 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 0448f13035152..64e6bfea7e42c 100644 --- a/examples/svm/plot_svm_regression.py +++ b/examples/svm/plot_svm_regression.py @@ -22,7 +22,7 @@ ############################################################################### # Fit regression model -from scikits.learn.svm import SVR +from sklearn.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 2f95eeb8e9ff2..7b8364231b067 100644 --- a/examples/svm/plot_weighted_samples.py +++ b/examples/svm/plot_weighted_samples.py @@ -10,7 +10,7 @@ import numpy as np import pylab as pl -from scikits.learn import svm +from sklearn import svm # we create 20 points np.random.seed(0) diff --git a/setup.py b/setup.py index 3fcdba9aaa39e..de1328500f46b 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ import os import shutil -DISTNAME = 'scikits.learn' +DISTNAME = 'sklearn' DESCRIPTION = 'A set of python modules for machine learning and data mining' LONG_DESCRIPTION = open('README.rst').read() MAINTAINER = 'Fabian Pedregosa' @@ -34,6 +34,8 @@ 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__": diff --git a/scikits/learn/__init__.py b/sklearn/__init__.py similarity index 96% rename from scikits/learn/__init__.py rename to sklearn/__init__.py index 80e4e8d78ea3b..22867642d297f 100644 --- a/scikits/learn/__init__.py +++ b/sklearn/__init__.py @@ -2,7 +2,7 @@ Machine Learning module in python ================================= -scikits.learn is a Python module integrating classical machine +sklearn is a Python module integrating classical machine learning algorithms in the tightly-knit world of scientific Python packages (numpy, scipy, matplotlib). diff --git a/scikits/learn/ball_tree.c b/sklearn/ball_tree.c similarity index 69% rename from scikits/learn/ball_tree.c rename to sklearn/ball_tree.c index 771a5f7489c01..7968b5e49a4cc 100644 --- a/scikits/learn/ball_tree.c +++ b/sklearn/ball_tree.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.14.1 on Wed Aug 31 07:48:58 2011 */ +/* Generated by Cython 0.13 on Fri Sep 2 11:24:58 2011 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -126,20 +126,15 @@ #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) @@ -156,7 +151,7 @@ #endif #if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject + #define PyBoolObject PyLongObject #endif @@ -168,25 +163,6 @@ #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 @@ -219,17 +195,12 @@ #define _USE_MATH_DEFINES #endif #include -#define __PYX_HAVE_API__scikits__learn__ball_tree +#define __PYX_HAVE_API__sklearn__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__) @@ -239,7 +210,7 @@ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else - #define CYTHON_INLINE + #define CYTHON_INLINE #endif #endif @@ -247,14 +218,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 @@ -279,7 +250,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 ... */ @@ -367,9 +338,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_7scikits_5learn_9ball_tree_DTYPE_t; +typedef __pyx_t_5numpy_float64_t __pyx_t_7sklearn_9ball_tree_DTYPE_t; -typedef __pyx_t_5numpy_int32_t __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t; +typedef __pyx_t_5numpy_int32_t __pyx_t_7sklearn_9ball_tree_ITYPE_t; #if CYTHON_CCOMPLEX #ifdef __cplusplus @@ -401,7 +372,7 @@ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; typedef npy_cdouble __pyx_t_5numpy_complex_t; -/* "scikits/learn/ball_tree.pyx":323 +/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":323 * # array for efficiency. This is a hybrid of the "Array of Structures" * # and "Structure of Arrays" styles. * cdef struct NodeInfo: # <<<<<<<<<<<<<< @@ -409,14 +380,14 @@ typedef npy_cdouble __pyx_t_5numpy_complex_t; * ITYPE_t idx_end */ -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; +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; }; -/* "scikits/learn/ball_tree.pyx":333 +/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":333 * # stack struct * # This is used to keep track of the recursion stack in Node_query * cdef struct stack_item: # <<<<<<<<<<<<<< @@ -424,12 +395,12 @@ struct __pyx_t_7scikits_5learn_9ball_tree_NodeInfo { * 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; +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; }; -/* "scikits/learn/ball_tree.pyx":338 +/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":338 * * * cdef struct stack: # <<<<<<<<<<<<<< @@ -437,13 +408,13 @@ struct __pyx_t_7scikits_5learn_9ball_tree_stack_item { * stack_item* heap */ -struct __pyx_t_7scikits_5learn_9ball_tree_stack { +struct __pyx_t_7sklearn_9ball_tree_stack { int n; - struct __pyx_t_7scikits_5learn_9ball_tree_stack_item *heap; + struct __pyx_t_7sklearn_9ball_tree_stack_item *heap; int size; }; -/* "scikits/learn/ball_tree.pyx":395 +/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":395 * # BallTree class * # * cdef class BallTree(object): # <<<<<<<<<<<<<< @@ -451,28 +422,28 @@ struct __pyx_t_7scikits_5learn_9ball_tree_stack { * Ball Tree for fast nearest-neighbor searches : */ -struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree { +struct __pyx_obj_7sklearn_9ball_tree_BallTree { PyObject_HEAD - struct __pyx_vtabstruct_7scikits_5learn_9ball_tree_BallTree *__pyx_vtab; + struct __pyx_vtabstruct_7sklearn_9ball_tree_BallTree *__pyx_vtab; PyArrayObject *data; PyArrayObject *idx_array; PyArrayObject *node_centroid_arr; PyArrayObject *node_info_arr; - __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; + __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; }; -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 *); +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 *); }; -static struct __pyx_vtabstruct_7scikits_5learn_9ball_tree_BallTree *__pyx_vtabptr_7scikits_5learn_9ball_tree_BallTree; +static struct __pyx_vtabstruct_7sklearn_9ball_tree_BallTree *__pyx_vtabptr_7sklearn_9ball_tree_BallTree; #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 @@ -522,11 +493,6 @@ static struct __pyx_vtabstruct_7scikits_5learn_9ball_tree_BallTree *__pyx_vtabpt 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*/ @@ -628,6 +594,11 @@ 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 */ @@ -669,17 +640,11 @@ 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)) - #if 1 - #define __Pyx_c_absf(z) (::std::abs(z)) - #define __Pyx_c_powf(a, b) (::std::pow(a, b)) - #endif + /*#define __Pyx_c_absf(z) (::std::abs(z))*/ #else #define __Pyx_c_is_zerof(z) ((z)==0) #define __Pyx_c_conjf(z) (conjf(z)) - #if 1 - #define __Pyx_c_absf(z) (cabsf(z)) - #define __Pyx_c_powf(a, b) (cpowf(a, b)) - #endif + /*#define __Pyx_c_absf(z) (cabsf(z))*/ #endif #else static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex); @@ -690,10 +655,7 @@ 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); - #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 + /*static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex);*/ #endif static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); @@ -708,17 +670,11 @@ 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)) - #if 1 - #define __Pyx_c_abs(z) (::std::abs(z)) - #define __Pyx_c_pow(a, b) (::std::pow(a, b)) - #endif + /*#define __Pyx_c_abs(z) (::std::abs(z))*/ #else #define __Pyx_c_is_zero(z) ((z)==0) #define __Pyx_c_conj(z) (conj(z)) - #if 1 - #define __Pyx_c_abs(z) (cabs(z)) - #define __Pyx_c_pow(a, b) (cpow(a, b)) - #endif + /*#define __Pyx_c_abs(z) (cabs(z))*/ #endif #else static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex); @@ -729,10 +685,7 @@ 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); - #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 + /*static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex);*/ #endif static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *); @@ -809,71 +762,71 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *); / /* Module declarations from libc */ -/* 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 */ +/* 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 */ 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_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_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__B[] = "B"; static char __pyx_k__C[] = "C"; static char __pyx_k__H[] = "H"; @@ -919,6 +872,7 @@ 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"; @@ -938,6 +892,7 @@ 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"; @@ -951,6 +906,7 @@ 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"; @@ -959,37 +915,40 @@ 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_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_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_3; -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_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_n_s__C; static PyObject *__pyx_n_s__DTYPE; static PyObject *__pyx_n_s__ITYPE; @@ -999,6 +958,8 @@ 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; @@ -1048,7 +1009,9 @@ 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; @@ -1068,40 +1031,12 @@ 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_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 +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 * # * @cython.profile(False) * cdef inline DTYPE_t dmax(DTYPE_t x, DTYPE_t y): # <<<<<<<<<<<<<< @@ -1109,12 +1044,12 @@ static PyObject *__pyx_k_tuple_53; * return x */ -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; +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; int __pyx_t_1; __Pyx_RefNannySetupContext("dmax"); - /* "scikits/learn/ball_tree.pyx":216 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":216 * @cython.profile(False) * cdef inline DTYPE_t dmax(DTYPE_t x, DTYPE_t y): * if x >= y: # <<<<<<<<<<<<<< @@ -1124,7 +1059,7 @@ static CYTHON_INLINE __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits __pyx_t_1 = (__pyx_v_x >= __pyx_v_y); if (__pyx_t_1) { - /* "scikits/learn/ball_tree.pyx":217 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":217 * cdef inline DTYPE_t dmax(DTYPE_t x, DTYPE_t y): * if x >= y: * return x # <<<<<<<<<<<<<< @@ -1137,7 +1072,7 @@ static CYTHON_INLINE __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits } /*else*/ { - /* "scikits/learn/ball_tree.pyx":219 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":219 * return x * else: * return y # <<<<<<<<<<<<<< @@ -1155,7 +1090,7 @@ static CYTHON_INLINE __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits return __pyx_r; } -/* "scikits/learn/ball_tree.pyx":223 +/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":223 * * @cython.profile(False) * cdef inline DTYPE_t dmin(DTYPE_t x, DTYPE_t y): # <<<<<<<<<<<<<< @@ -1163,12 +1098,12 @@ static CYTHON_INLINE __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits * return x */ -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; +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; int __pyx_t_1; __Pyx_RefNannySetupContext("dmin"); - /* "scikits/learn/ball_tree.pyx":224 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":224 * @cython.profile(False) * cdef inline DTYPE_t dmin(DTYPE_t x, DTYPE_t y): * if x <= y: # <<<<<<<<<<<<<< @@ -1178,7 +1113,7 @@ static CYTHON_INLINE __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits __pyx_t_1 = (__pyx_v_x <= __pyx_v_y); if (__pyx_t_1) { - /* "scikits/learn/ball_tree.pyx":225 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":225 * cdef inline DTYPE_t dmin(DTYPE_t x, DTYPE_t y): * if x <= y: * return x # <<<<<<<<<<<<<< @@ -1191,7 +1126,7 @@ static CYTHON_INLINE __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits } /*else*/ { - /* "scikits/learn/ball_tree.pyx":227 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":227 * return x * else: * return y # <<<<<<<<<<<<<< @@ -1209,7 +1144,7 @@ static CYTHON_INLINE __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits return __pyx_r; } -/* "scikits/learn/ball_tree.pyx":231 +/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":231 * * @cython.profile(False) * cdef inline DTYPE_t dabs(DTYPE_t x): # <<<<<<<<<<<<<< @@ -1217,12 +1152,12 @@ static CYTHON_INLINE __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits * return x */ -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; +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; int __pyx_t_1; __Pyx_RefNannySetupContext("dabs"); - /* "scikits/learn/ball_tree.pyx":232 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":232 * @cython.profile(False) * cdef inline DTYPE_t dabs(DTYPE_t x): * if x >= 0: # <<<<<<<<<<<<<< @@ -1232,7 +1167,7 @@ static CYTHON_INLINE __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits __pyx_t_1 = (__pyx_v_x >= 0.0); if (__pyx_t_1) { - /* "scikits/learn/ball_tree.pyx":233 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":233 * cdef inline DTYPE_t dabs(DTYPE_t x): * if x >= 0: * return x # <<<<<<<<<<<<<< @@ -1245,7 +1180,7 @@ static CYTHON_INLINE __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits } /*else*/ { - /* "scikits/learn/ball_tree.pyx":235 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":235 * return x * else: * return -x # <<<<<<<<<<<<<< @@ -1263,7 +1198,7 @@ static CYTHON_INLINE __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits return __pyx_r; } -/* "scikits/learn/ball_tree.pyx":248 +/* "/home/fabian/dev/scikit-learn/sklearn/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): # <<<<<<<<<<<<<< @@ -1271,16 +1206,16 @@ static CYTHON_INLINE __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits * cdef DTYPE_t r, d */ -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; +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; int __pyx_t_1; - __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_t_2; + __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_t_2; __Pyx_RefNannySetupContext("dist"); - /* "scikits/learn/ball_tree.pyx":251 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":251 * cdef ITYPE_t i * cdef DTYPE_t r, d * r = 0 # <<<<<<<<<<<<<< @@ -1289,7 +1224,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball */ __pyx_v_r = 0.0; - /* "scikits/learn/ball_tree.pyx":252 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":252 * cdef DTYPE_t r, d * r = 0 * if p == 2: # <<<<<<<<<<<<<< @@ -1299,7 +1234,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball __pyx_t_1 = (__pyx_v_p == 2.0); if (__pyx_t_1) { - /* "scikits/learn/ball_tree.pyx":253 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":253 * r = 0 * if p == 2: * for i from 0 <= i < n: # <<<<<<<<<<<<<< @@ -1309,7 +1244,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball __pyx_t_2 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "scikits/learn/ball_tree.pyx":254 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":254 * if p == 2: * for i from 0 <= i < n: * d = x1[i] - x2[i] # <<<<<<<<<<<<<< @@ -1318,38 +1253,38 @@ static __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball */ __pyx_v_d = ((__pyx_v_x1[__pyx_v_i]) - (__pyx_v_x2[__pyx_v_i])); - /* "scikits/learn/ball_tree.pyx":255 + /* "/home/fabian/dev/scikit-learn/sklearn/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_r + (__pyx_v_d * __pyx_v_d)); + __pyx_v_r += (__pyx_v_d * __pyx_v_d); } - /* "scikits/learn/ball_tree.pyx":256 + /* "/home/fabian/dev/scikit-learn/sklearn/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(((double)__pyx_v_r), 0.5); + __pyx_v_r = pow(__pyx_v_r, 0.5); goto __pyx_L3; } - /* "scikits/learn/ball_tree.pyx":257 + /* "/home/fabian/dev/scikit-learn/sklearn/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_7scikits_5learn_9ball_tree_infinity); + __pyx_t_1 = (__pyx_v_p == __pyx_v_7sklearn_9ball_tree_infinity); if (__pyx_t_1) { - /* "scikits/learn/ball_tree.pyx":258 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":258 * r = r ** 0.5 * elif p == infinity: * for i from 0 <= i < n: # <<<<<<<<<<<<<< @@ -1359,19 +1294,19 @@ static __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball __pyx_t_2 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "scikits/learn/ball_tree.pyx":259 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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])))); + __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])))); } goto __pyx_L3; } - /* "scikits/learn/ball_tree.pyx":260 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":260 * for i from 0 <= i < n: * r = dmax(r, dabs(x1[i] - x2[i])) * elif p == 1: # <<<<<<<<<<<<<< @@ -1381,7 +1316,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball __pyx_t_1 = (__pyx_v_p == 1.0); if (__pyx_t_1) { - /* "scikits/learn/ball_tree.pyx":261 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":261 * r = dmax(r, dabs(x1[i] - x2[i])) * elif p == 1: * for i from 0 <= i < n: # <<<<<<<<<<<<<< @@ -1391,20 +1326,20 @@ static __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball __pyx_t_2 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "scikits/learn/ball_tree.pyx":262 + /* "/home/fabian/dev/scikit-learn/sklearn/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_v_r + __pyx_f_7scikits_5learn_9ball_tree_dabs(((__pyx_v_x1[__pyx_v_i]) - (__pyx_v_x2[__pyx_v_i])))); + __pyx_v_r += __pyx_f_7sklearn_9ball_tree_dabs(((__pyx_v_x1[__pyx_v_i]) - (__pyx_v_x2[__pyx_v_i]))); } goto __pyx_L3; } /*else*/ { - /* "scikits/learn/ball_tree.pyx":264 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":264 * r += dabs(x1[i] - x2[i]) * else: * for i from 0 <= i < n: # <<<<<<<<<<<<<< @@ -1414,26 +1349,26 @@ static __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball __pyx_t_2 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "scikits/learn/ball_tree.pyx":265 + /* "/home/fabian/dev/scikit-learn/sklearn/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_7scikits_5learn_9ball_tree_dabs(((__pyx_v_x1[__pyx_v_i]) - (__pyx_v_x2[__pyx_v_i]))); + __pyx_v_d = __pyx_f_7sklearn_9ball_tree_dabs(((__pyx_v_x1[__pyx_v_i]) - (__pyx_v_x2[__pyx_v_i]))); - /* "scikits/learn/ball_tree.pyx":266 + /* "/home/fabian/dev/scikit-learn/sklearn/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 = (__pyx_v_r + pow(__pyx_v_d, __pyx_v_p)); + __pyx_v_r += pow(__pyx_v_d, __pyx_v_p); } - /* "scikits/learn/ball_tree.pyx":267 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":267 * d = dabs(x1[i] - x2[i]) * r += d ** p * r = r ** (1. / p) # <<<<<<<<<<<<<< @@ -1444,7 +1379,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball } __pyx_L3:; - /* "scikits/learn/ball_tree.pyx":268 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":268 * r += d ** p * r = r ** (1. / p) * return r # <<<<<<<<<<<<<< @@ -1460,7 +1395,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball return __pyx_r; } -/* "scikits/learn/ball_tree.pyx":272 +/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":272 * * @cython.cdivision(True) * cdef DTYPE_t dist_p(DTYPE_t *x1, DTYPE_t *x2, ITYPE_t n, DTYPE_t p): # <<<<<<<<<<<<<< @@ -1468,16 +1403,16 @@ static __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball * cdef DTYPE_t r, d */ -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; +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; int __pyx_t_1; - __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_t_2; + __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_t_2; __Pyx_RefNannySetupContext("dist_p"); - /* "scikits/learn/ball_tree.pyx":275 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":275 * cdef ITYPE_t i * cdef DTYPE_t r, d * r = 0 # <<<<<<<<<<<<<< @@ -1486,7 +1421,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball */ __pyx_v_r = 0.0; - /* "scikits/learn/ball_tree.pyx":276 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":276 * cdef DTYPE_t r, d * r = 0 * if p == 2: # <<<<<<<<<<<<<< @@ -1496,7 +1431,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball __pyx_t_1 = (__pyx_v_p == 2.0); if (__pyx_t_1) { - /* "scikits/learn/ball_tree.pyx":277 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":277 * r = 0 * if p == 2: * for i from 0 <= i < n: # <<<<<<<<<<<<<< @@ -1506,7 +1441,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball __pyx_t_2 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "scikits/learn/ball_tree.pyx":278 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":278 * if p == 2: * for i from 0 <= i < n: * d = x1[i] - x2[i] # <<<<<<<<<<<<<< @@ -1515,29 +1450,29 @@ static __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball */ __pyx_v_d = ((__pyx_v_x1[__pyx_v_i]) - (__pyx_v_x2[__pyx_v_i])); - /* "scikits/learn/ball_tree.pyx":279 + /* "/home/fabian/dev/scikit-learn/sklearn/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_r + (__pyx_v_d * __pyx_v_d)); + __pyx_v_r += (__pyx_v_d * __pyx_v_d); } goto __pyx_L3; } - /* "scikits/learn/ball_tree.pyx":280 + /* "/home/fabian/dev/scikit-learn/sklearn/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_7scikits_5learn_9ball_tree_infinity); + __pyx_t_1 = (__pyx_v_p == __pyx_v_7sklearn_9ball_tree_infinity); if (__pyx_t_1) { - /* "scikits/learn/ball_tree.pyx":281 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":281 * r += d * d * elif p == infinity: * for i from 0 <= i < n: # <<<<<<<<<<<<<< @@ -1547,19 +1482,19 @@ static __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball __pyx_t_2 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "scikits/learn/ball_tree.pyx":282 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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])))); + __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])))); } goto __pyx_L3; } - /* "scikits/learn/ball_tree.pyx":283 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":283 * for i from 0 <= i < n: * r = dmax(r, dabs(x1[i] - x2[i])) * elif p == 1: # <<<<<<<<<<<<<< @@ -1569,7 +1504,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball __pyx_t_1 = (__pyx_v_p == 1.0); if (__pyx_t_1) { - /* "scikits/learn/ball_tree.pyx":284 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":284 * r = dmax(r, dabs(x1[i] - x2[i])) * elif p == 1: * for i from 0 <= i < n: # <<<<<<<<<<<<<< @@ -1579,20 +1514,20 @@ static __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball __pyx_t_2 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "scikits/learn/ball_tree.pyx":285 + /* "/home/fabian/dev/scikit-learn/sklearn/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_v_r + __pyx_f_7scikits_5learn_9ball_tree_dabs(((__pyx_v_x1[__pyx_v_i]) - (__pyx_v_x2[__pyx_v_i])))); + __pyx_v_r += __pyx_f_7sklearn_9ball_tree_dabs(((__pyx_v_x1[__pyx_v_i]) - (__pyx_v_x2[__pyx_v_i]))); } goto __pyx_L3; } /*else*/ { - /* "scikits/learn/ball_tree.pyx":287 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":287 * r += dabs(x1[i] - x2[i]) * else: * for i from 0 <= i < n: # <<<<<<<<<<<<<< @@ -1602,28 +1537,28 @@ static __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball __pyx_t_2 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "scikits/learn/ball_tree.pyx":288 + /* "/home/fabian/dev/scikit-learn/sklearn/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_7scikits_5learn_9ball_tree_dabs(((__pyx_v_x1[__pyx_v_i]) - (__pyx_v_x2[__pyx_v_i]))); + __pyx_v_d = __pyx_f_7sklearn_9ball_tree_dabs(((__pyx_v_x1[__pyx_v_i]) - (__pyx_v_x2[__pyx_v_i]))); - /* "scikits/learn/ball_tree.pyx":289 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":289 * for i from 0 <= i < n: * d = dabs(x1[i] - x2[i]) * r += d ** p # <<<<<<<<<<<<<< * return r * */ - __pyx_v_r = (__pyx_v_r + pow(__pyx_v_d, __pyx_v_p)); + __pyx_v_r += pow(__pyx_v_d, __pyx_v_p); } } __pyx_L3:; - /* "scikits/learn/ball_tree.pyx":290 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":290 * d = dabs(x1[i] - x2[i]) * r += d ** p * return r # <<<<<<<<<<<<<< @@ -1639,7 +1574,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball return __pyx_r; } -/* "scikits/learn/ball_tree.pyx":294 +/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":294 * * @cython.cdivision(True) * cdef DTYPE_t dist_from_dist_p(DTYPE_t r, DTYPE_t p): # <<<<<<<<<<<<<< @@ -1647,12 +1582,12 @@ static __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball * return r ** 0.5 */ -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; +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; int __pyx_t_1; __Pyx_RefNannySetupContext("dist_from_dist_p"); - /* "scikits/learn/ball_tree.pyx":295 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":295 * @cython.cdivision(True) * cdef DTYPE_t dist_from_dist_p(DTYPE_t r, DTYPE_t p): * if p == 2: # <<<<<<<<<<<<<< @@ -1662,29 +1597,29 @@ static __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball __pyx_t_1 = (__pyx_v_p == 2.0); if (__pyx_t_1) { - /* "scikits/learn/ball_tree.pyx":296 + /* "/home/fabian/dev/scikit-learn/sklearn/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(((double)__pyx_v_r), 0.5); + __pyx_r = pow(__pyx_v_r, 0.5); goto __pyx_L0; goto __pyx_L3; } - /* "scikits/learn/ball_tree.pyx":297 + /* "/home/fabian/dev/scikit-learn/sklearn/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_7scikits_5learn_9ball_tree_infinity); + __pyx_t_1 = (__pyx_v_p == __pyx_v_7sklearn_9ball_tree_infinity); if (__pyx_t_1) { - /* "scikits/learn/ball_tree.pyx":298 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":298 * return r ** 0.5 * elif p == infinity: * return r # <<<<<<<<<<<<<< @@ -1696,7 +1631,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball goto __pyx_L3; } - /* "scikits/learn/ball_tree.pyx":299 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":299 * elif p == infinity: * return r * elif p == 1: # <<<<<<<<<<<<<< @@ -1706,7 +1641,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball __pyx_t_1 = (__pyx_v_p == 1.0); if (__pyx_t_1) { - /* "scikits/learn/ball_tree.pyx":300 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":300 * return r * elif p == 1: * return r # <<<<<<<<<<<<<< @@ -1719,7 +1654,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball } /*else*/ { - /* "scikits/learn/ball_tree.pyx":302 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":302 * return r * else: * return r ** (1. / p) # <<<<<<<<<<<<<< @@ -1737,7 +1672,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball return __pyx_r; } -/* "scikits/learn/ball_tree.pyx":306 +/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":306 * * @cython.cdivision(True) * cdef DTYPE_t dist_p_from_dist(DTYPE_t r, DTYPE_t p): # <<<<<<<<<<<<<< @@ -1745,12 +1680,12 @@ static __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball * return r ** 2 */ -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; +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; int __pyx_t_1; __Pyx_RefNannySetupContext("dist_p_from_dist"); - /* "scikits/learn/ball_tree.pyx":307 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":307 * @cython.cdivision(True) * cdef DTYPE_t dist_p_from_dist(DTYPE_t r, DTYPE_t p): * if p == 2: # <<<<<<<<<<<<<< @@ -1760,7 +1695,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball __pyx_t_1 = (__pyx_v_p == 2.0); if (__pyx_t_1) { - /* "scikits/learn/ball_tree.pyx":308 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":308 * cdef DTYPE_t dist_p_from_dist(DTYPE_t r, DTYPE_t p): * if p == 2: * return r ** 2 # <<<<<<<<<<<<<< @@ -1772,17 +1707,17 @@ static __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball goto __pyx_L3; } - /* "scikits/learn/ball_tree.pyx":309 + /* "/home/fabian/dev/scikit-learn/sklearn/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_7scikits_5learn_9ball_tree_infinity); + __pyx_t_1 = (__pyx_v_p == __pyx_v_7sklearn_9ball_tree_infinity); if (__pyx_t_1) { - /* "scikits/learn/ball_tree.pyx":310 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":310 * return r ** 2 * elif p == infinity: * return r # <<<<<<<<<<<<<< @@ -1794,7 +1729,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball goto __pyx_L3; } - /* "scikits/learn/ball_tree.pyx":311 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":311 * elif p == infinity: * return r * elif p == 1: # <<<<<<<<<<<<<< @@ -1804,7 +1739,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball __pyx_t_1 = (__pyx_v_p == 1.0); if (__pyx_t_1) { - /* "scikits/learn/ball_tree.pyx":312 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":312 * return r * elif p == 1: * return r # <<<<<<<<<<<<<< @@ -1817,7 +1752,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball } /*else*/ { - /* "scikits/learn/ball_tree.pyx":314 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":314 * return r * else: * return r ** p # <<<<<<<<<<<<<< @@ -1835,7 +1770,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball return __pyx_r; } -/* "scikits/learn/ball_tree.pyx":345 +/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":345 * * @cython.profile(False) * cdef inline void stack_create(stack* self, int size): # <<<<<<<<<<<<<< @@ -1843,10 +1778,10 @@ static __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits_5learn_9ball * self.heap = stdlib.malloc(sizeof(stack_item) * 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) { +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) { __Pyx_RefNannySetupContext("stack_create"); - /* "scikits/learn/ball_tree.pyx":346 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":346 * @cython.profile(False) * cdef inline void stack_create(stack* self, int size): * self.size = size # <<<<<<<<<<<<<< @@ -1855,16 +1790,16 @@ static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_stack_create(struct */ __pyx_v_self->size = __pyx_v_size; - /* "scikits/learn/ball_tree.pyx":347 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":347 * cdef inline void stack_create(stack* self, int size): * self.size = size * self.heap = stdlib.malloc(sizeof(stack_item) * size) # <<<<<<<<<<<<<< * self.n = 0 * */ - __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))); + __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))); - /* "scikits/learn/ball_tree.pyx":348 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":348 * self.size = size * self.heap = stdlib.malloc(sizeof(stack_item) * size) * self.n = 0 # <<<<<<<<<<<<<< @@ -1876,7 +1811,7 @@ static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_stack_create(struct __Pyx_RefNannyFinishContext(); } -/* "scikits/learn/ball_tree.pyx":352 +/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":352 * * @cython.profile(False) * cdef inline void stack_destroy(stack* self): # <<<<<<<<<<<<<< @@ -1884,10 +1819,10 @@ static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_stack_create(struct * */ -static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_stack_destroy(struct __pyx_t_7scikits_5learn_9ball_tree_stack *__pyx_v_self) { +static CYTHON_INLINE void __pyx_f_7sklearn_9ball_tree_stack_destroy(struct __pyx_t_7sklearn_9ball_tree_stack *__pyx_v_self) { __Pyx_RefNannySetupContext("stack_destroy"); - /* "scikits/learn/ball_tree.pyx":353 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":353 * @cython.profile(False) * cdef inline void stack_destroy(stack* self): * stdlib.free(self.heap) # <<<<<<<<<<<<<< @@ -1899,7 +1834,7 @@ static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_stack_destroy(struc __Pyx_RefNannyFinishContext(); } -/* "scikits/learn/ball_tree.pyx":357 +/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":357 * * @cython.profile(False) * cdef inline void stack_resize(stack* self, int new_size): # <<<<<<<<<<<<<< @@ -1907,12 +1842,13 @@ static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_stack_destroy(struc * if new_size < self.n: */ -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) { +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) { int __pyx_t_1; PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("stack_resize"); - /* "scikits/learn/ball_tree.pyx":359 + /* "/home/fabian/dev/scikit-learn/sklearn/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: # <<<<<<<<<<<<<< @@ -1922,23 +1858,29 @@ static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_stack_resize(struct __pyx_t_1 = (__pyx_v_new_size < __pyx_v_self->n); if (__pyx_t_1) { - /* "scikits/learn/ball_tree.pyx":360 + /* "/home/fabian/dev/scikit-learn/sklearn/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 = 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_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_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); + __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_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:; - /* "scikits/learn/ball_tree.pyx":362 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":362 * raise ValueError("new_size smaller than current") * * self.size = new_size # <<<<<<<<<<<<<< @@ -1947,24 +1889,25 @@ static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_stack_resize(struct */ __pyx_v_self->size = __pyx_v_new_size; - /* "scikits/learn/ball_tree.pyx":363 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":363 * * self.size = new_size * self.heap = stdlib.realloc( self.heap, # <<<<<<<<<<<<<< * new_size * sizeof(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))))); + __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))))); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); - __Pyx_WriteUnraisable("scikits.learn.ball_tree.stack_resize"); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_WriteUnraisable("sklearn.ball_tree.stack_resize"); __pyx_L0:; __Pyx_RefNannyFinishContext(); } -/* "scikits/learn/ball_tree.pyx":368 +/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":368 * * @cython.profile(False) * cdef inline void stack_push(stack* self, stack_item item): # <<<<<<<<<<<<<< @@ -1972,11 +1915,11 @@ static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_stack_resize(struct * stack_resize(self, 2 * self.size + 1) */ -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) { +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) { int __pyx_t_1; __Pyx_RefNannySetupContext("stack_push"); - /* "scikits/learn/ball_tree.pyx":369 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":369 * @cython.profile(False) * cdef inline void stack_push(stack* self, stack_item item): * if self.n >= self.size: # <<<<<<<<<<<<<< @@ -1986,19 +1929,19 @@ static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_stack_push(struct _ __pyx_t_1 = (__pyx_v_self->n >= __pyx_v_self->size); if (__pyx_t_1) { - /* "scikits/learn/ball_tree.pyx":370 + /* "/home/fabian/dev/scikit-learn/sklearn/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_7scikits_5learn_9ball_tree_stack_resize(__pyx_v_self, ((2 * __pyx_v_self->size) + 1)); + __pyx_f_7sklearn_9ball_tree_stack_resize(__pyx_v_self, ((2 * __pyx_v_self->size) + 1)); goto __pyx_L3; } __pyx_L3:; - /* "scikits/learn/ball_tree.pyx":372 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":372 * stack_resize(self, 2 * self.size + 1) * * self.heap[self.n] = item # <<<<<<<<<<<<<< @@ -2007,19 +1950,19 @@ static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_stack_push(struct _ */ (__pyx_v_self->heap[__pyx_v_self->n]) = __pyx_v_item; - /* "scikits/learn/ball_tree.pyx":373 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":373 * * self.heap[self.n] = item * self.n += 1 # <<<<<<<<<<<<<< * * */ - __pyx_v_self->n = (__pyx_v_self->n + 1); + __pyx_v_self->n += 1; __Pyx_RefNannyFinishContext(); } -/* "scikits/learn/ball_tree.pyx":377 +/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":377 * * @cython.profile(False) * cdef inline stack_item stack_pop(stack* self): # <<<<<<<<<<<<<< @@ -2027,13 +1970,14 @@ static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_stack_push(struct _ * raise ValueError("popping empty stack") */ -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; +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; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("stack_pop"); - /* "scikits/learn/ball_tree.pyx":378 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":378 * @cython.profile(False) * cdef inline stack_item stack_pop(stack* self): * if self.n == 0: # <<<<<<<<<<<<<< @@ -2043,32 +1987,38 @@ static CYTHON_INLINE struct __pyx_t_7scikits_5learn_9ball_tree_stack_item __pyx_ __pyx_t_1 = (__pyx_v_self->n == 0); if (__pyx_t_1) { - /* "scikits/learn/ball_tree.pyx":379 + /* "/home/fabian/dev/scikit-learn/sklearn/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 = 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_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_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); + __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_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:; - /* "scikits/learn/ball_tree.pyx":381 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":381 * raise ValueError("popping empty stack") * * self.n -= 1 # <<<<<<<<<<<<<< * return self.heap[self.n] * */ - __pyx_v_self->n = (__pyx_v_self->n - 1); + __pyx_v_self->n -= 1; - /* "scikits/learn/ball_tree.pyx":382 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":382 * * self.n -= 1 * return self.heap[self.n] # <<<<<<<<<<<<<< @@ -2081,13 +2031,14 @@ static CYTHON_INLINE struct __pyx_t_7scikits_5learn_9ball_tree_stack_item __pyx_ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); - __Pyx_WriteUnraisable("scikits.learn.ball_tree.stack_pop"); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_WriteUnraisable("sklearn.ball_tree.stack_pop"); __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "scikits/learn/ball_tree.pyx":388 +/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":388 * # newObj function * # this is a helper function for pickling * def newObj(obj): # <<<<<<<<<<<<<< @@ -2095,9 +2046,8 @@ static CYTHON_INLINE struct __pyx_t_7scikits_5learn_9ball_tree_stack_item __pyx_ * */ -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) { +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) { PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -2105,7 +2055,7 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_newObj(PyObject *__pyx_self __Pyx_RefNannySetupContext("newObj"); __pyx_self = __pyx_self; - /* "scikits/learn/ball_tree.pyx":389 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":389 * # this is a helper function for pickling * def newObj(obj): * return obj.__new__(obj) # <<<<<<<<<<<<<< @@ -2116,14 +2066,14 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_newObj(PyObject *__pyx_self __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(((PyObject *)__pyx_t_2)); + __Pyx_GOTREF(__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, ((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_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_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; @@ -2134,7 +2084,7 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_newObj(PyObject *__pyx_self __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("scikits.learn.ball_tree.newObj"); + __Pyx_AddTraceback("sklearn.ball_tree.newObj"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -2142,7 +2092,31 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_newObj(PyObject *__pyx_self return __pyx_r; } -/* "scikits/learn/ball_tree.pyx":468 +/* "/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 * cdef ITYPE_t n_nodes * * def __cinit__(self): # <<<<<<<<<<<<<< @@ -2150,18 +2124,19 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_newObj(PyObject *__pyx_self * initialize all arrays to empty. This will prevent memory errors */ -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) { +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) { 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; - /* "scikits/learn/ball_tree.pyx":473 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":473 * in rare cases where __init__ is not called * """ * self.data = np.empty((0,0), dtype=DTYPE) # <<<<<<<<<<<<<< @@ -2173,53 +2148,73 @@ static int __pyx_pf_7scikits_5learn_9ball_tree_8BallTree___cinit__(PyObject *__p __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_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_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_DECREF(__pyx_t_3); __pyx_t_3 = 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 = 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; + 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; - /* "scikits/learn/ball_tree.pyx":474 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __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_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, ((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_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_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_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_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_t_2 = 0; - /* "scikits/learn/ball_tree.pyx":475 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -2231,24 +2226,38 @@ static int __pyx_pf_7scikits_5learn_9ball_tree_8BallTree___cinit__(PyObject *__p __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, ((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_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_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_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_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_t_1 = 0; - /* "scikits/learn/ball_tree.pyx":476 + /* "/home/fabian/dev/scikit-learn/sklearn/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') # <<<<<<<<<<<<<< @@ -2260,18 +2269,24 @@ static int __pyx_pf_7scikits_5learn_9ball_tree_8BallTree___cinit__(PyObject *__p __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 = 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_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_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__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 = 476; __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)->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_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_t_3 = 0; __pyx_r = 0; @@ -2280,14 +2295,15 @@ static int __pyx_pf_7scikits_5learn_9ball_tree_8BallTree___cinit__(PyObject *__p __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("scikits.learn.ball_tree.BallTree.__cinit__"); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("sklearn.ball_tree.BallTree.__cinit__"); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "scikits/learn/ball_tree.pyx":478 +/* "/home/fabian/dev/scikit-learn/sklearn/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): # <<<<<<<<<<<<<< @@ -2295,13 +2311,13 @@ static int __pyx_pf_7scikits_5learn_9ball_tree_8BallTree___cinit__(PyObject *__p * */ -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) { +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) { PyObject *__pyx_v_X = 0; - __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; + __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; int __pyx_r; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -2311,7 +2327,7 @@ static int __pyx_pf_7scikits_5learn_9ball_tree_8BallTree_1__init__(PyObject *__p long __pyx_t_6; long __pyx_t_7; long __pyx_t_8; - __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_t_9; + __pyx_t_7sklearn_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)) { @@ -2347,16 +2363,16 @@ static int __pyx_pf_7scikits_5learn_9ball_tree_8BallTree_1__init__(PyObject *__p 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_7scikits_5learn_9ball_tree_ITYPE_t)20); + __pyx_v_leaf_size = ((__pyx_t_7sklearn_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_7scikits_5learn_9ball_tree_DTYPE_t)2.0); + __pyx_v_p = ((__pyx_t_7sklearn_9ball_tree_DTYPE_t)2.0); } } else { - __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); + __pyx_v_leaf_size = ((__pyx_t_7sklearn_9ball_tree_ITYPE_t)20); + __pyx_v_p = ((__pyx_t_7sklearn_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;} @@ -2369,12 +2385,12 @@ static int __pyx_pf_7scikits_5learn_9ball_tree_8BallTree_1__init__(PyObject *__p __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("scikits.learn.ball_tree.BallTree.__init__"); + __Pyx_AddTraceback("sklearn.ball_tree.BallTree.__init__"); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - /* "scikits/learn/ball_tree.pyx":479 + /* "/home/fabian/dev/scikit-learn/sklearn/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') # <<<<<<<<<<<<<< @@ -2387,7 +2403,7 @@ static int __pyx_pf_7scikits_5learn_9ball_tree_8BallTree_1__init__(PyObject *__p __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(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_X); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_X); __Pyx_GIVEREF(__pyx_v_X); @@ -2398,19 +2414,19 @@ static int __pyx_pf_7scikits_5learn_9ball_tree_8BallTree_1__init__(PyObject *__p 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, ((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_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_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __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 = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GIVEREF(__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_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; - /* "scikits/learn/ball_tree.pyx":481 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":481 * self.data = np.asarray(X, dtype=DTYPE, order='C') * * if X.size == 0: # <<<<<<<<<<<<<< @@ -2426,41 +2442,53 @@ static int __pyx_pf_7scikits_5learn_9ball_tree_8BallTree_1__init__(PyObject *__p __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_5) { - /* "scikits/learn/ball_tree.pyx":482 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":482 * * if X.size == 0: * raise ValueError("X is an empty array") # <<<<<<<<<<<<<< * * if self.data.ndim != 2: */ - __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_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_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0); + __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_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:; - /* "scikits/learn/ball_tree.pyx":484 + /* "/home/fabian/dev/scikit-learn/sklearn/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_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->data->nd != 2); + __pyx_t_5 = (((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->data->nd != 2); if (__pyx_t_5) { - /* "scikits/learn/ball_tree.pyx":485 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":485 * * if self.data.ndim != 2: * raise ValueError("X should have two dimensions") # <<<<<<<<<<<<<< * * if p < 1: */ - __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_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_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;} @@ -2468,7 +2496,7 @@ static int __pyx_pf_7scikits_5learn_9ball_tree_8BallTree_1__init__(PyObject *__p } __pyx_L7:; - /* "scikits/learn/ball_tree.pyx":487 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":487 * raise ValueError("X should have two dimensions") * * if p < 1: # <<<<<<<<<<<<<< @@ -2478,32 +2506,38 @@ static int __pyx_pf_7scikits_5learn_9ball_tree_8BallTree_1__init__(PyObject *__p __pyx_t_5 = (__pyx_v_p < 1.0); if (__pyx_t_5) { - /* "scikits/learn/ball_tree.pyx":488 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":488 * * if p < 1: * raise ValueError("p must be greater than or equal to 1") # <<<<<<<<<<<<<< * self.p = p * */ - __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_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_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0); + __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_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:; - /* "scikits/learn/ball_tree.pyx":489 + /* "/home/fabian/dev/scikit-learn/sklearn/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_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->p = __pyx_v_p; + ((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->p = __pyx_v_p; - /* "scikits/learn/ball_tree.pyx":491 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":491 * self.p = p * * if leaf_size < 1: # <<<<<<<<<<<<<< @@ -2513,15 +2547,21 @@ static int __pyx_pf_7scikits_5learn_9ball_tree_8BallTree_1__init__(PyObject *__p __pyx_t_5 = (__pyx_v_leaf_size < 1); if (__pyx_t_5) { - /* "scikits/learn/ball_tree.pyx":492 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_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;} @@ -2529,34 +2569,34 @@ static int __pyx_pf_7scikits_5learn_9ball_tree_8BallTree_1__init__(PyObject *__p } __pyx_L9:; - /* "scikits/learn/ball_tree.pyx":493 + /* "/home/fabian/dev/scikit-learn/sklearn/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_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->leaf_size = __pyx_v_leaf_size; + ((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->leaf_size = __pyx_v_leaf_size; - /* "scikits/learn/ball_tree.pyx":495 + /* "/home/fabian/dev/scikit-learn/sklearn/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_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->data->dimensions[0]); + __pyx_v_n_samples = (((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->data->dimensions[0]); - /* "scikits/learn/ball_tree.pyx":496 + /* "/home/fabian/dev/scikit-learn/sklearn/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_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->data->dimensions[1]); + __pyx_v_n_features = (((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->data->dimensions[1]); - /* "scikits/learn/ball_tree.pyx":500 + /* "/home/fabian/dev/scikit-learn/sklearn/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 # <<<<<<<<<<<<<< @@ -2569,15 +2609,15 @@ static int __pyx_pf_7scikits_5learn_9ball_tree_8BallTree_1__init__(PyObject *__p __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_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->leaf_size == 0)) { + if (unlikely(((struct __pyx_obj_7sklearn_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_7scikits_5learn_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_7sklearn_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_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->leaf_size); + __pyx_t_7 = __Pyx_div_long(__pyx_t_6, ((struct __pyx_obj_7sklearn_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; @@ -2587,31 +2627,31 @@ static int __pyx_pf_7scikits_5learn_9ball_tree_8BallTree_1__init__(PyObject *__p __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(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__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, ((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_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_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__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_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->n_levels = __pyx_t_9; + ((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->n_levels = __pyx_t_9; - /* "scikits/learn/ball_tree.pyx":501 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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); + ((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); - /* "scikits/learn/ball_tree.pyx":503 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":503 * self.n_nodes = (2 ** self.n_levels) - 1 * * self.idx_array = np.arange(n_samples, dtype=ITYPE) # <<<<<<<<<<<<<< @@ -2626,7 +2666,7 @@ static int __pyx_pf_7scikits_5learn_9ball_tree_8BallTree_1__init__(PyObject *__p __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(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; @@ -2636,19 +2676,19 @@ static int __pyx_pf_7scikits_5learn_9ball_tree_8BallTree_1__init__(PyObject *__p __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, ((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_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_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__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_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_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_t_2 = 0; - /* "scikits/learn/ball_tree.pyx":505 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":505 * self.idx_array = np.arange(n_samples, dtype=ITYPE) * * self.node_centroid_arr = np.empty((self.n_nodes, n_features), # <<<<<<<<<<<<<< @@ -2660,12 +2700,12 @@ static int __pyx_pf_7scikits_5learn_9ball_tree_8BallTree_1__init__(PyObject *__p __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_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_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_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(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(__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); @@ -2673,14 +2713,14 @@ static int __pyx_pf_7scikits_5learn_9ball_tree_8BallTree_1__init__(PyObject *__p __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(((PyObject *)__pyx_t_4)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 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)); - /* "scikits/learn/ball_tree.pyx":506 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":506 * * self.node_centroid_arr = np.empty((self.n_nodes, n_features), * dtype=DTYPE, order='C') # <<<<<<<<<<<<<< @@ -2692,14 +2732,14 @@ static int __pyx_pf_7scikits_5learn_9ball_tree_8BallTree_1__init__(PyObject *__p 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, ((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_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_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 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 = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "scikits/learn/ball_tree.pyx":505 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":505 * self.idx_array = np.arange(n_samples, dtype=ITYPE) * * self.node_centroid_arr = np.empty((self.n_nodes, n_features), # <<<<<<<<<<<<<< @@ -2707,12 +2747,12 @@ static int __pyx_pf_7scikits_5learn_9ball_tree_8BallTree_1__init__(PyObject *__p * */ __Pyx_GIVEREF(__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_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_t_2 = 0; - /* "scikits/learn/ball_tree.pyx":508 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":508 * dtype=DTYPE, order='C') * * self.node_info_arr = np.empty(self.n_nodes * sizeof(NodeInfo), # <<<<<<<<<<<<<< @@ -2724,10 +2764,10 @@ static int __pyx_pf_7scikits_5learn_9ball_tree_8BallTree_1__init__(PyObject *__p __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_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_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_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(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; @@ -2735,26 +2775,26 @@ static int __pyx_pf_7scikits_5learn_9ball_tree_8BallTree_1__init__(PyObject *__p __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, ((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_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_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 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 = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GIVEREF(__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_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_t_1 = 0; - /* "scikits/learn/ball_tree.pyx":510 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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)); + ((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)); __pyx_r = 0; goto __pyx_L0; @@ -2763,14 +2803,14 @@ static int __pyx_pf_7scikits_5learn_9ball_tree_8BallTree_1__init__(PyObject *__p __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("scikits.learn.ball_tree.BallTree.__init__"); + __Pyx_AddTraceback("sklearn.ball_tree.BallTree.__init__"); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "scikits/learn/ball_tree.pyx":512 +/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":512 * self.build_tree_() * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -2778,9 +2818,9 @@ static int __pyx_pf_7scikits_5learn_9ball_tree_8BallTree_1__init__(PyObject *__p * reduce method used for pickling */ -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) { +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) { PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -2788,7 +2828,7 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_2__reduce__(PyObj PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("__reduce__"); - /* "scikits/learn/ball_tree.pyx":516 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":516 * reduce method used for pickling * """ * return (newObj, (BallTree,), self.__getstate__()) # <<<<<<<<<<<<<< @@ -2799,27 +2839,27 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_2__reduce__(PyObj __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(((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_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_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(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(__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, ((PyObject *)__pyx_t_2)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __Pyx_GIVEREF(__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 = ((PyObject *)__pyx_t_3); + __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; @@ -2830,7 +2870,7 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_2__reduce__(PyObj __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("scikits.learn.ball_tree.BallTree.__reduce__"); + __Pyx_AddTraceback("sklearn.ball_tree.BallTree.__reduce__"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -2838,7 +2878,7 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_2__reduce__(PyObj return __pyx_r; } -/* "scikits/learn/ball_tree.pyx":518 +/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":518 * return (newObj, (BallTree,), self.__getstate__()) * * def __getstate__(self): # <<<<<<<<<<<<<< @@ -2846,9 +2886,9 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_2__reduce__(PyObj * get state for pickling */ -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) { +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) { PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -2857,7 +2897,7 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_3__getstate__(PyO PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("__getstate__"); - /* "scikits/learn/ball_tree.pyx":522 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":522 * get state for pickling * """ * return (self.data, # <<<<<<<<<<<<<< @@ -2866,59 +2906,59 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_3__getstate__(PyO */ __Pyx_XDECREF(__pyx_r); - /* "scikits/learn/ball_tree.pyx":526 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_GOTREF(__pyx_t_1); - /* "scikits/learn/ball_tree.pyx":527 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_GOTREF(__pyx_t_2); - /* "scikits/learn/ball_tree.pyx":528 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_GOTREF(__pyx_t_3); - /* "scikits/learn/ball_tree.pyx":529 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_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(((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)); + __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)); 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); @@ -2931,7 +2971,7 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_3__getstate__(PyO __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; - __pyx_r = ((PyObject *)__pyx_t_5); + __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; @@ -2943,7 +2983,7 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_3__getstate__(PyO __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("scikits.learn.ball_tree.BallTree.__getstate__"); + __Pyx_AddTraceback("sklearn.ball_tree.BallTree.__getstate__"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -2951,7 +2991,7 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_3__getstate__(PyO return __pyx_r; } -/* "scikits/learn/ball_tree.pyx":531 +/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":531 * self.n_nodes) * * def __setstate__(self, state): # <<<<<<<<<<<<<< @@ -2959,16 +2999,16 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_3__getstate__(PyO * set state for pickling */ -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) { +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) { PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; - __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_t_2; - __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_t_3; + __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_t_2; + __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_t_3; __Pyx_RefNannySetupContext("__setstate__"); - /* "scikits/learn/ball_tree.pyx":535 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":535 * set state for pickling * """ * self.data = state[0] # <<<<<<<<<<<<<< @@ -2979,12 +3019,12 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_4__setstate__(PyO __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_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_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_t_1 = 0; - /* "scikits/learn/ball_tree.pyx":536 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":536 * """ * self.data = state[0] * self.idx_array = state[1] # <<<<<<<<<<<<<< @@ -2995,12 +3035,12 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_4__setstate__(PyO __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_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_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_t_1 = 0; - /* "scikits/learn/ball_tree.pyx":537 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":537 * self.data = state[0] * self.idx_array = state[1] * self.node_centroid_arr = state[2] # <<<<<<<<<<<<<< @@ -3011,12 +3051,12 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_4__setstate__(PyO __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_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_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_t_1 = 0; - /* "scikits/learn/ball_tree.pyx":538 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":538 * self.idx_array = state[1] * self.node_centroid_arr = state[2] * self.node_info_arr = state[3] # <<<<<<<<<<<<<< @@ -3027,12 +3067,12 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_4__setstate__(PyO __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_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_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_t_1 = 0; - /* "scikits/learn/ball_tree.pyx":539 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":539 * self.node_centroid_arr = state[2] * self.node_info_arr = state[3] * self.p = state[4] # <<<<<<<<<<<<<< @@ -3043,9 +3083,9 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_4__setstate__(PyO __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_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->p = __pyx_t_2; + ((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->p = __pyx_t_2; - /* "scikits/learn/ball_tree.pyx":540 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":540 * self.node_info_arr = state[3] * self.p = state[4] * self.leaf_size = state[5] # <<<<<<<<<<<<<< @@ -3056,9 +3096,9 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_4__setstate__(PyO __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_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->leaf_size = __pyx_t_3; + ((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->leaf_size = __pyx_t_3; - /* "scikits/learn/ball_tree.pyx":541 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":541 * self.p = state[4] * self.leaf_size = state[5] * self.n_levels = state[6] # <<<<<<<<<<<<<< @@ -3069,9 +3109,9 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_4__setstate__(PyO __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_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->n_levels = __pyx_t_3; + ((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->n_levels = __pyx_t_3; - /* "scikits/learn/ball_tree.pyx":542 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":542 * self.leaf_size = state[5] * self.n_levels = state[6] * self.n_nodes = state[7] # <<<<<<<<<<<<<< @@ -3082,13 +3122,13 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_4__setstate__(PyO __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_7scikits_5learn_9ball_tree_BallTree *)__pyx_v_self)->n_nodes = __pyx_t_3; + ((struct __pyx_obj_7sklearn_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("scikits.learn.ball_tree.BallTree.__setstate__"); + __Pyx_AddTraceback("sklearn.ball_tree.BallTree.__setstate__"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -3096,7 +3136,7 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_4__setstate__(PyO return __pyx_r; } -/* "scikits/learn/ball_tree.pyx":544 +/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":544 * self.n_nodes = state[7] * * def query(self, X, k=1, return_distance=True): # <<<<<<<<<<<<<< @@ -3104,29 +3144,29 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_4__setstate__(PyO * query(X, k=1, return_distance=True) */ -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) { +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) { PyObject *__pyx_v_X = 0; PyObject *__pyx_v_k = 0; PyObject *__pyx_v_return_distance = 0; PyObject *__pyx_v_orig_shape; - __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; + __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; PyArrayObject *__pyx_v_distances = 0; PyArrayObject *__pyx_v_idx_array = 0; PyArrayObject *__pyx_v_Xi; - __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; + __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; 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_7scikits_5learn_9ball_tree_ITYPE_t __pyx_t_6; + __pyx_t_7sklearn_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}; @@ -3135,7 +3175,7 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_5query(PyObject * 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_19; + values[2] = __pyx_k_7; 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); @@ -3167,7 +3207,7 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_5query(PyObject * __pyx_v_return_distance = values[2]; } else { __pyx_v_k = ((PyObject *)__pyx_int_1); - __pyx_v_return_distance = __pyx_k_19; + __pyx_v_return_distance = __pyx_k_7; 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); @@ -3180,7 +3220,7 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_5query(PyObject * __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("scikits.learn.ball_tree.BallTree.query"); + __Pyx_AddTraceback("sklearn.ball_tree.BallTree.query"); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; @@ -3188,7 +3228,7 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_5query(PyObject * __pyx_v_orig_shape = Py_None; __Pyx_INCREF(Py_None); __pyx_v_Xi = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - /* "scikits/learn/ball_tree.pyx":589 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":589 * [ 0. 0.19662693 0.29473397] * """ * X = np.asarray(X, dtype=DTYPE, order='C') # <<<<<<<<<<<<<< @@ -3201,7 +3241,7 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_5query(PyObject * __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(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_X); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_X); __Pyx_GIVEREF(__pyx_v_X); @@ -3212,16 +3252,16 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_5query(PyObject * 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, ((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_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_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__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; - /* "scikits/learn/ball_tree.pyx":590 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":590 * """ * X = np.asarray(X, dtype=DTYPE, order='C') * X = np.atleast_2d(X) # <<<<<<<<<<<<<< @@ -3234,19 +3274,19 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_5query(PyObject * __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(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__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, ((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_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_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_v_X); __pyx_v_X = __pyx_t_1; __pyx_t_1 = 0; - /* "scikits/learn/ball_tree.pyx":592 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":592 * X = np.atleast_2d(X) * * if X.shape[-1] != self.data.shape[1]: # <<<<<<<<<<<<<< @@ -3258,7 +3298,7 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_5query(PyObject * __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_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_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_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); @@ -3268,47 +3308,59 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_5query(PyObject * __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_5) { - /* "scikits/learn/ball_tree.pyx":593 + /* "/home/fabian/dev/scikit-learn/sklearn/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 = 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_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_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0); + __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_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:; - /* "scikits/learn/ball_tree.pyx":596 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_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_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_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_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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_5) { - /* "scikits/learn/ball_tree.pyx":597 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_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;} @@ -3316,7 +3368,7 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_5query(PyObject * } __pyx_L7:; - /* "scikits/learn/ball_tree.pyx":601 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":601 * * # flatten X for iteration * orig_shape = X.shape # <<<<<<<<<<<<<< @@ -3329,7 +3381,7 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_5query(PyObject * __pyx_v_orig_shape = __pyx_t_1; __pyx_t_1 = 0; - /* "scikits/learn/ball_tree.pyx":602 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":602 * # flatten X for iteration * orig_shape = X.shape * X = X.reshape((-1, X.shape[-1])) # <<<<<<<<<<<<<< @@ -3344,7 +3396,7 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_5query(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 = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(__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); @@ -3352,19 +3404,19 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_5query(PyObject * __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(((PyObject *)__pyx_t_4)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __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_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_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_v_X); __pyx_v_X = __pyx_t_3; __pyx_t_3 = 0; - /* "scikits/learn/ball_tree.pyx":606 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -3377,7 +3429,7 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_5query(PyObject * __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_use_max_heap = __pyx_t_6; - /* "scikits/learn/ball_tree.pyx":609 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":609 * * cdef ITYPE_t i * cdef ITYPE_t n_neighbors = k # <<<<<<<<<<<<<< @@ -3387,7 +3439,7 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_5query(PyObject * __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; - /* "scikits/learn/ball_tree.pyx":610 + /* "/home/fabian/dev/scikit-learn/sklearn/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), # <<<<<<<<<<<<<< @@ -3407,7 +3459,7 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_5query(PyObject * __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(((PyObject *)__pyx_t_2)); + __Pyx_GOTREF(__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); @@ -3415,14 +3467,14 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_5query(PyObject * __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(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 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 = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - /* "scikits/learn/ball_tree.pyx":611 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":611 * cdef ITYPE_t n_neighbors = k * cdef np.ndarray distances = np.empty((X.shape[0], n_neighbors), * dtype=DTYPE) # <<<<<<<<<<<<<< @@ -3433,16 +3485,16 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_5query(PyObject * __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, ((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_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_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __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 = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_distances = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "scikits/learn/ball_tree.pyx":612 + /* "/home/fabian/dev/scikit-learn/sklearn/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), # <<<<<<<<<<<<<< @@ -3462,7 +3514,7 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_5query(PyObject * __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(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__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); @@ -3470,14 +3522,14 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_5query(PyObject * __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(((PyObject *)__pyx_t_1)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_4)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 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 = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - /* "scikits/learn/ball_tree.pyx":613 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":613 * dtype=DTYPE) * cdef np.ndarray idx_array = np.empty((X.shape[0], n_neighbors), * dtype=ITYPE) # <<<<<<<<<<<<<< @@ -3488,16 +3540,16 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_5query(PyObject * __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, ((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_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_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__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; - /* "scikits/learn/ball_tree.pyx":616 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":616 * cdef np.ndarray Xi * * distances[:] = np.inf # <<<<<<<<<<<<<< @@ -3509,37 +3561,37 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_5query(PyObject * __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 (__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;} + 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;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "scikits/learn/ball_tree.pyx":618 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":618 * distances[:] = np.inf * * cdef DTYPE_t* dist_ptr = distances.data # <<<<<<<<<<<<<< * cdef ITYPE_t* idx_ptr = idx_array.data * */ - __pyx_v_dist_ptr = ((__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *)__pyx_v_distances->data); + __pyx_v_dist_ptr = ((__pyx_t_7sklearn_9ball_tree_DTYPE_t *)__pyx_v_distances->data); - /* "scikits/learn/ball_tree.pyx":619 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":619 * * cdef DTYPE_t* dist_ptr = distances.data * cdef ITYPE_t* idx_ptr = idx_array.data # <<<<<<<<<<<<<< * * cdef stack node_stack */ - __pyx_v_idx_ptr = ((__pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *)__pyx_v_idx_array->data); + __pyx_v_idx_ptr = ((__pyx_t_7sklearn_9ball_tree_ITYPE_t *)__pyx_v_idx_array->data); - /* "scikits/learn/ball_tree.pyx":622 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":622 * * cdef stack node_stack * stack_create(&node_stack, self.n_levels + 1) # <<<<<<<<<<<<<< * * for i, Xi in enumerate(X): */ - __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)); + __pyx_f_7sklearn_9ball_tree_stack_create((&__pyx_v_node_stack), (((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->n_levels + 1)); - /* "scikits/learn/ball_tree.pyx":624 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":624 * stack_create(&node_stack, self.n_levels + 1) * * for i, Xi in enumerate(X): # <<<<<<<<<<<<<< @@ -3575,16 +3627,16 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_5query(PyObject * __pyx_v_i = __pyx_t_6; __pyx_t_6 = (__pyx_t_6 + 1); - /* "scikits/learn/ball_tree.pyx":626 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":626 * for i, Xi in enumerate(X): * self.query_one_(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_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); + ((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); - /* "scikits/learn/ball_tree.pyx":629 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":629 * * # if max-heap is used, results must be sorted * if use_max_heap: # <<<<<<<<<<<<<< @@ -3593,48 +3645,48 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_5query(PyObject * */ if (__pyx_v_use_max_heap) { - /* "scikits/learn/ball_tree.pyx":630 + /* "/home/fabian/dev/scikit-learn/sklearn/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_7scikits_5learn_9ball_tree_sort_dist_idx(__pyx_v_dist_ptr, __pyx_v_idx_ptr, __pyx_v_n_neighbors); + __pyx_f_7sklearn_9ball_tree_sort_dist_idx(__pyx_v_dist_ptr, __pyx_v_idx_ptr, __pyx_v_n_neighbors); goto __pyx_L10; } __pyx_L10:; - /* "scikits/learn/ball_tree.pyx":632 + /* "/home/fabian/dev/scikit-learn/sklearn/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_dist_ptr + __pyx_v_n_neighbors); + __pyx_v_dist_ptr += __pyx_v_n_neighbors; - /* "scikits/learn/ball_tree.pyx":633 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":633 * * dist_ptr += n_neighbors * idx_ptr += n_neighbors # <<<<<<<<<<<<<< * * stack_destroy(&node_stack) */ - __pyx_v_idx_ptr = (__pyx_v_idx_ptr + __pyx_v_n_neighbors); + __pyx_v_idx_ptr += __pyx_v_n_neighbors; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "scikits/learn/ball_tree.pyx":635 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":635 * idx_ptr += n_neighbors * * stack_destroy(&node_stack) # <<<<<<<<<<<<<< * * # deflatten results */ - __pyx_f_7scikits_5learn_9ball_tree_stack_destroy((&__pyx_v_node_stack)); + __pyx_f_7sklearn_9ball_tree_stack_destroy((&__pyx_v_node_stack)); - /* "scikits/learn/ball_tree.pyx":638 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":638 * * # deflatten results * if return_distance: # <<<<<<<<<<<<<< @@ -3644,7 +3696,7 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_5query(PyObject * __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) { - /* "scikits/learn/ball_tree.pyx":639 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":639 * # deflatten results * if return_distance: * return (distances.reshape((orig_shape[:-1]) + (k,)), # <<<<<<<<<<<<<< @@ -3654,28 +3706,28 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_5query(PyObject * __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 = __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_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_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(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__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, ((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_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_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __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 = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__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, ((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_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_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "scikits/learn/ball_tree.pyx":640 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":640 * if return_distance: * return (distances.reshape((orig_shape[:-1]) + (k,)), * idx_array.reshape((orig_shape[:-1]) + (k,))) # <<<<<<<<<<<<<< @@ -3684,42 +3736,42 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_5query(PyObject * */ __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 = __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_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_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(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(__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, ((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_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_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __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 = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(__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, ((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_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_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __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 = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(__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 = ((PyObject *)__pyx_t_3); + __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; goto __pyx_L11; } /*else*/ { - /* "scikits/learn/ball_tree.pyx":642 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":642 * idx_array.reshape((orig_shape[:-1]) + (k,))) * else: * return idx_array.reshape((orig_shape[:-1]) + (k,)) # <<<<<<<<<<<<<< @@ -3729,26 +3781,26 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_5query(PyObject * __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 = __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_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_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(((PyObject *)__pyx_t_2)); + __Pyx_GOTREF(__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, ((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_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_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __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 = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_GOTREF(__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, ((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_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_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; @@ -3763,7 +3815,7 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_5query(PyObject * __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("scikits.learn.ball_tree.BallTree.query"); + __Pyx_AddTraceback("sklearn.ball_tree.BallTree.query"); __pyx_r = NULL; __pyx_L0:; __Pyx_DECREF(__pyx_v_orig_shape); @@ -3776,7 +3828,7 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_5query(PyObject * return __pyx_r; } -/* "scikits/learn/ball_tree.pyx":644 +/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":644 * return idx_array.reshape((orig_shape[:-1]) + (k,)) * * def query_radius(self, X, r, return_distance=False, # <<<<<<<<<<<<<< @@ -3784,9 +3836,9 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_5query(PyObject * * """ */ -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) { +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) { PyObject *__pyx_v_X = 0; PyObject *__pyx_v_r = 0; PyObject *__pyx_v_return_distance = 0; @@ -3798,9 +3850,9 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_6query_radius(PyO PyArrayObject *__pyx_v_distances_i; PyArrayObject *__pyx_v_pt; PyArrayObject *__pyx_v_count; - __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_v_count_i; + __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_v_count_i; PyObject *__pyx_v_orig_shape; - struct __pyx_t_7scikits_5learn_9ball_tree_stack __pyx_v_node_stack; + struct __pyx_t_7sklearn_9ball_tree_stack __pyx_v_node_stack; PyObject *__pyx_v_pt_idx; PyObject *__pyx_r = NULL; int __pyx_t_1; @@ -3813,21 +3865,15 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_6query_radius(PyO PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; Py_ssize_t __pyx_t_10; - __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; + __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_t_11; 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_24; - values[3] = __pyx_k_25; - values[4] = __pyx_k_26; + values[2] = __pyx_k_10; + values[3] = __pyx_k_11; + values[4] = __pyx_k_12; 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); @@ -3873,9 +3919,9 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_6query_radius(PyO __pyx_v_count_only = values[3]; __pyx_v_sort_results = values[4]; } else { - __pyx_v_return_distance = __pyx_k_24; - __pyx_v_count_only = __pyx_k_25; - __pyx_v_sort_results = __pyx_k_26; + __pyx_v_return_distance = __pyx_k_10; + __pyx_v_count_only = __pyx_k_11; + __pyx_v_sort_results = __pyx_k_12; switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: __pyx_v_sort_results = PyTuple_GET_ITEM(__pyx_args, 4); @@ -3894,7 +3940,7 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_6query_radius(PyO __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("scikits.learn.ball_tree.BallTree.query_radius"); + __Pyx_AddTraceback("sklearn.ball_tree.BallTree.query_radius"); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; @@ -3909,7 +3955,7 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_6query_radius(PyO __pyx_v_orig_shape = Py_None; __Pyx_INCREF(Py_None); __pyx_v_pt_idx = Py_None; __Pyx_INCREF(Py_None); - /* "scikits/learn/ball_tree.pyx":710 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":710 * [3 0 1] * """ * if count_only and return_distance: # <<<<<<<<<<<<<< @@ -3925,23 +3971,29 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_6query_radius(PyO } if (__pyx_t_3) { - /* "scikits/learn/ball_tree.pyx":711 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":711 * """ * if count_only and return_distance: * raise ValueError("count_only and return_distance " # <<<<<<<<<<<<<< * "cannot both be true") * */ - __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_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_GOTREF(__pyx_t_4); - __Pyx_Raise(__pyx_t_4, 0, 0); + __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_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:; - /* "scikits/learn/ball_tree.pyx":714 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":714 * "cannot both be true") * * if sort_results and not return_distance: # <<<<<<<<<<<<<< @@ -3958,15 +4010,21 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_6query_radius(PyO } if (__pyx_t_1) { - /* "scikits/learn/ball_tree.pyx":715 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_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;} @@ -3974,7 +4032,7 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_6query_radius(PyO } __pyx_L7:; - /* "scikits/learn/ball_tree.pyx":723 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":723 * * # prepare X for query * X = np.asarray(X, dtype=DTYPE, order='C') # <<<<<<<<<<<<<< @@ -3987,7 +4045,7 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_6query_radius(PyO __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(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_X); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_X); __Pyx_GIVEREF(__pyx_v_X); @@ -3998,16 +4056,16 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_6query_radius(PyO 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, ((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_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_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__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; - /* "scikits/learn/ball_tree.pyx":724 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":724 * # prepare X for query * X = np.asarray(X, dtype=DTYPE, order='C') * X = np.atleast_2d(X) # <<<<<<<<<<<<<< @@ -4020,19 +4078,19 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_6query_radius(PyO __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(((PyObject *)__pyx_t_7)); + __Pyx_GOTREF(__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, ((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_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_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_v_X); __pyx_v_X = __pyx_t_4; __pyx_t_4 = 0; - /* "scikits/learn/ball_tree.pyx":725 + /* "/home/fabian/dev/scikit-learn/sklearn/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]: # <<<<<<<<<<<<<< @@ -4044,7 +4102,7 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_6query_radius(PyO __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_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_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_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); @@ -4054,38 +4112,44 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_6query_radius(PyO __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_1) { - /* "scikits/learn/ball_tree.pyx":726 + /* "/home/fabian/dev/scikit-learn/sklearn/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 = 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_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_GOTREF(__pyx_t_6); - __Pyx_Raise(__pyx_t_6, 0, 0); + __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_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:; - /* "scikits/learn/ball_tree.pyx":730 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_GOTREF(__pyx_t_6); - __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_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_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_6, 0, __pyx_v_r); + PyTuple_SET_ITEM(__pyx_t_4, 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)); @@ -4094,16 +4158,16 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_6query_radius(PyO 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_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_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_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; - /* "scikits/learn/ball_tree.pyx":731 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":731 * # prepare r for query * r = np.asarray(r, dtype=DTYPE, order='C') * r = np.atleast_1d(r) # <<<<<<<<<<<<<< @@ -4116,116 +4180,128 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_6query_radius(PyO __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(((PyObject *)__pyx_t_5)); + __Pyx_GOTREF(__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_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_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_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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; - /* "scikits/learn/ball_tree.pyx":732 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_GOTREF(__pyx_t_5); - __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_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_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) { - /* "scikits/learn/ball_tree.pyx":733 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_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_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_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_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_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_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_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_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_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_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_GOTREF(__pyx_t_9); - __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_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;} + __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_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(__pyx_t_9); __pyx_t_9 = 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; goto __pyx_L9; } /*else*/ { - /* "scikits/learn/ball_tree.pyx":735 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_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_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_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_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __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_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_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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) { - /* "scikits/learn/ball_tree.pyx":736 + /* "/home/fabian/dev/scikit-learn/sklearn/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 = 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_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_GOTREF(__pyx_t_9); - __Pyx_Raise(__pyx_t_9, 0, 0); + __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_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; } @@ -4233,80 +4309,86 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_6query_radius(PyO } __pyx_L9:; - /* "scikits/learn/ball_tree.pyx":739 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_DECREF(__pyx_v_orig_shape); - __pyx_v_orig_shape = __pyx_t_9; - __pyx_t_9 = 0; + __pyx_v_orig_shape = __pyx_t_7; + __pyx_t_7 = 0; - /* "scikits/learn/ball_tree.pyx":740 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_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_5, 0, __pyx_int_neg_1); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); - 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; + 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; __Pyx_DECREF(__pyx_v_X); - __pyx_v_X = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_v_X = __pyx_t_9; + __pyx_t_9 = 0; - /* "scikits/learn/ball_tree.pyx":741 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_DECREF(__pyx_v_r); - __pyx_v_r = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_v_r = __pyx_t_7; + __pyx_t_7 = 0; - /* "scikits/learn/ball_tree.pyx":744 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":744 * * cdef stack node_stack * stack_create(&node_stack, self.n_levels + 1) # <<<<<<<<<<<<<< * * if count_only: */ - __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)); + __pyx_f_7sklearn_9ball_tree_stack_create((&__pyx_v_node_stack), (((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)__pyx_v_self)->n_levels + 1)); - /* "scikits/learn/ball_tree.pyx":746 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":746 * stack_create(&node_stack, self.n_levels + 1) * * if count_only: # <<<<<<<<<<<<<< @@ -4316,43 +4398,43 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_6query_radius(PyO __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) { - /* "scikits/learn/ball_tree.pyx":747 + /* "/home/fabian/dev/scikit-learn/sklearn/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_(pt.data, */ - __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); - __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_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_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_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_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); __pyx_t_9 = 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_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_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __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;} + 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_v_count)); - __pyx_v_count = ((PyArrayObject *)__pyx_t_4); - __pyx_t_4 = 0; + __pyx_v_count = ((PyArrayObject *)__pyx_t_7); + __pyx_t_7 = 0; - /* "scikits/learn/ball_tree.pyx":748 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":748 * if count_only: * count = np.zeros(X.shape[0], ITYPE) * for pt_idx, pt in enumerate(X): # <<<<<<<<<<<<<< @@ -4360,88 +4442,79 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_6query_radius(PyO * r[pt_idx], */ __Pyx_INCREF(__pyx_int_0); - __pyx_t_4 = __pyx_int_0; + __pyx_t_7 = __pyx_int_0; if (PyList_CheckExact(__pyx_v_X) || PyTuple_CheckExact(__pyx_v_X)) { - __pyx_t_10 = 0; __pyx_t_6 = __pyx_v_X; __Pyx_INCREF(__pyx_t_6); + __pyx_t_10 = 0; __pyx_t_5 = __pyx_v_X; __Pyx_INCREF(__pyx_t_5); } else { - __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); + __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); } for (;;) { - 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++; + 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++; } else { - __pyx_t_5 = PyIter_Next(__pyx_t_6); - if (!__pyx_t_5) { + __pyx_t_6 = PyIter_Next(__pyx_t_5); + if (!__pyx_t_6) { if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} break; } - __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); } - 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;} + 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;} __Pyx_DECREF(((PyObject *)__pyx_v_pt)); - __pyx_v_pt = ((PyArrayObject *)__pyx_t_5); - __pyx_t_5 = 0; - __Pyx_INCREF(__pyx_t_4); + __pyx_v_pt = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + __Pyx_INCREF(__pyx_t_7); __Pyx_DECREF(__pyx_v_pt_idx); - __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_(pt.data, # <<<<<<<<<<<<<< - * r[pt_idx], - * &node_stack) - */ - __pyx_t_11 = ((__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *)__pyx_v_pt->data); + __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; - /* "scikits/learn/ball_tree.pyx":750 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":750 * for pt_idx, pt in enumerate(X): * count[pt_idx] = self.query_radius_count_(pt.data, * r[pt_idx], # <<<<<<<<<<<<<< * &node_stack) * elif not return_distance: */ - __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; + __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; - /* "scikits/learn/ball_tree.pyx":751 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":751 * count[pt_idx] = self.query_radius_count_(pt.data, * r[pt_idx], * &node_stack) # <<<<<<<<<<<<<< * elif not return_distance: * idx_array = np.empty(X.shape[0], dtype='object') */ - __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); + __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); - /* "scikits/learn/ball_tree.pyx":749 + /* "/home/fabian/dev/scikit-learn/sklearn/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_(pt.data, # <<<<<<<<<<<<<< * r[pt_idx], * &node_stack) */ - 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; + 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; } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L11; } - /* "scikits/learn/ball_tree.pyx":752 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":752 * r[pt_idx], * &node_stack) * elif not return_distance: # <<<<<<<<<<<<<< @@ -4452,42 +4525,42 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_6query_radius(PyO __pyx_t_3 = (!__pyx_t_1); if (__pyx_t_3) { - /* "scikits/learn/ball_tree.pyx":753 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_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_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_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_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_GOTREF(__pyx_t_9); - __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; + __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; 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; - /* "scikits/learn/ball_tree.pyx":754 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -4496,33 +4569,33 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_6query_radius(PyO */ __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_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_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_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __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_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_GOTREF(__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_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_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_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_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_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_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 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_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 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 = 754; __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 = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_idx_array_i)); - __pyx_v_idx_array_i = ((PyArrayObject *)__pyx_t_6); - __pyx_t_6 = 0; + __pyx_v_idx_array_i = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; - /* "scikits/learn/ball_tree.pyx":755 + /* "/home/fabian/dev/scikit-learn/sklearn/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): # <<<<<<<<<<<<<< @@ -4530,7 +4603,7 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_6query_radius(PyO * pt.data, */ __Pyx_INCREF(__pyx_int_0); - __pyx_t_6 = __pyx_int_0; + __pyx_t_5 = __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 { @@ -4540,165 +4613,147 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_6query_radius(PyO for (;;) { if (likely(PyList_CheckExact(__pyx_t_9))) { if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_9)) break; - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_4); __pyx_t_10++; + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; } else if (likely(PyTuple_CheckExact(__pyx_t_9))) { if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_9)) break; - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_4); __pyx_t_10++; + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; } else { - __pyx_t_4 = PyIter_Next(__pyx_t_9); - if (!__pyx_t_4) { + __pyx_t_7 = PyIter_Next(__pyx_t_9); + if (!__pyx_t_7) { if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} break; } - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_7); } - 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;} + 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;} __Pyx_DECREF(((PyObject *)__pyx_v_pt)); - __pyx_v_pt = ((PyArrayObject *)__pyx_t_4); - __pyx_t_4 = 0; - __Pyx_INCREF(__pyx_t_6); + __pyx_v_pt = ((PyArrayObject *)__pyx_t_7); + __pyx_t_7 = 0; + __Pyx_INCREF(__pyx_t_5); __Pyx_DECREF(__pyx_v_pt_idx); - __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_( - * pt.data, # <<<<<<<<<<<<<< - * r[pt_idx], - * 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 + __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 * count_i = self.query_radius_idx_only_( * pt.data, * r[pt_idx], # <<<<<<<<<<<<<< * idx_array_i.data, * &node_stack) */ - __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 - * pt.data, - * r[pt_idx], - * 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); + __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; - /* "scikits/learn/ball_tree.pyx":760 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":760 * r[pt_idx], * idx_array_i.data, * &node_stack) # <<<<<<<<<<<<<< * idx_array[pt_idx] = idx_array_i[:count_i].copy() * */ - __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)); + __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)); - /* "scikits/learn/ball_tree.pyx":761 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":761 * idx_array_i.data, * &node_stack) * idx_array[pt_idx] = idx_array_i[:count_i].copy() # <<<<<<<<<<<<<< * * else: */ - __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_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_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L11; } /*else*/ { - /* "scikits/learn/ball_tree.pyx":764 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_GOTREF(__pyx_t_9); - __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_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_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __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(__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_v_idx_array)); - __pyx_v_idx_array = ((PyArrayObject *)__pyx_t_5); - __pyx_t_5 = 0; + __pyx_v_idx_array = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; - /* "scikits/learn/ball_tree.pyx":765 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_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_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_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_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 = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + 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_GOTREF(((PyObject *)__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 = 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;} + 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;} __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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; - /* "scikits/learn/ball_tree.pyx":766 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -4707,68 +4762,68 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_6query_radius(PyO */ __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_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_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_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __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_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_GOTREF(__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_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_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_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_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_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_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;} + 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;} __Pyx_DECREF(((PyObject *)__pyx_v_idx_array_i)); - __pyx_v_idx_array_i = ((PyArrayObject *)__pyx_t_4); - __pyx_t_4 = 0; + __pyx_v_idx_array_i = ((PyArrayObject *)__pyx_t_7); + __pyx_t_7 = 0; - /* "scikits/learn/ball_tree.pyx":767 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_GOTREF(__pyx_t_9); - __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); - 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_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_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_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; - __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(__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_DECREF(((PyObject *)__pyx_v_distances_i)); - __pyx_v_distances_i = ((PyArrayObject *)__pyx_t_6); - __pyx_t_6 = 0; + __pyx_v_distances_i = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; - /* "scikits/learn/ball_tree.pyx":768 + /* "/home/fabian/dev/scikit-learn/sklearn/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): # <<<<<<<<<<<<<< @@ -4776,90 +4831,63 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_6query_radius(PyO * pt.data, */ __Pyx_INCREF(__pyx_int_0); - __pyx_t_6 = __pyx_int_0; + __pyx_t_5 = __pyx_int_0; if (PyList_CheckExact(__pyx_v_X) || PyTuple_CheckExact(__pyx_v_X)) { - __pyx_t_10 = 0; __pyx_t_4 = __pyx_v_X; __Pyx_INCREF(__pyx_t_4); + __pyx_t_10 = 0; __pyx_t_7 = __pyx_v_X; __Pyx_INCREF(__pyx_t_7); } else { - __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); + __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); } for (;;) { - 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++; + 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++; } else { - __pyx_t_5 = PyIter_Next(__pyx_t_4); - if (!__pyx_t_5) { + __pyx_t_6 = PyIter_Next(__pyx_t_7); + if (!__pyx_t_6) { if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} break; } - __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); } - 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;} + 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;} __Pyx_DECREF(((PyObject *)__pyx_v_pt)); - __pyx_v_pt = ((PyArrayObject *)__pyx_t_5); - __pyx_t_5 = 0; - __Pyx_INCREF(__pyx_t_6); + __pyx_v_pt = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; + __Pyx_INCREF(__pyx_t_5); __Pyx_DECREF(__pyx_v_pt_idx); - __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; - - /* "scikits/learn/ball_tree.pyx":770 - * for pt_idx, pt in enumerate(X): - * count_i = self.query_radius_distances_( - * pt.data, # <<<<<<<<<<<<<< - * r[pt_idx], - * idx_array_i.data, - */ - __pyx_t_15 = ((__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *)__pyx_v_pt->data); + __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; - /* "scikits/learn/ball_tree.pyx":771 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":771 * count_i = self.query_radius_distances_( * pt.data, * r[pt_idx], # <<<<<<<<<<<<<< * idx_array_i.data, * distances_i.data, */ - __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; + __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; - /* "scikits/learn/ball_tree.pyx":772 - * pt.data, - * r[pt_idx], - * idx_array_i.data, # <<<<<<<<<<<<<< - * distances_i.data, - * &node_stack) - */ - __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], - * idx_array_i.data, - * 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 - * idx_array_i.data, + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":774 + * idx_array_i.data, * distances_i.data, * &node_stack) # <<<<<<<<<<<<<< * if sort_results: * sort_dist_idx(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)); + __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)); - /* "scikits/learn/ball_tree.pyx":775 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":775 * distances_i.data, * &node_stack) * if sort_results: # <<<<<<<<<<<<<< @@ -4869,69 +4897,69 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_6query_radius(PyO __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) { - /* "scikits/learn/ball_tree.pyx":778 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":778 * sort_dist_idx(distances_i.data, * idx_array_i.data, * count_i) # <<<<<<<<<<<<<< * * idx_array[pt_idx] = idx_array_i[:count_i].copy() */ - __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); + __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); goto __pyx_L18; } __pyx_L18:; - /* "scikits/learn/ball_tree.pyx":780 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_GOTREF(__pyx_t_9); - __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_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_9); __pyx_t_9 = 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; + 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; - /* "scikits/learn/ball_tree.pyx":781 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_GOTREF(__pyx_t_9); - __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_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_9); __pyx_t_9 = 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; + 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; } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_L11:; - /* "scikits/learn/ball_tree.pyx":783 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":783 * distances[pt_idx] = distances_i[:count_i].copy() * * stack_destroy(&node_stack) # <<<<<<<<<<<<<< * * # deflatten results */ - __pyx_f_7scikits_5learn_9ball_tree_stack_destroy((&__pyx_v_node_stack)); + __pyx_f_7sklearn_9ball_tree_stack_destroy((&__pyx_v_node_stack)); - /* "scikits/learn/ball_tree.pyx":786 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":786 * * # deflatten results * if count_only: # <<<<<<<<<<<<<< @@ -4941,7 +4969,7 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_6query_radius(PyO __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) { - /* "scikits/learn/ball_tree.pyx":787 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":787 * # deflatten results * if count_only: * return count.reshape(orig_shape[:-1]) # <<<<<<<<<<<<<< @@ -4949,26 +4977,26 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_6query_radius(PyO * return (idx_array.reshape(orig_shape[:-1]), */ __Pyx_XDECREF(__pyx_r); - __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_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_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 = 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); + 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_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; goto __pyx_L0; goto __pyx_L19; } - /* "scikits/learn/ball_tree.pyx":788 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":788 * if count_only: * return count.reshape(orig_shape[:-1]) * elif return_distance: # <<<<<<<<<<<<<< @@ -4978,7 +5006,7 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_6query_radius(PyO __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) { - /* "scikits/learn/ball_tree.pyx":789 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":789 * return count.reshape(orig_shape[:-1]) * elif return_distance: * return (idx_array.reshape(orig_shape[:-1]), # <<<<<<<<<<<<<< @@ -4986,56 +5014,56 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_6query_radius(PyO * else: */ __Pyx_XDECREF(__pyx_r); - __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); - __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_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_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; + 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; - /* "scikits/learn/ball_tree.pyx":790 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_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(((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_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_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(((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_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_t_9 = 0; goto __pyx_L0; goto __pyx_L19; } /*else*/ { - /* "scikits/learn/ball_tree.pyx":792 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":792 * distances.reshape(orig_shape[:-1])) * else: * return idx_array.reshape(orig_shape[:-1]) # <<<<<<<<<<<<<< @@ -5045,19 +5073,19 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_6query_radius(PyO __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_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_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_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; goto __pyx_L0; } __pyx_L19:; @@ -5071,7 +5099,7 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_6query_radius(PyO __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); - __Pyx_AddTraceback("scikits.learn.ball_tree.BallTree.query_radius"); + __Pyx_AddTraceback("sklearn.ball_tree.BallTree.query_radius"); __pyx_r = NULL; __pyx_L0:; __Pyx_DECREF((PyObject *)__pyx_v_idx_array); @@ -5089,7 +5117,7 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_6query_radius(PyO return __pyx_r; } -/* "scikits/learn/ball_tree.pyx":795 +/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":795 * * @cython.cdivision(True) * cdef void build_tree_(BallTree self): # <<<<<<<<<<<<<< @@ -5097,68 +5125,69 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_6query_radius(PyO * cdef ITYPE_t* idx_array = self.idx_array.data */ -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; +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; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; - __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_t_4; + PyObject *__pyx_t_4 = NULL; + __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_t_5; __Pyx_RefNannySetupContext("build_tree_"); - /* "scikits/learn/ball_tree.pyx":796 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":796 * @cython.cdivision(True) * cdef void build_tree_(BallTree self): * cdef DTYPE_t* data = self.data.data # <<<<<<<<<<<<<< * cdef ITYPE_t* idx_array = self.idx_array.data * cdef DTYPE_t* node_centroid_arr = self.node_centroid_arr.data */ - __pyx_v_data = ((__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *)__pyx_v_self->data->data); + __pyx_v_data = ((__pyx_t_7sklearn_9ball_tree_DTYPE_t *)__pyx_v_self->data->data); - /* "scikits/learn/ball_tree.pyx":797 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":797 * cdef void build_tree_(BallTree self): * cdef DTYPE_t* data = self.data.data * cdef ITYPE_t* idx_array = self.idx_array.data # <<<<<<<<<<<<<< * cdef DTYPE_t* node_centroid_arr = self.node_centroid_arr.data * cdef NodeInfo* node_info_arr = self.node_info_arr.data */ - __pyx_v_idx_array = ((__pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *)__pyx_v_self->idx_array->data); + __pyx_v_idx_array = ((__pyx_t_7sklearn_9ball_tree_ITYPE_t *)__pyx_v_self->idx_array->data); - /* "scikits/learn/ball_tree.pyx":798 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":798 * cdef DTYPE_t* data = self.data.data * cdef ITYPE_t* idx_array = self.idx_array.data * cdef DTYPE_t* node_centroid_arr = self.node_centroid_arr.data # <<<<<<<<<<<<<< * cdef NodeInfo* node_info_arr = self.node_info_arr.data * */ - __pyx_v_node_centroid_arr = ((__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *)__pyx_v_self->node_centroid_arr->data); + __pyx_v_node_centroid_arr = ((__pyx_t_7sklearn_9ball_tree_DTYPE_t *)__pyx_v_self->node_centroid_arr->data); - /* "scikits/learn/ball_tree.pyx":799 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":799 * cdef ITYPE_t* idx_array = self.idx_array.data * cdef DTYPE_t* node_centroid_arr = self.node_centroid_arr.data * cdef NodeInfo* node_info_arr = self.node_info_arr.data # <<<<<<<<<<<<<< * * cdef DTYPE_t p = self.p */ - __pyx_v_node_info_arr = ((struct __pyx_t_7scikits_5learn_9ball_tree_NodeInfo *)__pyx_v_self->node_info_arr->data); + __pyx_v_node_info_arr = ((struct __pyx_t_7sklearn_9ball_tree_NodeInfo *)__pyx_v_self->node_info_arr->data); - /* "scikits/learn/ball_tree.pyx":801 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":801 * cdef NodeInfo* node_info_arr = self.node_info_arr.data * * cdef DTYPE_t p = self.p # <<<<<<<<<<<<<< @@ -5167,7 +5196,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_build_tree_(struct __p */ __pyx_v_p = __pyx_v_self->p; - /* "scikits/learn/ball_tree.pyx":802 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":802 * * cdef DTYPE_t p = self.p * cdef ITYPE_t n_samples = self.data.shape[0] # <<<<<<<<<<<<<< @@ -5176,7 +5205,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_build_tree_(struct __p */ __pyx_v_n_samples = (__pyx_v_self->data->dimensions[0]); - /* "scikits/learn/ball_tree.pyx":803 + /* "/home/fabian/dev/scikit-learn/sklearn/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] # <<<<<<<<<<<<<< @@ -5185,7 +5214,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_build_tree_(struct __p */ __pyx_v_n_features = (__pyx_v_self->data->dimensions[1]); - /* "scikits/learn/ball_tree.pyx":809 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":809 * cdef ITYPE_t i, i_node, i_parent * * cdef DTYPE_t* centroid = node_centroid_arr # <<<<<<<<<<<<<< @@ -5194,7 +5223,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_build_tree_(struct __p */ __pyx_v_centroid = __pyx_v_node_centroid_arr; - /* "scikits/learn/ball_tree.pyx":810 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":810 * * cdef DTYPE_t* centroid = node_centroid_arr * cdef NodeInfo* node_info = node_info_arr # <<<<<<<<<<<<<< @@ -5203,7 +5232,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_build_tree_(struct __p */ __pyx_v_node_info = __pyx_v_node_info_arr; - /* "scikits/learn/ball_tree.pyx":816 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":816 * #------------------------------------------------------------ * # take care of the root node * node_info.idx_start = 0 # <<<<<<<<<<<<<< @@ -5212,7 +5241,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_build_tree_(struct __p */ __pyx_v_node_info->idx_start = 0; - /* "scikits/learn/ball_tree.pyx":817 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":817 * # take care of the root node * node_info.idx_start = 0 * node_info.idx_end = n_samples # <<<<<<<<<<<<<< @@ -5221,7 +5250,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_build_tree_(struct __p */ __pyx_v_node_info->idx_end = __pyx_v_n_samples; - /* "scikits/learn/ball_tree.pyx":818 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":818 * node_info.idx_start = 0 * node_info.idx_end = n_samples * n_points = n_samples # <<<<<<<<<<<<<< @@ -5230,16 +5259,16 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_build_tree_(struct __p */ __pyx_v_n_points = __pyx_v_n_samples; - /* "scikits/learn/ball_tree.pyx":822 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":822 * # determine Node centroid * compute_centroid(centroid, data, idx_array, * n_features, n_samples) # <<<<<<<<<<<<<< * * # determine Node radius */ - __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); + __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); - /* "scikits/learn/ball_tree.pyx":825 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":825 * * # determine Node radius * radius = 0 # <<<<<<<<<<<<<< @@ -5248,7 +5277,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_build_tree_(struct __p */ __pyx_v_radius = 0.0; - /* "scikits/learn/ball_tree.pyx":826 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":826 * # determine Node radius * radius = 0 * for i from node_info.idx_start <= i < node_info.idx_end: # <<<<<<<<<<<<<< @@ -5258,26 +5287,26 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_build_tree_(struct __p __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++) { - /* "scikits/learn/ball_tree.pyx":829 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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)); + __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)); } - /* "scikits/learn/ball_tree.pyx":830 + /* "/home/fabian/dev/scikit-learn/sklearn/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_7scikits_5learn_9ball_tree_dist_from_dist_p(__pyx_v_radius, __pyx_v_p); + __pyx_v_node_info->radius = __pyx_f_7sklearn_9ball_tree_dist_from_dist_p(__pyx_v_radius, __pyx_v_p); - /* "scikits/learn/ball_tree.pyx":833 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":833 * * # check if this is a leaf * if self.n_nodes == 1: # <<<<<<<<<<<<<< @@ -5287,7 +5316,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_build_tree_(struct __p __pyx_t_2 = (__pyx_v_self->n_nodes == 1); if (__pyx_t_2) { - /* "scikits/learn/ball_tree.pyx":834 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":834 * # check if this is a leaf * if self.n_nodes == 1: * node_info.is_leaf = 1 # <<<<<<<<<<<<<< @@ -5299,7 +5328,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_build_tree_(struct __p } /*else*/ { - /* "scikits/learn/ball_tree.pyx":837 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":837 * * else: * node_info.is_leaf = 0 # <<<<<<<<<<<<<< @@ -5308,27 +5337,27 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_build_tree_(struct __p */ __pyx_v_node_info->is_leaf = 0; - /* "scikits/learn/ball_tree.pyx":841 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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); + __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); - /* "scikits/learn/ball_tree.pyx":849 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":849 * n_points / 2, * n_features, * 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_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_L5:; - /* "scikits/learn/ball_tree.pyx":853 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":853 * #------------------------------------------------------------ * # cycle through all child nodes * for i_node from 1 <= i_node < self.n_nodes: # <<<<<<<<<<<<<< @@ -5338,7 +5367,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_build_tree_(struct __p __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++) { - /* "scikits/learn/ball_tree.pyx":854 + /* "/home/fabian/dev/scikit-learn/sklearn/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 # <<<<<<<<<<<<<< @@ -5347,7 +5376,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_build_tree_(struct __p */ __pyx_v_i_parent = ((__pyx_v_i_node - 1) / 2); - /* "scikits/learn/ball_tree.pyx":855 + /* "/home/fabian/dev/scikit-learn/sklearn/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 # <<<<<<<<<<<<<< @@ -5356,7 +5385,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_build_tree_(struct __p */ __pyx_v_parent_info = (__pyx_v_node_info_arr + __pyx_v_i_parent); - /* "scikits/learn/ball_tree.pyx":857 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":857 * parent_info = node_info_arr + i_parent * * node_info = node_info_arr + i_node # <<<<<<<<<<<<<< @@ -5365,7 +5394,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_build_tree_(struct __p */ __pyx_v_node_info = (__pyx_v_node_info_arr + __pyx_v_i_node); - /* "scikits/learn/ball_tree.pyx":859 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":859 * node_info = node_info_arr + i_node * * if parent_info.is_leaf: # <<<<<<<<<<<<<< @@ -5374,23 +5403,29 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_build_tree_(struct __p */ if (__pyx_v_parent_info->is_leaf) { - /* "scikits/learn/ball_tree.pyx":860 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":860 * * if parent_info.is_leaf: * raise ValueError("Fatal: parent is a leaf. Memory " # <<<<<<<<<<<<<< * "allocation is flawed") * */ - __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_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_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0); + __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_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:; - /* "scikits/learn/ball_tree.pyx":863 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":863 * "allocation is flawed") * * if i_node < self.n_nodes / 2: # <<<<<<<<<<<<<< @@ -5400,7 +5435,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_build_tree_(struct __p __pyx_t_2 = (__pyx_v_i_node < (__pyx_v_self->n_nodes / 2)); if (__pyx_t_2) { - /* "scikits/learn/ball_tree.pyx":864 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":864 * * if i_node < self.n_nodes / 2: * node_info.is_leaf = 0 # <<<<<<<<<<<<<< @@ -5412,7 +5447,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_build_tree_(struct __p } /*else*/ { - /* "scikits/learn/ball_tree.pyx":866 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":866 * node_info.is_leaf = 0 * else: * node_info.is_leaf = 1 # <<<<<<<<<<<<<< @@ -5423,7 +5458,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_build_tree_(struct __p } __pyx_L9:; - /* "scikits/learn/ball_tree.pyx":868 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":868 * node_info.is_leaf = 1 * * centroid = node_centroid_arr + i_node * n_features # <<<<<<<<<<<<<< @@ -5432,7 +5467,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_build_tree_(struct __p */ __pyx_v_centroid = (__pyx_v_node_centroid_arr + (__pyx_v_i_node * __pyx_v_n_features)); - /* "scikits/learn/ball_tree.pyx":871 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":871 * * # find indices for this node * idx_start = parent_info.idx_start # <<<<<<<<<<<<<< @@ -5441,7 +5476,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_build_tree_(struct __p */ __pyx_v_idx_start = __pyx_v_parent_info->idx_start; - /* "scikits/learn/ball_tree.pyx":872 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":872 * # find indices for this node * idx_start = parent_info.idx_start * idx_end = parent_info.idx_end # <<<<<<<<<<<<<< @@ -5450,7 +5485,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_build_tree_(struct __p */ __pyx_v_idx_end = __pyx_v_parent_info->idx_end; - /* "scikits/learn/ball_tree.pyx":874 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":874 * idx_end = parent_info.idx_end * * if i_node % 2 == 1: # <<<<<<<<<<<<<< @@ -5460,7 +5495,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_build_tree_(struct __p __pyx_t_2 = ((__pyx_v_i_node % 2) == 1); if (__pyx_t_2) { - /* "scikits/learn/ball_tree.pyx":875 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":875 * * if i_node % 2 == 1: * idx_start = (idx_start + idx_end) / 2 # <<<<<<<<<<<<<< @@ -5472,7 +5507,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_build_tree_(struct __p } /*else*/ { - /* "scikits/learn/ball_tree.pyx":877 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":877 * idx_start = (idx_start + idx_end) / 2 * else: * idx_end = (idx_start + idx_end) / 2 # <<<<<<<<<<<<<< @@ -5483,7 +5518,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_build_tree_(struct __p } __pyx_L10:; - /* "scikits/learn/ball_tree.pyx":879 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":879 * idx_end = (idx_start + idx_end) / 2 * * node_info.idx_start = idx_start # <<<<<<<<<<<<<< @@ -5492,7 +5527,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_build_tree_(struct __p */ __pyx_v_node_info->idx_start = __pyx_v_idx_start; - /* "scikits/learn/ball_tree.pyx":880 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":880 * * node_info.idx_start = idx_start * node_info.idx_end = idx_end # <<<<<<<<<<<<<< @@ -5501,7 +5536,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_build_tree_(struct __p */ __pyx_v_node_info->idx_end = __pyx_v_idx_end; - /* "scikits/learn/ball_tree.pyx":882 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":882 * node_info.idx_end = idx_end * * n_points = idx_end - idx_start # <<<<<<<<<<<<<< @@ -5510,39 +5545,37 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_build_tree_(struct __p */ __pyx_v_n_points = (__pyx_v_idx_end - __pyx_v_idx_start); - /* "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 + /* "/home/fabian/dev/scikit-learn/sklearn/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: - /* "scikits/learn/ball_tree.pyx":885 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":885 * * if n_points == 0: * raise ValueError("zero-sized node") # <<<<<<<<<<<<<< * * elif n_points == 1: */ - __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_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_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; - /* "scikits/learn/ball_tree.pyx":887 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":887 * raise ValueError("zero-sized node") * * elif n_points == 1: # <<<<<<<<<<<<<< @@ -5551,16 +5584,16 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_build_tree_(struct __p */ case 1: - /* "scikits/learn/ball_tree.pyx":891 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":891 * copy_array(centroid, * data + idx_array[idx_start] * n_features, * n_features) # <<<<<<<<<<<<<< * * #store radius in array */ - __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); + __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); - /* "scikits/learn/ball_tree.pyx":894 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":894 * * #store radius in array * node_info.radius = 0 # <<<<<<<<<<<<<< @@ -5569,7 +5602,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_build_tree_(struct __p */ __pyx_v_node_info->radius = 0.0; - /* "scikits/learn/ball_tree.pyx":897 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":897 * * #is a leaf * node_info.is_leaf = 1 # <<<<<<<<<<<<<< @@ -5580,16 +5613,16 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_build_tree_(struct __p break; default: - /* "scikits/learn/ball_tree.pyx":902 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":902 * # determine Node centroid * compute_centroid(centroid, data, idx_array + idx_start, * n_features, n_points) # <<<<<<<<<<<<<< * * # determine Node radius */ - __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); + __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); - /* "scikits/learn/ball_tree.pyx":905 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":905 * * # determine Node radius * radius = 0 # <<<<<<<<<<<<<< @@ -5598,36 +5631,36 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_build_tree_(struct __p */ __pyx_v_radius = 0.0; - /* "scikits/learn/ball_tree.pyx":906 + /* "/home/fabian/dev/scikit-learn/sklearn/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_4 = __pyx_v_idx_end; - for (__pyx_v_i = __pyx_v_idx_start; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { + __pyx_t_5 = __pyx_v_idx_end; + for (__pyx_v_i = __pyx_v_idx_start; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { - /* "scikits/learn/ball_tree.pyx":910 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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)); + __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)); } - /* "scikits/learn/ball_tree.pyx":911 + /* "/home/fabian/dev/scikit-learn/sklearn/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_7scikits_5learn_9ball_tree_dist_from_dist_p(__pyx_v_radius, __pyx_v_p); + __pyx_v_node_info->radius = __pyx_f_7sklearn_9ball_tree_dist_from_dist_p(__pyx_v_radius, __pyx_v_p); - /* "scikits/learn/ball_tree.pyx":913 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":913 * node_info.radius = dist_from_dist_p(radius, p) * * if not node_info.is_leaf: # <<<<<<<<<<<<<< @@ -5637,23 +5670,23 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_build_tree_(struct __p __pyx_t_2 = (!__pyx_v_node_info->is_leaf); if (__pyx_t_2) { - /* "scikits/learn/ball_tree.pyx":916 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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); + __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); - /* "scikits/learn/ball_tree.pyx":924 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":924 * n_points / 2, * n_features, * n_points) # <<<<<<<<<<<<<< * * cdef void query_one_(BallTree self, */ - __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); + __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); goto __pyx_L13; } __pyx_L13:; @@ -5664,12 +5697,13 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_build_tree_(struct __p goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("scikits.learn.ball_tree.BallTree.build_tree_"); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("sklearn.ball_tree.BallTree.build_tree_"); __pyx_L0:; __Pyx_RefNannyFinishContext(); } -/* "scikits/learn/ball_tree.pyx":926 +/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":926 * n_points) * * cdef void query_one_(BallTree self, # <<<<<<<<<<<<<< @@ -5677,66 +5711,66 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_build_tree_(struct __p * ITYPE_t k, */ -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); +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); int __pyx_t_1; - __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_t_2; + __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_t_2; __Pyx_RefNannySetupContext("query_one_"); - /* "scikits/learn/ball_tree.pyx":933 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":933 * stack* node_stack, * ITYPE_t use_max_heap): * cdef DTYPE_t* data = self.data.data # <<<<<<<<<<<<<< * cdef ITYPE_t* idx_array = self.idx_array.data * cdef DTYPE_t* node_centroid_arr = self.node_centroid_arr.data */ - __pyx_v_data = ((__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *)__pyx_v_self->data->data); + __pyx_v_data = ((__pyx_t_7sklearn_9ball_tree_DTYPE_t *)__pyx_v_self->data->data); - /* "scikits/learn/ball_tree.pyx":934 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":934 * ITYPE_t use_max_heap): * cdef DTYPE_t* data = self.data.data * cdef ITYPE_t* idx_array = self.idx_array.data # <<<<<<<<<<<<<< * cdef DTYPE_t* node_centroid_arr = self.node_centroid_arr.data * cdef NodeInfo* node_info_arr = self.node_info_arr.data */ - __pyx_v_idx_array = ((__pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *)__pyx_v_self->idx_array->data); + __pyx_v_idx_array = ((__pyx_t_7sklearn_9ball_tree_ITYPE_t *)__pyx_v_self->idx_array->data); - /* "scikits/learn/ball_tree.pyx":935 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":935 * cdef DTYPE_t* data = self.data.data * cdef ITYPE_t* idx_array = self.idx_array.data * cdef DTYPE_t* node_centroid_arr = self.node_centroid_arr.data # <<<<<<<<<<<<<< * cdef NodeInfo* node_info_arr = self.node_info_arr.data * cdef NodeInfo* node_info = node_info_arr */ - __pyx_v_node_centroid_arr = ((__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *)__pyx_v_self->node_centroid_arr->data); + __pyx_v_node_centroid_arr = ((__pyx_t_7sklearn_9ball_tree_DTYPE_t *)__pyx_v_self->node_centroid_arr->data); - /* "scikits/learn/ball_tree.pyx":936 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":936 * cdef ITYPE_t* idx_array = self.idx_array.data * cdef DTYPE_t* node_centroid_arr = self.node_centroid_arr.data * cdef NodeInfo* node_info_arr = self.node_info_arr.data # <<<<<<<<<<<<<< * cdef NodeInfo* node_info = node_info_arr * */ - __pyx_v_node_info_arr = ((struct __pyx_t_7scikits_5learn_9ball_tree_NodeInfo *)__pyx_v_self->node_info_arr->data); + __pyx_v_node_info_arr = ((struct __pyx_t_7sklearn_9ball_tree_NodeInfo *)__pyx_v_self->node_info_arr->data); - /* "scikits/learn/ball_tree.pyx":937 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":937 * cdef DTYPE_t* node_centroid_arr = self.node_centroid_arr.data * cdef NodeInfo* node_info_arr = self.node_info_arr.data * cdef NodeInfo* node_info = node_info_arr # <<<<<<<<<<<<<< @@ -5745,7 +5779,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_query_one_(struct __py */ __pyx_v_node_info = __pyx_v_node_info_arr; - /* "scikits/learn/ball_tree.pyx":939 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":939 * cdef NodeInfo* node_info = node_info_arr * * cdef DTYPE_t p = self.p # <<<<<<<<<<<<<< @@ -5754,7 +5788,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_query_one_(struct __py */ __pyx_v_p = __pyx_v_self->p; - /* "scikits/learn/ball_tree.pyx":940 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":940 * * cdef DTYPE_t p = self.p * cdef ITYPE_t n_features = self.data.shape[1] # <<<<<<<<<<<<<< @@ -5763,7 +5797,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_query_one_(struct __py */ __pyx_v_n_features = (__pyx_v_self->data->dimensions[1]); - /* "scikits/learn/ball_tree.pyx":947 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":947 * cdef stack_item item * * item.i_node = 0 # <<<<<<<<<<<<<< @@ -5772,25 +5806,25 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_query_one_(struct __py */ __pyx_v_item.i_node = 0; - /* "scikits/learn/ball_tree.pyx":948 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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); + __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); - /* "scikits/learn/ball_tree.pyx":951 + /* "/home/fabian/dev/scikit-learn/sklearn/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_7scikits_5learn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); + __pyx_f_7sklearn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); - /* "scikits/learn/ball_tree.pyx":959 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":959 * ITYPE_t*, ITYPE_t) * * if use_max_heap: # <<<<<<<<<<<<<< @@ -5799,48 +5833,48 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_query_one_(struct __py */ if (__pyx_v_use_max_heap) { - /* "scikits/learn/ball_tree.pyx":960 + /* "/home/fabian/dev/scikit-learn/sklearn/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_7scikits_5learn_9ball_tree_max_heap_largest); + __pyx_v_heapqueue_largest = (&__pyx_f_7sklearn_9ball_tree_max_heap_largest); - /* "scikits/learn/ball_tree.pyx":961 + /* "/home/fabian/dev/scikit-learn/sklearn/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_7scikits_5learn_9ball_tree_max_heap_insert); + __pyx_v_heapqueue_insert = (&__pyx_f_7sklearn_9ball_tree_max_heap_insert); goto __pyx_L3; } /*else*/ { - /* "scikits/learn/ball_tree.pyx":963 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":963 * heapqueue_insert = &max_heap_insert * else: * heapqueue_largest = &pqueue_largest # <<<<<<<<<<<<<< * heapqueue_insert = &pqueue_insert * */ - __pyx_v_heapqueue_largest = (&__pyx_f_7scikits_5learn_9ball_tree_pqueue_largest); + __pyx_v_heapqueue_largest = (&__pyx_f_7sklearn_9ball_tree_pqueue_largest); - /* "scikits/learn/ball_tree.pyx":964 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":964 * else: * heapqueue_largest = &pqueue_largest * heapqueue_insert = &pqueue_insert # <<<<<<<<<<<<<< * * while(node_stack.n > 0): */ - __pyx_v_heapqueue_insert = (&__pyx_f_7scikits_5learn_9ball_tree_pqueue_insert); + __pyx_v_heapqueue_insert = (&__pyx_f_7sklearn_9ball_tree_pqueue_insert); } __pyx_L3:; - /* "scikits/learn/ball_tree.pyx":966 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":966 * heapqueue_insert = &pqueue_insert * * while(node_stack.n > 0): # <<<<<<<<<<<<<< @@ -5851,16 +5885,16 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_query_one_(struct __py __pyx_t_1 = (__pyx_v_node_stack->n > 0); if (!__pyx_t_1) break; - /* "scikits/learn/ball_tree.pyx":967 + /* "/home/fabian/dev/scikit-learn/sklearn/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_7scikits_5learn_9ball_tree_stack_pop(__pyx_v_node_stack); + __pyx_v_item = __pyx_f_7sklearn_9ball_tree_stack_pop(__pyx_v_node_stack); - /* "scikits/learn/ball_tree.pyx":968 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":968 * while(node_stack.n > 0): * item = stack_pop(node_stack) * i_node = item.i_node # <<<<<<<<<<<<<< @@ -5869,7 +5903,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_query_one_(struct __py */ __pyx_v_i_node = __pyx_v_item.i_node; - /* "scikits/learn/ball_tree.pyx":969 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":969 * item = stack_pop(node_stack) * i_node = item.i_node * dist_p_LB = item.dist_p_LB # <<<<<<<<<<<<<< @@ -5878,7 +5912,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_query_one_(struct __py */ __pyx_v_dist_p_LB = __pyx_v_item.dist_p_LB; - /* "scikits/learn/ball_tree.pyx":971 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":971 * dist_p_LB = item.dist_p_LB * * node_info = node_info_arr + i_node # <<<<<<<<<<<<<< @@ -5887,7 +5921,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_query_one_(struct __py */ __pyx_v_node_info = (__pyx_v_node_info_arr + __pyx_v_i_node); - /* "scikits/learn/ball_tree.pyx":975 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":975 * #------------------------------------------------------------ * # Case 1: query point is outside node radius * if dist_p_LB >= heapqueue_largest(near_set_dist, k): # <<<<<<<<<<<<<< @@ -5897,7 +5931,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_query_one_(struct __py __pyx_t_1 = (__pyx_v_dist_p_LB >= __pyx_v_heapqueue_largest(__pyx_v_near_set_dist, __pyx_v_k)); if (__pyx_t_1) { - /* "scikits/learn/ball_tree.pyx":976 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":976 * # Case 1: query point is outside node radius * if dist_p_LB >= heapqueue_largest(near_set_dist, k): * continue # <<<<<<<<<<<<<< @@ -5908,7 +5942,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_query_one_(struct __py goto __pyx_L6; } - /* "scikits/learn/ball_tree.pyx":980 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":980 * #------------------------------------------------------------ * # Case 2: this is a leaf node. Update set of nearby points * elif node_info.is_leaf: # <<<<<<<<<<<<<< @@ -5917,7 +5951,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_query_one_(struct __py */ if (__pyx_v_node_info->is_leaf) { - /* "scikits/learn/ball_tree.pyx":981 + /* "/home/fabian/dev/scikit-learn/sklearn/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: # <<<<<<<<<<<<<< @@ -5927,16 +5961,16 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_query_one_(struct __py __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++) { - /* "scikits/learn/ball_tree.pyx":984 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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); + __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); - /* "scikits/learn/ball_tree.pyx":986 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":986 * n_features, p) * * if dist_pt < heapqueue_largest(near_set_dist, k): # <<<<<<<<<<<<<< @@ -5946,7 +5980,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_query_one_(struct __py __pyx_t_1 = (__pyx_v_dist_pt < __pyx_v_heapqueue_largest(__pyx_v_near_set_dist, __pyx_v_k)); if (__pyx_t_1) { - /* "scikits/learn/ball_tree.pyx":988 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -5962,7 +5996,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_query_one_(struct __py } /*else*/ { - /* "scikits/learn/ball_tree.pyx":994 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":994 * # starting with the one whose centroid is closest * else: * i1 = 2 * i_node + 1 # <<<<<<<<<<<<<< @@ -5971,7 +6005,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_query_one_(struct __py */ __pyx_v_i1 = ((2 * __pyx_v_i_node) + 1); - /* "scikits/learn/ball_tree.pyx":995 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":995 * else: * i1 = 2 * i_node + 1 * i2 = i1 + 1 # <<<<<<<<<<<<<< @@ -5980,25 +6014,25 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_query_one_(struct __py */ __pyx_v_i2 = (__pyx_v_i1 + 1); - /* "scikits/learn/ball_tree.pyx":999 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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); + __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); - /* "scikits/learn/ball_tree.pyx":1003 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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); + __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); - /* "scikits/learn/ball_tree.pyx":1006 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1006 * * # append children to stack: last-in-first-out * if dist_p_LB_2 <= dist_p_LB_1: # <<<<<<<<<<<<<< @@ -6008,7 +6042,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_query_one_(struct __py __pyx_t_1 = (__pyx_v_dist_p_LB_2 <= __pyx_v_dist_p_LB_1); if (__pyx_t_1) { - /* "scikits/learn/ball_tree.pyx":1007 + /* "/home/fabian/dev/scikit-learn/sklearn/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 # <<<<<<<<<<<<<< @@ -6017,7 +6051,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_query_one_(struct __py */ __pyx_v_item.i_node = __pyx_v_i1; - /* "scikits/learn/ball_tree.pyx":1008 + /* "/home/fabian/dev/scikit-learn/sklearn/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 # <<<<<<<<<<<<<< @@ -6026,16 +6060,16 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_query_one_(struct __py */ __pyx_v_item.dist_p_LB = __pyx_v_dist_p_LB_1; - /* "scikits/learn/ball_tree.pyx":1009 + /* "/home/fabian/dev/scikit-learn/sklearn/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_7scikits_5learn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); + __pyx_f_7sklearn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); - /* "scikits/learn/ball_tree.pyx":1011 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1011 * stack_push(node_stack, item) * * item.i_node = i2 # <<<<<<<<<<<<<< @@ -6044,7 +6078,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_query_one_(struct __py */ __pyx_v_item.i_node = __pyx_v_i2; - /* "scikits/learn/ball_tree.pyx":1012 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1012 * * item.i_node = i2 * item.dist_p_LB = dist_p_LB_2 # <<<<<<<<<<<<<< @@ -6053,19 +6087,19 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_query_one_(struct __py */ __pyx_v_item.dist_p_LB = __pyx_v_dist_p_LB_2; - /* "scikits/learn/ball_tree.pyx":1013 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1013 * item.i_node = i2 * item.dist_p_LB = dist_p_LB_2 * stack_push(node_stack, item) # <<<<<<<<<<<<<< * * else: */ - __pyx_f_7scikits_5learn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); + __pyx_f_7sklearn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); goto __pyx_L10; } /*else*/ { - /* "scikits/learn/ball_tree.pyx":1016 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1016 * * else: * item.i_node = i2 # <<<<<<<<<<<<<< @@ -6074,7 +6108,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_query_one_(struct __py */ __pyx_v_item.i_node = __pyx_v_i2; - /* "scikits/learn/ball_tree.pyx":1017 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1017 * else: * item.i_node = i2 * item.dist_p_LB = dist_p_LB_2 # <<<<<<<<<<<<<< @@ -6083,16 +6117,16 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_query_one_(struct __py */ __pyx_v_item.dist_p_LB = __pyx_v_dist_p_LB_2; - /* "scikits/learn/ball_tree.pyx":1018 + /* "/home/fabian/dev/scikit-learn/sklearn/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_7scikits_5learn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); + __pyx_f_7sklearn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); - /* "scikits/learn/ball_tree.pyx":1020 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1020 * stack_push(node_stack, item) * * item.i_node = i1 # <<<<<<<<<<<<<< @@ -6101,7 +6135,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_query_one_(struct __py */ __pyx_v_item.i_node = __pyx_v_i1; - /* "scikits/learn/ball_tree.pyx":1021 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1021 * * item.i_node = i1 * item.dist_p_LB = dist_p_LB_1 # <<<<<<<<<<<<<< @@ -6110,14 +6144,14 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_query_one_(struct __py */ __pyx_v_item.dist_p_LB = __pyx_v_dist_p_LB_1; - /* "scikits/learn/ball_tree.pyx":1022 + /* "/home/fabian/dev/scikit-learn/sklearn/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_7scikits_5learn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); + __pyx_f_7sklearn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); } __pyx_L10:; } @@ -6125,7 +6159,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_query_one_(struct __py __pyx_L4_continue:; } - /* "scikits/learn/ball_tree.pyx":1024 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1024 * stack_push(node_stack, item) * * for i from 0 <= i < k: # <<<<<<<<<<<<<< @@ -6135,20 +6169,20 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_query_one_(struct __py __pyx_t_2 = __pyx_v_k; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "scikits/learn/ball_tree.pyx":1025 + /* "/home/fabian/dev/scikit-learn/sklearn/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_7scikits_5learn_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_7sklearn_9ball_tree_dist_from_dist_p((__pyx_v_near_set_dist[__pyx_v_i]), __pyx_v_p); } __Pyx_RefNannyFinishContext(); } -/* "scikits/learn/ball_tree.pyx":1027 +/* "/home/fabian/dev/scikit-learn/sklearn/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, # <<<<<<<<<<<<<< @@ -6156,63 +6190,63 @@ static void __pyx_f_7scikits_5learn_9ball_tree_8BallTree_query_one_(struct __py * stack* node_stack): */ -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; +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; int __pyx_t_1; - __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_t_2; + __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_t_2; long __pyx_t_3; __Pyx_RefNannySetupContext("query_radius_count_"); - /* "scikits/learn/ball_tree.pyx":1030 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1030 * DTYPE_t* pt, DTYPE_t r, * stack* node_stack): * cdef DTYPE_t* data = self.data.data # <<<<<<<<<<<<<< * cdef ITYPE_t* idx_array = self.idx_array.data * cdef DTYPE_t* node_centroid_arr = self.node_centroid_arr.data */ - __pyx_v_data = ((__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *)__pyx_v_self->data->data); + __pyx_v_data = ((__pyx_t_7sklearn_9ball_tree_DTYPE_t *)__pyx_v_self->data->data); - /* "scikits/learn/ball_tree.pyx":1031 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1031 * stack* node_stack): * cdef DTYPE_t* data = self.data.data * cdef ITYPE_t* idx_array = self.idx_array.data # <<<<<<<<<<<<<< * cdef DTYPE_t* node_centroid_arr = self.node_centroid_arr.data * cdef NodeInfo* node_info_arr = self.node_info_arr.data */ - __pyx_v_idx_array = ((__pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *)__pyx_v_self->idx_array->data); + __pyx_v_idx_array = ((__pyx_t_7sklearn_9ball_tree_ITYPE_t *)__pyx_v_self->idx_array->data); - /* "scikits/learn/ball_tree.pyx":1032 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1032 * cdef DTYPE_t* data = self.data.data * cdef ITYPE_t* idx_array = self.idx_array.data * cdef DTYPE_t* node_centroid_arr = self.node_centroid_arr.data # <<<<<<<<<<<<<< * cdef NodeInfo* node_info_arr = self.node_info_arr.data * cdef NodeInfo* node_info = node_info_arr */ - __pyx_v_node_centroid_arr = ((__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *)__pyx_v_self->node_centroid_arr->data); + __pyx_v_node_centroid_arr = ((__pyx_t_7sklearn_9ball_tree_DTYPE_t *)__pyx_v_self->node_centroid_arr->data); - /* "scikits/learn/ball_tree.pyx":1033 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1033 * cdef ITYPE_t* idx_array = self.idx_array.data * cdef DTYPE_t* node_centroid_arr = self.node_centroid_arr.data * cdef NodeInfo* node_info_arr = self.node_info_arr.data # <<<<<<<<<<<<<< * cdef NodeInfo* node_info = node_info_arr * */ - __pyx_v_node_info_arr = ((struct __pyx_t_7scikits_5learn_9ball_tree_NodeInfo *)__pyx_v_self->node_info_arr->data); + __pyx_v_node_info_arr = ((struct __pyx_t_7sklearn_9ball_tree_NodeInfo *)__pyx_v_self->node_info_arr->data); - /* "scikits/learn/ball_tree.pyx":1034 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1034 * cdef DTYPE_t* node_centroid_arr = self.node_centroid_arr.data * cdef NodeInfo* node_info_arr = self.node_info_arr.data * cdef NodeInfo* node_info = node_info_arr # <<<<<<<<<<<<<< @@ -6221,7 +6255,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball */ __pyx_v_node_info = __pyx_v_node_info_arr; - /* "scikits/learn/ball_tree.pyx":1036 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1036 * cdef NodeInfo* node_info = node_info_arr * * cdef DTYPE_t p = self.p # <<<<<<<<<<<<<< @@ -6230,7 +6264,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball */ __pyx_v_p = __pyx_v_self->p; - /* "scikits/learn/ball_tree.pyx":1037 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1037 * * cdef DTYPE_t p = self.p * cdef ITYPE_t n_features = self.data.shape[1] # <<<<<<<<<<<<<< @@ -6239,7 +6273,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball */ __pyx_v_n_features = (__pyx_v_self->data->dimensions[1]); - /* "scikits/learn/ball_tree.pyx":1039 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1039 * cdef ITYPE_t n_features = self.data.shape[1] * cdef ITYPE_t i, i_node * cdef ITYPE_t count = 0 # <<<<<<<<<<<<<< @@ -6248,16 +6282,16 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball */ __pyx_v_count = 0; - /* "scikits/learn/ball_tree.pyx":1040 + /* "/home/fabian/dev/scikit-learn/sklearn/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_7scikits_5learn_9ball_tree_dist_p_from_dist(__pyx_v_r, __pyx_v_p); + __pyx_v_r_p = __pyx_f_7sklearn_9ball_tree_dist_p_from_dist(__pyx_v_r, __pyx_v_p); - /* "scikits/learn/ball_tree.pyx":1045 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1045 * cdef stack_item item * * item.i_node = 0 # <<<<<<<<<<<<<< @@ -6266,16 +6300,16 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball */ __pyx_v_item.i_node = 0; - /* "scikits/learn/ball_tree.pyx":1046 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1046 * * item.i_node = 0 * stack_push(node_stack, item) # <<<<<<<<<<<<<< * * while(node_stack.n > 0): */ - __pyx_f_7scikits_5learn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); + __pyx_f_7sklearn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); - /* "scikits/learn/ball_tree.pyx":1048 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1048 * stack_push(node_stack, item) * * while(node_stack.n > 0): # <<<<<<<<<<<<<< @@ -6286,16 +6320,16 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball __pyx_t_1 = (__pyx_v_node_stack->n > 0); if (!__pyx_t_1) break; - /* "scikits/learn/ball_tree.pyx":1049 + /* "/home/fabian/dev/scikit-learn/sklearn/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_7scikits_5learn_9ball_tree_stack_pop(__pyx_v_node_stack); + __pyx_v_item = __pyx_f_7sklearn_9ball_tree_stack_pop(__pyx_v_node_stack); - /* "scikits/learn/ball_tree.pyx":1050 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1050 * while(node_stack.n > 0): * item = stack_pop(node_stack) * i_node = item.i_node # <<<<<<<<<<<<<< @@ -6304,7 +6338,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball */ __pyx_v_i_node = __pyx_v_item.i_node; - /* "scikits/learn/ball_tree.pyx":1051 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1051 * item = stack_pop(node_stack) * i_node = item.i_node * node_info = node_info_arr + i_node # <<<<<<<<<<<<<< @@ -6313,16 +6347,16 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball */ __pyx_v_node_info = (__pyx_v_node_info_arr + __pyx_v_i_node); - /* "scikits/learn/ball_tree.pyx":1054 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1054 * * dist_pt = dist(pt, node_centroid_arr + n_features * i_node, * n_features, 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); + __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); - /* "scikits/learn/ball_tree.pyx":1059 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1059 * # Case 1: all node points are outside distance r. * # prune this branch. * if dist_pt - node_info.radius > r: # <<<<<<<<<<<<<< @@ -6332,7 +6366,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball __pyx_t_1 = ((__pyx_v_dist_pt - __pyx_v_node_info->radius) > __pyx_v_r); if (__pyx_t_1) { - /* "scikits/learn/ball_tree.pyx":1060 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1060 * # prune this branch. * if dist_pt - node_info.radius > r: * continue # <<<<<<<<<<<<<< @@ -6343,7 +6377,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball goto __pyx_L5; } - /* "scikits/learn/ball_tree.pyx":1065 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1065 * # Case 2: all node points are within distance r * # add all points * elif dist_pt + node_info.radius < r: # <<<<<<<<<<<<<< @@ -6353,18 +6387,18 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball __pyx_t_1 = ((__pyx_v_dist_pt + __pyx_v_node_info->radius) < __pyx_v_r); if (__pyx_t_1) { - /* "scikits/learn/ball_tree.pyx":1066 + /* "/home/fabian/dev/scikit-learn/sklearn/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_count + (__pyx_v_node_info->idx_end - __pyx_v_node_info->idx_start)); + __pyx_v_count += (__pyx_v_node_info->idx_end - __pyx_v_node_info->idx_start); goto __pyx_L5; } - /* "scikits/learn/ball_tree.pyx":1071 + /* "/home/fabian/dev/scikit-learn/sklearn/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: # <<<<<<<<<<<<<< @@ -6373,7 +6407,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball */ if (__pyx_v_node_info->is_leaf) { - /* "scikits/learn/ball_tree.pyx":1072 + /* "/home/fabian/dev/scikit-learn/sklearn/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: # <<<<<<<<<<<<<< @@ -6383,16 +6417,16 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball __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++) { - /* "scikits/learn/ball_tree.pyx":1075 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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); + __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); - /* "scikits/learn/ball_tree.pyx":1076 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1076 * data + idx_array[i] * n_features, * n_features, p) * if dist_pt <= r_p: # <<<<<<<<<<<<<< @@ -6402,14 +6436,14 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball __pyx_t_1 = (__pyx_v_dist_pt <= __pyx_v_r_p); if (__pyx_t_1) { - /* "scikits/learn/ball_tree.pyx":1077 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1077 * n_features, p) * if dist_pt <= r_p: * count += 1 # <<<<<<<<<<<<<< * * #------------------------------------------------------------ */ - __pyx_v_count = (__pyx_v_count + 1); + __pyx_v_count += 1; goto __pyx_L8; } __pyx_L8:; @@ -6418,7 +6452,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball } /*else*/ { - /* "scikits/learn/ball_tree.pyx":1082 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1082 * # Case 4: Node is not a leaf. Recursively query subnodes * else: * item.i_node = 2 * i_node + 1 # <<<<<<<<<<<<<< @@ -6427,16 +6461,16 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball */ __pyx_v_item.i_node = ((2 * __pyx_v_i_node) + 1); - /* "scikits/learn/ball_tree.pyx":1083 + /* "/home/fabian/dev/scikit-learn/sklearn/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_7scikits_5learn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); + __pyx_f_7sklearn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); - /* "scikits/learn/ball_tree.pyx":1085 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1085 * stack_push(node_stack, item) * * item.i_node = i = 2 * i_node + 2 # <<<<<<<<<<<<<< @@ -6447,20 +6481,20 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball __pyx_v_item.i_node = __pyx_t_3; __pyx_v_i = __pyx_t_3; - /* "scikits/learn/ball_tree.pyx":1086 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1086 * * item.i_node = i = 2 * i_node + 2 * stack_push(node_stack, item) # <<<<<<<<<<<<<< * * return count */ - __pyx_f_7scikits_5learn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); + __pyx_f_7sklearn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); } __pyx_L5:; __pyx_L3_continue:; } - /* "scikits/learn/ball_tree.pyx":1088 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1088 * stack_push(node_stack, item) * * return count # <<<<<<<<<<<<<< @@ -6476,7 +6510,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball return __pyx_r; } -/* "scikits/learn/ball_tree.pyx":1090 +/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1090 * return count * * cdef ITYPE_t query_radius_idx_only_(BallTree self, # <<<<<<<<<<<<<< @@ -6484,63 +6518,63 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball * ITYPE_t* indices, */ -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; +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; int __pyx_t_1; - __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_t_2; + __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_t_2; long __pyx_t_3; __Pyx_RefNannySetupContext("query_radius_idx_only_"); - /* "scikits/learn/ball_tree.pyx":1094 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1094 * ITYPE_t* indices, * stack* node_stack): * cdef DTYPE_t* data = self.data.data # <<<<<<<<<<<<<< * cdef ITYPE_t* idx_array = self.idx_array.data * cdef DTYPE_t* node_centroid_arr = self.node_centroid_arr.data */ - __pyx_v_data = ((__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *)__pyx_v_self->data->data); + __pyx_v_data = ((__pyx_t_7sklearn_9ball_tree_DTYPE_t *)__pyx_v_self->data->data); - /* "scikits/learn/ball_tree.pyx":1095 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1095 * stack* node_stack): * cdef DTYPE_t* data = self.data.data * cdef ITYPE_t* idx_array = self.idx_array.data # <<<<<<<<<<<<<< * cdef DTYPE_t* node_centroid_arr = self.node_centroid_arr.data * cdef NodeInfo* node_info_arr = self.node_info_arr.data */ - __pyx_v_idx_array = ((__pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *)__pyx_v_self->idx_array->data); + __pyx_v_idx_array = ((__pyx_t_7sklearn_9ball_tree_ITYPE_t *)__pyx_v_self->idx_array->data); - /* "scikits/learn/ball_tree.pyx":1096 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1096 * cdef DTYPE_t* data = self.data.data * cdef ITYPE_t* idx_array = self.idx_array.data * cdef DTYPE_t* node_centroid_arr = self.node_centroid_arr.data # <<<<<<<<<<<<<< * cdef NodeInfo* node_info_arr = self.node_info_arr.data * cdef NodeInfo* node_info = node_info_arr */ - __pyx_v_node_centroid_arr = ((__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *)__pyx_v_self->node_centroid_arr->data); + __pyx_v_node_centroid_arr = ((__pyx_t_7sklearn_9ball_tree_DTYPE_t *)__pyx_v_self->node_centroid_arr->data); - /* "scikits/learn/ball_tree.pyx":1097 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1097 * cdef ITYPE_t* idx_array = self.idx_array.data * cdef DTYPE_t* node_centroid_arr = self.node_centroid_arr.data * cdef NodeInfo* node_info_arr = self.node_info_arr.data # <<<<<<<<<<<<<< * cdef NodeInfo* node_info = node_info_arr * */ - __pyx_v_node_info_arr = ((struct __pyx_t_7scikits_5learn_9ball_tree_NodeInfo *)__pyx_v_self->node_info_arr->data); + __pyx_v_node_info_arr = ((struct __pyx_t_7sklearn_9ball_tree_NodeInfo *)__pyx_v_self->node_info_arr->data); - /* "scikits/learn/ball_tree.pyx":1098 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1098 * cdef DTYPE_t* node_centroid_arr = self.node_centroid_arr.data * cdef NodeInfo* node_info_arr = self.node_info_arr.data * cdef NodeInfo* node_info = node_info_arr # <<<<<<<<<<<<<< @@ -6549,7 +6583,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball */ __pyx_v_node_info = __pyx_v_node_info_arr; - /* "scikits/learn/ball_tree.pyx":1100 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1100 * cdef NodeInfo* node_info = node_info_arr * * cdef DTYPE_t p = self.p # <<<<<<<<<<<<<< @@ -6558,7 +6592,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball */ __pyx_v_p = __pyx_v_self->p; - /* "scikits/learn/ball_tree.pyx":1101 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1101 * * cdef DTYPE_t p = self.p * cdef ITYPE_t n_features = self.data.shape[1] # <<<<<<<<<<<<<< @@ -6567,7 +6601,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball */ __pyx_v_n_features = (__pyx_v_self->data->dimensions[1]); - /* "scikits/learn/ball_tree.pyx":1103 + /* "/home/fabian/dev/scikit-learn/sklearn/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 # <<<<<<<<<<<<<< @@ -6576,16 +6610,16 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball */ __pyx_v_idx_i = 0; - /* "scikits/learn/ball_tree.pyx":1104 + /* "/home/fabian/dev/scikit-learn/sklearn/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_7scikits_5learn_9ball_tree_dist_p_from_dist(__pyx_v_r, __pyx_v_p); + __pyx_v_r_p = __pyx_f_7sklearn_9ball_tree_dist_p_from_dist(__pyx_v_r, __pyx_v_p); - /* "scikits/learn/ball_tree.pyx":1109 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1109 * cdef stack_item item * * item.i_node = 0 # <<<<<<<<<<<<<< @@ -6594,16 +6628,16 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball */ __pyx_v_item.i_node = 0; - /* "scikits/learn/ball_tree.pyx":1110 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1110 * * item.i_node = 0 * stack_push(node_stack, item) # <<<<<<<<<<<<<< * * while(node_stack.n > 0): */ - __pyx_f_7scikits_5learn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); + __pyx_f_7sklearn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); - /* "scikits/learn/ball_tree.pyx":1112 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1112 * stack_push(node_stack, item) * * while(node_stack.n > 0): # <<<<<<<<<<<<<< @@ -6614,16 +6648,16 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball __pyx_t_1 = (__pyx_v_node_stack->n > 0); if (!__pyx_t_1) break; - /* "scikits/learn/ball_tree.pyx":1113 + /* "/home/fabian/dev/scikit-learn/sklearn/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_7scikits_5learn_9ball_tree_stack_pop(__pyx_v_node_stack); + __pyx_v_item = __pyx_f_7sklearn_9ball_tree_stack_pop(__pyx_v_node_stack); - /* "scikits/learn/ball_tree.pyx":1114 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1114 * while(node_stack.n > 0): * item = stack_pop(node_stack) * i_node = item.i_node # <<<<<<<<<<<<<< @@ -6632,7 +6666,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball */ __pyx_v_i_node = __pyx_v_item.i_node; - /* "scikits/learn/ball_tree.pyx":1115 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1115 * item = stack_pop(node_stack) * i_node = item.i_node * node_info = node_info_arr + i_node # <<<<<<<<<<<<<< @@ -6641,16 +6675,16 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball */ __pyx_v_node_info = (__pyx_v_node_info_arr + __pyx_v_i_node); - /* "scikits/learn/ball_tree.pyx":1118 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1118 * * dist_pt = dist(pt, node_centroid_arr + n_features * i_node, * n_features, 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); + __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); - /* "scikits/learn/ball_tree.pyx":1123 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1123 * # Case 1: all node points are outside distance r. * # prune this branch. * if dist_pt - node_info.radius > r: # <<<<<<<<<<<<<< @@ -6660,7 +6694,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball __pyx_t_1 = ((__pyx_v_dist_pt - __pyx_v_node_info->radius) > __pyx_v_r); if (__pyx_t_1) { - /* "scikits/learn/ball_tree.pyx":1124 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1124 * # prune this branch. * if dist_pt - node_info.radius > r: * continue # <<<<<<<<<<<<<< @@ -6671,7 +6705,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball goto __pyx_L5; } - /* "scikits/learn/ball_tree.pyx":1129 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1129 * # Case 2: all node points are within distance r * # add all points * elif dist_pt + node_info.radius < r: # <<<<<<<<<<<<<< @@ -6681,7 +6715,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball __pyx_t_1 = ((__pyx_v_dist_pt + __pyx_v_node_info->radius) < __pyx_v_r); if (__pyx_t_1) { - /* "scikits/learn/ball_tree.pyx":1130 + /* "/home/fabian/dev/scikit-learn/sklearn/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: # <<<<<<<<<<<<<< @@ -6691,7 +6725,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball __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++) { - /* "scikits/learn/ball_tree.pyx":1131 + /* "/home/fabian/dev/scikit-learn/sklearn/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] # <<<<<<<<<<<<<< @@ -6700,19 +6734,19 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball */ (__pyx_v_indices[__pyx_v_idx_i]) = (__pyx_v_idx_array[__pyx_v_i]); - /* "scikits/learn/ball_tree.pyx":1132 + /* "/home/fabian/dev/scikit-learn/sklearn/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 = (__pyx_v_idx_i + 1); + __pyx_v_idx_i += 1; } goto __pyx_L5; } - /* "scikits/learn/ball_tree.pyx":1137 + /* "/home/fabian/dev/scikit-learn/sklearn/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: # <<<<<<<<<<<<<< @@ -6721,7 +6755,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball */ if (__pyx_v_node_info->is_leaf) { - /* "scikits/learn/ball_tree.pyx":1138 + /* "/home/fabian/dev/scikit-learn/sklearn/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: # <<<<<<<<<<<<<< @@ -6731,16 +6765,16 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball __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++) { - /* "scikits/learn/ball_tree.pyx":1141 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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); + __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); - /* "scikits/learn/ball_tree.pyx":1142 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1142 * data + idx_array[i] * n_features, * n_features, p) * if dist_pt <= r_p: # <<<<<<<<<<<<<< @@ -6750,7 +6784,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball __pyx_t_1 = (__pyx_v_dist_pt <= __pyx_v_r_p); if (__pyx_t_1) { - /* "scikits/learn/ball_tree.pyx":1143 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1143 * n_features, p) * if dist_pt <= r_p: * indices[idx_i] = idx_array[i] # <<<<<<<<<<<<<< @@ -6759,14 +6793,14 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball */ (__pyx_v_indices[__pyx_v_idx_i]) = (__pyx_v_idx_array[__pyx_v_i]); - /* "scikits/learn/ball_tree.pyx":1144 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1144 * if dist_pt <= r_p: * indices[idx_i] = idx_array[i] * idx_i += 1 # <<<<<<<<<<<<<< * * #------------------------------------------------------------ */ - __pyx_v_idx_i = (__pyx_v_idx_i + 1); + __pyx_v_idx_i += 1; goto __pyx_L10; } __pyx_L10:; @@ -6775,7 +6809,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball } /*else*/ { - /* "scikits/learn/ball_tree.pyx":1149 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1149 * # Case 4: Node is not a leaf. Recursively query subnodes * else: * item.i_node = 2 * i_node + 1 # <<<<<<<<<<<<<< @@ -6784,16 +6818,16 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball */ __pyx_v_item.i_node = ((2 * __pyx_v_i_node) + 1); - /* "scikits/learn/ball_tree.pyx":1150 + /* "/home/fabian/dev/scikit-learn/sklearn/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_7scikits_5learn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); + __pyx_f_7sklearn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); - /* "scikits/learn/ball_tree.pyx":1152 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1152 * stack_push(node_stack, item) * * item.i_node = i = 2 * i_node + 2 # <<<<<<<<<<<<<< @@ -6804,20 +6838,20 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball __pyx_v_item.i_node = __pyx_t_3; __pyx_v_i = __pyx_t_3; - /* "scikits/learn/ball_tree.pyx":1153 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1153 * * item.i_node = i = 2 * i_node + 2 * stack_push(node_stack, item) # <<<<<<<<<<<<<< * * return idx_i */ - __pyx_f_7scikits_5learn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); + __pyx_f_7sklearn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); } __pyx_L5:; __pyx_L3_continue:; } - /* "scikits/learn/ball_tree.pyx":1155 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1155 * stack_push(node_stack, item) * * return idx_i # <<<<<<<<<<<<<< @@ -6833,7 +6867,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball return __pyx_r; } -/* "scikits/learn/ball_tree.pyx":1157 +/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1157 * return idx_i * * cdef ITYPE_t query_radius_distances_(BallTree self, # <<<<<<<<<<<<<< @@ -6841,63 +6875,63 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball * ITYPE_t* indices, */ -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; +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; int __pyx_t_1; - __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_t_2; + __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_t_2; long __pyx_t_3; __Pyx_RefNannySetupContext("query_radius_distances_"); - /* "scikits/learn/ball_tree.pyx":1162 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1162 * DTYPE_t* distances, * stack* node_stack): * cdef DTYPE_t* data = self.data.data # <<<<<<<<<<<<<< * cdef ITYPE_t* idx_array = self.idx_array.data * cdef DTYPE_t* node_centroid_arr = self.node_centroid_arr.data */ - __pyx_v_data = ((__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *)__pyx_v_self->data->data); + __pyx_v_data = ((__pyx_t_7sklearn_9ball_tree_DTYPE_t *)__pyx_v_self->data->data); - /* "scikits/learn/ball_tree.pyx":1163 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1163 * stack* node_stack): * cdef DTYPE_t* data = self.data.data * cdef ITYPE_t* idx_array = self.idx_array.data # <<<<<<<<<<<<<< * cdef DTYPE_t* node_centroid_arr = self.node_centroid_arr.data * cdef NodeInfo* node_info_arr = self.node_info_arr.data */ - __pyx_v_idx_array = ((__pyx_t_7scikits_5learn_9ball_tree_ITYPE_t *)__pyx_v_self->idx_array->data); + __pyx_v_idx_array = ((__pyx_t_7sklearn_9ball_tree_ITYPE_t *)__pyx_v_self->idx_array->data); - /* "scikits/learn/ball_tree.pyx":1164 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1164 * cdef DTYPE_t* data = self.data.data * cdef ITYPE_t* idx_array = self.idx_array.data * cdef DTYPE_t* node_centroid_arr = self.node_centroid_arr.data # <<<<<<<<<<<<<< * cdef NodeInfo* node_info_arr = self.node_info_arr.data * cdef NodeInfo* node_info = node_info_arr */ - __pyx_v_node_centroid_arr = ((__pyx_t_7scikits_5learn_9ball_tree_DTYPE_t *)__pyx_v_self->node_centroid_arr->data); + __pyx_v_node_centroid_arr = ((__pyx_t_7sklearn_9ball_tree_DTYPE_t *)__pyx_v_self->node_centroid_arr->data); - /* "scikits/learn/ball_tree.pyx":1165 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1165 * cdef ITYPE_t* idx_array = self.idx_array.data * cdef DTYPE_t* node_centroid_arr = self.node_centroid_arr.data * cdef NodeInfo* node_info_arr = self.node_info_arr.data # <<<<<<<<<<<<<< * cdef NodeInfo* node_info = node_info_arr * */ - __pyx_v_node_info_arr = ((struct __pyx_t_7scikits_5learn_9ball_tree_NodeInfo *)__pyx_v_self->node_info_arr->data); + __pyx_v_node_info_arr = ((struct __pyx_t_7sklearn_9ball_tree_NodeInfo *)__pyx_v_self->node_info_arr->data); - /* "scikits/learn/ball_tree.pyx":1166 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1166 * cdef DTYPE_t* node_centroid_arr = self.node_centroid_arr.data * cdef NodeInfo* node_info_arr = self.node_info_arr.data * cdef NodeInfo* node_info = node_info_arr # <<<<<<<<<<<<<< @@ -6906,7 +6940,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball */ __pyx_v_node_info = __pyx_v_node_info_arr; - /* "scikits/learn/ball_tree.pyx":1168 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1168 * cdef NodeInfo* node_info = node_info_arr * * cdef DTYPE_t p = self.p # <<<<<<<<<<<<<< @@ -6915,7 +6949,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball */ __pyx_v_p = __pyx_v_self->p; - /* "scikits/learn/ball_tree.pyx":1169 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1169 * * cdef DTYPE_t p = self.p * cdef ITYPE_t n_features = self.data.shape[1] # <<<<<<<<<<<<<< @@ -6924,7 +6958,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball */ __pyx_v_n_features = (__pyx_v_self->data->dimensions[1]); - /* "scikits/learn/ball_tree.pyx":1171 + /* "/home/fabian/dev/scikit-learn/sklearn/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 # <<<<<<<<<<<<<< @@ -6933,16 +6967,16 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball */ __pyx_v_idx_i = 0; - /* "scikits/learn/ball_tree.pyx":1172 + /* "/home/fabian/dev/scikit-learn/sklearn/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_7scikits_5learn_9ball_tree_dist_p_from_dist(__pyx_v_r, __pyx_v_p); + __pyx_v_r_p = __pyx_f_7sklearn_9ball_tree_dist_p_from_dist(__pyx_v_r, __pyx_v_p); - /* "scikits/learn/ball_tree.pyx":1177 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1177 * cdef stack_item item * * item.i_node = 0 # <<<<<<<<<<<<<< @@ -6951,16 +6985,16 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball */ __pyx_v_item.i_node = 0; - /* "scikits/learn/ball_tree.pyx":1178 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1178 * * item.i_node = 0 * stack_push(node_stack, item) # <<<<<<<<<<<<<< * * while(node_stack.n > 0): */ - __pyx_f_7scikits_5learn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); + __pyx_f_7sklearn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); - /* "scikits/learn/ball_tree.pyx":1180 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1180 * stack_push(node_stack, item) * * while(node_stack.n > 0): # <<<<<<<<<<<<<< @@ -6971,16 +7005,16 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball __pyx_t_1 = (__pyx_v_node_stack->n > 0); if (!__pyx_t_1) break; - /* "scikits/learn/ball_tree.pyx":1181 + /* "/home/fabian/dev/scikit-learn/sklearn/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_7scikits_5learn_9ball_tree_stack_pop(__pyx_v_node_stack); + __pyx_v_item = __pyx_f_7sklearn_9ball_tree_stack_pop(__pyx_v_node_stack); - /* "scikits/learn/ball_tree.pyx":1182 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1182 * while(node_stack.n > 0): * item = stack_pop(node_stack) * i_node = item.i_node # <<<<<<<<<<<<<< @@ -6989,7 +7023,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball */ __pyx_v_i_node = __pyx_v_item.i_node; - /* "scikits/learn/ball_tree.pyx":1183 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1183 * item = stack_pop(node_stack) * i_node = item.i_node * node_info = node_info_arr + i_node # <<<<<<<<<<<<<< @@ -6998,16 +7032,16 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball */ __pyx_v_node_info = (__pyx_v_node_info_arr + __pyx_v_i_node); - /* "scikits/learn/ball_tree.pyx":1186 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1186 * * dist_pt = dist(pt, node_centroid_arr + n_features * i_node, * n_features, 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); + __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); - /* "scikits/learn/ball_tree.pyx":1191 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1191 * # Case 1: all node points are outside distance r. * # prune this branch. * if dist_pt - node_info.radius > r: # <<<<<<<<<<<<<< @@ -7017,7 +7051,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball __pyx_t_1 = ((__pyx_v_dist_pt - __pyx_v_node_info->radius) > __pyx_v_r); if (__pyx_t_1) { - /* "scikits/learn/ball_tree.pyx":1192 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1192 * # prune this branch. * if dist_pt - node_info.radius > r: * continue # <<<<<<<<<<<<<< @@ -7028,7 +7062,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball goto __pyx_L5; } - /* "scikits/learn/ball_tree.pyx":1197 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1197 * # Case 2: all node points are within distance r * # add all points * elif dist_pt + node_info.radius < r: # <<<<<<<<<<<<<< @@ -7038,7 +7072,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball __pyx_t_1 = ((__pyx_v_dist_pt + __pyx_v_node_info->radius) < __pyx_v_r); if (__pyx_t_1) { - /* "scikits/learn/ball_tree.pyx":1198 + /* "/home/fabian/dev/scikit-learn/sklearn/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: # <<<<<<<<<<<<<< @@ -7048,16 +7082,16 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball __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++) { - /* "scikits/learn/ball_tree.pyx":1201 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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); + __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); - /* "scikits/learn/ball_tree.pyx":1202 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1202 * data + idx_array[i] * n_features, * n_features, p) * indices[idx_i] = idx_array[i] # <<<<<<<<<<<<<< @@ -7066,7 +7100,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball */ (__pyx_v_indices[__pyx_v_idx_i]) = (__pyx_v_idx_array[__pyx_v_i]); - /* "scikits/learn/ball_tree.pyx":1203 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1203 * n_features, p) * indices[idx_i] = idx_array[i] * distances[idx_i] = dist_pt # <<<<<<<<<<<<<< @@ -7075,19 +7109,19 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball */ (__pyx_v_distances[__pyx_v_idx_i]) = __pyx_v_dist_pt; - /* "scikits/learn/ball_tree.pyx":1204 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1204 * indices[idx_i] = idx_array[i] * distances[idx_i] = dist_pt * idx_i += 1 # <<<<<<<<<<<<<< * * #------------------------------------------------------------ */ - __pyx_v_idx_i = (__pyx_v_idx_i + 1); + __pyx_v_idx_i += 1; } goto __pyx_L5; } - /* "scikits/learn/ball_tree.pyx":1209 + /* "/home/fabian/dev/scikit-learn/sklearn/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: # <<<<<<<<<<<<<< @@ -7096,7 +7130,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball */ if (__pyx_v_node_info->is_leaf) { - /* "scikits/learn/ball_tree.pyx":1210 + /* "/home/fabian/dev/scikit-learn/sklearn/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: # <<<<<<<<<<<<<< @@ -7106,16 +7140,16 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball __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++) { - /* "scikits/learn/ball_tree.pyx":1213 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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); + __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); - /* "scikits/learn/ball_tree.pyx":1214 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1214 * data + idx_array[i] * n_features, * n_features, p) * if dist_pt <= r_p: # <<<<<<<<<<<<<< @@ -7125,7 +7159,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball __pyx_t_1 = (__pyx_v_dist_pt <= __pyx_v_r_p); if (__pyx_t_1) { - /* "scikits/learn/ball_tree.pyx":1215 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1215 * n_features, p) * if dist_pt <= r_p: * indices[idx_i] = idx_array[i] # <<<<<<<<<<<<<< @@ -7134,23 +7168,23 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball */ (__pyx_v_indices[__pyx_v_idx_i]) = (__pyx_v_idx_array[__pyx_v_i]); - /* "scikits/learn/ball_tree.pyx":1216 + /* "/home/fabian/dev/scikit-learn/sklearn/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_7scikits_5learn_9ball_tree_dist_from_dist_p(__pyx_v_dist_pt, __pyx_v_p); + (__pyx_v_distances[__pyx_v_idx_i]) = __pyx_f_7sklearn_9ball_tree_dist_from_dist_p(__pyx_v_dist_pt, __pyx_v_p); - /* "scikits/learn/ball_tree.pyx":1217 + /* "/home/fabian/dev/scikit-learn/sklearn/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 = (__pyx_v_idx_i + 1); + __pyx_v_idx_i += 1; goto __pyx_L10; } __pyx_L10:; @@ -7159,7 +7193,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball } /*else*/ { - /* "scikits/learn/ball_tree.pyx":1222 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1222 * # Case 4: Node is not a leaf. Recursively query subnodes * else: * item.i_node = 2 * i_node + 1 # <<<<<<<<<<<<<< @@ -7168,16 +7202,16 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball */ __pyx_v_item.i_node = ((2 * __pyx_v_i_node) + 1); - /* "scikits/learn/ball_tree.pyx":1223 + /* "/home/fabian/dev/scikit-learn/sklearn/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_7scikits_5learn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); + __pyx_f_7sklearn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); - /* "scikits/learn/ball_tree.pyx":1225 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1225 * stack_push(node_stack, item) * * item.i_node = i = 2 * i_node + 2 # <<<<<<<<<<<<<< @@ -7188,20 +7222,20 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball __pyx_v_item.i_node = __pyx_t_3; __pyx_v_i = __pyx_t_3; - /* "scikits/learn/ball_tree.pyx":1226 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1226 * * item.i_node = i = 2 * i_node + 2 * stack_push(node_stack, item) # <<<<<<<<<<<<<< * * return idx_i */ - __pyx_f_7scikits_5learn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); + __pyx_f_7sklearn_9ball_tree_stack_push(__pyx_v_node_stack, __pyx_v_item); } __pyx_L5:; __pyx_L3_continue:; } - /* "scikits/learn/ball_tree.pyx":1228 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1228 * stack_push(node_stack, item) * * return idx_i # <<<<<<<<<<<<<< @@ -7217,31 +7251,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball return __pyx_r; } -/* "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 +/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1235 * # * @cython.profile(False) * cdef inline void copy_array(DTYPE_t* x, DTYPE_t* y, ITYPE_t n): # <<<<<<<<<<<<<< @@ -7249,12 +7259,12 @@ static PyObject *__pyx_pf_7scikits_5learn_9ball_tree_8BallTree_4data___get__(PyO * cdef ITYPE_t i */ -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; +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; __Pyx_RefNannySetupContext("copy_array"); - /* "scikits/learn/ball_tree.pyx":1238 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1238 * # copy array y into array x * cdef ITYPE_t i * for i from 0 <= i < n: # <<<<<<<<<<<<<< @@ -7264,7 +7274,7 @@ static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_copy_array(__pyx_t_ __pyx_t_1 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { - /* "scikits/learn/ball_tree.pyx":1239 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1239 * cdef ITYPE_t i * for i from 0 <= i < n: * x[i] = y[i] # <<<<<<<<<<<<<< @@ -7277,7 +7287,7 @@ static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_copy_array(__pyx_t_ __Pyx_RefNannyFinishContext(); } -/* "scikits/learn/ball_tree.pyx":1243 +/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1243 * * @cython.cdivision(True) * cdef void compute_centroid(DTYPE_t* centroid, # <<<<<<<<<<<<<< @@ -7285,16 +7295,15 @@ static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_copy_array(__pyx_t_ * ITYPE_t* node_indices, */ -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; +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; __Pyx_RefNannySetupContext("compute_centroid"); - /* "scikits/learn/ball_tree.pyx":1254 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1254 * cdef ITYPE_t i, j * * for j from 0 <= j < n_features: # <<<<<<<<<<<<<< @@ -7304,7 +7313,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_compute_centroid(__pyx_t_7scikit __pyx_t_1 = __pyx_v_n_features; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_1; __pyx_v_j++) { - /* "scikits/learn/ball_tree.pyx":1255 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1255 * * for j from 0 <= j < n_features: * centroid[j] = 0 # <<<<<<<<<<<<<< @@ -7314,7 +7323,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_compute_centroid(__pyx_t_7scikit (__pyx_v_centroid[__pyx_v_j]) = 0.0; } - /* "scikits/learn/ball_tree.pyx":1257 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1257 * centroid[j] = 0 * * for i from 0 <= i < n_points: # <<<<<<<<<<<<<< @@ -7324,7 +7333,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_compute_centroid(__pyx_t_7scikit __pyx_t_1 = __pyx_v_n_points; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { - /* "scikits/learn/ball_tree.pyx":1258 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1258 * * for i from 0 <= i < n_points: * this_pt = data + n_features * node_indices[i] # <<<<<<<<<<<<<< @@ -7333,7 +7342,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_compute_centroid(__pyx_t_7scikit */ __pyx_v_this_pt = (__pyx_v_data + (__pyx_v_n_features * (__pyx_v_node_indices[__pyx_v_i]))); - /* "scikits/learn/ball_tree.pyx":1259 + /* "/home/fabian/dev/scikit-learn/sklearn/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: # <<<<<<<<<<<<<< @@ -7343,19 +7352,18 @@ static void __pyx_f_7scikits_5learn_9ball_tree_compute_centroid(__pyx_t_7scikit __pyx_t_2 = __pyx_v_n_features; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_2; __pyx_v_j++) { - /* "scikits/learn/ball_tree.pyx":1260 + /* "/home/fabian/dev/scikit-learn/sklearn/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_t_3 = __pyx_v_j; - (__pyx_v_centroid[__pyx_t_3]) = ((__pyx_v_centroid[__pyx_t_3]) + (__pyx_v_this_pt[__pyx_v_j])); + (__pyx_v_centroid[__pyx_v_j]) += (__pyx_v_this_pt[__pyx_v_j]); } } - /* "scikits/learn/ball_tree.pyx":1262 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1262 * centroid[j] += this_pt[j] * * for j from 0 <= j < n_features: # <<<<<<<<<<<<<< @@ -7365,21 +7373,20 @@ static void __pyx_f_7scikits_5learn_9ball_tree_compute_centroid(__pyx_t_7scikit __pyx_t_1 = __pyx_v_n_features; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_1; __pyx_v_j++) { - /* "scikits/learn/ball_tree.pyx":1263 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1263 * * for j from 0 <= j < n_features: * centroid[j] /= 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_v_centroid[__pyx_v_j]) /= __pyx_v_n_points; } __Pyx_RefNannyFinishContext(); } -/* "scikits/learn/ball_tree.pyx":1266 +/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1266 * * * cdef ITYPE_t find_split_dim(DTYPE_t* data, # <<<<<<<<<<<<<< @@ -7387,22 +7394,22 @@ static void __pyx_f_7scikits_5learn_9ball_tree_compute_centroid(__pyx_t_7scikit * ITYPE_t n_features, */ -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; +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; int __pyx_t_3; __Pyx_RefNannySetupContext("find_split_dim"); - /* "scikits/learn/ball_tree.pyx":1275 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1275 * cdef ITYPE_t i, j, j_max * * j_max = 0 # <<<<<<<<<<<<<< @@ -7411,7 +7418,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball */ __pyx_v_j_max = 0; - /* "scikits/learn/ball_tree.pyx":1276 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1276 * * j_max = 0 * max_spread = 0 # <<<<<<<<<<<<<< @@ -7420,7 +7427,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball */ __pyx_v_max_spread = 0.0; - /* "scikits/learn/ball_tree.pyx":1278 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1278 * max_spread = 0 * * for j from 0 <= j < n_features: # <<<<<<<<<<<<<< @@ -7430,7 +7437,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball __pyx_t_1 = __pyx_v_n_features; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_1; __pyx_v_j++) { - /* "scikits/learn/ball_tree.pyx":1279 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1279 * * for j from 0 <= j < n_features: * max_val = data[node_indices[0] * n_features + j] # <<<<<<<<<<<<<< @@ -7439,7 +7446,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball */ __pyx_v_max_val = (__pyx_v_data[(((__pyx_v_node_indices[0]) * __pyx_v_n_features) + __pyx_v_j)]); - /* "scikits/learn/ball_tree.pyx":1280 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1280 * for j from 0 <= j < n_features: * max_val = data[node_indices[0] * n_features + j] * min_val = max_val # <<<<<<<<<<<<<< @@ -7448,7 +7455,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball */ __pyx_v_min_val = __pyx_v_max_val; - /* "scikits/learn/ball_tree.pyx":1281 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1281 * max_val = data[node_indices[0] * n_features + j] * min_val = max_val * for i from 1 <= i < n_points: # <<<<<<<<<<<<<< @@ -7458,7 +7465,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball __pyx_t_2 = __pyx_v_n_points; for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "scikits/learn/ball_tree.pyx":1282 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1282 * min_val = max_val * for i from 1 <= i < n_points: * val = data[node_indices[i] * n_features + j] # <<<<<<<<<<<<<< @@ -7467,26 +7474,26 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball */ __pyx_v_val = (__pyx_v_data[(((__pyx_v_node_indices[__pyx_v_i]) * __pyx_v_n_features) + __pyx_v_j)]); - /* "scikits/learn/ball_tree.pyx":1283 + /* "/home/fabian/dev/scikit-learn/sklearn/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_7scikits_5learn_9ball_tree_dmax(__pyx_v_max_val, __pyx_v_val); + __pyx_v_max_val = __pyx_f_7sklearn_9ball_tree_dmax(__pyx_v_max_val, __pyx_v_val); - /* "scikits/learn/ball_tree.pyx":1284 + /* "/home/fabian/dev/scikit-learn/sklearn/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_7scikits_5learn_9ball_tree_dmin(__pyx_v_min_val, __pyx_v_val); + __pyx_v_min_val = __pyx_f_7sklearn_9ball_tree_dmin(__pyx_v_min_val, __pyx_v_val); } - /* "scikits/learn/ball_tree.pyx":1285 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1285 * max_val = dmax(max_val, val) * min_val = dmin(min_val, val) * spread = max_val - min_val # <<<<<<<<<<<<<< @@ -7495,7 +7502,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball */ __pyx_v_spread = (__pyx_v_max_val - __pyx_v_min_val); - /* "scikits/learn/ball_tree.pyx":1286 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1286 * min_val = dmin(min_val, val) * spread = max_val - min_val * if spread > max_spread: # <<<<<<<<<<<<<< @@ -7505,7 +7512,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball __pyx_t_3 = (__pyx_v_spread > __pyx_v_max_spread); if (__pyx_t_3) { - /* "scikits/learn/ball_tree.pyx":1287 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1287 * spread = max_val - min_val * if spread > max_spread: * max_spread = spread # <<<<<<<<<<<<<< @@ -7514,7 +7521,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball */ __pyx_v_max_spread = __pyx_v_spread; - /* "scikits/learn/ball_tree.pyx":1288 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1288 * if spread > max_spread: * max_spread = spread * j_max = j # <<<<<<<<<<<<<< @@ -7527,7 +7534,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball __pyx_L7:; } - /* "scikits/learn/ball_tree.pyx":1289 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1289 * max_spread = spread * j_max = j * return j_max # <<<<<<<<<<<<<< @@ -7543,7 +7550,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball return __pyx_r; } -/* "scikits/learn/ball_tree.pyx":1293 +/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1293 * * @cython.profile(False) * cdef inline void iswap(ITYPE_t* arr, ITYPE_t i1, ITYPE_t i2): # <<<<<<<<<<<<<< @@ -7551,11 +7558,11 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball * arr[i1] = arr[i2] */ -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; +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; __Pyx_RefNannySetupContext("iswap"); - /* "scikits/learn/ball_tree.pyx":1294 + /* "/home/fabian/dev/scikit-learn/sklearn/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] # <<<<<<<<<<<<<< @@ -7564,7 +7571,7 @@ static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_iswap(__pyx_t_7scik */ __pyx_v_tmp = (__pyx_v_arr[__pyx_v_i1]); - /* "scikits/learn/ball_tree.pyx":1295 + /* "/home/fabian/dev/scikit-learn/sklearn/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] # <<<<<<<<<<<<<< @@ -7573,7 +7580,7 @@ static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_iswap(__pyx_t_7scik */ (__pyx_v_arr[__pyx_v_i1]) = (__pyx_v_arr[__pyx_v_i2]); - /* "scikits/learn/ball_tree.pyx":1296 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1296 * cdef ITYPE_t tmp = arr[i1] * arr[i1] = arr[i2] * arr[i2] = tmp # <<<<<<<<<<<<<< @@ -7585,7 +7592,7 @@ static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_iswap(__pyx_t_7scik __Pyx_RefNannyFinishContext(); } -/* "scikits/learn/ball_tree.pyx":1300 +/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1300 * * @cython.profile(False) * cdef inline void dswap(DTYPE_t* arr, ITYPE_t i1, ITYPE_t i2): # <<<<<<<<<<<<<< @@ -7593,11 +7600,11 @@ static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_iswap(__pyx_t_7scik * arr[i1] = arr[i2] */ -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; +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; __Pyx_RefNannySetupContext("dswap"); - /* "scikits/learn/ball_tree.pyx":1301 + /* "/home/fabian/dev/scikit-learn/sklearn/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] # <<<<<<<<<<<<<< @@ -7606,7 +7613,7 @@ static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_dswap(__pyx_t_7scik */ __pyx_v_tmp = (__pyx_v_arr[__pyx_v_i1]); - /* "scikits/learn/ball_tree.pyx":1302 + /* "/home/fabian/dev/scikit-learn/sklearn/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] # <<<<<<<<<<<<<< @@ -7615,7 +7622,7 @@ static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_dswap(__pyx_t_7scik */ (__pyx_v_arr[__pyx_v_i1]) = (__pyx_v_arr[__pyx_v_i2]); - /* "scikits/learn/ball_tree.pyx":1303 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1303 * cdef DTYPE_t tmp = arr[i1] * arr[i1] = arr[i2] * arr[i2] = tmp # <<<<<<<<<<<<<< @@ -7627,7 +7634,7 @@ static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_dswap(__pyx_t_7scik __Pyx_RefNannyFinishContext(); } -/* "scikits/learn/ball_tree.pyx":1306 +/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1306 * * * cdef void partition_indices(DTYPE_t* data, # <<<<<<<<<<<<<< @@ -7635,18 +7642,18 @@ static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_dswap(__pyx_t_7scik * ITYPE_t split_dim, */ -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; +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; int __pyx_t_2; __Pyx_RefNannySetupContext("partition_indices"); - /* "scikits/learn/ball_tree.pyx":1322 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1322 * cdef ITYPE_t left, right, midindex, i * cdef DTYPE_t d1, d2 * left = 0 # <<<<<<<<<<<<<< @@ -7655,7 +7662,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_partition_indices(__pyx_t_7sciki */ __pyx_v_left = 0; - /* "scikits/learn/ball_tree.pyx":1323 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1323 * cdef DTYPE_t d1, d2 * left = 0 * right = n_points - 1 # <<<<<<<<<<<<<< @@ -7664,7 +7671,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_partition_indices(__pyx_t_7sciki */ __pyx_v_right = (__pyx_v_n_points - 1); - /* "scikits/learn/ball_tree.pyx":1325 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1325 * right = n_points - 1 * * while True: # <<<<<<<<<<<<<< @@ -7674,7 +7681,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_partition_indices(__pyx_t_7sciki while (1) { if (!1) break; - /* "scikits/learn/ball_tree.pyx":1326 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1326 * * while True: * midindex = left # <<<<<<<<<<<<<< @@ -7683,7 +7690,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_partition_indices(__pyx_t_7sciki */ __pyx_v_midindex = __pyx_v_left; - /* "scikits/learn/ball_tree.pyx":1327 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1327 * while True: * midindex = left * for i from left <= i < right: # <<<<<<<<<<<<<< @@ -7693,7 +7700,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_partition_indices(__pyx_t_7sciki __pyx_t_1 = __pyx_v_right; for (__pyx_v_i = __pyx_v_left; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { - /* "scikits/learn/ball_tree.pyx":1328 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1328 * midindex = left * for i from left <= i < right: * d1 = data[node_indices[i] * n_features + split_dim] # <<<<<<<<<<<<<< @@ -7702,7 +7709,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_partition_indices(__pyx_t_7sciki */ __pyx_v_d1 = (__pyx_v_data[(((__pyx_v_node_indices[__pyx_v_i]) * __pyx_v_n_features) + __pyx_v_split_dim)]); - /* "scikits/learn/ball_tree.pyx":1329 + /* "/home/fabian/dev/scikit-learn/sklearn/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] # <<<<<<<<<<<<<< @@ -7711,7 +7718,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_partition_indices(__pyx_t_7sciki */ __pyx_v_d2 = (__pyx_v_data[(((__pyx_v_node_indices[__pyx_v_right]) * __pyx_v_n_features) + __pyx_v_split_dim)]); - /* "scikits/learn/ball_tree.pyx":1330 + /* "/home/fabian/dev/scikit-learn/sklearn/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: # <<<<<<<<<<<<<< @@ -7721,38 +7728,38 @@ static void __pyx_f_7scikits_5learn_9ball_tree_partition_indices(__pyx_t_7sciki __pyx_t_2 = (__pyx_v_d1 < __pyx_v_d2); if (__pyx_t_2) { - /* "scikits/learn/ball_tree.pyx":1331 + /* "/home/fabian/dev/scikit-learn/sklearn/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_7scikits_5learn_9ball_tree_iswap(__pyx_v_node_indices, __pyx_v_i, __pyx_v_midindex); + __pyx_f_7sklearn_9ball_tree_iswap(__pyx_v_node_indices, __pyx_v_i, __pyx_v_midindex); - /* "scikits/learn/ball_tree.pyx":1332 + /* "/home/fabian/dev/scikit-learn/sklearn/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 = (__pyx_v_midindex + 1); + __pyx_v_midindex += 1; goto __pyx_L7; } __pyx_L7:; } - /* "scikits/learn/ball_tree.pyx":1333 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1333 * iswap(node_indices, i, midindex) * midindex += 1 * iswap(node_indices, midindex, right) # <<<<<<<<<<<<<< * if midindex == split_index: * break */ - __pyx_f_7scikits_5learn_9ball_tree_iswap(__pyx_v_node_indices, __pyx_v_midindex, __pyx_v_right); + __pyx_f_7sklearn_9ball_tree_iswap(__pyx_v_node_indices, __pyx_v_midindex, __pyx_v_right); - /* "scikits/learn/ball_tree.pyx":1334 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1334 * midindex += 1 * iswap(node_indices, midindex, right) * if midindex == split_index: # <<<<<<<<<<<<<< @@ -7762,7 +7769,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_partition_indices(__pyx_t_7sciki __pyx_t_2 = (__pyx_v_midindex == __pyx_v_split_index); if (__pyx_t_2) { - /* "scikits/learn/ball_tree.pyx":1335 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1335 * iswap(node_indices, midindex, right) * if midindex == split_index: * break # <<<<<<<<<<<<<< @@ -7773,7 +7780,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_partition_indices(__pyx_t_7sciki goto __pyx_L8; } - /* "scikits/learn/ball_tree.pyx":1336 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1336 * if midindex == split_index: * break * elif midindex < split_index: # <<<<<<<<<<<<<< @@ -7783,7 +7790,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_partition_indices(__pyx_t_7sciki __pyx_t_2 = (__pyx_v_midindex < __pyx_v_split_index); if (__pyx_t_2) { - /* "scikits/learn/ball_tree.pyx":1337 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1337 * break * elif midindex < split_index: * left = midindex + 1 # <<<<<<<<<<<<<< @@ -7795,7 +7802,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_partition_indices(__pyx_t_7sciki } /*else*/ { - /* "scikits/learn/ball_tree.pyx":1339 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1339 * left = midindex + 1 * else: * right = midindex - 1 # <<<<<<<<<<<<<< @@ -7811,7 +7818,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_partition_indices(__pyx_t_7sciki __Pyx_RefNannyFinishContext(); } -/* "scikits/learn/ball_tree.pyx":1347 +/* "/home/fabian/dev/scikit-learn/sklearn/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, # <<<<<<<<<<<<<< @@ -7819,18 +7826,18 @@ static void __pyx_f_7scikits_5learn_9ball_tree_partition_indices(__pyx_t_7sciki * DTYPE_t radius, */ -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; +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; __Pyx_RefNannySetupContext("calc_dist_LB"); - /* "scikits/learn/ball_tree.pyx":1353 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1353 * DTYPE_t p): * return dmax(0, (dist(pt, centroid, n_features, p) * - 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)); + __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)); goto __pyx_L0; __pyx_r = 0; @@ -7839,7 +7846,7 @@ static CYTHON_INLINE __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits return __pyx_r; } -/* "scikits/learn/ball_tree.pyx":1357 +/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1357 * * @cython.profile(False) * cdef inline DTYPE_t calc_dist_p_LB(DTYPE_t* pt, # <<<<<<<<<<<<<< @@ -7847,18 +7854,18 @@ static CYTHON_INLINE __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits * DTYPE_t radius, */ -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; +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; __Pyx_RefNannySetupContext("calc_dist_p_LB"); - /* "scikits/learn/ball_tree.pyx":1363 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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); + __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); goto __pyx_L0; __pyx_r = 0; @@ -7867,7 +7874,7 @@ static CYTHON_INLINE __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits return __pyx_r; } -/* "scikits/learn/ball_tree.pyx":1373 +/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1373 * # are represented by infinities. * @cython.profile(False) * cdef inline DTYPE_t pqueue_largest(DTYPE_t* queue, ITYPE_t queue_size): # <<<<<<<<<<<<<< @@ -7875,11 +7882,11 @@ static CYTHON_INLINE __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits * */ -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; +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; __Pyx_RefNannySetupContext("pqueue_largest"); - /* "scikits/learn/ball_tree.pyx":1374 + /* "/home/fabian/dev/scikit-learn/sklearn/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] # <<<<<<<<<<<<<< @@ -7895,7 +7902,7 @@ static CYTHON_INLINE __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits return __pyx_r; } -/* "scikits/learn/ball_tree.pyx":1377 +/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1377 * * * cdef inline void pqueue_insert(DTYPE_t val, ITYPE_t i_val, # <<<<<<<<<<<<<< @@ -7903,16 +7910,16 @@ static CYTHON_INLINE __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits * ITYPE_t queue_size): */ -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; +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; int __pyx_t_1; - __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_t_2; + __pyx_t_7sklearn_9ball_tree_ITYPE_t __pyx_t_2; __Pyx_RefNannySetupContext("pqueue_insert"); - /* "scikits/learn/ball_tree.pyx":1380 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1380 * DTYPE_t* queue, ITYPE_t* idx_array, * ITYPE_t queue_size): * cdef ITYPE_t i_lower = 0 # <<<<<<<<<<<<<< @@ -7921,7 +7928,7 @@ static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_pqueue_insert(__pyx */ __pyx_v_i_lower = 0; - /* "scikits/learn/ball_tree.pyx":1381 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1381 * ITYPE_t queue_size): * cdef ITYPE_t i_lower = 0 * cdef ITYPE_t i_upper = queue_size - 1 # <<<<<<<<<<<<<< @@ -7930,7 +7937,7 @@ static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_pqueue_insert(__pyx */ __pyx_v_i_upper = (__pyx_v_queue_size - 1); - /* "scikits/learn/ball_tree.pyx":1385 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1385 * cdef ITYPE_t i * * if val >= queue[i_upper]: # <<<<<<<<<<<<<< @@ -7940,7 +7947,7 @@ static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_pqueue_insert(__pyx __pyx_t_1 = (__pyx_v_val >= (__pyx_v_queue[__pyx_v_i_upper])); if (__pyx_t_1) { - /* "scikits/learn/ball_tree.pyx":1386 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1386 * * if val >= queue[i_upper]: * return # <<<<<<<<<<<<<< @@ -7951,7 +7958,7 @@ static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_pqueue_insert(__pyx goto __pyx_L3; } - /* "scikits/learn/ball_tree.pyx":1387 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1387 * if val >= queue[i_upper]: * return * elif val <= queue[i_lower]: # <<<<<<<<<<<<<< @@ -7961,7 +7968,7 @@ static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_pqueue_insert(__pyx __pyx_t_1 = (__pyx_v_val <= (__pyx_v_queue[__pyx_v_i_lower])); if (__pyx_t_1) { - /* "scikits/learn/ball_tree.pyx":1388 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1388 * return * elif val <= queue[i_lower]: * i_mid = i_lower # <<<<<<<<<<<<<< @@ -7973,7 +7980,7 @@ static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_pqueue_insert(__pyx } /*else*/ { - /* "scikits/learn/ball_tree.pyx":1390 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1390 * i_mid = i_lower * else: * while True: # <<<<<<<<<<<<<< @@ -7983,7 +7990,7 @@ static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_pqueue_insert(__pyx while (1) { if (!1) break; - /* "scikits/learn/ball_tree.pyx":1391 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1391 * else: * while True: * if (i_upper - i_lower) < 2: # <<<<<<<<<<<<<< @@ -7993,7 +8000,7 @@ static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_pqueue_insert(__pyx __pyx_t_1 = ((__pyx_v_i_upper - __pyx_v_i_lower) < 2); if (__pyx_t_1) { - /* "scikits/learn/ball_tree.pyx":1392 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1392 * while True: * if (i_upper - i_lower) < 2: * i_mid = i_lower + 1 # <<<<<<<<<<<<<< @@ -8002,7 +8009,7 @@ static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_pqueue_insert(__pyx */ __pyx_v_i_mid = (__pyx_v_i_lower + 1); - /* "scikits/learn/ball_tree.pyx":1393 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1393 * if (i_upper - i_lower) < 2: * i_mid = i_lower + 1 * break # <<<<<<<<<<<<<< @@ -8014,7 +8021,7 @@ static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_pqueue_insert(__pyx } /*else*/ { - /* "scikits/learn/ball_tree.pyx":1395 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1395 * break * else: * i_mid = (i_lower + i_upper) / 2 # <<<<<<<<<<<<<< @@ -8025,7 +8032,7 @@ static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_pqueue_insert(__pyx } __pyx_L6:; - /* "scikits/learn/ball_tree.pyx":1397 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1397 * i_mid = (i_lower + i_upper) / 2 * * if i_mid == i_lower: # <<<<<<<<<<<<<< @@ -8035,16 +8042,16 @@ static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_pqueue_insert(__pyx __pyx_t_1 = (__pyx_v_i_mid == __pyx_v_i_lower); if (__pyx_t_1) { - /* "scikits/learn/ball_tree.pyx":1398 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1398 * * if i_mid == i_lower: * i_mid += 1 # <<<<<<<<<<<<<< * break * */ - __pyx_v_i_mid = (__pyx_v_i_mid + 1); + __pyx_v_i_mid += 1; - /* "scikits/learn/ball_tree.pyx":1399 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1399 * if i_mid == i_lower: * i_mid += 1 * break # <<<<<<<<<<<<<< @@ -8056,7 +8063,7 @@ static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_pqueue_insert(__pyx } __pyx_L7:; - /* "scikits/learn/ball_tree.pyx":1401 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1401 * break * * if val >= queue[i_mid]: # <<<<<<<<<<<<<< @@ -8066,7 +8073,7 @@ static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_pqueue_insert(__pyx __pyx_t_1 = (__pyx_v_val >= (__pyx_v_queue[__pyx_v_i_mid])); if (__pyx_t_1) { - /* "scikits/learn/ball_tree.pyx":1402 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1402 * * if val >= queue[i_mid]: * i_lower = i_mid # <<<<<<<<<<<<<< @@ -8078,7 +8085,7 @@ static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_pqueue_insert(__pyx } /*else*/ { - /* "scikits/learn/ball_tree.pyx":1404 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1404 * i_lower = i_mid * else: * i_upper = i_mid # <<<<<<<<<<<<<< @@ -8093,7 +8100,7 @@ static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_pqueue_insert(__pyx } __pyx_L3:; - /* "scikits/learn/ball_tree.pyx":1406 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1406 * i_upper = i_mid * * for i from queue_size > i > i_mid: # <<<<<<<<<<<<<< @@ -8103,7 +8110,7 @@ static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_pqueue_insert(__pyx __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--) { - /* "scikits/learn/ball_tree.pyx":1407 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1407 * * for i from queue_size > i > i_mid: * queue[i] = queue[i - 1] # <<<<<<<<<<<<<< @@ -8112,7 +8119,7 @@ static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_pqueue_insert(__pyx */ (__pyx_v_queue[__pyx_v_i]) = (__pyx_v_queue[(__pyx_v_i - 1)]); - /* "scikits/learn/ball_tree.pyx":1408 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1408 * for i from queue_size > i > i_mid: * queue[i] = queue[i - 1] * idx_array[i] = idx_array[i - 1] # <<<<<<<<<<<<<< @@ -8122,7 +8129,7 @@ static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_pqueue_insert(__pyx (__pyx_v_idx_array[__pyx_v_i]) = (__pyx_v_idx_array[(__pyx_v_i - 1)]); } - /* "scikits/learn/ball_tree.pyx":1410 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1410 * idx_array[i] = idx_array[i - 1] * * queue[i_mid] = val # <<<<<<<<<<<<<< @@ -8131,7 +8138,7 @@ static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_pqueue_insert(__pyx */ (__pyx_v_queue[__pyx_v_i_mid]) = __pyx_v_val; - /* "scikits/learn/ball_tree.pyx":1411 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1411 * * queue[i_mid] = val * idx_array[i_mid] = i_val # <<<<<<<<<<<<<< @@ -8144,7 +8151,7 @@ static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_pqueue_insert(__pyx __Pyx_RefNannyFinishContext(); } -/* "scikits/learn/ball_tree.pyx":1437 +/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1437 * # `sort_dist_idx()` * @cython.profile(False) * cdef inline DTYPE_t max_heap_largest(DTYPE_t* heap, ITYPE_t k): # <<<<<<<<<<<<<< @@ -8152,11 +8159,11 @@ static CYTHON_INLINE void __pyx_f_7scikits_5learn_9ball_tree_pqueue_insert(__pyx * */ -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; +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; __Pyx_RefNannySetupContext("max_heap_largest"); - /* "scikits/learn/ball_tree.pyx":1438 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1438 * @cython.profile(False) * cdef inline DTYPE_t max_heap_largest(DTYPE_t* heap, ITYPE_t k): * return heap[0] # <<<<<<<<<<<<<< @@ -8172,7 +8179,7 @@ static CYTHON_INLINE __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits return __pyx_r; } -/* "scikits/learn/ball_tree.pyx":1441 +/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1441 * * * cdef void max_heap_insert(DTYPE_t val, ITYPE_t i_val, # <<<<<<<<<<<<<< @@ -8180,15 +8187,15 @@ static CYTHON_INLINE __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_f_7scikits * ITYPE_t* idx_array, */ -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; +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; int __pyx_t_1; __Pyx_RefNannySetupContext("max_heap_insert"); - /* "scikits/learn/ball_tree.pyx":1449 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1449 * * # check if val should be in heap * if val > heap[0]: # <<<<<<<<<<<<<< @@ -8198,7 +8205,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_max_heap_insert(__pyx_t_7scikits __pyx_t_1 = (__pyx_v_val > (__pyx_v_heap[0])); if (__pyx_t_1) { - /* "scikits/learn/ball_tree.pyx":1450 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1450 * # check if val should be in heap * if val > heap[0]: * return # <<<<<<<<<<<<<< @@ -8210,7 +8217,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_max_heap_insert(__pyx_t_7scikits } __pyx_L3:; - /* "scikits/learn/ball_tree.pyx":1453 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1453 * * # insert val at position zero * heap[0] = val # <<<<<<<<<<<<<< @@ -8219,7 +8226,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_max_heap_insert(__pyx_t_7scikits */ (__pyx_v_heap[0]) = __pyx_v_val; - /* "scikits/learn/ball_tree.pyx":1454 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1454 * # insert val at position zero * heap[0] = val * idx_array[0] = i_val # <<<<<<<<<<<<<< @@ -8228,7 +8235,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_max_heap_insert(__pyx_t_7scikits */ (__pyx_v_idx_array[0]) = __pyx_v_i_val; - /* "scikits/learn/ball_tree.pyx":1457 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1457 * * #descend the heap, swapping values until the max heap criterion is met * i = 0 # <<<<<<<<<<<<<< @@ -8237,7 +8244,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_max_heap_insert(__pyx_t_7scikits */ __pyx_v_i = 0; - /* "scikits/learn/ball_tree.pyx":1458 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1458 * #descend the heap, swapping values until the max heap criterion is met * i = 0 * while 1: # <<<<<<<<<<<<<< @@ -8247,7 +8254,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_max_heap_insert(__pyx_t_7scikits while (1) { if (!1) break; - /* "scikits/learn/ball_tree.pyx":1459 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1459 * i = 0 * while 1: * ic1 = 2 * i + 1 # <<<<<<<<<<<<<< @@ -8256,7 +8263,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_max_heap_insert(__pyx_t_7scikits */ __pyx_v_ic1 = ((2 * __pyx_v_i) + 1); - /* "scikits/learn/ball_tree.pyx":1460 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1460 * while 1: * ic1 = 2 * i + 1 * ic2 = ic1 + 1 # <<<<<<<<<<<<<< @@ -8265,7 +8272,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_max_heap_insert(__pyx_t_7scikits */ __pyx_v_ic2 = (__pyx_v_ic1 + 1); - /* "scikits/learn/ball_tree.pyx":1462 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1462 * ic2 = ic1 + 1 * * if ic1 >= heap_size: # <<<<<<<<<<<<<< @@ -8275,7 +8282,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_max_heap_insert(__pyx_t_7scikits __pyx_t_1 = (__pyx_v_ic1 >= __pyx_v_heap_size); if (__pyx_t_1) { - /* "scikits/learn/ball_tree.pyx":1463 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1463 * * if ic1 >= heap_size: * break # <<<<<<<<<<<<<< @@ -8286,7 +8293,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_max_heap_insert(__pyx_t_7scikits goto __pyx_L6; } - /* "scikits/learn/ball_tree.pyx":1464 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1464 * if ic1 >= heap_size: * break * elif ic2 >= heap_size: # <<<<<<<<<<<<<< @@ -8296,7 +8303,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_max_heap_insert(__pyx_t_7scikits __pyx_t_1 = (__pyx_v_ic2 >= __pyx_v_heap_size); if (__pyx_t_1) { - /* "scikits/learn/ball_tree.pyx":1465 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1465 * break * elif ic2 >= heap_size: * if heap[ic1] > val: # <<<<<<<<<<<<<< @@ -8306,7 +8313,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_max_heap_insert(__pyx_t_7scikits __pyx_t_1 = ((__pyx_v_heap[__pyx_v_ic1]) > __pyx_v_val); if (__pyx_t_1) { - /* "scikits/learn/ball_tree.pyx":1466 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1466 * elif ic2 >= heap_size: * if heap[ic1] > val: * i_swap = ic1 # <<<<<<<<<<<<<< @@ -8318,7 +8325,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_max_heap_insert(__pyx_t_7scikits } /*else*/ { - /* "scikits/learn/ball_tree.pyx":1468 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1468 * i_swap = ic1 * else: * break # <<<<<<<<<<<<<< @@ -8331,7 +8338,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_max_heap_insert(__pyx_t_7scikits goto __pyx_L6; } - /* "scikits/learn/ball_tree.pyx":1469 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1469 * else: * break * elif heap[ic1] >= heap[ic2]: # <<<<<<<<<<<<<< @@ -8341,7 +8348,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_max_heap_insert(__pyx_t_7scikits __pyx_t_1 = ((__pyx_v_heap[__pyx_v_ic1]) >= (__pyx_v_heap[__pyx_v_ic2])); if (__pyx_t_1) { - /* "scikits/learn/ball_tree.pyx":1470 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1470 * break * elif heap[ic1] >= heap[ic2]: * if val < heap[ic1]: # <<<<<<<<<<<<<< @@ -8351,7 +8358,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_max_heap_insert(__pyx_t_7scikits __pyx_t_1 = (__pyx_v_val < (__pyx_v_heap[__pyx_v_ic1])); if (__pyx_t_1) { - /* "scikits/learn/ball_tree.pyx":1471 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1471 * elif heap[ic1] >= heap[ic2]: * if val < heap[ic1]: * i_swap = ic1 # <<<<<<<<<<<<<< @@ -8363,7 +8370,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_max_heap_insert(__pyx_t_7scikits } /*else*/ { - /* "scikits/learn/ball_tree.pyx":1473 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1473 * i_swap = ic1 * else: * break # <<<<<<<<<<<<<< @@ -8377,7 +8384,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_max_heap_insert(__pyx_t_7scikits } /*else*/ { - /* "scikits/learn/ball_tree.pyx":1475 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1475 * break * else: * if val < heap[ic2]: # <<<<<<<<<<<<<< @@ -8387,7 +8394,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_max_heap_insert(__pyx_t_7scikits __pyx_t_1 = (__pyx_v_val < (__pyx_v_heap[__pyx_v_ic2])); if (__pyx_t_1) { - /* "scikits/learn/ball_tree.pyx":1476 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1476 * else: * if val < heap[ic2]: * i_swap = ic2 # <<<<<<<<<<<<<< @@ -8399,7 +8406,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_max_heap_insert(__pyx_t_7scikits } /*else*/ { - /* "scikits/learn/ball_tree.pyx":1478 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1478 * i_swap = ic2 * else: * break # <<<<<<<<<<<<<< @@ -8412,7 +8419,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_max_heap_insert(__pyx_t_7scikits } __pyx_L6:; - /* "scikits/learn/ball_tree.pyx":1480 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1480 * break * * heap[i] = heap[i_swap] # <<<<<<<<<<<<<< @@ -8421,7 +8428,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_max_heap_insert(__pyx_t_7scikits */ (__pyx_v_heap[__pyx_v_i]) = (__pyx_v_heap[__pyx_v_i_swap]); - /* "scikits/learn/ball_tree.pyx":1481 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1481 * * heap[i] = heap[i_swap] * idx_array[i] = idx_array[i_swap] # <<<<<<<<<<<<<< @@ -8430,7 +8437,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_max_heap_insert(__pyx_t_7scikits */ (__pyx_v_idx_array[__pyx_v_i]) = (__pyx_v_idx_array[__pyx_v_i_swap]); - /* "scikits/learn/ball_tree.pyx":1483 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1483 * idx_array[i] = idx_array[i_swap] * * i = i_swap # <<<<<<<<<<<<<< @@ -8441,7 +8448,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_max_heap_insert(__pyx_t_7scikits } __pyx_L5_break:; - /* "scikits/learn/ball_tree.pyx":1485 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1485 * i = i_swap * * heap[i] = val # <<<<<<<<<<<<<< @@ -8450,7 +8457,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_max_heap_insert(__pyx_t_7scikits */ (__pyx_v_heap[__pyx_v_i]) = __pyx_v_val; - /* "scikits/learn/ball_tree.pyx":1486 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1486 * * heap[i] = val * idx_array[i] = i_val # <<<<<<<<<<<<<< @@ -8463,7 +8470,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_max_heap_insert(__pyx_t_7scikits __Pyx_RefNannyFinishContext(); } -/* "scikits/learn/ball_tree.pyx":1493 +/* "/home/fabian/dev/scikit-learn/sklearn/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): # <<<<<<<<<<<<<< @@ -8471,12 +8478,12 @@ static void __pyx_f_7scikits_5learn_9ball_tree_max_heap_insert(__pyx_t_7scikits * if k > 1: */ -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; +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; int __pyx_t_1; __Pyx_RefNannySetupContext("sort_dist_idx"); - /* "scikits/learn/ball_tree.pyx":1495 + /* "/home/fabian/dev/scikit-learn/sklearn/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: # <<<<<<<<<<<<<< @@ -8486,32 +8493,32 @@ static void __pyx_f_7scikits_5learn_9ball_tree_sort_dist_idx(__pyx_t_7scikits_5 __pyx_t_1 = (__pyx_v_k > 1); if (__pyx_t_1) { - /* "scikits/learn/ball_tree.pyx":1496 + /* "/home/fabian/dev/scikit-learn/sklearn/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_7scikits_5learn_9ball_tree_partition_dist_idx(__pyx_v_dist, __pyx_v_idx, __pyx_v_k); + __pyx_v_pivot_idx = __pyx_f_7sklearn_9ball_tree_partition_dist_idx(__pyx_v_dist, __pyx_v_idx, __pyx_v_k); - /* "scikits/learn/ball_tree.pyx":1498 + /* "/home/fabian/dev/scikit-learn/sklearn/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_7scikits_5learn_9ball_tree_sort_dist_idx(__pyx_v_dist, __pyx_v_idx, __pyx_v_pivot_idx); + __pyx_f_7sklearn_9ball_tree_sort_dist_idx(__pyx_v_dist, __pyx_v_idx, __pyx_v_pivot_idx); - /* "scikits/learn/ball_tree.pyx":1502 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1502 * sort_dist_idx(dist + pivot_idx + 1, * idx + pivot_idx + 1, * k - 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)); + __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)); goto __pyx_L3; } __pyx_L3:; @@ -8519,7 +8526,7 @@ static void __pyx_f_7scikits_5learn_9ball_tree_sort_dist_idx(__pyx_t_7scikits_5 __Pyx_RefNannyFinishContext(); } -/* "scikits/learn/ball_tree.pyx":1505 +/* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1505 * * * cdef ITYPE_t partition_dist_idx(DTYPE_t* dist, ITYPE_t* idx, ITYPE_t k): # <<<<<<<<<<<<<< @@ -8527,17 +8534,17 @@ static void __pyx_f_7scikits_5learn_9ball_tree_sort_dist_idx(__pyx_t_7scikits_5 * cdef DTYPE_t pivot_val = dist[pivot_idx] */ -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; +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; long __pyx_t_1; int __pyx_t_2; __Pyx_RefNannySetupContext("partition_dist_idx"); - /* "scikits/learn/ball_tree.pyx":1506 + /* "/home/fabian/dev/scikit-learn/sklearn/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 # <<<<<<<<<<<<<< @@ -8546,7 +8553,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball */ __pyx_v_pivot_idx = __Pyx_div_long(__pyx_v_k, 2); - /* "scikits/learn/ball_tree.pyx":1507 + /* "/home/fabian/dev/scikit-learn/sklearn/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] # <<<<<<<<<<<<<< @@ -8555,7 +8562,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball */ __pyx_v_pivot_val = (__pyx_v_dist[__pyx_v_pivot_idx]); - /* "scikits/learn/ball_tree.pyx":1508 + /* "/home/fabian/dev/scikit-learn/sklearn/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 # <<<<<<<<<<<<<< @@ -8564,25 +8571,25 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball */ __pyx_v_store_idx = 0; - /* "scikits/learn/ball_tree.pyx":1511 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1511 * cdef ITYPE_t i * * dswap(dist, pivot_idx, k - 1) # <<<<<<<<<<<<<< * iswap(idx, pivot_idx, k - 1) * */ - __pyx_f_7scikits_5learn_9ball_tree_dswap(__pyx_v_dist, __pyx_v_pivot_idx, (__pyx_v_k - 1)); + __pyx_f_7sklearn_9ball_tree_dswap(__pyx_v_dist, __pyx_v_pivot_idx, (__pyx_v_k - 1)); - /* "scikits/learn/ball_tree.pyx":1512 + /* "/home/fabian/dev/scikit-learn/sklearn/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_7scikits_5learn_9ball_tree_iswap(__pyx_v_idx, __pyx_v_pivot_idx, (__pyx_v_k - 1)); + __pyx_f_7sklearn_9ball_tree_iswap(__pyx_v_idx, __pyx_v_pivot_idx, (__pyx_v_k - 1)); - /* "scikits/learn/ball_tree.pyx":1514 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1514 * iswap(idx, pivot_idx, k - 1) * * for i from 0 <= i < k - 1: # <<<<<<<<<<<<<< @@ -8592,7 +8599,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball __pyx_t_1 = (__pyx_v_k - 1); for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { - /* "scikits/learn/ball_tree.pyx":1515 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1515 * * for i from 0 <= i < k - 1: * if dist[i] < pivot_val: # <<<<<<<<<<<<<< @@ -8602,55 +8609,55 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball __pyx_t_2 = ((__pyx_v_dist[__pyx_v_i]) < __pyx_v_pivot_val); if (__pyx_t_2) { - /* "scikits/learn/ball_tree.pyx":1516 + /* "/home/fabian/dev/scikit-learn/sklearn/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_7scikits_5learn_9ball_tree_dswap(__pyx_v_dist, __pyx_v_i, __pyx_v_store_idx); + __pyx_f_7sklearn_9ball_tree_dswap(__pyx_v_dist, __pyx_v_i, __pyx_v_store_idx); - /* "scikits/learn/ball_tree.pyx":1517 + /* "/home/fabian/dev/scikit-learn/sklearn/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_7scikits_5learn_9ball_tree_iswap(__pyx_v_idx, __pyx_v_i, __pyx_v_store_idx); + __pyx_f_7sklearn_9ball_tree_iswap(__pyx_v_idx, __pyx_v_i, __pyx_v_store_idx); - /* "scikits/learn/ball_tree.pyx":1518 + /* "/home/fabian/dev/scikit-learn/sklearn/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 = (__pyx_v_store_idx + 1); + __pyx_v_store_idx += 1; goto __pyx_L5; } __pyx_L5:; } - /* "scikits/learn/ball_tree.pyx":1519 + /* "/home/fabian/dev/scikit-learn/sklearn/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_7scikits_5learn_9ball_tree_dswap(__pyx_v_dist, __pyx_v_store_idx, (__pyx_v_k - 1)); + __pyx_f_7sklearn_9ball_tree_dswap(__pyx_v_dist, __pyx_v_store_idx, (__pyx_v_k - 1)); - /* "scikits/learn/ball_tree.pyx":1520 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1520 * store_idx += 1 * dswap(dist, store_idx, k - 1) * iswap(idx, store_idx, k - 1) # <<<<<<<<<<<<<< * return store_idx */ - __pyx_f_7scikits_5learn_9ball_tree_iswap(__pyx_v_idx, __pyx_v_store_idx, (__pyx_v_k - 1)); + __pyx_f_7sklearn_9ball_tree_iswap(__pyx_v_idx, __pyx_v_store_idx, (__pyx_v_k - 1)); - /* "scikits/learn/ball_tree.pyx":1521 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":1521 * dswap(dist, store_idx, k - 1) * iswap(idx, store_idx, k - 1) * return store_idx # <<<<<<<<<<<<<< @@ -8664,7 +8671,7 @@ static __pyx_t_7scikits_5learn_9ball_tree_ITYPE_t __pyx_f_7scikits_5learn_9ball return __pyx_r; } -/* "numpy.pxd":188 +/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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): # <<<<<<<<<<<<<< @@ -8685,21 +8692,21 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ int __pyx_v_offset; int __pyx_v_hasfields; int __pyx_r; - PyObject *__pyx_t_1 = NULL; + int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_t_7; - PyObject *__pyx_t_8 = NULL; + int __pyx_t_8; 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); - /* "numpy.pxd":194 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":194 * # of flags * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -8708,7 +8715,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_endian_detector = 1; - /* "numpy.pxd":195 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":195 * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -8717,29 +8724,26 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "numpy.pxd":197 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":197 * cdef bint little_endian = ((&endian_detector)[0] != 0) * * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< * * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - __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; + __pyx_v_ndim = PyArray_NDIM(((PyArrayObject *)__pyx_v_self)); - /* "numpy.pxd":199 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":199 * ndim = PyArray_NDIM(self) * * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< * copy_shape = 1 * else: */ - __pyx_t_2 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); - if (__pyx_t_2) { + __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); + if (__pyx_t_1) { - /* "numpy.pxd":200 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":200 * * if sizeof(npy_intp) != sizeof(Py_ssize_t): * copy_shape = 1 # <<<<<<<<<<<<<< @@ -8751,7 +8755,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } /*else*/ { - /* "numpy.pxd":202 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":202 * copy_shape = 1 * else: * copy_shape = 0 # <<<<<<<<<<<<<< @@ -8762,105 +8766,108 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } __pyx_L5:; - /* "numpy.pxd":204 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_2 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS); - if (__pyx_t_2) { + __pyx_t_1 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS); + if (__pyx_t_1) { - /* "numpy.pxd":205 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/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") * */ - __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; + __pyx_t_2 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_v_self), NPY_C_CONTIGUOUS)); + __pyx_t_3 = __pyx_t_2; } else { - __pyx_t_4 = __pyx_t_2; + __pyx_t_3 = __pyx_t_1; } - if (__pyx_t_4) { + if (__pyx_t_3) { - /* "numpy.pxd":206 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_filename = __pyx_f[1]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; - /* "numpy.pxd":208 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_4 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS); - if (__pyx_t_4) { + __pyx_t_3 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS); + if (__pyx_t_3) { - /* "numpy.pxd":209 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/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") * */ - __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; + __pyx_t_1 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_v_self), NPY_F_CONTIGUOUS)); + __pyx_t_2 = __pyx_t_1; } else { - __pyx_t_3 = __pyx_t_4; + __pyx_t_2 = __pyx_t_3; } - if (__pyx_t_3) { + if (__pyx_t_2) { - /* "numpy.pxd":210 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_filename = __pyx_f[1]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L7; } __pyx_L7:; - /* "numpy.pxd":212 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":212 * raise ValueError(u"ndarray is not Fortran contiguous") * * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< * info.ndim = ndim * if copy_shape: */ - __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; + __pyx_v_info->buf = PyArray_DATA(((PyArrayObject *)__pyx_v_self)); - /* "numpy.pxd":213 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":213 * * info.buf = PyArray_DATA(self) * info.ndim = ndim # <<<<<<<<<<<<<< @@ -8869,7 +8876,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->ndim = __pyx_v_ndim; - /* "numpy.pxd":214 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":214 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if copy_shape: # <<<<<<<<<<<<<< @@ -8878,7 +8885,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ if (__pyx_v_copy_shape) { - /* "numpy.pxd":217 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":217 * # Allocate new buffer for strides and shape info. This is allocated * # as one block, strides first. * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< @@ -8887,7 +8894,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))); - /* "numpy.pxd":218 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":218 * # as one block, strides first. * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) * info.shape = info.strides + ndim # <<<<<<<<<<<<<< @@ -8896,72 +8903,60 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "numpy.pxd":219 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":219 * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) * info.shape = info.strides + ndim * for i in range(ndim): # <<<<<<<<<<<<<< * info.strides[i] = PyArray_STRIDES(self)[i] * info.shape[i] = PyArray_DIMS(self)[i] */ - __pyx_t_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; + __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; - /* "numpy.pxd":220 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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; + (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]); - /* "numpy.pxd":221 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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 = PyArray_STRIDES(self) */ - __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; + (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]); } goto __pyx_L8; } /*else*/ { - /* "numpy.pxd":223 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":223 * info.shape[i] = PyArray_DIMS(self)[i] * else: * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL */ - __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; + __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(((PyArrayObject *)__pyx_v_self))); - /* "numpy.pxd":224 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":224 * else: * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(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_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(((PyArrayObject *)__pyx_v_self))); } __pyx_L8:; - /* "numpy.pxd":225 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":225 * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -8970,31 +8965,25 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->suboffsets = NULL; - /* "numpy.pxd":226 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":226 * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< * info.readonly = not PyArray_ISWRITEABLE(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; + __pyx_v_info->itemsize = PyArray_ITEMSIZE(((PyArrayObject *)__pyx_v_self)); - /* "numpy.pxd":227 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":227 * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< * * cdef int t */ - __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; + __pyx_v_info->readonly = (!PyArray_ISWRITEABLE(((PyArrayObject *)__pyx_v_self))); - /* "numpy.pxd":230 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":230 * * cdef int t * cdef char* f = NULL # <<<<<<<<<<<<<< @@ -9003,7 +8992,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_f = NULL; - /* "numpy.pxd":231 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":231 * cdef int t * cdef char* f = NULL * cdef dtype descr = self.descr # <<<<<<<<<<<<<< @@ -9013,7 +9002,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; - /* "numpy.pxd":235 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":235 * cdef int offset * * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< @@ -9022,23 +9011,23 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - /* "numpy.pxd":237 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_3 = (!__pyx_v_hasfields); - if (__pyx_t_3) { - __pyx_t_4 = (!__pyx_v_copy_shape); - __pyx_t_2 = __pyx_t_4; + __pyx_t_2 = (!__pyx_v_hasfields); + if (__pyx_t_2) { + __pyx_t_3 = (!__pyx_v_copy_shape); + __pyx_t_1 = __pyx_t_3; } else { - __pyx_t_2 = __pyx_t_3; + __pyx_t_1 = __pyx_t_2; } - if (__pyx_t_2) { + if (__pyx_t_1) { - /* "numpy.pxd":239 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":239 * if not hasfields and not copy_shape: * # do not call releasebuffer * info.obj = None # <<<<<<<<<<<<<< @@ -9054,7 +9043,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } /*else*/ { - /* "numpy.pxd":242 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":242 * else: * # need to call releasebuffer * info.obj = self # <<<<<<<<<<<<<< @@ -9069,17 +9058,17 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } __pyx_L11:; - /* "numpy.pxd":244 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":244 * info.obj = self * * if not hasfields: # <<<<<<<<<<<<<< * t = descr.type_num * if ((descr.byteorder == '>' and little_endian) or */ - __pyx_t_2 = (!__pyx_v_hasfields); - if (__pyx_t_2) { + __pyx_t_1 = (!__pyx_v_hasfields); + if (__pyx_t_1) { - /* "numpy.pxd":245 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":245 * * if not hasfields: * t = descr.type_num # <<<<<<<<<<<<<< @@ -9088,306 +9077,312 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_t = __pyx_v_descr->type_num; - /* "numpy.pxd":246 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_2 = (__pyx_v_descr->byteorder == '>'); - if (__pyx_t_2) { - __pyx_t_3 = __pyx_v_little_endian; + __pyx_t_1 = (__pyx_v_descr->byteorder == '>'); + if (__pyx_t_1) { + __pyx_t_2 = __pyx_v_little_endian; } else { - __pyx_t_3 = __pyx_t_2; + __pyx_t_2 = __pyx_t_1; } - if (!__pyx_t_3) { + if (!__pyx_t_2) { - /* "numpy.pxd":247 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_2 = (__pyx_v_descr->byteorder == '<'); - if (__pyx_t_2) { - __pyx_t_4 = (!__pyx_v_little_endian); - __pyx_t_7 = __pyx_t_4; + __pyx_t_1 = (__pyx_v_descr->byteorder == '<'); + if (__pyx_t_1) { + __pyx_t_3 = (!__pyx_v_little_endian); + __pyx_t_8 = __pyx_t_3; } else { - __pyx_t_7 = __pyx_t_2; + __pyx_t_8 = __pyx_t_1; } - __pyx_t_2 = __pyx_t_7; + __pyx_t_1 = __pyx_t_8; } else { - __pyx_t_2 = __pyx_t_3; + __pyx_t_1 = __pyx_t_2; } - if (__pyx_t_2) { + if (__pyx_t_1) { - /* "numpy.pxd":248 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_filename = __pyx_f[1]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L13; } __pyx_L13:; - /* "numpy.pxd":249 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_2 = (__pyx_v_t == NPY_BYTE); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_BYTE); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__b; goto __pyx_L14; } - /* "numpy.pxd":250 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_2 = (__pyx_v_t == NPY_UBYTE); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_UBYTE); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__B; goto __pyx_L14; } - /* "numpy.pxd":251 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_2 = (__pyx_v_t == NPY_SHORT); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_SHORT); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__h; goto __pyx_L14; } - /* "numpy.pxd":252 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_2 = (__pyx_v_t == NPY_USHORT); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_USHORT); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__H; goto __pyx_L14; } - /* "numpy.pxd":253 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_2 = (__pyx_v_t == NPY_INT); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_INT); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__i; goto __pyx_L14; } - /* "numpy.pxd":254 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_2 = (__pyx_v_t == NPY_UINT); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_UINT); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__I; goto __pyx_L14; } - /* "numpy.pxd":255 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_2 = (__pyx_v_t == NPY_LONG); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_LONG); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__l; goto __pyx_L14; } - /* "numpy.pxd":256 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_2 = (__pyx_v_t == NPY_ULONG); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_ULONG); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__L; goto __pyx_L14; } - /* "numpy.pxd":257 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_2 = (__pyx_v_t == NPY_LONGLONG); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_LONGLONG); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__q; goto __pyx_L14; } - /* "numpy.pxd":258 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_2 = (__pyx_v_t == NPY_ULONGLONG); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_ULONGLONG); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__Q; goto __pyx_L14; } - /* "numpy.pxd":259 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_2 = (__pyx_v_t == NPY_FLOAT); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_FLOAT); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__f; goto __pyx_L14; } - /* "numpy.pxd":260 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_2 = (__pyx_v_t == NPY_DOUBLE); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_DOUBLE); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__d; goto __pyx_L14; } - /* "numpy.pxd":261 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_2 = (__pyx_v_t == NPY_LONGDOUBLE); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_LONGDOUBLE); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__g; goto __pyx_L14; } - /* "numpy.pxd":262 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_2 = (__pyx_v_t == NPY_CFLOAT); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_CFLOAT); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__Zf; goto __pyx_L14; } - /* "numpy.pxd":263 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_2 = (__pyx_v_t == NPY_CDOUBLE); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_CDOUBLE); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__Zd; goto __pyx_L14; } - /* "numpy.pxd":264 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_2 = (__pyx_v_t == NPY_CLONGDOUBLE); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_CLONGDOUBLE); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__Zg; goto __pyx_L14; } - /* "numpy.pxd":265 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_2 = (__pyx_v_t == NPY_OBJECT); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_OBJECT); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__O; goto __pyx_L14; } /*else*/ { - /* "numpy.pxd":267 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L14:; - /* "numpy.pxd":268 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":268 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f # <<<<<<<<<<<<<< @@ -9396,7 +9391,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->format = __pyx_v_f; - /* "numpy.pxd":269 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":269 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f * return # <<<<<<<<<<<<<< @@ -9409,7 +9404,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } /*else*/ { - /* "numpy.pxd":271 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":271 * return * else: * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< @@ -9418,7 +9413,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->format = ((char *)malloc(255)); - /* "numpy.pxd":272 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":272 * else: * info.format = stdlib.malloc(_buffer_format_string_len) * info.format[0] = '^' # Native data types, manual alignment # <<<<<<<<<<<<<< @@ -9427,7 +9422,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ (__pyx_v_info->format[0]) = '^'; - /* "numpy.pxd":273 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":273 * info.format = stdlib.malloc(_buffer_format_string_len) * info.format[0] = '^' # Native data types, manual alignment * offset = 0 # <<<<<<<<<<<<<< @@ -9436,7 +9431,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_offset = 0; - /* "numpy.pxd":276 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":276 * f = _util_dtypestring(descr, info.format + 1, * info.format + _buffer_format_string_len, * &offset) # <<<<<<<<<<<<<< @@ -9446,7 +9441,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; - /* "numpy.pxd":277 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":277 * info.format + _buffer_format_string_len, * &offset) * f[0] = 0 # Terminate format string # <<<<<<<<<<<<<< @@ -9460,8 +9455,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_1); - __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("numpy.ndarray.__getbuffer__"); __pyx_r = -1; __Pyx_GOTREF(__pyx_v_info->obj); @@ -9478,7 +9473,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ return __pyx_r; } -/* "numpy.pxd":279 +/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":279 * f[0] = 0 # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -9486,26 +9481,22 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ * stdlib.free(info.format) */ -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; +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; __Pyx_RefNannySetupContext("__releasebuffer__"); - /* "numpy.pxd":280 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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 = __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) { + __pyx_t_1 = PyArray_HASFIELDS(((PyArrayObject *)__pyx_v_self)); + if (__pyx_t_1) { - /* "numpy.pxd":281 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":281 * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): * stdlib.free(info.format) # <<<<<<<<<<<<<< @@ -9517,17 +9508,17 @@ static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray_1__releasebuffer__(PyObject * } __pyx_L5:; - /* "numpy.pxd":282 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_2 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); - if (__pyx_t_2) { + __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); + if (__pyx_t_1) { - /* "numpy.pxd":283 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":283 * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): * stdlib.free(info.strides) # <<<<<<<<<<<<<< @@ -9542,7 +9533,7 @@ static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray_1__releasebuffer__(PyObject * __Pyx_RefNannyFinishContext(); } -/* "numpy.pxd":756 +/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":756 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -9555,7 +9546,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1"); - /* "numpy.pxd":757 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":757 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -9581,7 +9572,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "numpy.pxd":759 +/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":759 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -9594,7 +9585,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2"); - /* "numpy.pxd":760 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":760 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -9620,7 +9611,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "numpy.pxd":762 +/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":762 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -9633,7 +9624,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3"); - /* "numpy.pxd":763 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":763 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -9659,7 +9650,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "numpy.pxd":765 +/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":765 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -9672,7 +9663,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4"); - /* "numpy.pxd":766 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":766 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< @@ -9698,7 +9689,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "numpy.pxd":768 +/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":768 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -9711,7 +9702,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5"); - /* "numpy.pxd":769 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":769 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< @@ -9737,7 +9728,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "numpy.pxd":771 +/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":771 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -9763,16 +9754,15 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx int __pyx_t_7; int __pyx_t_8; int __pyx_t_9; - long __pyx_t_10; - char *__pyx_t_11; + char *__pyx_t_10; __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); - /* "numpy.pxd":778 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":778 * cdef int delta_offset * cdef tuple i * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -9781,7 +9771,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_endian_detector = 1; - /* "numpy.pxd":779 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":779 * cdef tuple i * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -9790,17 +9780,18 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "numpy.pxd":782 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":782 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< * fields = descr.fields[childname] * child, new_offset = fields */ - 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;} + 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;} } - __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++; @@ -9808,7 +9799,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_v_childname = __pyx_t_3; __pyx_t_3 = 0; - /* "numpy.pxd":783 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":783 * * for childname in descr.names: * fields = descr.fields[childname] # <<<<<<<<<<<<<< @@ -9819,10 +9810,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; - /* "numpy.pxd":784 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":784 * for childname in descr.names: * fields = descr.fields[childname] * child, new_offset = fields # <<<<<<<<<<<<<< @@ -9845,7 +9836,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;} } - /* "numpy.pxd":786 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":786 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< @@ -9870,23 +9861,29 @@ 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) { - /* "numpy.pxd":787 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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 = 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_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_GOTREF(__pyx_t_5); - __Pyx_Raise(__pyx_t_5, 0, 0); + __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_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:; - /* "numpy.pxd":789 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":789 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< @@ -9901,7 +9898,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } if (!__pyx_t_7) { - /* "numpy.pxd":790 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":790 * * if ((child.byteorder == '>' and little_endian) or * (child.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< @@ -9921,15 +9918,21 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } if (__pyx_t_6) { - /* "numpy.pxd":791 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_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;} @@ -9937,7 +9940,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L6:; - /* "numpy.pxd":801 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":801 * * # Output padding bytes * while offset[0] < new_offset: # <<<<<<<<<<<<<< @@ -9954,7 +9957,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; - /* "numpy.pxd":802 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":802 * # Output padding bytes * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< @@ -9963,37 +9966,35 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ (__pyx_v_f[0]) = 120; - /* "numpy.pxd":803 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":803 * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte * f += 1 # <<<<<<<<<<<<<< * offset[0] += 1 * */ - __pyx_v_f = (__pyx_v_f + 1); + __pyx_v_f += 1; - /* "numpy.pxd":804 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":804 * f[0] = 120 # "x"; pad byte * f += 1 * offset[0] += 1 # <<<<<<<<<<<<<< * * offset[0] += child.itemsize */ - __pyx_t_10 = 0; - (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + 1); + (__pyx_v_offset[0]) += 1; } - /* "numpy.pxd":806 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":806 * offset[0] += 1 * * offset[0] += child.itemsize # <<<<<<<<<<<<<< * * if not PyDataType_HASFIELDS(child): */ - __pyx_t_10 = 0; - (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + __pyx_v_child->elsize); + (__pyx_v_offset[0]) += __pyx_v_child->elsize; - /* "numpy.pxd":808 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":808 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -10003,7 +10004,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) { - /* "numpy.pxd":809 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":809 * * if not PyDataType_HASFIELDS(child): * t = child.type_num # <<<<<<<<<<<<<< @@ -10016,7 +10017,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_v_t = __pyx_t_3; __pyx_t_3 = 0; - /* "numpy.pxd":810 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":810 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -10026,402 +10027,408 @@ 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) { - /* "numpy.pxd":811 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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 = 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_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_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0); + __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_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:; - /* "numpy.pxd":814 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/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" */ - __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_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_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_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 = 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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 98; goto __pyx_L11; } - /* "numpy.pxd":815 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_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_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 = 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_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 66; goto __pyx_L11; } - /* "numpy.pxd":816 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_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_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 = 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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 104; goto __pyx_L11; } - /* "numpy.pxd":817 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_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_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 = 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_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 72; goto __pyx_L11; } - /* "numpy.pxd":818 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_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_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 = 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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 105; goto __pyx_L11; } - /* "numpy.pxd":819 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_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_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 = 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_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 73; goto __pyx_L11; } - /* "numpy.pxd":820 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_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_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 = 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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 108; goto __pyx_L11; } - /* "numpy.pxd":821 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_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_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 = 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_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 76; goto __pyx_L11; } - /* "numpy.pxd":822 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_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_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 = 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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 113; goto __pyx_L11; } - /* "numpy.pxd":823 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_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_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 = 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_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 81; goto __pyx_L11; } - /* "numpy.pxd":824 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_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_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 = 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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 102; goto __pyx_L11; } - /* "numpy.pxd":825 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_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_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 = 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_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 100; goto __pyx_L11; } - /* "numpy.pxd":826 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_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_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 = 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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 103; goto __pyx_L11; } - /* "numpy.pxd":827 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_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_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 = 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_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; (__pyx_v_f[1]) = 102; - __pyx_v_f = (__pyx_v_f + 1); + __pyx_v_f += 1; goto __pyx_L11; } - /* "numpy.pxd":828 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_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_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 = 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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; (__pyx_v_f[1]) = 100; - __pyx_v_f = (__pyx_v_f + 1); + __pyx_v_f += 1; goto __pyx_L11; } - /* "numpy.pxd":829 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_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_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 = 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_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; (__pyx_v_f[1]) = 103; - __pyx_v_f = (__pyx_v_f + 1); + __pyx_v_f += 1; goto __pyx_L11; } - /* "numpy.pxd":830 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_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_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_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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 79; goto __pyx_L11; } /*else*/ { - /* "numpy.pxd":832 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_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_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_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); + 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(__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:; - /* "numpy.pxd":833 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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 = (__pyx_v_f + 1); + __pyx_v_f += 1; goto __pyx_L9; } /*else*/ { - /* "numpy.pxd":837 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_L9:; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "numpy.pxd":838 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":838 * # so don't output it * f = _util_dtypestring(child, f, end, offset) * return f # <<<<<<<<<<<<<< @@ -10450,7 +10457,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx return __pyx_r; } -/* "numpy.pxd":953 +/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":953 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -10461,10 +10468,9 @@ 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"); - /* "numpy.pxd":955 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":955 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -10474,7 +10480,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) { - /* "numpy.pxd":956 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":956 * cdef PyObject* baseptr * if base is None: * baseptr = NULL # <<<<<<<<<<<<<< @@ -10486,19 +10492,16 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } /*else*/ { - /* "numpy.pxd":958 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":958 * baseptr = NULL * else: * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< * baseptr = base * Py_XDECREF(arr.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; + Py_INCREF(__pyx_v_base); - /* "numpy.pxd":959 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":959 * else: * Py_INCREF(base) # important to do this before decref below! * baseptr = base # <<<<<<<<<<<<<< @@ -10509,7 +10512,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } __pyx_L3:; - /* "numpy.pxd":960 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":960 * Py_INCREF(base) # important to do this before decref below! * baseptr = base * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< @@ -10518,7 +10521,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_XDECREF(__pyx_v_arr->base); - /* "numpy.pxd":961 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":961 * baseptr = base * Py_XDECREF(arr.base) * arr.base = baseptr # <<<<<<<<<<<<<< @@ -10530,7 +10533,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyFinishContext(); } -/* "numpy.pxd":963 +/* "/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 * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -10543,7 +10546,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base"); - /* "numpy.pxd":964 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":964 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -10553,7 +10556,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) { - /* "numpy.pxd":965 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":965 * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: * return None # <<<<<<<<<<<<<< @@ -10568,7 +10571,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py } /*else*/ { - /* "numpy.pxd":967 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":967 * return None * else: * return arr.base # <<<<<<<<<<<<<< @@ -10586,26 +10589,26 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __Pyx_RefNannyFinishContext(); return __pyx_r; } -static struct __pyx_vtabstruct_7scikits_5learn_9ball_tree_BallTree __pyx_vtable_7scikits_5learn_9ball_tree_BallTree; +static struct __pyx_vtabstruct_7sklearn_9ball_tree_BallTree __pyx_vtable_7sklearn_9ball_tree_BallTree; -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; +static PyObject *__pyx_tp_new_7sklearn_9ball_tree_BallTree(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_7sklearn_9ball_tree_BallTree *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; - p = ((struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)o); - p->__pyx_vtab = __pyx_vtabptr_7scikits_5learn_9ball_tree_BallTree; + p = ((struct __pyx_obj_7sklearn_9ball_tree_BallTree *)o); + p->__pyx_vtab = __pyx_vtabptr_7sklearn_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_7scikits_5learn_9ball_tree_8BallTree___cinit__(o, __pyx_empty_tuple, NULL) < 0) { + if (__pyx_pf_7sklearn_9ball_tree_8BallTree___cinit__(o, __pyx_empty_tuple, NULL) < 0) { Py_DECREF(o); o = 0; } return 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; +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; Py_XDECREF(((PyObject *)p->data)); Py_XDECREF(((PyObject *)p->idx_array)); Py_XDECREF(((PyObject *)p->node_centroid_arr)); @@ -10613,9 +10616,9 @@ static void __pyx_tp_dealloc_7scikits_5learn_9ball_tree_BallTree(PyObject *o) { (*Py_TYPE(o)->tp_free)(o); } -static int __pyx_tp_traverse_7scikits_5learn_9ball_tree_BallTree(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_7sklearn_9ball_tree_BallTree(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *p = (struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree *)o; + struct __pyx_obj_7sklearn_9ball_tree_BallTree *p = (struct __pyx_obj_7sklearn_9ball_tree_BallTree *)o; if (p->data) { e = (*v)(((PyObject*)p->data), a); if (e) return e; } @@ -10631,8 +10634,8 @@ static int __pyx_tp_traverse_7scikits_5learn_9ball_tree_BallTree(PyObject *o, vi return 0; } -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; +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; PyObject* tmp; tmp = ((PyObject*)p->data); p->data = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); @@ -10649,21 +10652,21 @@ static int __pyx_tp_clear_7scikits_5learn_9ball_tree_BallTree(PyObject *o) { return 0; } -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 PyObject *__pyx_getprop_7sklearn_9ball_tree_8BallTree_data(PyObject *o, void *x) { + return __pyx_pf_7sklearn_9ball_tree_8BallTree_4data___get__(o); } -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)}, +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)}, {0, 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}, +static struct PyGetSetDef __pyx_getsets_7sklearn_9ball_tree_BallTree[] = { + {(char *)"data", __pyx_getprop_7sklearn_9ball_tree_8BallTree_data, 0, 0, 0}, {0, 0, 0, 0, 0} }; @@ -10765,12 +10768,12 @@ static PyBufferProcs __pyx_tp_as_buffer_BallTree = { #endif }; -static PyTypeObject __pyx_type_7scikits_5learn_9ball_tree_BallTree = { +PyTypeObject __pyx_type_7sklearn_9ball_tree_BallTree = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("scikits.learn.ball_tree.BallTree"), /*tp_name*/ - sizeof(struct __pyx_obj_7scikits_5learn_9ball_tree_BallTree), /*tp_basicsize*/ + __Pyx_NAMESTR("sklearn.ball_tree.BallTree"), /*tp_name*/ + sizeof(struct __pyx_obj_7sklearn_9ball_tree_BallTree), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_7scikits_5learn_9ball_tree_BallTree, /*tp_dealloc*/ + __pyx_tp_dealloc_7sklearn_9ball_tree_BallTree, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -10789,25 +10792,25 @@ static PyTypeObject __pyx_type_7scikits_5learn_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_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|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_7scikits_5learn_9ball_tree_BallTree, /*tp_traverse*/ - __pyx_tp_clear_7scikits_5learn_9ball_tree_BallTree, /*tp_clear*/ + __pyx_tp_traverse_7sklearn_9ball_tree_BallTree, /*tp_traverse*/ + __pyx_tp_clear_7sklearn_9ball_tree_BallTree, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_7scikits_5learn_9ball_tree_BallTree, /*tp_methods*/ + __pyx_methods_7sklearn_9ball_tree_BallTree, /*tp_methods*/ 0, /*tp_members*/ - __pyx_getsets_7scikits_5learn_9ball_tree_BallTree, /*tp_getset*/ + __pyx_getsets_7sklearn_9ball_tree_BallTree, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - __pyx_pf_7scikits_5learn_9ball_tree_8BallTree_1__init__, /*tp_init*/ + __pyx_pf_7sklearn_9ball_tree_8BallTree___init__, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_7scikits_5learn_9ball_tree_BallTree, /*tp_new*/ + __pyx_tp_new_7sklearn_9ball_tree_BallTree, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -10822,6 +10825,7 @@ static PyTypeObject __pyx_type_7scikits_5learn_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} }; @@ -10829,7 +10833,7 @@ static PyMethodDef __pyx_methods[] = { static struct PyModuleDef __pyx_moduledef = { PyModuleDef_HEAD_INIT, __Pyx_NAMESTR("ball_tree"), - __Pyx_DOCSTR(__pyx_k_54), /* m_doc */ + __Pyx_DOCSTR(__pyx_k_26), /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ @@ -10841,31 +10845,32 @@ 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_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_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_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0}, - {&__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_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_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}, @@ -10875,6 +10880,8 @@ 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}, @@ -10924,7 +10931,9 @@ 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}, @@ -10951,397 +10960,6 @@ 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;}; @@ -11364,7 +10982,8 @@ PyMODINIT_FUNC PyInit_ball_tree(void) { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - __pyx_t_7scikits_5learn_9ball_tree_DTYPE_t __pyx_t_3; + __pyx_t_7sklearn_9ball_tree_DTYPE_t __pyx_t_3; + PyObject *__pyx_t_4 = NULL; #if CYTHON_REFNANNY void* __pyx_refnanny = NULL; __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); @@ -11390,7 +11009,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_54), 0, PYTHON_API_VERSION); + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("ball_tree"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_26), 0, PYTHON_API_VERSION); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif @@ -11403,26 +11022,32 @@ 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_scikits__learn__ball_tree) { + if (__pyx_module_is_main_sklearn__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_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; + __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; /*--- 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;} @@ -11432,7 +11057,7 @@ PyMODINIT_FUNC PyInit_ball_tree(void) /*--- Function import code ---*/ /*--- Execution code ---*/ - /* "scikits/learn/ball_tree.pyx":190 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":190 * """ * * import numpy as np # <<<<<<<<<<<<<< @@ -11444,7 +11069,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; - /* "scikits/learn/ball_tree.pyx":200 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":200 * # * # type used for data * DTYPE = np.float64 # <<<<<<<<<<<<<< @@ -11459,7 +11084,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; - /* "scikits/learn/ball_tree.pyx":204 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":204 * * # type used for indices & counts * ITYPE = np.int32 # <<<<<<<<<<<<<< @@ -11474,7 +11099,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; - /* "scikits/learn/ball_tree.pyx":208 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":208 * * # infinity * cdef DTYPE_t infinity = np.inf # <<<<<<<<<<<<<< @@ -11488,21 +11113,9 @@ 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_7scikits_5learn_9ball_tree_infinity = __pyx_t_3; + __pyx_v_7sklearn_9ball_tree_infinity = __pyx_t_3; - /* "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 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":544 * self.n_nodes = state[7] * * def query(self, X, k=1, return_distance=True): # <<<<<<<<<<<<<< @@ -11511,11 +11124,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_19 = __pyx_t_2; + __pyx_k_7 = __pyx_t_2; __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - /* "scikits/learn/ball_tree.pyx":644 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":644 * return idx_array.reshape((orig_shape[:-1]) + (k,)) * * def query_radius(self, X, r, return_distance=False, # <<<<<<<<<<<<<< @@ -11524,11 +11137,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_24 = __pyx_t_2; + __pyx_k_10 = __pyx_t_2; __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - /* "scikits/learn/ball_tree.pyx":645 + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":645 * * def query_radius(self, X, r, return_distance=False, * count_only=False, sort_results=False): # <<<<<<<<<<<<<< @@ -11537,198 +11150,110 @@ 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_25 = __pyx_t_2; + __pyx_k_11 = __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_26 = __pyx_t_2; - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - - /* "scikits/learn/ball_tree.pyx":2 - * - * # Author: Jake Vanderplas # <<<<<<<<<<<<<< - * # License: BSD - * - */ - __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)); - 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; - - /* "libc/stdio.pxd":1 - * # 7.19 Input/output # <<<<<<<<<<<<<< - * - * 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 , */ - 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; + __pyx_k_12 = __pyx_t_2; + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 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; - } + /* "/home/fabian/dev/scikit-learn/sklearn/ball_tree.pyx":2 + * + * # Author: Jake Vanderplas # <<<<<<<<<<<<<< + * # License: BSD + * + */ + __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 (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; - PyErr_SetObject(type, value); + /* "/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 # <<<<<<<<<<<<<< + * + * 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 +} - 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); - } - } +/* Runtime support code */ -bad: - return; +static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { + PyObject *result; + result = PyObject_GetAttr(dict, name); + if (!result) + PyErr_SetObject(PyExc_NameError, name); + return result; } -#endif static void __Pyx_RaiseArgtupleInvalid( const char* func_name, @@ -11972,6 +11497,143 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) { 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 , */ + 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; @@ -12160,60 +11822,15 @@ static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_Py_intptr_t(Py_intptr_t val) { z.imag = -a.imag; return z; } - #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 +/* + 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 + } +*/ #endif #if CYTHON_CCOMPLEX @@ -12280,60 +11897,15 @@ static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_Py_intptr_t(Py_intptr_t val) { z.imag = -a.imag; return z; } - #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 +/* + 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 + } +*/ #endif static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) { @@ -12799,13 +12371,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 @@ -12815,7 +12387,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/scikits/learn/ball_tree.pyx b/sklearn/ball_tree.pyx similarity index 100% rename from scikits/learn/ball_tree.pyx rename to sklearn/ball_tree.pyx diff --git a/scikits/learn/base.py b/sklearn/base.py similarity index 100% rename from scikits/learn/base.py rename to sklearn/base.py diff --git a/scikits/learn/check_build/__init__.py b/sklearn/check_build/__init__.py similarity index 100% rename from scikits/learn/check_build/__init__.py rename to sklearn/check_build/__init__.py diff --git a/scikits/learn/check_build/_check_build.c b/sklearn/check_build/_check_build.c similarity index 100% rename from scikits/learn/check_build/_check_build.c rename to sklearn/check_build/_check_build.c diff --git a/scikits/learn/check_build/_check_build.pyx b/sklearn/check_build/_check_build.pyx similarity index 100% rename from scikits/learn/check_build/_check_build.pyx rename to sklearn/check_build/_check_build.pyx diff --git a/scikits/learn/check_build/setup.py b/sklearn/check_build/setup.py similarity index 100% rename from scikits/learn/check_build/setup.py rename to sklearn/check_build/setup.py diff --git a/scikits/learn/cluster/__init__.py b/sklearn/cluster/__init__.py similarity index 100% rename from scikits/learn/cluster/__init__.py rename to sklearn/cluster/__init__.py diff --git a/scikits/learn/cluster/_feature_agglomeration.py b/sklearn/cluster/_feature_agglomeration.py similarity index 100% rename from scikits/learn/cluster/_feature_agglomeration.py rename to sklearn/cluster/_feature_agglomeration.py diff --git a/scikits/learn/cluster/_inertia.c b/sklearn/cluster/_inertia.c similarity index 100% rename from scikits/learn/cluster/_inertia.c rename to sklearn/cluster/_inertia.c diff --git a/scikits/learn/cluster/_inertia.pyx b/sklearn/cluster/_inertia.pyx similarity index 100% rename from scikits/learn/cluster/_inertia.pyx rename to sklearn/cluster/_inertia.pyx diff --git a/scikits/learn/cluster/_k_means.c b/sklearn/cluster/_k_means.c similarity index 100% rename from scikits/learn/cluster/_k_means.c rename to sklearn/cluster/_k_means.c diff --git a/scikits/learn/cluster/_k_means.pyx b/sklearn/cluster/_k_means.pyx similarity index 100% rename from scikits/learn/cluster/_k_means.pyx rename to sklearn/cluster/_k_means.pyx diff --git a/scikits/learn/cluster/affinity_propagation_.py b/sklearn/cluster/affinity_propagation_.py similarity index 100% rename from scikits/learn/cluster/affinity_propagation_.py rename to sklearn/cluster/affinity_propagation_.py diff --git a/scikits/learn/cluster/dbscan_.py b/sklearn/cluster/dbscan_.py similarity index 100% rename from scikits/learn/cluster/dbscan_.py rename to sklearn/cluster/dbscan_.py diff --git a/scikits/learn/cluster/hierarchical.py b/sklearn/cluster/hierarchical.py similarity index 100% rename from scikits/learn/cluster/hierarchical.py rename to sklearn/cluster/hierarchical.py diff --git a/scikits/learn/cluster/k_means_.py b/sklearn/cluster/k_means_.py similarity index 100% rename from scikits/learn/cluster/k_means_.py rename to sklearn/cluster/k_means_.py diff --git a/scikits/learn/cluster/mean_shift_.py b/sklearn/cluster/mean_shift_.py similarity index 100% rename from scikits/learn/cluster/mean_shift_.py rename to sklearn/cluster/mean_shift_.py diff --git a/scikits/learn/cluster/setup.py b/sklearn/cluster/setup.py similarity index 100% rename from scikits/learn/cluster/setup.py rename to sklearn/cluster/setup.py diff --git a/scikits/learn/cluster/spectral.py b/sklearn/cluster/spectral.py similarity index 100% rename from scikits/learn/cluster/spectral.py rename to sklearn/cluster/spectral.py diff --git a/scikits/learn/cluster/tests/__init__.py b/sklearn/cluster/tests/__init__.py similarity index 100% rename from scikits/learn/cluster/tests/__init__.py rename to sklearn/cluster/tests/__init__.py diff --git a/scikits/learn/cluster/tests/common.py b/sklearn/cluster/tests/common.py similarity index 100% rename from scikits/learn/cluster/tests/common.py rename to sklearn/cluster/tests/common.py diff --git a/scikits/learn/cluster/tests/test_affinity_propagation.py b/sklearn/cluster/tests/test_affinity_propagation.py similarity index 100% rename from scikits/learn/cluster/tests/test_affinity_propagation.py rename to sklearn/cluster/tests/test_affinity_propagation.py diff --git a/scikits/learn/cluster/tests/test_dbscan.py b/sklearn/cluster/tests/test_dbscan.py similarity index 98% rename from scikits/learn/cluster/tests/test_dbscan.py rename to sklearn/cluster/tests/test_dbscan.py index 7c36e710e7cd2..442d3b305f676 100644 --- a/scikits/learn/cluster/tests/test_dbscan.py +++ b/sklearn/cluster/tests/test_dbscan.py @@ -8,7 +8,7 @@ from numpy.testing import assert_equal from scipy.spatial import distance -from scikits.learn.cluster.dbscan_ import DBSCAN, dbscan +from sklearn.cluster.dbscan_ import DBSCAN, dbscan from .common import generate_clustered_data diff --git a/scikits/learn/cluster/tests/test_hierarchical.py b/sklearn/cluster/tests/test_hierarchical.py similarity index 94% rename from scikits/learn/cluster/tests/test_hierarchical.py rename to sklearn/cluster/tests/test_hierarchical.py index ce4daadc7408d..26ba26c02a2d8 100644 --- a/scikits/learn/cluster/tests/test_hierarchical.py +++ b/sklearn/cluster/tests/test_hierarchical.py @@ -7,9 +7,9 @@ import numpy as np from scipy.cluster import hierarchy -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 +from sklearn.cluster import Ward, WardAgglomeration, ward_tree +from sklearn.cluster.hierarchical import _hc_cut +from sklearn.feature_extraction.image import grid_to_graph def test_structured_ward_tree(): diff --git a/scikits/learn/cluster/tests/test_k_means.py b/sklearn/cluster/tests/test_k_means.py similarity index 100% rename from scikits/learn/cluster/tests/test_k_means.py rename to sklearn/cluster/tests/test_k_means.py diff --git a/scikits/learn/cluster/tests/test_mean_shift.py b/sklearn/cluster/tests/test_mean_shift.py similarity index 100% rename from scikits/learn/cluster/tests/test_mean_shift.py rename to sklearn/cluster/tests/test_mean_shift.py diff --git a/scikits/learn/cluster/tests/test_spectral.py b/sklearn/cluster/tests/test_spectral.py similarity index 100% rename from scikits/learn/cluster/tests/test_spectral.py rename to sklearn/cluster/tests/test_spectral.py diff --git a/scikits/learn/covariance/__init__.py b/sklearn/covariance/__init__.py similarity index 88% rename from scikits/learn/covariance/__init__.py rename to sklearn/covariance/__init__.py index 1a90db72dbced..7bc505dd08845 100644 --- a/scikits/learn/covariance/__init__.py +++ b/sklearn/covariance/__init__.py @@ -2,7 +2,7 @@ Covariance estimators ===================== -:mod:`scikits.learn.covariance` is a module to fit to estimate +:mod:`sklearn.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/scikits/learn/covariance/empirical_covariance_.py b/sklearn/covariance/empirical_covariance_.py similarity index 100% rename from scikits/learn/covariance/empirical_covariance_.py rename to sklearn/covariance/empirical_covariance_.py diff --git a/scikits/learn/covariance/shrunk_covariance_.py b/sklearn/covariance/shrunk_covariance_.py similarity index 100% rename from scikits/learn/covariance/shrunk_covariance_.py rename to sklearn/covariance/shrunk_covariance_.py diff --git a/scikits/learn/covariance/tests/__init__.py b/sklearn/covariance/tests/__init__.py similarity index 100% rename from scikits/learn/covariance/tests/__init__.py rename to sklearn/covariance/tests/__init__.py diff --git a/scikits/learn/covariance/tests/test_covariance.py b/sklearn/covariance/tests/test_covariance.py similarity index 99% rename from scikits/learn/covariance/tests/test_covariance.py rename to sklearn/covariance/tests/test_covariance.py index 28463cab42d50..a685a1a425650 100644 --- a/scikits/learn/covariance/tests/test_covariance.py +++ b/sklearn/covariance/tests/test_covariance.py @@ -10,7 +10,7 @@ ShrunkCovariance, shrunk_covariance, LedoitWolf, ledoit_wolf, OAS, oas import numpy as np -from scikits.learn import datasets +from sklearn import datasets X = datasets.load_iris().data n_samples, n_features = X.shape diff --git a/scikits/learn/cross_val.py b/sklearn/cross_val.py similarity index 97% rename from scikits/learn/cross_val.py rename to sklearn/cross_val.py index 9e332f7116e0c..1bea4475c5ce8 100644 --- a/scikits/learn/cross_val.py +++ b/sklearn/cross_val.py @@ -38,14 +38,14 @@ def __init__(self, n, indices=False): Examples ======== - >>> from scikits.learn import cross_val + >>> from sklearn 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 - scikits.learn.cross_val.LeaveOneOut(n=2) + sklearn.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 @@ def __init__(self, n, p, indices=False): Examples ======== - >>> from scikits.learn import cross_val + >>> from sklearn 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 - scikits.learn.cross_val.LeavePOut(n=4, p=2) + sklearn.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 @@ def __init__(self, n, k, indices=False): Examples -------- - >>> from scikits.learn import cross_val + >>> from sklearn 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 - scikits.learn.cross_val.KFold(n=4, k=2) + sklearn.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 @@ def __init__(self, y, k, indices=False): Examples -------- - >>> from scikits.learn import cross_val + >>> from sklearn 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 - scikits.learn.cross_val.StratifiedKFold(labels=[0 0 1 1], k=2) + sklearn.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 @@ def __init__(self, labels, indices=False): Examples ---------- - >>> from scikits.learn import cross_val + >>> from sklearn 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 @@ def __init__(self, labels, indices=False): >>> len(lol) 2 >>> print lol - scikits.learn.cross_val.LeaveOneLabelOut(labels=[1 1 2 2]) + sklearn.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 @@ def __init__(self, labels, p, indices=False): Examples ---------- - >>> from scikits.learn import cross_val + >>> from sklearn 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 @@ def __init__(self, labels, p, indices=False): >>> len(lpl) 3 >>> print lpl - scikits.learn.cross_val.LeavePLabelOut(labels=[1 2 3], p=2) + sklearn.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 @@ def __init__(self, n, n_bootstraps=3, n_train=0.5, n_test=None, Examples ---------- - >>> from scikits.learn import cross_val + >>> from sklearn import cross_val >>> bs = cross_val.Bootstrap(9, random_state=0) >>> len(bs) 3 @@ -635,7 +635,7 @@ class ShuffleSplit(object): Examples ---------- - >>> from scikits.learn import cross_val + >>> from sklearn 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 - scikits.learn.cross_val module for the list of possible objects + sklearn.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/scikits/learn/datasets/DATASET_PROPOSAL.txt b/sklearn/datasets/DATASET_PROPOSAL.txt similarity index 100% rename from scikits/learn/datasets/DATASET_PROPOSAL.txt rename to sklearn/datasets/DATASET_PROPOSAL.txt diff --git a/scikits/learn/datasets/__init__.py b/sklearn/datasets/__init__.py similarity index 91% rename from scikits/learn/datasets/__init__.py rename to sklearn/datasets/__init__.py index 4fec421c4ea9d..77c4fffe7b02c 100644 --- a/scikits/learn/datasets/__init__.py +++ b/sklearn/datasets/__init__.py @@ -34,7 +34,7 @@ # backward compatibility @deprecated("to be removed in 0.9;" - " use scikits.learn.datasets.load_files instead") + " use sklearn.datasets.load_files instead") def load_filenames(*args, **kwargs): - """Deprecated, use ``scikits.learn.datasets.load_files`` instead""" + """Deprecated, use ``sklearn.datasets.load_files`` instead""" return load_files(*args, **kwargs) diff --git a/scikits/learn/datasets/base.py b/sklearn/datasets/base.py similarity index 97% rename from scikits/learn/datasets/base.py rename to sklearn/datasets/base.py index 8cc60fd2184da..dbea85522f874 100644 --- a/scikits/learn/datasets/base.py +++ b/sklearn/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 `scikits.learn.features.text` + algorithm you will first need to use the `sklearn.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 scikits.learn.datasets import load_iris + >>> from sklearn.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 scikits.learn.datasets import load_digits + >>> from sklearn.datasets import load_digits >>> digits = load_digits() >>> # import pylab as pl @@ -323,7 +323,7 @@ def load_boston(): Examples -------- - >>> from scikits.learn.datasets import load_boston + >>> from sklearn.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 scikits.learn.datasets import load_sample_images + >>> from sklearn.datasets import load_sample_images >>> dataset = load_sample_images() >>> len(dataset.images) 2 diff --git a/scikits/learn/datasets/data/boston_house_prices.csv b/sklearn/datasets/data/boston_house_prices.csv similarity index 100% rename from scikits/learn/datasets/data/boston_house_prices.csv rename to sklearn/datasets/data/boston_house_prices.csv diff --git a/scikits/learn/datasets/data/diabetes_data.csv.gz b/sklearn/datasets/data/diabetes_data.csv.gz similarity index 100% rename from scikits/learn/datasets/data/diabetes_data.csv.gz rename to sklearn/datasets/data/diabetes_data.csv.gz diff --git a/scikits/learn/datasets/data/diabetes_target.csv.gz b/sklearn/datasets/data/diabetes_target.csv.gz similarity index 100% rename from scikits/learn/datasets/data/diabetes_target.csv.gz rename to sklearn/datasets/data/diabetes_target.csv.gz diff --git a/scikits/learn/datasets/data/digits.csv.gz b/sklearn/datasets/data/digits.csv.gz similarity index 100% rename from scikits/learn/datasets/data/digits.csv.gz rename to sklearn/datasets/data/digits.csv.gz diff --git a/scikits/learn/datasets/data/iris.csv b/sklearn/datasets/data/iris.csv similarity index 100% rename from scikits/learn/datasets/data/iris.csv rename to sklearn/datasets/data/iris.csv diff --git a/scikits/learn/datasets/data/linnerud_exercise.csv b/sklearn/datasets/data/linnerud_exercise.csv similarity index 100% rename from scikits/learn/datasets/data/linnerud_exercise.csv rename to sklearn/datasets/data/linnerud_exercise.csv diff --git a/scikits/learn/datasets/data/linnerud_physiological.csv b/sklearn/datasets/data/linnerud_physiological.csv similarity index 100% rename from scikits/learn/datasets/data/linnerud_physiological.csv rename to sklearn/datasets/data/linnerud_physiological.csv diff --git a/scikits/learn/datasets/descr/boston_house_prices.rst b/sklearn/datasets/descr/boston_house_prices.rst similarity index 100% rename from scikits/learn/datasets/descr/boston_house_prices.rst rename to sklearn/datasets/descr/boston_house_prices.rst diff --git a/scikits/learn/datasets/descr/diabetes.rst b/sklearn/datasets/descr/diabetes.rst similarity index 100% rename from scikits/learn/datasets/descr/diabetes.rst rename to sklearn/datasets/descr/diabetes.rst diff --git a/scikits/learn/datasets/descr/digits.rst b/sklearn/datasets/descr/digits.rst similarity index 100% rename from scikits/learn/datasets/descr/digits.rst rename to sklearn/datasets/descr/digits.rst diff --git a/scikits/learn/datasets/descr/iris.rst b/sklearn/datasets/descr/iris.rst similarity index 100% rename from scikits/learn/datasets/descr/iris.rst rename to sklearn/datasets/descr/iris.rst diff --git a/scikits/learn/datasets/descr/linnerud.rst b/sklearn/datasets/descr/linnerud.rst similarity index 100% rename from scikits/learn/datasets/descr/linnerud.rst rename to sklearn/datasets/descr/linnerud.rst diff --git a/scikits/learn/datasets/images/README.txt b/sklearn/datasets/images/README.txt similarity index 100% rename from scikits/learn/datasets/images/README.txt rename to sklearn/datasets/images/README.txt diff --git a/scikits/learn/datasets/images/china.jpg b/sklearn/datasets/images/china.jpg similarity index 100% rename from scikits/learn/datasets/images/china.jpg rename to sklearn/datasets/images/china.jpg diff --git a/scikits/learn/datasets/images/flower.jpg b/sklearn/datasets/images/flower.jpg similarity index 100% rename from scikits/learn/datasets/images/flower.jpg rename to sklearn/datasets/images/flower.jpg diff --git a/scikits/learn/datasets/lfw.py b/sklearn/datasets/lfw.py similarity index 99% rename from scikits/learn/datasets/lfw.py rename to sklearn/datasets/lfw.py index 1d506d6f41dcb..d20fbbd38d220 100644 --- a/scikits/learn/datasets/lfw.py +++ b/sklearn/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 scikits.learn.datasets module from depending on PIL. + # the whole sklearn.datasets module from depending on PIL. try: try: from scipy.misc import imread diff --git a/scikits/learn/datasets/mlcomp.py b/sklearn/datasets/mlcomp.py similarity index 98% rename from scikits/learn/datasets/mlcomp.py rename to sklearn/datasets/mlcomp.py index f2991aed4cfd3..d0a44f6c396c3 100644 --- a/scikits/learn/datasets/mlcomp.py +++ b/sklearn/datasets/mlcomp.py @@ -3,7 +3,7 @@ """Glue code to load http://mlcomp.org data as a scikit.learn dataset""" import os -from scikits.learn.datasets.base import load_files +from sklearn.datasets.base import load_files def _load_document_classification(dataset_path, metadata, set_=None, **kwargs): diff --git a/scikits/learn/datasets/mldata.py b/sklearn/datasets/mldata.py similarity index 96% rename from scikits/learn/datasets/mldata.py rename to sklearn/datasets/mldata.py index 4f40d71acd8f2..dc8b3054b800b 100644 --- a/scikits/learn/datasets/mldata.py +++ b/sklearn/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 `scikits.learn` standard + to be transposed to match the `sklearn` 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 scikits.learn.datasets.mldata import fetch_mldata + >>> from sklearn.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 - scikits.learn axes convention: + sklearn 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 scikits.learn conventions + # set axes to sklearn conventions if transpose_data: dataset['data'] = dataset['data'].T if 'target' in dataset: diff --git a/scikits/learn/datasets/olivetti_faces.py b/sklearn/datasets/olivetti_faces.py similarity index 100% rename from scikits/learn/datasets/olivetti_faces.py rename to sklearn/datasets/olivetti_faces.py diff --git a/scikits/learn/datasets/samples_generator.py b/sklearn/datasets/samples_generator.py similarity index 99% rename from scikits/learn/datasets/samples_generator.py rename to sklearn/datasets/samples_generator.py index 8539543ebb009..e961dc35ee159 100644 --- a/scikits/learn/datasets/samples_generator.py +++ b/sklearn/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 scikits.learn.datasets.samples_generator import make_blobs + >>> from sklearn.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/scikits/learn/datasets/setup.py b/sklearn/datasets/setup.py similarity index 100% rename from scikits/learn/datasets/setup.py rename to sklearn/datasets/setup.py diff --git a/scikits/learn/datasets/svmlight_format.py b/sklearn/datasets/svmlight_format.py similarity index 100% rename from scikits/learn/datasets/svmlight_format.py rename to sklearn/datasets/svmlight_format.py diff --git a/scikits/learn/datasets/tests/__init__.py b/sklearn/datasets/tests/__init__.py similarity index 100% rename from scikits/learn/datasets/tests/__init__.py rename to sklearn/datasets/tests/__init__.py diff --git a/scikits/learn/datasets/tests/data/svmlight_classification.txt b/sklearn/datasets/tests/data/svmlight_classification.txt similarity index 100% rename from scikits/learn/datasets/tests/data/svmlight_classification.txt rename to sklearn/datasets/tests/data/svmlight_classification.txt diff --git a/scikits/learn/datasets/tests/data/svmlight_invalid.txt b/sklearn/datasets/tests/data/svmlight_invalid.txt similarity index 100% rename from scikits/learn/datasets/tests/data/svmlight_invalid.txt rename to sklearn/datasets/tests/data/svmlight_invalid.txt diff --git a/scikits/learn/datasets/tests/test_20news.py b/sklearn/datasets/tests/test_20news.py similarity index 97% rename from scikits/learn/datasets/tests/test_20news.py rename to sklearn/datasets/tests/test_20news.py index 21434a5a4927a..4aa63cdab46c7 100644 --- a/scikits/learn/datasets/tests/test_20news.py +++ b/sklearn/datasets/tests/test_20news.py @@ -3,7 +3,7 @@ from nose.tools import assert_equal from nose.plugins.skip import SkipTest -from scikits.learn import datasets +from sklearn import datasets def test_20news(): try: diff --git a/scikits/learn/datasets/tests/test_base.py b/sklearn/datasets/tests/test_base.py similarity index 90% rename from scikits/learn/datasets/tests/test_base.py rename to sklearn/datasets/tests/test_base.py index bff8f71f914b1..f8dfae333dbdf 100644 --- a/scikits/learn/datasets/tests/test_base.py +++ b/sklearn/datasets/tests/test_base.py @@ -2,8 +2,8 @@ import shutil import tempfile -from scikits.learn.datasets import get_data_home -from scikits.learn.datasets import clear_data_home +from sklearn.datasets import get_data_home +from sklearn.datasets import clear_data_home from nose.tools import assert_false from nose.tools import assert_true diff --git a/scikits/learn/datasets/tests/test_lfw.py b/sklearn/datasets/tests/test_lfw.py similarity index 97% rename from scikits/learn/datasets/tests/test_lfw.py rename to sklearn/datasets/tests/test_lfw.py index 0ddf95b47d17d..f474d4c1dae0a 100644 --- a/scikits/learn/datasets/tests/test_lfw.py +++ b/sklearn/datasets/tests/test_lfw.py @@ -21,9 +21,9 @@ except ImportError: imsave = None -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 sklearn.datasets import load_lfw_pairs +from sklearn.datasets import load_lfw_people +from sklearn.datasets import get_data_home from numpy.testing import assert_array_equal from numpy.testing import assert_equal diff --git a/scikits/learn/datasets/tests/test_mldata.py b/sklearn/datasets/tests/test_mldata.py similarity index 96% rename from scikits/learn/datasets/tests/test_mldata.py rename to sklearn/datasets/tests/test_mldata.py index 5d49836303203..c0e51c766f59b 100644 --- a/scikits/learn/datasets/tests/test_mldata.py +++ b/sklearn/datasets/tests/test_mldata.py @@ -1,8 +1,8 @@ """Test functionality of mldata fetching utilities.""" -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 sklearn import datasets +from sklearn.datasets import mldata_filename, fetch_mldata +from sklearn.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/scikits/learn/datasets/tests/test_samples_generator.py b/sklearn/datasets/tests/test_samples_generator.py similarity index 100% rename from scikits/learn/datasets/tests/test_samples_generator.py rename to sklearn/datasets/tests/test_samples_generator.py diff --git a/scikits/learn/datasets/tests/test_svmlight_format.py b/sklearn/datasets/tests/test_svmlight_format.py similarity index 97% rename from scikits/learn/datasets/tests/test_svmlight_format.py rename to sklearn/datasets/tests/test_svmlight_format.py index fedf53c7dd253..8708fff1c614f 100644 --- a/scikits/learn/datasets/tests/test_svmlight_format.py +++ b/sklearn/datasets/tests/test_svmlight_format.py @@ -4,7 +4,7 @@ from numpy.testing import assert_equal, assert_array_equal from nose.tools import raises -from scikits.learn.datasets import load_svmlight_file +from sklearn.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/scikits/learn/datasets/twenty_newsgroups.py b/sklearn/datasets/twenty_newsgroups.py similarity index 100% rename from scikits/learn/datasets/twenty_newsgroups.py rename to sklearn/datasets/twenty_newsgroups.py diff --git a/scikits/learn/decomposition/__init__.py b/sklearn/decomposition/__init__.py similarity index 100% rename from scikits/learn/decomposition/__init__.py rename to sklearn/decomposition/__init__.py diff --git a/scikits/learn/decomposition/fastica_.py b/sklearn/decomposition/fastica_.py similarity index 100% rename from scikits/learn/decomposition/fastica_.py rename to sklearn/decomposition/fastica_.py diff --git a/scikits/learn/decomposition/kernel_pca.py b/sklearn/decomposition/kernel_pca.py similarity index 100% rename from scikits/learn/decomposition/kernel_pca.py rename to sklearn/decomposition/kernel_pca.py diff --git a/scikits/learn/decomposition/nmf.py b/sklearn/decomposition/nmf.py similarity index 99% rename from scikits/learn/decomposition/nmf.py rename to sklearn/decomposition/nmf.py index 1324988a76a67..f40479f39e737 100644 --- a/scikits/learn/decomposition/nmf.py +++ b/sklearn/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 scikits.learn.decomposition import ProjectedGradientNMF + >>> from sklearn.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/scikits/learn/decomposition/pca.py b/sklearn/decomposition/pca.py similarity index 99% rename from scikits/learn/decomposition/pca.py rename to sklearn/decomposition/pca.py index 02511ce690c5d..5b6ccbf53e49b 100644 --- a/scikits/learn/decomposition/pca.py +++ b/sklearn/decomposition/pca.py @@ -154,7 +154,7 @@ class PCA(BaseEstimator, TransformerMixin): Examples -------- >>> import numpy as np - >>> from scikits.learn.decomposition import PCA + >>> from sklearn.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 scikits.learn.decomposition import RandomizedPCA + >>> from sklearn.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/scikits/learn/decomposition/sparse_pca.py b/sklearn/decomposition/sparse_pca.py similarity index 100% rename from scikits/learn/decomposition/sparse_pca.py rename to sklearn/decomposition/sparse_pca.py diff --git a/scikits/learn/decomposition/tests/__init__.py b/sklearn/decomposition/tests/__init__.py similarity index 100% rename from scikits/learn/decomposition/tests/__init__.py rename to sklearn/decomposition/tests/__init__.py diff --git a/scikits/learn/decomposition/tests/test_fastica.py b/sklearn/decomposition/tests/test_fastica.py similarity index 100% rename from scikits/learn/decomposition/tests/test_fastica.py rename to sklearn/decomposition/tests/test_fastica.py diff --git a/scikits/learn/decomposition/tests/test_kernel_pca.py b/sklearn/decomposition/tests/test_kernel_pca.py similarity index 100% rename from scikits/learn/decomposition/tests/test_kernel_pca.py rename to sklearn/decomposition/tests/test_kernel_pca.py diff --git a/scikits/learn/decomposition/tests/test_nmf.py b/sklearn/decomposition/tests/test_nmf.py similarity index 100% rename from scikits/learn/decomposition/tests/test_nmf.py rename to sklearn/decomposition/tests/test_nmf.py diff --git a/scikits/learn/decomposition/tests/test_pca.py b/sklearn/decomposition/tests/test_pca.py similarity index 100% rename from scikits/learn/decomposition/tests/test_pca.py rename to sklearn/decomposition/tests/test_pca.py diff --git a/scikits/learn/decomposition/tests/test_sparse_pca.py b/sklearn/decomposition/tests/test_sparse_pca.py similarity index 97% rename from scikits/learn/decomposition/tests/test_sparse_pca.py rename to sklearn/decomposition/tests/test_sparse_pca.py index bb9f3e03a8bed..f7da34a75ae9c 100644 --- a/scikits/learn/decomposition/tests/test_sparse_pca.py +++ b/sklearn/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 scikits.learn.externals.joblib.parallel as joblib_par + import sklearn.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 scikits.learn.externals.joblib.parallel as joblib_par + import sklearn.externals.joblib.parallel as joblib_par _mp = joblib_par.multiprocessing joblib_par.multiprocessing = None try: diff --git a/scikits/learn/externals/README b/sklearn/externals/README similarity index 100% rename from scikits/learn/externals/README rename to sklearn/externals/README diff --git a/scikits/learn/externals/__init__.py b/sklearn/externals/__init__.py similarity index 100% rename from scikits/learn/externals/__init__.py rename to sklearn/externals/__init__.py diff --git a/scikits/learn/externals/copy_joblib.sh b/sklearn/externals/copy_joblib.sh similarity index 100% rename from scikits/learn/externals/copy_joblib.sh rename to sklearn/externals/copy_joblib.sh diff --git a/scikits/learn/externals/joblib/__init__.py b/sklearn/externals/joblib/__init__.py similarity index 96% rename from scikits/learn/externals/joblib/__init__.py rename to sklearn/externals/joblib/__init__.py index c587ab4e723a7..581a4d5063787 100755 --- a/scikits/learn/externals/joblib/__init__.py +++ b/sklearn/externals/joblib/__init__.py @@ -59,7 +59,7 @@ inputs and outputs: Python functions. Joblib can save their computation to disk and rerun it only if necessary:: - >>> from scikits.learn.externals.joblib import Memory + >>> from sklearn.externals.joblib import Memory >>> mem = Memory(cachedir='/tmp/joblib') >>> import numpy as np >>> a = np.vander(np.arange(3)) @@ -78,7 +78,7 @@ 2) **Embarrassingly parallel helper:** to make is easy to write readable parallel code and debug it quickly: - >>> from scikits.learn.externals.joblib import Parallel, delayed + >>> from sklearn.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/scikits/learn/externals/joblib/disk.py b/sklearn/externals/joblib/disk.py similarity index 100% rename from scikits/learn/externals/joblib/disk.py rename to sklearn/externals/joblib/disk.py diff --git a/scikits/learn/externals/joblib/format_stack.py b/sklearn/externals/joblib/format_stack.py similarity index 100% rename from scikits/learn/externals/joblib/format_stack.py rename to sklearn/externals/joblib/format_stack.py diff --git a/scikits/learn/externals/joblib/func_inspect.py b/sklearn/externals/joblib/func_inspect.py similarity index 100% rename from scikits/learn/externals/joblib/func_inspect.py rename to sklearn/externals/joblib/func_inspect.py diff --git a/scikits/learn/externals/joblib/hashing.py b/sklearn/externals/joblib/hashing.py similarity index 100% rename from scikits/learn/externals/joblib/hashing.py rename to sklearn/externals/joblib/hashing.py diff --git a/scikits/learn/externals/joblib/logger.py b/sklearn/externals/joblib/logger.py similarity index 100% rename from scikits/learn/externals/joblib/logger.py rename to sklearn/externals/joblib/logger.py diff --git a/scikits/learn/externals/joblib/memory.py b/sklearn/externals/joblib/memory.py similarity index 100% rename from scikits/learn/externals/joblib/memory.py rename to sklearn/externals/joblib/memory.py diff --git a/scikits/learn/externals/joblib/my_exceptions.py b/sklearn/externals/joblib/my_exceptions.py similarity index 100% rename from scikits/learn/externals/joblib/my_exceptions.py rename to sklearn/externals/joblib/my_exceptions.py diff --git a/scikits/learn/externals/joblib/numpy_pickle.py b/sklearn/externals/joblib/numpy_pickle.py similarity index 100% rename from scikits/learn/externals/joblib/numpy_pickle.py rename to sklearn/externals/joblib/numpy_pickle.py diff --git a/scikits/learn/externals/joblib/parallel.py b/sklearn/externals/joblib/parallel.py similarity index 97% rename from scikits/learn/externals/joblib/parallel.py rename to sklearn/externals/joblib/parallel.py index 782bcd6f2da43..312f4ee9a8d6d 100755 --- a/scikits/learn/externals/joblib/parallel.py +++ b/sklearn/externals/joblib/parallel.py @@ -199,7 +199,7 @@ class Parallel(Logger): A simple example: >>> from math import sqrt - >>> from scikits.learn.externals.joblib import Parallel, delayed + >>> from sklearn.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 scikits.learn.externals.joblib import Parallel, delayed + >>> from sklearn.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 scikits.learn.externals.joblib import Parallel, delayed + >>> from sklearn.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 scikits.learn.externals.joblib import Parallel, delayed + >>> from sklearn.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 scikits.learn.externals.joblib import Parallel, delayed + >>> from sklearn.externals.joblib import Parallel, delayed >>> def producer(): ... for i in range(6): diff --git a/scikits/learn/externals/joblib/test/__init__.py b/sklearn/externals/joblib/test/__init__.py similarity index 100% rename from scikits/learn/externals/joblib/test/__init__.py rename to sklearn/externals/joblib/test/__init__.py diff --git a/scikits/learn/externals/joblib/test/common.py b/sklearn/externals/joblib/test/common.py similarity index 100% rename from scikits/learn/externals/joblib/test/common.py rename to sklearn/externals/joblib/test/common.py diff --git a/scikits/learn/externals/joblib/test/test_format_stack.py b/sklearn/externals/joblib/test/test_format_stack.py similarity index 100% rename from scikits/learn/externals/joblib/test/test_format_stack.py rename to sklearn/externals/joblib/test/test_format_stack.py diff --git a/scikits/learn/externals/joblib/test/test_func_inspect.py b/sklearn/externals/joblib/test/test_func_inspect.py similarity index 100% rename from scikits/learn/externals/joblib/test/test_func_inspect.py rename to sklearn/externals/joblib/test/test_func_inspect.py diff --git a/scikits/learn/externals/joblib/test/test_hashing.py b/sklearn/externals/joblib/test/test_hashing.py similarity index 100% rename from scikits/learn/externals/joblib/test/test_hashing.py rename to sklearn/externals/joblib/test/test_hashing.py diff --git a/scikits/learn/externals/joblib/test/test_logger.py b/sklearn/externals/joblib/test/test_logger.py similarity index 100% rename from scikits/learn/externals/joblib/test/test_logger.py rename to sklearn/externals/joblib/test/test_logger.py diff --git a/scikits/learn/externals/joblib/test/test_memory.py b/sklearn/externals/joblib/test/test_memory.py similarity index 100% rename from scikits/learn/externals/joblib/test/test_memory.py rename to sklearn/externals/joblib/test/test_memory.py diff --git a/scikits/learn/externals/joblib/test/test_my_exceptions.py b/sklearn/externals/joblib/test/test_my_exceptions.py similarity index 100% rename from scikits/learn/externals/joblib/test/test_my_exceptions.py rename to sklearn/externals/joblib/test/test_my_exceptions.py diff --git a/scikits/learn/externals/joblib/test/test_numpy_pickle.py b/sklearn/externals/joblib/test/test_numpy_pickle.py similarity index 100% rename from scikits/learn/externals/joblib/test/test_numpy_pickle.py rename to sklearn/externals/joblib/test/test_numpy_pickle.py diff --git a/scikits/learn/externals/joblib/test/test_parallel.py b/sklearn/externals/joblib/test/test_parallel.py similarity index 100% rename from scikits/learn/externals/joblib/test/test_parallel.py rename to sklearn/externals/joblib/test/test_parallel.py diff --git a/scikits/learn/externals/joblib/testing.py b/sklearn/externals/joblib/testing.py similarity index 100% rename from scikits/learn/externals/joblib/testing.py rename to sklearn/externals/joblib/testing.py diff --git a/scikits/learn/externals/setup.py b/sklearn/externals/setup.py similarity index 100% rename from scikits/learn/externals/setup.py rename to sklearn/externals/setup.py diff --git a/scikits/learn/externals/test_externals_setup.py b/sklearn/externals/test_externals_setup.py similarity index 100% rename from scikits/learn/externals/test_externals_setup.py rename to sklearn/externals/test_externals_setup.py diff --git a/scikits/learn/feature_extraction/__init__.py b/sklearn/feature_extraction/__init__.py similarity index 100% rename from scikits/learn/feature_extraction/__init__.py rename to sklearn/feature_extraction/__init__.py diff --git a/scikits/learn/feature_extraction/image.py b/sklearn/feature_extraction/image.py similarity index 100% rename from scikits/learn/feature_extraction/image.py rename to sklearn/feature_extraction/image.py diff --git a/scikits/learn/feature_extraction/tests/__init__.py b/sklearn/feature_extraction/tests/__init__.py similarity index 100% rename from scikits/learn/feature_extraction/tests/__init__.py rename to sklearn/feature_extraction/tests/__init__.py diff --git a/scikits/learn/feature_extraction/tests/test_image.py b/sklearn/feature_extraction/tests/test_image.py similarity index 100% rename from scikits/learn/feature_extraction/tests/test_image.py rename to sklearn/feature_extraction/tests/test_image.py diff --git a/scikits/learn/feature_extraction/tests/test_text.py b/sklearn/feature_extraction/tests/test_text.py similarity index 94% rename from scikits/learn/feature_extraction/tests/test_text.py rename to sklearn/feature_extraction/tests/test_text.py index 429c54b283f0e..979f7796d3cee 100644 --- a/scikits/learn/feature_extraction/tests/test_text.py +++ b/sklearn/feature_extraction/tests/test_text.py @@ -1,15 +1,15 @@ -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 +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 import numpy as np from nose.tools import assert_equal, assert_equals, \ diff --git a/scikits/learn/feature_extraction/text.py b/sklearn/feature_extraction/text.py similarity index 100% rename from scikits/learn/feature_extraction/text.py rename to sklearn/feature_extraction/text.py diff --git a/scikits/learn/feature_selection/__init__.py b/sklearn/feature_selection/__init__.py similarity index 100% rename from scikits/learn/feature_selection/__init__.py rename to sklearn/feature_selection/__init__.py diff --git a/scikits/learn/feature_selection/rfe.py b/sklearn/feature_selection/rfe.py similarity index 100% rename from scikits/learn/feature_selection/rfe.py rename to sklearn/feature_selection/rfe.py diff --git a/scikits/learn/feature_selection/tests/__init__.py b/sklearn/feature_selection/tests/__init__.py similarity index 100% rename from scikits/learn/feature_selection/tests/__init__.py rename to sklearn/feature_selection/tests/__init__.py diff --git a/scikits/learn/feature_selection/tests/test_chi2.py b/sklearn/feature_selection/tests/test_chi2.py similarity index 100% rename from scikits/learn/feature_selection/tests/test_chi2.py rename to sklearn/feature_selection/tests/test_chi2.py diff --git a/scikits/learn/feature_selection/tests/test_feature_select.py b/sklearn/feature_selection/tests/test_feature_select.py similarity index 99% rename from scikits/learn/feature_selection/tests/test_feature_select.py rename to sklearn/feature_selection/tests/test_feature_select.py index 4319a83e5294e..4d4771665af1b 100644 --- a/scikits/learn/feature_selection/tests/test_feature_select.py +++ b/sklearn/feature_selection/tests/test_feature_select.py @@ -9,7 +9,7 @@ import numpy as np from numpy.testing import assert_array_equal from scipy import stats -from scikits.learn.datasets.samples_generator import make_classification, \ +from sklearn.datasets.samples_generator import make_classification, \ make_regression ############################################################################## diff --git a/scikits/learn/feature_selection/tests/test_rfe.py b/sklearn/feature_selection/tests/test_rfe.py similarity index 100% rename from scikits/learn/feature_selection/tests/test_rfe.py rename to sklearn/feature_selection/tests/test_rfe.py diff --git a/scikits/learn/feature_selection/univariate_selection.py b/sklearn/feature_selection/univariate_selection.py similarity index 100% rename from scikits/learn/feature_selection/univariate_selection.py rename to sklearn/feature_selection/univariate_selection.py diff --git a/scikits/learn/gaussian_process/__init__.py b/sklearn/gaussian_process/__init__.py similarity index 100% rename from scikits/learn/gaussian_process/__init__.py rename to sklearn/gaussian_process/__init__.py diff --git a/scikits/learn/gaussian_process/correlation_models.py b/sklearn/gaussian_process/correlation_models.py similarity index 100% rename from scikits/learn/gaussian_process/correlation_models.py rename to sklearn/gaussian_process/correlation_models.py diff --git a/scikits/learn/gaussian_process/gaussian_process.py b/sklearn/gaussian_process/gaussian_process.py similarity index 99% rename from scikits/learn/gaussian_process/gaussian_process.py rename to sklearn/gaussian_process/gaussian_process.py index 0a85246f847c7..1639396e99fa1 100644 --- a/scikits/learn/gaussian_process/gaussian_process.py +++ b/sklearn/gaussian_process/gaussian_process.py @@ -158,7 +158,7 @@ class GaussianProcess(BaseEstimator, RegressorMixin): Example ------- >>> import numpy as np - >>> from scikits.learn.gaussian_process import GaussianProcess + >>> from sklearn.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/scikits/learn/gaussian_process/regression_models.py b/sklearn/gaussian_process/regression_models.py similarity index 100% rename from scikits/learn/gaussian_process/regression_models.py rename to sklearn/gaussian_process/regression_models.py diff --git a/scikits/learn/gaussian_process/tests/__init__.py b/sklearn/gaussian_process/tests/__init__.py similarity index 100% rename from scikits/learn/gaussian_process/tests/__init__.py rename to sklearn/gaussian_process/tests/__init__.py diff --git a/scikits/learn/gaussian_process/tests/test_gaussian_process.py b/sklearn/gaussian_process/tests/test_gaussian_process.py similarity index 97% rename from scikits/learn/gaussian_process/tests/test_gaussian_process.py rename to sklearn/gaussian_process/tests/test_gaussian_process.py index 0f0e643a31c8b..89ea1d5b25b91 100644 --- a/scikits/learn/gaussian_process/tests/test_gaussian_process.py +++ b/sklearn/gaussian_process/tests/test_gaussian_process.py @@ -1,5 +1,5 @@ """ -Testing for Gaussian Process module (scikits.learn.gaussian_process) +Testing for Gaussian Process module (sklearn.gaussian_process) """ # Author: Vincent Dubourg diff --git a/scikits/learn/grid_search.py b/sklearn/grid_search.py similarity index 98% rename from scikits/learn/grid_search.py rename to sklearn/grid_search.py index 36c30f80132da..63292db3b2ab6 100644 --- a/scikits/learn/grid_search.py +++ b/sklearn/grid_search.py @@ -33,7 +33,7 @@ class IterGrid(object): Examples --------- - >>> from scikits.learn.grid_search import IterGrid + >>> from sklearn.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 - scikits.learn.cross_val module for the list of possible objects + sklearn.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 scikits.learn import svm, grid_search, datasets + >>> from sklearn import svm, grid_search, datasets >>> iris = datasets.load_iris() >>> parameters = {'kernel':('linear', 'rbf'), 'C':[1, 10]} >>> svr = svm.SVR() diff --git a/scikits/learn/hmm.py b/sklearn/hmm.py similarity index 99% rename from scikits/learn/hmm.py rename to sklearn/hmm.py index 8023901092145..b949bb17c1b34 100644 --- a/scikits/learn/hmm.py +++ b/sklearn/hmm.py @@ -578,7 +578,7 @@ class GaussianHMM(_BaseHMM): Examples -------- - >>> from scikits.learn.hmm import GaussianHMM + >>> from sklearn.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 scikits.learn.hmm import MultinomialHMM + >>> from sklearn.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 scikits.learn.hmm import GMMHMM + >>> from sklearn.hmm import GMMHMM >>> GMMHMM(n_components=2, n_mix=10, cvtype='diag') ... # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE GMMHMM(cvtype='diag', diff --git a/scikits/learn/lda.py b/sklearn/lda.py similarity index 99% rename from scikits/learn/lda.py rename to sklearn/lda.py index 224b8f6211be3..46427a6ea0ed8 100644 --- a/scikits/learn/lda.py +++ b/sklearn/lda.py @@ -40,7 +40,7 @@ class LDA(BaseEstimator, ClassifierMixin, TransformerMixin): Examples -------- >>> import numpy as np - >>> from scikits.learn.lda import LDA + >>> from sklearn.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/scikits/learn/linear_model/__init__.py b/sklearn/linear_model/__init__.py similarity index 93% rename from scikits/learn/linear_model/__init__.py rename to sklearn/linear_model/__init__.py index 65a7dae88d03f..2bb97881639bb 100644 --- a/scikits/learn/linear_model/__init__.py +++ b/sklearn/linear_model/__init__.py @@ -1,5 +1,5 @@ """ -:mod:`scikits.learn.linear_model` is a module to fit genelarized linear +:mod:`sklearn.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/scikits/learn/linear_model/base.py b/sklearn/linear_model/base.py similarity index 99% rename from scikits/learn/linear_model/base.py rename to sklearn/linear_model/base.py index ddc5cd0a37e4f..996fdc35df2eb 100644 --- a/scikits/learn/linear_model/base.py +++ b/sklearn/linear_model/base.py @@ -55,7 +55,7 @@ def _center_data(X, y, fit_intercept, normalize=False): nearly all linear models will want their data to be centered. WARNING : This function modifies X inplace : - Use scikits.learn.utils.as_float_array before to convert X to np.float. + Use sklearn.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/scikits/learn/linear_model/bayes.py b/sklearn/linear_model/bayes.py similarity index 99% rename from scikits/learn/linear_model/bayes.py rename to sklearn/linear_model/bayes.py index 6a8eaedf3d7e6..374f6fcf31374 100644 --- a/scikits/learn/linear_model/bayes.py +++ b/sklearn/linear_model/bayes.py @@ -101,7 +101,7 @@ class BayesianRidge(LinearModel): Examples -------- - >>> from scikits.learn import linear_model + >>> from sklearn 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 scikits.learn import linear_model + >>> from sklearn 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/scikits/learn/linear_model/cd_fast.c b/sklearn/linear_model/cd_fast.c similarity index 100% rename from scikits/learn/linear_model/cd_fast.c rename to sklearn/linear_model/cd_fast.c diff --git a/scikits/learn/linear_model/cd_fast.pyx b/sklearn/linear_model/cd_fast.pyx similarity index 100% rename from scikits/learn/linear_model/cd_fast.pyx rename to sklearn/linear_model/cd_fast.pyx diff --git a/scikits/learn/linear_model/coordinate_descent.py b/sklearn/linear_model/coordinate_descent.py similarity index 99% rename from scikits/learn/linear_model/coordinate_descent.py rename to sklearn/linear_model/coordinate_descent.py index 89bc7c762b540..49b662073002d 100644 --- a/scikits/learn/linear_model/coordinate_descent.py +++ b/sklearn/linear_model/coordinate_descent.py @@ -226,7 +226,7 @@ class Lasso(ElasticNet): Examples -------- - >>> from scikits.learn import linear_model + >>> from sklearn 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 - scikits.learn.cross_val module for the list of possible objects + sklearn.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 - scikits.learn.cross_val module for the list of possible objects + sklearn.cross_val module for the list of possible objects Notes diff --git a/scikits/learn/linear_model/least_angle.py b/sklearn/linear_model/least_angle.py similarity index 99% rename from scikits/learn/linear_model/least_angle.py rename to sklearn/linear_model/least_angle.py index 847c68f0b7cb9..c9be3dc9e2b3e 100644 --- a/scikits/learn/linear_model/least_angle.py +++ b/sklearn/linear_model/least_angle.py @@ -343,7 +343,7 @@ class Lars(LinearModel): Examples -------- - >>> from scikits.learn import linear_model + >>> from sklearn 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 scikits.learn import linear_model + >>> from sklearn 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 scikits.learn.cross_val module. If None is passed, default to + see sklearn.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 scikits.learn.cross_val module. If None is passed, default to + see sklearn.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 scikits.learn import linear_model + >>> from sklearn 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/scikits/learn/linear_model/logistic.py b/sklearn/linear_model/logistic.py similarity index 100% rename from scikits/learn/linear_model/logistic.py rename to sklearn/linear_model/logistic.py diff --git a/scikits/learn/linear_model/omp.py b/sklearn/linear_model/omp.py similarity index 100% rename from scikits/learn/linear_model/omp.py rename to sklearn/linear_model/omp.py diff --git a/scikits/learn/linear_model/ridge.py b/sklearn/linear_model/ridge.py similarity index 99% rename from scikits/learn/linear_model/ridge.py rename to sklearn/linear_model/ridge.py index c31b314109ee0..578af2791e12d 100644 --- a/scikits/learn/linear_model/ridge.py +++ b/sklearn/linear_model/ridge.py @@ -155,7 +155,7 @@ class Ridge(LinearModel): Examples -------- - >>> from scikits.learn.linear_model import Ridge + >>> from sklearn.linear_model import Ridge >>> import numpy as np >>> n_samples, n_features = 10, 5 >>> np.random.seed(0) diff --git a/scikits/learn/linear_model/setup.py b/sklearn/linear_model/setup.py similarity index 100% rename from scikits/learn/linear_model/setup.py rename to sklearn/linear_model/setup.py diff --git a/scikits/learn/linear_model/sgd_fast.c b/sklearn/linear_model/sgd_fast.c similarity index 74% rename from scikits/learn/linear_model/sgd_fast.c rename to sklearn/linear_model/sgd_fast.c index 8d1f8e86ca74e..7cebda799c4f1 100644 --- a/scikits/learn/linear_model/sgd_fast.c +++ b/sklearn/linear_model/sgd_fast.c @@ -1,39 +1,18 @@ -/* Generated by Cython 0.14.1 on Wed May 11 16:17:32 2011 */ +/* Generated by Cython 0.12.1 on Fri Sep 2 11:08: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 /* 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,43 +82,14 @@ #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 -#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) @@ -153,42 +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) || (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)) + #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 @@ -208,69 +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 -#define __PYX_HAVE_API__scikits__learn__linear_model__sgd_fast -#include "stdio.h" +#define __PYX_HAVE_API__sklearn__linear_model__sgd_fast #include "stdlib.h" +#include "stdio.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 */ -#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*); @@ -280,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 ... */ @@ -300,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) @@ -325,11 +308,6 @@ static const char *__pyx_filename; #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; @@ -368,9 +346,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_7scikits_5learn_12linear_model_8sgd_fast_DOUBLE; +typedef __pyx_t_5numpy_float64_t __pyx_t_7sklearn_12linear_model_8sgd_fast_DOUBLE; -typedef __pyx_t_5numpy_int32_t __pyx_t_7scikits_5learn_12linear_model_8sgd_fast_INTEGER; +typedef __pyx_t_5numpy_int32_t __pyx_t_7sklearn_12linear_model_8sgd_fast_INTEGER; #if CYTHON_CCOMPLEX #ifdef __cplusplus @@ -402,7 +380,7 @@ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; typedef npy_cdouble __pyx_t_5numpy_complex_t; -/* "scikits/learn/linear_model/sgd_fast.pxd":20 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pxd":20 * # ----------------------------------------- * * cdef class LossFunction: # <<<<<<<<<<<<<< @@ -410,12 +388,12 @@ typedef npy_cdouble __pyx_t_5numpy_complex_t; * cpdef double dloss(self, double p, double y) */ -struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction { +struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction { PyObject_HEAD - struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *__pyx_vtab; + struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_LossFunction *__pyx_vtab; }; -/* "scikits/learn/linear_model/sgd_fast.pxd":24 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pxd":24 * cpdef double dloss(self, double p, double y) * * cdef class Regression(LossFunction): # <<<<<<<<<<<<<< @@ -423,23 +401,24 @@ struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction { * cpdef double dloss(self,double p, double y) */ -struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Regression { - struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction __pyx_base; +struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Regression { + struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction __pyx_base; }; -/* "scikits/learn/linear_model/sgd_fast.pxd":44 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/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_obj_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss { - struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Regression __pyx_base; +struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Huber { + struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Regression __pyx_base; + double c; }; -/* "scikits/learn/linear_model/sgd_fast.pxd":28 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pxd":28 * cpdef double dloss(self,double p, double y) * * cdef class Classification(LossFunction): # <<<<<<<<<<<<<< @@ -447,36 +426,35 @@ struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss { * cpdef double dloss(self, double p, double y) */ -struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Classification { - struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction __pyx_base; +struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Classification { + struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction __pyx_base; }; -/* "scikits/learn/linear_model/sgd_fast.pxd":36 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pxd":40 * cpdef double dloss(self, double p, double y) * - * cdef class Hinge(Classification): # <<<<<<<<<<<<<< + * cdef class Log(Classification): # <<<<<<<<<<<<<< * cpdef double loss(self, double p, double y) * cpdef double dloss(self, double p, double y) */ -struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Hinge { - struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Classification __pyx_base; +struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Log { + struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Classification __pyx_base; }; -/* "scikits/learn/linear_model/sgd_fast.pxd":48 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pxd":36 * cpdef double dloss(self, double p, double y) * - * cdef class Huber(Regression): # <<<<<<<<<<<<<< - * cdef double c + * cdef class Hinge(Classification): # <<<<<<<<<<<<<< * cpdef double loss(self, double p, double y) + * cpdef double dloss(self, double p, double y) */ -struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Huber { - struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Regression __pyx_base; - double c; +struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Hinge { + struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Classification __pyx_base; }; -/* "scikits/learn/linear_model/sgd_fast.pxd":32 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pxd":32 * cpdef double dloss(self, double p, double y) * * cdef class ModifiedHuber(Classification): # <<<<<<<<<<<<<< @@ -484,24 +462,24 @@ struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Huber { * cpdef double dloss(self, double p, double y) */ -struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber { - struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Classification __pyx_base; +struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_ModifiedHuber { + struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Classification __pyx_base; }; -/* "scikits/learn/linear_model/sgd_fast.pxd":40 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pxd":44 * cpdef double dloss(self, double p, double y) * - * cdef class Log(Classification): # <<<<<<<<<<<<<< + * cdef class SquaredLoss(Regression): # <<<<<<<<<<<<<< * cpdef double loss(self, double p, double y) * cpdef double dloss(self, double p, double y) */ -struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Log { - struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Classification __pyx_base; +struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_SquaredLoss { + struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Regression __pyx_base; }; -/* "scikits/learn/linear_model/sgd_fast.pyx":31 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":31 * # ---------------------------------------- * * cdef class LossFunction: # <<<<<<<<<<<<<< @@ -509,14 +487,14 @@ struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Log { * */ -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); +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); }; -static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_LossFunction; +static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_LossFunction *__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_LossFunction; -/* "scikits/learn/linear_model/sgd_fast.pyx":69 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":69 * * * cdef class Regression(LossFunction): # <<<<<<<<<<<<<< @@ -524,27 +502,27 @@ static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_LossFunc * */ -struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Regression { - struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_LossFunction __pyx_base; +struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Regression { + struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_LossFunction __pyx_base; }; -static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Regression *__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Regression; +static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Regression *__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_Regression; -/* "scikits/learn/linear_model/sgd_fast.pyx":174 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":162 * * - * cdef class Huber(Regression): # <<<<<<<<<<<<<< - * """Huber regression loss - * + * cdef class SquaredLoss(Regression): # <<<<<<<<<<<<<< + * """Squared loss traditional used in linear regression.""" + * cpdef double loss(self, double p, double y): */ -struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Huber { - struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Regression __pyx_base; +struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_SquaredLoss { + struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Regression __pyx_base; }; -static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Huber *__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Huber; +static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_SquaredLoss *__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_SquaredLoss; -/* "scikits/learn/linear_model/sgd_fast.pyx":79 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":79 * * * cdef class Classification(LossFunction): # <<<<<<<<<<<<<< @@ -552,27 +530,27 @@ static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Huber *_ * */ -struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Classification { - struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_LossFunction __pyx_base; +struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Classification { + struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_LossFunction __pyx_base; }; -static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Classification *__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Classification; +static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Classification *__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_Classification; -/* "scikits/learn/linear_model/sgd_fast.pyx":119 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":89 * * - * cdef class Hinge(Classification): # <<<<<<<<<<<<<< - * """SVM loss for binary classification tasks with y in {-1,1}""" - * cpdef double loss(self, double p, double y): + * cdef class ModifiedHuber(Classification): # <<<<<<<<<<<<<< + * """Modified Huber loss for binary classification with y in {-1, 1} + * */ -struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Hinge { - struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Classification __pyx_base; +struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_ModifiedHuber { + struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Classification __pyx_base; }; -static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Hinge *__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Hinge; +static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_ModifiedHuber *__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_ModifiedHuber; -/* "scikits/learn/linear_model/sgd_fast.pyx":137 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":137 * * * cdef class Log(Classification): # <<<<<<<<<<<<<< @@ -580,38 +558,38 @@ static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Hinge *_ * */ -struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Log { - struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Classification __pyx_base; +struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Log { + struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Classification __pyx_base; }; -static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Log *__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Log; +static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Log *__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_Log; -/* "scikits/learn/linear_model/sgd_fast.pyx":89 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":174 * * - * cdef class ModifiedHuber(Classification): # <<<<<<<<<<<<<< - * """Modified Huber loss for binary classification with y in {-1, 1} + * cdef class Huber(Regression): # <<<<<<<<<<<<<< + * """Huber regression loss * */ -struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber { - struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Classification __pyx_base; +struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Huber { + struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Regression __pyx_base; }; -static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber *__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber; +static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Huber *__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_Huber; -/* "scikits/learn/linear_model/sgd_fast.pyx":162 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":119 * * - * cdef class SquaredLoss(Regression): # <<<<<<<<<<<<<< - * """Squared loss traditional used in linear regression.""" + * 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_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss { - struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Regression __pyx_base; +struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Hinge { + struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Classification __pyx_base; }; -static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss *__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss; +static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Hinge *__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_Hinge; #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 @@ -659,24 +637,14 @@ static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_SquaredL #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 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_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, - const char *name, int exact); /*proto*/ - /* Run-time type information about structs used with buffers */ struct __Pyx_StructField_; @@ -699,8 +667,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*/ @@ -716,11 +684,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); @@ -733,14 +701,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); @@ -753,15 +721,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); @@ -775,18 +743,27 @@ 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; } -static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); +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 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); @@ -800,13 +777,17 @@ Py_ssize_t __Pyx_minusones[] = {-1, -1}; static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ -static int __Pyx_Print(PyObject*, PyObject *, int); /*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*/ #if PY_MAJOR_VERSION >= 3 static PyObject* __pyx_print = 0; static PyObject* __pyx_print_kwargs = 0; #endif -static int __Pyx_PrintOne(PyObject* stream, PyObject *o); /*proto*/ +static int __Pyx_PrintOne(PyObject *o); /*proto*/ #if CYTHON_CCOMPLEX #ifdef __cplusplus @@ -841,17 +822,11 @@ 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)) - #if 1 - #define __Pyx_c_absf(z) (::std::abs(z)) - #define __Pyx_c_powf(a, b) (::std::pow(a, b)) - #endif + /*#define __Pyx_c_absf(z) (::std::abs(z))*/ #else #define __Pyx_c_is_zerof(z) ((z)==0) #define __Pyx_c_conjf(z) (conjf(z)) - #if 1 - #define __Pyx_c_absf(z) (cabsf(z)) - #define __Pyx_c_powf(a, b) (cpowf(a, b)) - #endif + /*#define __Pyx_c_absf(z) (cabsf(z))*/ #endif #else static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex); @@ -862,10 +837,7 @@ 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); - #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 + /*static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex);*/ #endif static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); @@ -880,17 +852,11 @@ 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)) - #if 1 - #define __Pyx_c_abs(z) (::std::abs(z)) - #define __Pyx_c_pow(a, b) (::std::pow(a, b)) - #endif + /*#define __Pyx_c_abs(z) (::std::abs(z))*/ #else #define __Pyx_c_is_zero(z) ((z)==0) #define __Pyx_c_conj(z) (conj(z)) - #if 1 - #define __Pyx_c_abs(z) (cabs(z)) - #define __Pyx_c_pow(a, b) (cpow(a, b)) - #endif + /*#define __Pyx_c_abs(z) (cabs(z))*/ #endif #else static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex); @@ -901,10 +867,7 @@ 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); - #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 + /*static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex);*/ #endif static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *); @@ -925,8 +888,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 *); @@ -950,15 +911,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 */ @@ -979,28 +938,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 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' }; +/* 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' }; static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), '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 "scikits.learn.linear_model.sgd_fast" -static int __pyx_module_is_main_scikits__learn__linear_model__sgd_fast = 0; +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; -/* Implementation of scikits.learn.linear_model.sgd_fast */ +/* Implementation of sklearn.linear_model.sgd_fast */ static PyObject *__pyx_builtin_NotImplementedError; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_range; @@ -1009,13 +968,12 @@ 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_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_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__B[] = "B"; static char __pyx_k__H[] = "H"; static char __pyx_k__I[] = "I"; @@ -1078,13 +1036,11 @@ 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"; @@ -1098,15 +1054,14 @@ 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; @@ -1114,7 +1069,6 @@ 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; @@ -1149,7 +1103,6 @@ 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; @@ -1171,15 +1124,8 @@ static PyObject *__pyx_n_s__weight_pos; static PyObject *__pyx_n_s__y; static PyObject *__pyx_n_s__zeros; static PyObject *__pyx_int_15; -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 + +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":34 * """Base class for convex loss functions""" * * cpdef double loss(self, double p, double y): # <<<<<<<<<<<<<< @@ -1187,8 +1133,8 @@ static PyObject *__pyx_k_tuple_17; * */ -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) { +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) { double __pyx_r; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -1202,22 +1148,22 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_12LossFunction_l 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_7scikits_5learn_12linear_model_8sgd_fast_12LossFunction_loss)) { + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_7sklearn_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(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__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, ((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_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_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__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; @@ -1227,7 +1173,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_12LossFunction_l __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "scikits/learn/linear_model/sgd_fast.pyx":49 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":49 * The loss evaluated at `p` and `y`. * """ * raise NotImplementedError() # <<<<<<<<<<<<<< @@ -1247,14 +1193,14 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_12LossFunction_l __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_WriteUnraisable("scikits.learn.linear_model.sgd_fast.LossFunction.loss"); + __Pyx_WriteUnraisable("sklearn.linear_model.sgd_fast.LossFunction.loss"); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "scikits/learn/linear_model/sgd_fast.pyx":34 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":34 * """Base class for convex loss functions""" * * cpdef double loss(self, double p, double y): # <<<<<<<<<<<<<< @@ -1262,9 +1208,9 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_12LossFunction_l * */ -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) { +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) { double __pyx_v_p; double __pyx_v_y; PyObject *__pyx_r = NULL; @@ -1307,12 +1253,11 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_12LossFunctio __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("scikits.learn.linear_model.sgd_fast.LossFunction.loss"); - __Pyx_RefNannyFinishContext(); + __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.LossFunction.loss"); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_XDECREF(__pyx_r); - __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_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_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -1322,7 +1267,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_12LossFunctio goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.LossFunction.loss"); + __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.LossFunction.loss"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -1330,7 +1275,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_12LossFunctio return __pyx_r; } -/* "scikits/learn/linear_model/sgd_fast.pyx":51 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":51 * raise NotImplementedError() * * cpdef double dloss(self, double p, double y): # <<<<<<<<<<<<<< @@ -1338,8 +1283,8 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_12LossFunctio * the prediction `p`. */ -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) { +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) { double __pyx_r; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -1353,22 +1298,22 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_12LossFunction_d 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_7scikits_5learn_12linear_model_8sgd_fast_12LossFunction_1dloss)) { + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_7sklearn_12linear_model_8sgd_fast_12LossFunction_dloss)) { __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(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__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, ((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_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_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__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; @@ -1378,7 +1323,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_12LossFunction_d __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "scikits/learn/linear_model/sgd_fast.pyx":66 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":66 * The derivative of the loss function w.r.t. `p`. * """ * raise NotImplementedError() # <<<<<<<<<<<<<< @@ -1398,14 +1343,14 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_12LossFunction_d __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_WriteUnraisable("scikits.learn.linear_model.sgd_fast.LossFunction.dloss"); + __Pyx_WriteUnraisable("sklearn.linear_model.sgd_fast.LossFunction.dloss"); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "scikits/learn/linear_model/sgd_fast.pyx":51 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":51 * raise NotImplementedError() * * cpdef double dloss(self, double p, double y): # <<<<<<<<<<<<<< @@ -1413,9 +1358,9 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_12LossFunction_d * the prediction `p`. */ -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) { +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) { double __pyx_v_p; double __pyx_v_y; PyObject *__pyx_r = NULL; @@ -1458,12 +1403,11 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_12LossFunctio __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("scikits.learn.linear_model.sgd_fast.LossFunction.dloss"); - __Pyx_RefNannyFinishContext(); + __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.LossFunction.dloss"); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_XDECREF(__pyx_r); - __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_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_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -1473,7 +1417,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_12LossFunctio goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.LossFunction.dloss"); + __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.LossFunction.dloss"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -1481,7 +1425,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_12LossFunctio return __pyx_r; } -/* "scikits/learn/linear_model/sgd_fast.pyx":72 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":72 * """Base class for loss functions for regression""" * * cpdef double loss(self, double p, double y): # <<<<<<<<<<<<<< @@ -1489,8 +1433,8 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_12LossFunctio * */ -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) { +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) { double __pyx_r; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -1504,22 +1448,22 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_10Regression_los 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_7scikits_5learn_12linear_model_8sgd_fast_10Regression_loss)) { + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_7sklearn_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(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__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, ((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_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_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__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; @@ -1529,7 +1473,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_10Regression_los __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "scikits/learn/linear_model/sgd_fast.pyx":73 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":73 * * cpdef double loss(self, double p, double y): * raise NotImplementedError() # <<<<<<<<<<<<<< @@ -1549,14 +1493,14 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_10Regression_los __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_WriteUnraisable("scikits.learn.linear_model.sgd_fast.Regression.loss"); + __Pyx_WriteUnraisable("sklearn.linear_model.sgd_fast.Regression.loss"); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "scikits/learn/linear_model/sgd_fast.pyx":72 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":72 * """Base class for loss functions for regression""" * * cpdef double loss(self, double p, double y): # <<<<<<<<<<<<<< @@ -1564,8 +1508,8 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_10Regression_los * */ -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) { +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) { double __pyx_v_p; double __pyx_v_y; PyObject *__pyx_r = NULL; @@ -1608,12 +1552,11 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_10Regression_ __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("scikits.learn.linear_model.sgd_fast.Regression.loss"); - __Pyx_RefNannyFinishContext(); + __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Regression.loss"); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_XDECREF(__pyx_r); - __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_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_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -1623,7 +1566,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_10Regression_ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.Regression.loss"); + __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Regression.loss"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -1631,7 +1574,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_10Regression_ return __pyx_r; } -/* "scikits/learn/linear_model/sgd_fast.pyx":75 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":75 * raise NotImplementedError() * * cpdef double dloss(self, double p, double y): # <<<<<<<<<<<<<< @@ -1639,8 +1582,8 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_10Regression_ * */ -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) { +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) { double __pyx_r; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -1654,22 +1597,22 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_10Regression_dlo 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_7scikits_5learn_12linear_model_8sgd_fast_10Regression_1dloss)) { + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_7sklearn_12linear_model_8sgd_fast_10Regression_dloss)) { __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(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__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, ((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_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_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__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; @@ -1679,7 +1622,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_10Regression_dlo __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "scikits/learn/linear_model/sgd_fast.pyx":76 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":76 * * cpdef double dloss(self, double p, double y): * raise NotImplementedError() # <<<<<<<<<<<<<< @@ -1699,14 +1642,14 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_10Regression_dlo __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_WriteUnraisable("scikits.learn.linear_model.sgd_fast.Regression.dloss"); + __Pyx_WriteUnraisable("sklearn.linear_model.sgd_fast.Regression.dloss"); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "scikits/learn/linear_model/sgd_fast.pyx":75 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":75 * raise NotImplementedError() * * cpdef double dloss(self, double p, double y): # <<<<<<<<<<<<<< @@ -1714,8 +1657,8 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_10Regression_dlo * */ -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) { +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) { double __pyx_v_p; double __pyx_v_y; PyObject *__pyx_r = NULL; @@ -1758,12 +1701,11 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_10Regression_ __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("scikits.learn.linear_model.sgd_fast.Regression.dloss"); - __Pyx_RefNannyFinishContext(); + __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Regression.dloss"); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_XDECREF(__pyx_r); - __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_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_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -1773,7 +1715,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_10Regression_ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.Regression.dloss"); + __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Regression.dloss"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -1781,7 +1723,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_10Regression_ return __pyx_r; } -/* "scikits/learn/linear_model/sgd_fast.pyx":82 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":82 * """Base class for loss functions for classification""" * * cpdef double loss(self, double p, double y): # <<<<<<<<<<<<<< @@ -1789,8 +1731,8 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_10Regression_ * */ -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) { +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) { double __pyx_r; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -1804,22 +1746,22 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_14Classification 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_7scikits_5learn_12linear_model_8sgd_fast_14Classification_loss)) { + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_7sklearn_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(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__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, ((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_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_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__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; @@ -1829,7 +1771,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_14Classification __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "scikits/learn/linear_model/sgd_fast.pyx":83 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":83 * * cpdef double loss(self, double p, double y): * raise NotImplementedError() # <<<<<<<<<<<<<< @@ -1849,14 +1791,14 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_14Classification __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_WriteUnraisable("scikits.learn.linear_model.sgd_fast.Classification.loss"); + __Pyx_WriteUnraisable("sklearn.linear_model.sgd_fast.Classification.loss"); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "scikits/learn/linear_model/sgd_fast.pyx":82 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":82 * """Base class for loss functions for classification""" * * cpdef double loss(self, double p, double y): # <<<<<<<<<<<<<< @@ -1864,8 +1806,8 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_14Classification * */ -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) { +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) { double __pyx_v_p; double __pyx_v_y; PyObject *__pyx_r = NULL; @@ -1908,12 +1850,11 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_14Classificat __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("scikits.learn.linear_model.sgd_fast.Classification.loss"); - __Pyx_RefNannyFinishContext(); + __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Classification.loss"); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_XDECREF(__pyx_r); - __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_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_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -1923,7 +1864,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_14Classificat goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.Classification.loss"); + __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Classification.loss"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -1931,7 +1872,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_14Classificat return __pyx_r; } -/* "scikits/learn/linear_model/sgd_fast.pyx":85 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":85 * raise NotImplementedError() * * cpdef double dloss(self, double p, double y): # <<<<<<<<<<<<<< @@ -1939,8 +1880,8 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_14Classificat * */ -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) { +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) { double __pyx_r; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -1954,22 +1895,22 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_14Classification 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_7scikits_5learn_12linear_model_8sgd_fast_14Classification_1dloss)) { + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_7sklearn_12linear_model_8sgd_fast_14Classification_dloss)) { __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(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__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, ((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_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_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__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; @@ -1979,7 +1920,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_14Classification __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "scikits/learn/linear_model/sgd_fast.pyx":86 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":86 * * cpdef double dloss(self, double p, double y): * raise NotImplementedError() # <<<<<<<<<<<<<< @@ -1999,14 +1940,14 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_14Classification __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_WriteUnraisable("scikits.learn.linear_model.sgd_fast.Classification.dloss"); + __Pyx_WriteUnraisable("sklearn.linear_model.sgd_fast.Classification.dloss"); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "scikits/learn/linear_model/sgd_fast.pyx":85 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":85 * raise NotImplementedError() * * cpdef double dloss(self, double p, double y): # <<<<<<<<<<<<<< @@ -2014,8 +1955,8 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_14Classification * */ -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) { +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) { double __pyx_v_p; double __pyx_v_y; PyObject *__pyx_r = NULL; @@ -2058,12 +1999,11 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_14Classificat __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("scikits.learn.linear_model.sgd_fast.Classification.dloss"); - __Pyx_RefNannyFinishContext(); + __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Classification.dloss"); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_XDECREF(__pyx_r); - __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_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_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -2073,7 +2013,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_14Classificat goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.Classification.dloss"); + __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Classification.dloss"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -2081,7 +2021,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_14Classificat return __pyx_r; } -/* "scikits/learn/linear_model/sgd_fast.pyx":97 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":97 * Stochastic Gradient Descent', ICML'04. * """ * cpdef double loss(self, double p, double y): # <<<<<<<<<<<<<< @@ -2089,8 +2029,8 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_14Classificat * if z >= 1.0: */ -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) { +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) { double __pyx_v_z; double __pyx_r; PyObject *__pyx_t_1 = NULL; @@ -2100,28 +2040,29 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_13ModifiedHuber_ 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_7scikits_5learn_12linear_model_8sgd_fast_13ModifiedHuber_loss)) { + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_7sklearn_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(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__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, ((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_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_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__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; @@ -2131,7 +2072,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_13ModifiedHuber_ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "scikits/learn/linear_model/sgd_fast.pyx":98 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":98 * """ * cpdef double loss(self, double p, double y): * cdef double z = p * y # <<<<<<<<<<<<<< @@ -2140,7 +2081,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_13ModifiedHuber_ */ __pyx_v_z = (__pyx_v_p * __pyx_v_y); - /* "scikits/learn/linear_model/sgd_fast.pyx":99 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":99 * cpdef double loss(self, double p, double y): * cdef double z = p * y * if z >= 1.0: # <<<<<<<<<<<<<< @@ -2150,7 +2091,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_13ModifiedHuber_ __pyx_t_6 = (__pyx_v_z >= 1.0); if (__pyx_t_6) { - /* "scikits/learn/linear_model/sgd_fast.pyx":100 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":100 * cdef double z = p * y * if z >= 1.0: * return 0.0 # <<<<<<<<<<<<<< @@ -2162,17 +2103,17 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_13ModifiedHuber_ goto __pyx_L3; } - /* "scikits/learn/linear_model/sgd_fast.pyx":101 + /* "/home/fabian/dev/scikit-learn/sklearn/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) { - /* "scikits/learn/linear_model/sgd_fast.pyx":102 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":102 * return 0.0 * elif z >= -1.0: * return (1.0 - z) * (1.0 - z) # <<<<<<<<<<<<<< @@ -2185,14 +2126,14 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_13ModifiedHuber_ } /*else*/ { - /* "scikits/learn/linear_model/sgd_fast.pyx":104 + /* "/home/fabian/dev/scikit-learn/sklearn/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:; @@ -2204,14 +2145,15 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_13ModifiedHuber_ __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_WriteUnraisable("scikits.learn.linear_model.sgd_fast.ModifiedHuber.loss"); + __Pyx_WriteUnraisable("sklearn.linear_model.sgd_fast.ModifiedHuber.loss"); __pyx_r = 0; __pyx_L0:; + __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "scikits/learn/linear_model/sgd_fast.pyx":97 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":97 * Stochastic Gradient Descent', ICML'04. * """ * cpdef double loss(self, double p, double y): # <<<<<<<<<<<<<< @@ -2219,8 +2161,8 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_13ModifiedHuber_ * if z >= 1.0: */ -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) { +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) { double __pyx_v_p; double __pyx_v_y; PyObject *__pyx_r = NULL; @@ -2263,12 +2205,11 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_13ModifiedHub __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("scikits.learn.linear_model.sgd_fast.ModifiedHuber.loss"); - __Pyx_RefNannyFinishContext(); + __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.ModifiedHuber.loss"); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_XDECREF(__pyx_r); - __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_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_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -2278,7 +2219,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_13ModifiedHub goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.ModifiedHuber.loss"); + __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.ModifiedHuber.loss"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -2286,7 +2227,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_13ModifiedHub return __pyx_r; } -/* "scikits/learn/linear_model/sgd_fast.pyx":106 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":106 * return -4.0 * z * * cpdef double dloss(self, double p, double y): # <<<<<<<<<<<<<< @@ -2294,8 +2235,8 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_13ModifiedHub * if z >= 1.0: */ -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) { +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) { double __pyx_v_z; double __pyx_r; PyObject *__pyx_t_1 = NULL; @@ -2305,28 +2246,29 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_13ModifiedHuber_ 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_7scikits_5learn_12linear_model_8sgd_fast_13ModifiedHuber_1dloss)) { + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_7sklearn_12linear_model_8sgd_fast_13ModifiedHuber_dloss)) { __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(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__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, ((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_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_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__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; @@ -2336,7 +2278,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_13ModifiedHuber_ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "scikits/learn/linear_model/sgd_fast.pyx":107 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":107 * * cpdef double dloss(self, double p, double y): * cdef double z = p * y # <<<<<<<<<<<<<< @@ -2345,7 +2287,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_13ModifiedHuber_ */ __pyx_v_z = (__pyx_v_p * __pyx_v_y); - /* "scikits/learn/linear_model/sgd_fast.pyx":108 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":108 * cpdef double dloss(self, double p, double y): * cdef double z = p * y * if z >= 1.0: # <<<<<<<<<<<<<< @@ -2355,7 +2297,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_13ModifiedHuber_ __pyx_t_6 = (__pyx_v_z >= 1.0); if (__pyx_t_6) { - /* "scikits/learn/linear_model/sgd_fast.pyx":109 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":109 * cdef double z = p * y * if z >= 1.0: * return 0.0 # <<<<<<<<<<<<<< @@ -2367,17 +2309,17 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_13ModifiedHuber_ goto __pyx_L3; } - /* "scikits/learn/linear_model/sgd_fast.pyx":110 + /* "/home/fabian/dev/scikit-learn/sklearn/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) { - /* "scikits/learn/linear_model/sgd_fast.pyx":111 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":111 * return 0.0 * elif z >= -1.0: * return 2.0 * (1.0 - z) * -y # <<<<<<<<<<<<<< @@ -2390,14 +2332,14 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_13ModifiedHuber_ } /*else*/ { - /* "scikits/learn/linear_model/sgd_fast.pyx":113 + /* "/home/fabian/dev/scikit-learn/sklearn/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:; @@ -2409,14 +2351,15 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_13ModifiedHuber_ __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_WriteUnraisable("scikits.learn.linear_model.sgd_fast.ModifiedHuber.dloss"); + __Pyx_WriteUnraisable("sklearn.linear_model.sgd_fast.ModifiedHuber.dloss"); __pyx_r = 0; __pyx_L0:; + __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "scikits/learn/linear_model/sgd_fast.pyx":106 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":106 * return -4.0 * z * * cpdef double dloss(self, double p, double y): # <<<<<<<<<<<<<< @@ -2424,8 +2367,8 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_13ModifiedHuber_ * if z >= 1.0: */ -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) { +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) { double __pyx_v_p; double __pyx_v_y; PyObject *__pyx_r = NULL; @@ -2468,12 +2411,11 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_13ModifiedHub __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("scikits.learn.linear_model.sgd_fast.ModifiedHuber.dloss"); - __Pyx_RefNannyFinishContext(); + __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.ModifiedHuber.dloss"); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_XDECREF(__pyx_r); - __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_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_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -2483,7 +2425,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_13ModifiedHub goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.ModifiedHuber.dloss"); + __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.ModifiedHuber.dloss"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -2491,7 +2433,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_13ModifiedHub return __pyx_r; } -/* "scikits/learn/linear_model/sgd_fast.pyx":115 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":115 * return -4.0 * y * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -2499,13 +2441,13 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_13ModifiedHub * */ -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) { +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) { PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce__"); - /* "scikits/learn/linear_model/sgd_fast.pyx":116 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":116 * * def __reduce__(self): * return ModifiedHuber, () # <<<<<<<<<<<<<< @@ -2514,14 +2456,14 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_13ModifiedHub */ __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(((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_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_INCREF(((PyObject *)__pyx_empty_tuple)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_empty_tuple)); __Pyx_GIVEREF(((PyObject *)__pyx_empty_tuple)); - __pyx_r = ((PyObject *)__pyx_t_1); + __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; @@ -2529,7 +2471,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_13ModifiedHub goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.ModifiedHuber.__reduce__"); + __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.ModifiedHuber.__reduce__"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -2537,7 +2479,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_13ModifiedHub return __pyx_r; } -/* "scikits/learn/linear_model/sgd_fast.pyx":121 +/* "/home/fabian/dev/scikit-learn/sklearn/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): # <<<<<<<<<<<<<< @@ -2545,8 +2487,8 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_13ModifiedHub * if z < 1.0: */ -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) { +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) { double __pyx_v_z; double __pyx_r; PyObject *__pyx_t_1 = NULL; @@ -2556,28 +2498,29 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_5Hinge_loss(stru 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_7scikits_5learn_12linear_model_8sgd_fast_5Hinge_loss)) { + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_7sklearn_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(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__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, ((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_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_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__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; @@ -2587,7 +2530,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_5Hinge_loss(stru __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "scikits/learn/linear_model/sgd_fast.pyx":122 + /* "/home/fabian/dev/scikit-learn/sklearn/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 # <<<<<<<<<<<<<< @@ -2596,7 +2539,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_5Hinge_loss(stru */ __pyx_v_z = (__pyx_v_p * __pyx_v_y); - /* "scikits/learn/linear_model/sgd_fast.pyx":123 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":123 * cpdef double loss(self, double p, double y): * cdef double z = p * y * if z < 1.0: # <<<<<<<<<<<<<< @@ -2606,20 +2549,20 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_5Hinge_loss(stru __pyx_t_6 = (__pyx_v_z < 1.0); if (__pyx_t_6) { - /* "scikits/learn/linear_model/sgd_fast.pyx":124 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":124 * cdef double z = p * y * if z < 1.0: * return (1 - z) # <<<<<<<<<<<<<< * return 0.0 * */ - __pyx_r = (1.0 - __pyx_v_z); + __pyx_r = (1 - __pyx_v_z); goto __pyx_L0; goto __pyx_L3; } __pyx_L3:; - /* "scikits/learn/linear_model/sgd_fast.pyx":125 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":125 * if z < 1.0: * return (1 - z) * return 0.0 # <<<<<<<<<<<<<< @@ -2636,14 +2579,15 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_5Hinge_loss(stru __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_WriteUnraisable("scikits.learn.linear_model.sgd_fast.Hinge.loss"); + __Pyx_WriteUnraisable("sklearn.linear_model.sgd_fast.Hinge.loss"); __pyx_r = 0; __pyx_L0:; + __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "scikits/learn/linear_model/sgd_fast.pyx":121 +/* "/home/fabian/dev/scikit-learn/sklearn/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): # <<<<<<<<<<<<<< @@ -2651,8 +2595,8 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_5Hinge_loss(stru * if z < 1.0: */ -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) { +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) { double __pyx_v_p; double __pyx_v_y; PyObject *__pyx_r = NULL; @@ -2695,12 +2639,11 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Hinge_loss(P __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("scikits.learn.linear_model.sgd_fast.Hinge.loss"); - __Pyx_RefNannyFinishContext(); + __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Hinge.loss"); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_XDECREF(__pyx_r); - __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_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_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -2710,7 +2653,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Hinge_loss(P goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.Hinge.loss"); + __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Hinge.loss"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -2718,7 +2661,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Hinge_loss(P return __pyx_r; } -/* "scikits/learn/linear_model/sgd_fast.pyx":127 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":127 * return 0.0 * * cpdef double dloss(self, double p, double y): # <<<<<<<<<<<<<< @@ -2726,8 +2669,8 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Hinge_loss(P * if z < 1.0: */ -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) { +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) { double __pyx_v_z; double __pyx_r; PyObject *__pyx_t_1 = NULL; @@ -2737,28 +2680,29 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_5Hinge_dloss(str 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_7scikits_5learn_12linear_model_8sgd_fast_5Hinge_1dloss)) { + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Hinge_dloss)) { __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(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__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, ((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_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_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__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; @@ -2768,7 +2712,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_5Hinge_dloss(str __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "scikits/learn/linear_model/sgd_fast.pyx":128 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":128 * * cpdef double dloss(self, double p, double y): * cdef double z = p * y # <<<<<<<<<<<<<< @@ -2777,7 +2721,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_5Hinge_dloss(str */ __pyx_v_z = (__pyx_v_p * __pyx_v_y); - /* "scikits/learn/linear_model/sgd_fast.pyx":129 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":129 * cpdef double dloss(self, double p, double y): * cdef double z = p * y * if z < 1.0: # <<<<<<<<<<<<<< @@ -2787,7 +2731,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_5Hinge_dloss(str __pyx_t_6 = (__pyx_v_z < 1.0); if (__pyx_t_6) { - /* "scikits/learn/linear_model/sgd_fast.pyx":130 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":130 * cdef double z = p * y * if z < 1.0: * return -y # <<<<<<<<<<<<<< @@ -2800,7 +2744,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_5Hinge_dloss(str } __pyx_L3:; - /* "scikits/learn/linear_model/sgd_fast.pyx":131 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":131 * if z < 1.0: * return -y * return 0.0 # <<<<<<<<<<<<<< @@ -2817,14 +2761,15 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_5Hinge_dloss(str __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_WriteUnraisable("scikits.learn.linear_model.sgd_fast.Hinge.dloss"); + __Pyx_WriteUnraisable("sklearn.linear_model.sgd_fast.Hinge.dloss"); __pyx_r = 0; __pyx_L0:; + __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "scikits/learn/linear_model/sgd_fast.pyx":127 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":127 * return 0.0 * * cpdef double dloss(self, double p, double y): # <<<<<<<<<<<<<< @@ -2832,8 +2777,8 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_5Hinge_dloss(str * if z < 1.0: */ -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) { +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) { double __pyx_v_p; double __pyx_v_y; PyObject *__pyx_r = NULL; @@ -2876,12 +2821,11 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Hinge_1dloss __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("scikits.learn.linear_model.sgd_fast.Hinge.dloss"); - __Pyx_RefNannyFinishContext(); + __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Hinge.dloss"); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_XDECREF(__pyx_r); - __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_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_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -2891,7 +2835,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Hinge_1dloss goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.Hinge.dloss"); + __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Hinge.dloss"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -2899,7 +2843,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Hinge_1dloss return __pyx_r; } -/* "scikits/learn/linear_model/sgd_fast.pyx":133 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":133 * return 0.0 * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -2907,13 +2851,13 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Hinge_1dloss * */ -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) { +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) { PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce__"); - /* "scikits/learn/linear_model/sgd_fast.pyx":134 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":134 * * def __reduce__(self): * return Hinge, () # <<<<<<<<<<<<<< @@ -2922,14 +2866,14 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Hinge_2__red */ __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(((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_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_INCREF(((PyObject *)__pyx_empty_tuple)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_empty_tuple)); __Pyx_GIVEREF(((PyObject *)__pyx_empty_tuple)); - __pyx_r = ((PyObject *)__pyx_t_1); + __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; @@ -2937,7 +2881,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Hinge_2__red goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.Hinge.__reduce__"); + __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Hinge.__reduce__"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -2945,7 +2889,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Hinge_2__red return __pyx_r; } -/* "scikits/learn/linear_model/sgd_fast.pyx":140 +/* "/home/fabian/dev/scikit-learn/sklearn/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): # <<<<<<<<<<<<<< @@ -2953,8 +2897,8 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Hinge_2__red * # approximately equal and saves the computation of the log */ -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) { +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) { double __pyx_v_z; double __pyx_r; PyObject *__pyx_t_1 = NULL; @@ -2964,28 +2908,29 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_3Log_loss(struct 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_7scikits_5learn_12linear_model_8sgd_fast_3Log_loss)) { + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_7sklearn_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(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__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, ((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_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_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__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; @@ -2995,7 +2940,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_3Log_loss(struct __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "scikits/learn/linear_model/sgd_fast.pyx":141 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":141 * * cpdef double loss(self, double p, double y): * cdef double z = p * y # <<<<<<<<<<<<<< @@ -3004,17 +2949,17 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_3Log_loss(struct */ __pyx_v_z = (__pyx_v_p * __pyx_v_y); - /* "scikits/learn/linear_model/sgd_fast.pyx":143 + /* "/home/fabian/dev/scikit-learn/sklearn/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.0); + __pyx_t_6 = (__pyx_v_z > 18); if (__pyx_t_6) { - /* "scikits/learn/linear_model/sgd_fast.pyx":144 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":144 * # approximately equal and saves the computation of the log * if z > 18: * return exp(-z) # <<<<<<<<<<<<<< @@ -3027,17 +2972,17 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_3Log_loss(struct } __pyx_L3:; - /* "scikits/learn/linear_model/sgd_fast.pyx":145 + /* "/home/fabian/dev/scikit-learn/sklearn/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.0); + __pyx_t_6 = (__pyx_v_z < -18); if (__pyx_t_6) { - /* "scikits/learn/linear_model/sgd_fast.pyx":146 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":146 * return exp(-z) * if z < -18: * return -z # <<<<<<<<<<<<<< @@ -3050,7 +2995,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_3Log_loss(struct } __pyx_L4:; - /* "scikits/learn/linear_model/sgd_fast.pyx":147 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":147 * if z < -18: * return -z * return log(1.0 + exp(-z)) # <<<<<<<<<<<<<< @@ -3067,14 +3012,15 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_3Log_loss(struct __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_WriteUnraisable("scikits.learn.linear_model.sgd_fast.Log.loss"); + __Pyx_WriteUnraisable("sklearn.linear_model.sgd_fast.Log.loss"); __pyx_r = 0; __pyx_L0:; + __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "scikits/learn/linear_model/sgd_fast.pyx":140 +/* "/home/fabian/dev/scikit-learn/sklearn/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): # <<<<<<<<<<<<<< @@ -3082,8 +3028,8 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_3Log_loss(struct * # approximately equal and saves the computation of the log */ -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) { +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) { double __pyx_v_p; double __pyx_v_y; PyObject *__pyx_r = NULL; @@ -3126,12 +3072,11 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_3Log_loss(PyO __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("scikits.learn.linear_model.sgd_fast.Log.loss"); - __Pyx_RefNannyFinishContext(); + __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Log.loss"); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_XDECREF(__pyx_r); - __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_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_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -3141,7 +3086,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_3Log_loss(PyO goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.Log.loss"); + __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Log.loss"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -3149,7 +3094,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_3Log_loss(PyO return __pyx_r; } -/* "scikits/learn/linear_model/sgd_fast.pyx":149 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":149 * return log(1.0 + exp(-z)) * * cpdef double dloss(self, double p, double y): # <<<<<<<<<<<<<< @@ -3157,8 +3102,8 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_3Log_loss(PyO * # approximately equal and saves the computation of the log */ -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) { +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) { double __pyx_v_z; double __pyx_r; PyObject *__pyx_t_1 = NULL; @@ -3168,28 +3113,29 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_3Log_dloss(struc 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_7scikits_5learn_12linear_model_8sgd_fast_3Log_1dloss)) { + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_7sklearn_12linear_model_8sgd_fast_3Log_dloss)) { __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(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__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, ((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_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_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__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; @@ -3199,7 +3145,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_3Log_dloss(struc __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "scikits/learn/linear_model/sgd_fast.pyx":150 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":150 * * cpdef double dloss(self, double p, double y): * cdef double z = p * y # <<<<<<<<<<<<<< @@ -3208,7 +3154,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_3Log_dloss(struc */ __pyx_v_z = (__pyx_v_p * __pyx_v_y); - /* "scikits/learn/linear_model/sgd_fast.pyx":152 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":152 * cdef double z = p * y * # approximately equal and saves the computation of the log * if z > 18.0: # <<<<<<<<<<<<<< @@ -3218,7 +3164,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_3Log_dloss(struc __pyx_t_6 = (__pyx_v_z > 18.0); if (__pyx_t_6) { - /* "scikits/learn/linear_model/sgd_fast.pyx":153 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":153 * # approximately equal and saves the computation of the log * if z > 18.0: * return exp(-z) * -y # <<<<<<<<<<<<<< @@ -3231,17 +3177,17 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_3Log_dloss(struc } __pyx_L3:; - /* "scikits/learn/linear_model/sgd_fast.pyx":154 + /* "/home/fabian/dev/scikit-learn/sklearn/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) { - /* "scikits/learn/linear_model/sgd_fast.pyx":155 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":155 * return exp(-z) * -y * if z < -18.0: * return -y # <<<<<<<<<<<<<< @@ -3254,7 +3200,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_3Log_dloss(struc } __pyx_L4:; - /* "scikits/learn/linear_model/sgd_fast.pyx":156 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":156 * if z < -18.0: * return -y * return -y / (exp(z) + 1.0) # <<<<<<<<<<<<<< @@ -3271,14 +3217,15 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_3Log_dloss(struc __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_WriteUnraisable("scikits.learn.linear_model.sgd_fast.Log.dloss"); + __Pyx_WriteUnraisable("sklearn.linear_model.sgd_fast.Log.dloss"); __pyx_r = 0; __pyx_L0:; + __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "scikits/learn/linear_model/sgd_fast.pyx":149 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":149 * return log(1.0 + exp(-z)) * * cpdef double dloss(self, double p, double y): # <<<<<<<<<<<<<< @@ -3286,8 +3233,8 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_3Log_dloss(struc * # approximately equal and saves the computation of the log */ -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) { +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) { double __pyx_v_p; double __pyx_v_y; PyObject *__pyx_r = NULL; @@ -3330,12 +3277,11 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_3Log_1dloss(P __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("scikits.learn.linear_model.sgd_fast.Log.dloss"); - __Pyx_RefNannyFinishContext(); + __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Log.dloss"); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_XDECREF(__pyx_r); - __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_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_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -3345,7 +3291,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_3Log_1dloss(P goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.Log.dloss"); + __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Log.dloss"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -3353,7 +3299,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_3Log_1dloss(P return __pyx_r; } -/* "scikits/learn/linear_model/sgd_fast.pyx":158 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":158 * return -y / (exp(z) + 1.0) * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -3361,13 +3307,13 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_3Log_1dloss(P * */ -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) { +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) { PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce__"); - /* "scikits/learn/linear_model/sgd_fast.pyx":159 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":159 * * def __reduce__(self): * return Log, () # <<<<<<<<<<<<<< @@ -3376,14 +3322,14 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_3Log_2__reduc */ __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(((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_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_INCREF(((PyObject *)__pyx_empty_tuple)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_empty_tuple)); __Pyx_GIVEREF(((PyObject *)__pyx_empty_tuple)); - __pyx_r = ((PyObject *)__pyx_t_1); + __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; @@ -3391,7 +3337,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_3Log_2__reduc goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.Log.__reduce__"); + __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Log.__reduce__"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -3399,7 +3345,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_3Log_2__reduc return __pyx_r; } -/* "scikits/learn/linear_model/sgd_fast.pyx":164 +/* "/home/fabian/dev/scikit-learn/sklearn/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): # <<<<<<<<<<<<<< @@ -3407,8 +3353,8 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_3Log_2__reduc * */ -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) { +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) { double __pyx_r; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -3422,22 +3368,22 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_11SquaredLoss_lo 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_7scikits_5learn_12linear_model_8sgd_fast_11SquaredLoss_loss)) { + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_7sklearn_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(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__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, ((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_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_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__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; @@ -3447,7 +3393,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_11SquaredLoss_lo __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "scikits/learn/linear_model/sgd_fast.pyx":165 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -3464,14 +3410,14 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_11SquaredLoss_lo __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_WriteUnraisable("scikits.learn.linear_model.sgd_fast.SquaredLoss.loss"); + __Pyx_WriteUnraisable("sklearn.linear_model.sgd_fast.SquaredLoss.loss"); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "scikits/learn/linear_model/sgd_fast.pyx":164 +/* "/home/fabian/dev/scikit-learn/sklearn/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): # <<<<<<<<<<<<<< @@ -3479,8 +3425,8 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_11SquaredLoss_lo * */ -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) { +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) { double __pyx_v_p; double __pyx_v_y; PyObject *__pyx_r = NULL; @@ -3523,12 +3469,11 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_11SquaredLoss __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("scikits.learn.linear_model.sgd_fast.SquaredLoss.loss"); - __Pyx_RefNannyFinishContext(); + __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.SquaredLoss.loss"); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_XDECREF(__pyx_r); - __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_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_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -3538,7 +3483,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_11SquaredLoss goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.SquaredLoss.loss"); + __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.SquaredLoss.loss"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -3546,7 +3491,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_11SquaredLoss return __pyx_r; } -/* "scikits/learn/linear_model/sgd_fast.pyx":167 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":167 * return 0.5 * (p - y) * (p - y) * * cpdef double dloss(self, double p, double y): # <<<<<<<<<<<<<< @@ -3554,8 +3499,8 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_11SquaredLoss * */ -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) { +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) { double __pyx_r; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -3569,22 +3514,22 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_11SquaredLoss_dl 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_7scikits_5learn_12linear_model_8sgd_fast_11SquaredLoss_1dloss)) { + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_7sklearn_12linear_model_8sgd_fast_11SquaredLoss_dloss)) { __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(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__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, ((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_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_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__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; @@ -3594,7 +3539,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_11SquaredLoss_dl __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "scikits/learn/linear_model/sgd_fast.pyx":168 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":168 * * cpdef double dloss(self, double p, double y): * return p - y # <<<<<<<<<<<<<< @@ -3611,14 +3556,14 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_11SquaredLoss_dl __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_WriteUnraisable("scikits.learn.linear_model.sgd_fast.SquaredLoss.dloss"); + __Pyx_WriteUnraisable("sklearn.linear_model.sgd_fast.SquaredLoss.dloss"); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "scikits/learn/linear_model/sgd_fast.pyx":167 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":167 * return 0.5 * (p - y) * (p - y) * * cpdef double dloss(self, double p, double y): # <<<<<<<<<<<<<< @@ -3626,8 +3571,8 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_11SquaredLoss_dl * */ -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) { +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) { double __pyx_v_p; double __pyx_v_y; PyObject *__pyx_r = NULL; @@ -3670,12 +3615,11 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_11SquaredLoss __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("scikits.learn.linear_model.sgd_fast.SquaredLoss.dloss"); - __Pyx_RefNannyFinishContext(); + __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.SquaredLoss.dloss"); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_XDECREF(__pyx_r); - __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_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_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -3685,7 +3629,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_11SquaredLoss goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.SquaredLoss.dloss"); + __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.SquaredLoss.dloss"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -3693,7 +3637,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_11SquaredLoss return __pyx_r; } -/* "scikits/learn/linear_model/sgd_fast.pyx":170 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":170 * return p - y * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -3701,13 +3645,13 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_11SquaredLoss * */ -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) { +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) { PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce__"); - /* "scikits/learn/linear_model/sgd_fast.pyx":171 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":171 * * def __reduce__(self): * return SquaredLoss, () # <<<<<<<<<<<<<< @@ -3716,14 +3660,14 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_11SquaredLoss */ __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(((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_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_INCREF(((PyObject *)__pyx_empty_tuple)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_empty_tuple)); __Pyx_GIVEREF(((PyObject *)__pyx_empty_tuple)); - __pyx_r = ((PyObject *)__pyx_t_1); + __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; @@ -3731,7 +3675,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_11SquaredLoss goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.SquaredLoss.__reduce__"); + __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.SquaredLoss.__reduce__"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -3739,7 +3683,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_11SquaredLoss return __pyx_r; } -/* "scikits/learn/linear_model/sgd_fast.pyx":186 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":186 * """ * * def __init__(self, c): # <<<<<<<<<<<<<< @@ -3747,8 +3691,8 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_11SquaredLoss * */ -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) { +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) { PyObject *__pyx_v_c = 0; int __pyx_r; double __pyx_t_1; @@ -3781,12 +3725,11 @@ static int __pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Huber___init__(PyO __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("scikits.learn.linear_model.sgd_fast.Huber.__init__"); - __Pyx_RefNannyFinishContext(); + __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Huber.__init__"); return -1; __pyx_L4_argument_unpacking_done:; - /* "scikits/learn/linear_model/sgd_fast.pyx":187 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":187 * * def __init__(self, c): * self.c = c # <<<<<<<<<<<<<< @@ -3794,19 +3737,19 @@ static int __pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Huber___init__(PyO * 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_7scikits_5learn_12linear_model_8sgd_fast_Huber *)__pyx_v_self)->c = __pyx_t_1; + ((struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Huber *)__pyx_v_self)->c = __pyx_t_1; __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; - __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.Huber.__init__"); + __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Huber.__init__"); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "scikits/learn/linear_model/sgd_fast.pyx":189 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":189 * self.c = c * * cpdef double loss(self, double p, double y): # <<<<<<<<<<<<<< @@ -3814,8 +3757,8 @@ static int __pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Huber___init__(PyO * cdef double abs_r = abs(r) */ -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) { +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) { double __pyx_v_r; double __pyx_v_abs_r; double __pyx_r; @@ -3826,28 +3769,29 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_5Huber_loss(stru 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_7scikits_5learn_12linear_model_8sgd_fast_5Huber_1loss)) { + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Huber_loss)) { __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(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__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, ((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_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_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__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; @@ -3857,7 +3801,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_5Huber_loss(stru __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "scikits/learn/linear_model/sgd_fast.pyx":190 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":190 * * cpdef double loss(self, double p, double y): * cdef double r = p - y # <<<<<<<<<<<<<< @@ -3866,7 +3810,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_5Huber_loss(stru */ __pyx_v_r = (__pyx_v_p - __pyx_v_y); - /* "scikits/learn/linear_model/sgd_fast.pyx":191 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -3882,7 +3826,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_5Huber_loss(stru __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_abs_r = __pyx_t_5; - /* "scikits/learn/linear_model/sgd_fast.pyx":192 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":192 * cdef double r = p - y * cdef double abs_r = abs(r) * if abs_r <= self.c: # <<<<<<<<<<<<<< @@ -3892,7 +3836,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_5Huber_loss(stru __pyx_t_6 = (__pyx_v_abs_r <= __pyx_v_self->c); if (__pyx_t_6) { - /* "scikits/learn/linear_model/sgd_fast.pyx":193 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":193 * cdef double abs_r = abs(r) * if abs_r <= self.c: * return 0.5 * r * r # <<<<<<<<<<<<<< @@ -3905,7 +3849,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_5Huber_loss(stru } /*else*/ { - /* "scikits/learn/linear_model/sgd_fast.pyx":195 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":195 * return 0.5 * r * r * else: * return self.c * abs_r - (0.5 * self.c * self.c) # <<<<<<<<<<<<<< @@ -3924,14 +3868,15 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_5Huber_loss(stru __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_WriteUnraisable("scikits.learn.linear_model.sgd_fast.Huber.loss"); + __Pyx_WriteUnraisable("sklearn.linear_model.sgd_fast.Huber.loss"); __pyx_r = 0; __pyx_L0:; + __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "scikits/learn/linear_model/sgd_fast.pyx":189 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":189 * self.c = c * * cpdef double loss(self, double p, double y): # <<<<<<<<<<<<<< @@ -3939,8 +3884,8 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_5Huber_loss(stru * cdef double abs_r = abs(r) */ -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) { +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) { double __pyx_v_p; double __pyx_v_y; PyObject *__pyx_r = NULL; @@ -3983,12 +3928,11 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Huber_1loss( __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("scikits.learn.linear_model.sgd_fast.Huber.loss"); - __Pyx_RefNannyFinishContext(); + __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Huber.loss"); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_XDECREF(__pyx_r); - __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_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_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -3998,7 +3942,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Huber_1loss( goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.Huber.loss"); + __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Huber.loss"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -4006,7 +3950,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Huber_1loss( return __pyx_r; } -/* "scikits/learn/linear_model/sgd_fast.pyx":197 +/* "/home/fabian/dev/scikit-learn/sklearn/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): # <<<<<<<<<<<<<< @@ -4014,8 +3958,8 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Huber_1loss( * cdef double abs_r = abs(r) */ -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) { +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) { double __pyx_v_r; double __pyx_v_abs_r; double __pyx_r; @@ -4026,28 +3970,29 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_5Huber_dloss(str 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_7scikits_5learn_12linear_model_8sgd_fast_5Huber_2dloss)) { + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_7sklearn_12linear_model_8sgd_fast_5Huber_dloss)) { __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(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__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, ((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_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_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__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; @@ -4057,7 +4002,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_5Huber_dloss(str __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "scikits/learn/linear_model/sgd_fast.pyx":198 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":198 * * cpdef double dloss(self, double p, double y): * cdef double r = p - y # FIXME y - p # <<<<<<<<<<<<<< @@ -4066,7 +4011,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_5Huber_dloss(str */ __pyx_v_r = (__pyx_v_p - __pyx_v_y); - /* "scikits/learn/linear_model/sgd_fast.pyx":199 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -4082,7 +4027,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_5Huber_dloss(str __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_abs_r = __pyx_t_5; - /* "scikits/learn/linear_model/sgd_fast.pyx":200 + /* "/home/fabian/dev/scikit-learn/sklearn/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: # <<<<<<<<<<<<<< @@ -4092,7 +4037,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_5Huber_dloss(str __pyx_t_6 = (__pyx_v_abs_r <= __pyx_v_self->c); if (__pyx_t_6) { - /* "scikits/learn/linear_model/sgd_fast.pyx":201 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":201 * cdef double abs_r = abs(r) * if abs_r <= self.c: * return r # <<<<<<<<<<<<<< @@ -4104,7 +4049,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_5Huber_dloss(str goto __pyx_L3; } - /* "scikits/learn/linear_model/sgd_fast.pyx":202 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":202 * if abs_r <= self.c: * return r * elif r > 0.0: # <<<<<<<<<<<<<< @@ -4114,7 +4059,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_5Huber_dloss(str __pyx_t_6 = (__pyx_v_r > 0.0); if (__pyx_t_6) { - /* "scikits/learn/linear_model/sgd_fast.pyx":203 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":203 * return r * elif r > 0.0: * return self.c # <<<<<<<<<<<<<< @@ -4127,7 +4072,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_5Huber_dloss(str } /*else*/ { - /* "scikits/learn/linear_model/sgd_fast.pyx":205 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":205 * return self.c * else: * return -self.c # <<<<<<<<<<<<<< @@ -4146,14 +4091,15 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_5Huber_dloss(str __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_WriteUnraisable("scikits.learn.linear_model.sgd_fast.Huber.dloss"); + __Pyx_WriteUnraisable("sklearn.linear_model.sgd_fast.Huber.dloss"); __pyx_r = 0; __pyx_L0:; + __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "scikits/learn/linear_model/sgd_fast.pyx":197 +/* "/home/fabian/dev/scikit-learn/sklearn/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): # <<<<<<<<<<<<<< @@ -4161,8 +4107,8 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_5Huber_dloss(str * cdef double abs_r = abs(r) */ -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) { +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) { double __pyx_v_p; double __pyx_v_y; PyObject *__pyx_r = NULL; @@ -4205,12 +4151,11 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Huber_2dloss __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("scikits.learn.linear_model.sgd_fast.Huber.dloss"); - __Pyx_RefNannyFinishContext(); + __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Huber.dloss"); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_XDECREF(__pyx_r); - __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_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_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -4220,7 +4165,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Huber_2dloss goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.Huber.dloss"); + __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Huber.dloss"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -4228,7 +4173,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Huber_2dloss return __pyx_r; } -/* "scikits/learn/linear_model/sgd_fast.pyx":207 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":207 * return -self.c * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -4236,14 +4181,14 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Huber_2dloss * */ -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) { +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) { PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__reduce__"); - /* "scikits/learn/linear_model/sgd_fast.pyx":208 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":208 * * def __reduce__(self): * return Huber, (self.c,) # <<<<<<<<<<<<<< @@ -4251,22 +4196,22 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Huber_3__red * */ __Pyx_XDECREF(__pyx_r); - __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_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_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(((PyObject *)__pyx_t_2)); + __Pyx_GOTREF(__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(((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_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_t_2 = 0; - __pyx_r = ((PyObject *)__pyx_t_1); + __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; @@ -4275,7 +4220,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Huber_3__red __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.Huber.__reduce__"); + __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.Huber.__reduce__"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -4283,7 +4228,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Huber_3__red return __pyx_r; } -/* "scikits/learn/linear_model/sgd_fast.pyx":214 +/* "/home/fabian/dev/scikit-learn/sklearn/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, # <<<<<<<<<<<<<< @@ -4291,13 +4236,12 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Huber_3__red * LossFunction loss, */ -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) { +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) { PyArrayObject *__pyx_v_w = 0; double __pyx_v_intercept; - struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *__pyx_v_loss = 0; + struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *__pyx_v_loss = 0; int __pyx_v_penalty_type; double __pyx_v_alpha; double __pyx_v_rho; @@ -4376,9 +4320,9 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; - unsigned int __pyx_t_13; - PyArrayObject *__pyx_t_14 = NULL; - int __pyx_t_15; + int __pyx_t_13; + unsigned int __pyx_t_14; + PyArrayObject *__pyx_t_15 = NULL; double __pyx_t_16; PyObject *__pyx_t_17 = NULL; int __pyx_t_18; @@ -4533,7 +4477,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO } __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_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *)values[2]); + __pyx_v_loss = ((struct __pyx_obj_7sklearn_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;} @@ -4555,7 +4499,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO } 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_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *)PyTuple_GET_ITEM(__pyx_args, 2)); + __pyx_v_loss = ((struct __pyx_obj_7sklearn_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;} @@ -4577,11 +4521,14 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO __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("scikits.learn.linear_model.sgd_fast.plain_sgd"); - __Pyx_RefNannyFinishContext(); + __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.plain_sgd"); 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; @@ -4590,7 +4537,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO __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_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_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_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;} @@ -4619,7 +4566,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO __pyx_bstride_0_sample_weight = __pyx_bstruct_sample_weight.strides[0]; __pyx_bshape_0_sample_weight = __pyx_bstruct_sample_weight.shape[0]; - /* "scikits/learn/linear_model/sgd_fast.pyx":286 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":286 * * # get the data information into easy vars * cdef unsigned int n_samples = Y.shape[0] # <<<<<<<<<<<<<< @@ -4628,7 +4575,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO */ __pyx_v_n_samples = (__pyx_v_Y->dimensions[0]); - /* "scikits/learn/linear_model/sgd_fast.pyx":287 + /* "/home/fabian/dev/scikit-learn/sklearn/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] # <<<<<<<<<<<<<< @@ -4637,7 +4584,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO */ __pyx_v_n_features = (__pyx_v_w->dimensions[0]); - /* "scikits/learn/linear_model/sgd_fast.pyx":290 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":290 * * # Array strides to get to next feature or example * cdef int row_stride = X.strides[0] # <<<<<<<<<<<<<< @@ -4646,7 +4593,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO */ __pyx_v_row_stride = (__pyx_v_X->strides[0]); - /* "scikits/learn/linear_model/sgd_fast.pyx":291 + /* "/home/fabian/dev/scikit-learn/sklearn/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] # <<<<<<<<<<<<<< @@ -4655,7 +4602,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO */ __pyx_v_elem_stride = (__pyx_v_X->strides[1]); - /* "scikits/learn/linear_model/sgd_fast.pyx":293 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":293 * cdef int elem_stride = X.strides[1] * * cdef double *w_data_ptr = w.data # <<<<<<<<<<<<<< @@ -4664,7 +4611,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO */ __pyx_v_w_data_ptr = ((double *)__pyx_v_w->data); - /* "scikits/learn/linear_model/sgd_fast.pyx":294 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":294 * * cdef double *w_data_ptr = w.data * cdef double *X_data_ptr = X.data # <<<<<<<<<<<<<< @@ -4673,7 +4620,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO */ __pyx_v_X_data_ptr = ((double *)__pyx_v_X->data); - /* "scikits/learn/linear_model/sgd_fast.pyx":295 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":295 * cdef double *w_data_ptr = w.data * cdef double *X_data_ptr = X.data * cdef double *Y_data_ptr = Y.data # <<<<<<<<<<<<<< @@ -4682,7 +4629,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO */ __pyx_v_Y_data_ptr = ((double *)__pyx_v_Y->data); - /* "scikits/learn/linear_model/sgd_fast.pyx":297 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":297 * cdef double *Y_data_ptr = Y.data * * cdef double *sample_weight_data = sample_weight.data # <<<<<<<<<<<<<< @@ -4691,7 +4638,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO */ __pyx_v_sample_weight_data = ((double *)__pyx_v_sample_weight->data); - /* "scikits/learn/linear_model/sgd_fast.pyx":301 + /* "/home/fabian/dev/scikit-learn/sklearn/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, # <<<<<<<<<<<<<< @@ -4706,14 +4653,14 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO __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(((PyObject *)__pyx_t_3)); + __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 = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - /* "scikits/learn/linear_model/sgd_fast.pyx":302 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":302 * cdef np.ndarray[np.int32_t, ndim=1, * mode="c"] index = np.arange(n_samples, * dtype=np.int32) # <<<<<<<<<<<<<< @@ -4727,10 +4674,10 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO __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, ((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_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_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__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); @@ -4747,7 +4694,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO __pyx_v_index = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "scikits/learn/linear_model/sgd_fast.pyx":303 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":303 * mode="c"] index = np.arange(n_samples, * dtype=np.int32) * cdef int *index_data_ptr = index.data # <<<<<<<<<<<<<< @@ -4756,7 +4703,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO */ __pyx_v_index_data_ptr = ((int *)__pyx_v_index->data); - /* "scikits/learn/linear_model/sgd_fast.pyx":306 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":306 * * # helper variable * cdef int offset = 0 # <<<<<<<<<<<<<< @@ -4765,7 +4712,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO */ __pyx_v_offset = 0; - /* "scikits/learn/linear_model/sgd_fast.pyx":307 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":307 * # helper variable * cdef int offset = 0 * cdef double wscale = 1.0 # <<<<<<<<<<<<<< @@ -4774,7 +4721,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO */ __pyx_v_wscale = 1.0; - /* "scikits/learn/linear_model/sgd_fast.pyx":308 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":308 * cdef int offset = 0 * cdef double wscale = 1.0 * cdef double eta = 0.0 # <<<<<<<<<<<<<< @@ -4783,7 +4730,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO */ __pyx_v_eta = 0.0; - /* "scikits/learn/linear_model/sgd_fast.pyx":309 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":309 * cdef double wscale = 1.0 * cdef double eta = 0.0 * cdef double p = 0.0 # <<<<<<<<<<<<<< @@ -4792,7 +4739,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO */ __pyx_v_p = 0.0; - /* "scikits/learn/linear_model/sgd_fast.pyx":310 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":310 * cdef double eta = 0.0 * cdef double p = 0.0 * cdef double update = 0.0 # <<<<<<<<<<<<<< @@ -4801,7 +4748,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO */ __pyx_v_update = 0.0; - /* "scikits/learn/linear_model/sgd_fast.pyx":311 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":311 * cdef double p = 0.0 * cdef double update = 0.0 * cdef double sumloss = 0.0 # <<<<<<<<<<<<<< @@ -4810,7 +4757,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO */ __pyx_v_sumloss = 0.0; - /* "scikits/learn/linear_model/sgd_fast.pyx":312 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":312 * cdef double update = 0.0 * cdef double sumloss = 0.0 * cdef double wnorm = 0.0 # <<<<<<<<<<<<<< @@ -4819,7 +4766,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO */ __pyx_v_wnorm = 0.0; - /* "scikits/learn/linear_model/sgd_fast.pyx":313 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":313 * cdef double sumloss = 0.0 * cdef double wnorm = 0.0 * cdef double t = 0.0 # <<<<<<<<<<<<<< @@ -4828,7 +4775,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO */ __pyx_v_t = 0.0; - /* "scikits/learn/linear_model/sgd_fast.pyx":314 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":314 * cdef double wnorm = 0.0 * cdef double t = 0.0 * cdef double y = 0.0 # <<<<<<<<<<<<<< @@ -4837,7 +4784,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO */ __pyx_v_y = 0.0; - /* "scikits/learn/linear_model/sgd_fast.pyx":315 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":315 * cdef double t = 0.0 * cdef double y = 0.0 * cdef double class_weight = 1.0 # <<<<<<<<<<<<<< @@ -4846,7 +4793,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO */ __pyx_v_class_weight = 1.0; - /* "scikits/learn/linear_model/sgd_fast.pyx":316 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":316 * cdef double y = 0.0 * cdef double class_weight = 1.0 * cdef unsigned int count = 0 # <<<<<<<<<<<<<< @@ -4855,7 +4802,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO */ __pyx_v_count = 0; - /* "scikits/learn/linear_model/sgd_fast.pyx":317 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":317 * cdef double class_weight = 1.0 * cdef unsigned int count = 0 * cdef unsigned int epoch = 0 # <<<<<<<<<<<<<< @@ -4864,7 +4811,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO */ __pyx_v_epoch = 0; - /* "scikits/learn/linear_model/sgd_fast.pyx":318 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":318 * cdef unsigned int count = 0 * cdef unsigned int epoch = 0 * cdef unsigned int i = 0 # <<<<<<<<<<<<<< @@ -4873,7 +4820,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO */ __pyx_v_i = 0; - /* "scikits/learn/linear_model/sgd_fast.pyx":319 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":319 * cdef unsigned int epoch = 0 * cdef unsigned int i = 0 * cdef int sample_idx = 0 # <<<<<<<<<<<<<< @@ -4882,7 +4829,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO */ __pyx_v_sample_idx = 0; - /* "scikits/learn/linear_model/sgd_fast.pyx":322 + /* "/home/fabian/dev/scikit-learn/sklearn/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 # <<<<<<<<<<<<<< @@ -4903,7 +4850,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO __Pyx_INCREF(Py_None); __pyx_v_q = ((PyArrayObject *)Py_None); - /* "scikits/learn/linear_model/sgd_fast.pyx":324 + /* "/home/fabian/dev/scikit-learn/sklearn/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: # <<<<<<<<<<<<<< @@ -4913,7 +4860,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO __pyx_t_8 = (__pyx_v_penalty_type != 2); if (__pyx_t_8) { - /* "scikits/learn/linear_model/sgd_fast.pyx":325 + /* "/home/fabian/dev/scikit-learn/sklearn/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") # <<<<<<<<<<<<<< @@ -4928,14 +4875,14 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO __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(((PyObject *)__pyx_t_3)); + __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 = 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(((PyObject *)__pyx_t_5)); - PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); + __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 = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); @@ -4947,10 +4894,10 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO 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, ((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_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_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + __Pyx_DECREF(__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); @@ -4976,7 +4923,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO __pyx_v_q = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "scikits/learn/linear_model/sgd_fast.pyx":326 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":326 * if penalty_type != L2: * q = np.zeros((n_features,), dtype=np.float64, order="c") * q_data_ptr = q.data # <<<<<<<<<<<<<< @@ -4988,7 +4935,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO } __pyx_L6:; - /* "scikits/learn/linear_model/sgd_fast.pyx":327 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":327 * q = np.zeros((n_features,), dtype=np.float64, order="c") * q_data_ptr = q.data * cdef double u = 0.0 # <<<<<<<<<<<<<< @@ -4997,7 +4944,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO */ __pyx_v_u = 0.0; - /* "scikits/learn/linear_model/sgd_fast.pyx":329 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":329 * cdef double u = 0.0 * * cdef double typw = sqrt(1.0 / sqrt(alpha)) # <<<<<<<<<<<<<< @@ -5006,7 +4953,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO */ __pyx_v_typw = sqrt((1.0 / sqrt(__pyx_v_alpha))); - /* "scikits/learn/linear_model/sgd_fast.pyx":331 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":331 * cdef double typw = sqrt(1.0 / sqrt(alpha)) * * if learning_rate == OPTIMAL: # <<<<<<<<<<<<<< @@ -5016,19 +4963,19 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO __pyx_t_8 = (__pyx_v_learning_rate == 2); if (__pyx_t_8) { - /* "scikits/learn/linear_model/sgd_fast.pyx":333 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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))); + __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))); goto __pyx_L7; } /*else*/ { - /* "scikits/learn/linear_model/sgd_fast.pyx":335 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":335 * eta0 = typw / max(1.0, loss.dloss(-typw, 1.0)) * else: * eta = eta0 # <<<<<<<<<<<<<< @@ -5039,7 +4986,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO } __pyx_L7:; - /* "scikits/learn/linear_model/sgd_fast.pyx":337 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":337 * eta = eta0 * * if learning_rate == OPTIMAL: # <<<<<<<<<<<<<< @@ -5049,7 +4996,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO __pyx_t_8 = (__pyx_v_learning_rate == 2); if (__pyx_t_8) { - /* "scikits/learn/linear_model/sgd_fast.pyx":339 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -5061,7 +5008,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO } /*else*/ { - /* "scikits/learn/linear_model/sgd_fast.pyx":341 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":341 * t = 1.0 / (eta0 * alpha) * else: * t = 1.0 # <<<<<<<<<<<<<< @@ -5072,7 +5019,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO } __pyx_L8:; - /* "scikits/learn/linear_model/sgd_fast.pyx":343 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":343 * t = 1.0 * * t_start = time() # <<<<<<<<<<<<<< @@ -5088,7 +5035,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO __pyx_v_t_start = __pyx_t_3; __pyx_t_3 = 0; - /* "scikits/learn/linear_model/sgd_fast.pyx":344 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":344 * * t_start = time() * for epoch from 0 <= epoch < n_iter: # <<<<<<<<<<<<<< @@ -5098,7 +5045,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO __pyx_t_9 = __pyx_v_n_iter; for (__pyx_v_epoch = 0; __pyx_v_epoch < __pyx_t_9; __pyx_v_epoch++) { - /* "scikits/learn/linear_model/sgd_fast.pyx":345 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":345 * t_start = time() * for epoch from 0 <= epoch < n_iter: * if verbose > 0: # <<<<<<<<<<<<<< @@ -5108,34 +5055,35 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO __pyx_t_8 = (__pyx_v_verbose > 0); if (__pyx_t_8) { - /* "scikits/learn/linear_model/sgd_fast.pyx":346 + /* "/home/fabian/dev/scikit-learn/sklearn/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 = 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_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_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(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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; + 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; goto __pyx_L11; } __pyx_L11:; - /* "scikits/learn/linear_model/sgd_fast.pyx":347 + /* "/home/fabian/dev/scikit-learn/sklearn/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: */ - if (__pyx_v_shuffle) { + __pyx_t_13 = __pyx_v_shuffle; + if (__pyx_t_13) { - /* "scikits/learn/linear_model/sgd_fast.pyx":348 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":348 * print("-- Epoch %d" % (epoch + 1)) * if shuffle: * np.random.RandomState(seed).shuffle(index) # <<<<<<<<<<<<<< @@ -5153,42 +5101,42 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO __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(((PyObject *)__pyx_t_5)); + __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_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_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_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + __Pyx_DECREF(__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(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(__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, ((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_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_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L12; } __pyx_L12:; - /* "scikits/learn/linear_model/sgd_fast.pyx":349 + /* "/home/fabian/dev/scikit-learn/sklearn/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_13 = __pyx_v_n_samples; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_13; __pyx_v_i++) { + __pyx_t_14 = __pyx_v_n_samples; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_14; __pyx_v_i++) { - /* "scikits/learn/linear_model/sgd_fast.pyx":350 + /* "/home/fabian/dev/scikit-learn/sklearn/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] # <<<<<<<<<<<<<< @@ -5197,7 +5145,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO */ __pyx_v_sample_idx = (__pyx_v_index_data_ptr[__pyx_v_i]); - /* "scikits/learn/linear_model/sgd_fast.pyx":353 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":353 * * # row offset in elem * offset = row_stride * sample_idx / elem_stride # <<<<<<<<<<<<<< @@ -5206,7 +5154,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO */ __pyx_v_offset = ((__pyx_v_row_stride * __pyx_v_sample_idx) / __pyx_v_elem_stride); - /* "scikits/learn/linear_model/sgd_fast.pyx":354 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":354 * # row offset in elem * offset = row_stride * sample_idx / elem_stride * y = Y_data_ptr[sample_idx] # <<<<<<<<<<<<<< @@ -5215,25 +5163,17 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO */ __pyx_v_y = (__pyx_v_Y_data_ptr[__pyx_v_sample_idx]); - /* "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 + /* "/home/fabian/dev/scikit-learn/sklearn/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: - /* "scikits/learn/linear_model/sgd_fast.pyx":356 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":356 * y = Y_data_ptr[sample_idx] * if learning_rate == OPTIMAL: * eta = 1.0 / (alpha * t) # <<<<<<<<<<<<<< @@ -5243,7 +5183,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO __pyx_v_eta = (1.0 / (__pyx_v_alpha * __pyx_v_t)); break; - /* "scikits/learn/linear_model/sgd_fast.pyx":357 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":357 * if learning_rate == OPTIMAL: * eta = 1.0 / (alpha * t) * elif learning_rate == INVSCALING: # <<<<<<<<<<<<<< @@ -5252,7 +5192,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO */ case 3: - /* "scikits/learn/linear_model/sgd_fast.pyx":358 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":358 * eta = 1.0 / (alpha * t) * elif learning_rate == INVSCALING: * eta = eta0 / pow(t, power_t) # <<<<<<<<<<<<<< @@ -5263,35 +5203,35 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO break; } - /* "scikits/learn/linear_model/sgd_fast.pyx":360 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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); + __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); - /* "scikits/learn/linear_model/sgd_fast.pyx":361 + /* "/home/fabian/dev/scikit-learn/sklearn/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 = (__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)); + __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); - /* "scikits/learn/linear_model/sgd_fast.pyx":362 + /* "/home/fabian/dev/scikit-learn/sklearn/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.0); + __pyx_t_8 = (__pyx_v_y > 0); if (__pyx_t_8) { - /* "scikits/learn/linear_model/sgd_fast.pyx":363 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":363 * sumloss += loss.loss(p, y) * if y > 0: * class_weight = weight_pos # <<<<<<<<<<<<<< @@ -5303,7 +5243,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO } /*else*/ { - /* "scikits/learn/linear_model/sgd_fast.pyx":365 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":365 * class_weight = weight_pos * else: * class_weight = weight_neg # <<<<<<<<<<<<<< @@ -5314,16 +5254,16 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO } __pyx_L15:; - /* "scikits/learn/linear_model/sgd_fast.pyx":367 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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])); + __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])); - /* "scikits/learn/linear_model/sgd_fast.pyx":368 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":368 * update = eta * loss.dloss(p, y) * class_weight * \ * sample_weight_data[sample_idx] * if update != 0.0: # <<<<<<<<<<<<<< @@ -5333,16 +5273,16 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO __pyx_t_8 = (__pyx_v_update != 0.0); if (__pyx_t_8) { - /* "scikits/learn/linear_model/sgd_fast.pyx":369 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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)); + __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)); - /* "scikits/learn/linear_model/sgd_fast.pyx":370 + /* "/home/fabian/dev/scikit-learn/sklearn/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: # <<<<<<<<<<<<<< @@ -5352,14 +5292,14 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO __pyx_t_8 = (__pyx_v_fit_intercept == 1); if (__pyx_t_8) { - /* "scikits/learn/linear_model/sgd_fast.pyx":371 + /* "/home/fabian/dev/scikit-learn/sklearn/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_intercept - __pyx_v_update); + __pyx_v_intercept -= __pyx_v_update; goto __pyx_L17; } __pyx_L17:; @@ -5367,7 +5307,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO } __pyx_L16:; - /* "scikits/learn/linear_model/sgd_fast.pyx":372 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":372 * if fit_intercept == 1: * intercept -= update * if penalty_type != L1: # <<<<<<<<<<<<<< @@ -5377,26 +5317,26 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO __pyx_t_8 = (__pyx_v_penalty_type != 1); if (__pyx_t_8) { - /* "scikits/learn/linear_model/sgd_fast.pyx":373 + /* "/home/fabian/dev/scikit-learn/sklearn/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 = (__pyx_v_wscale * (1.0 - ((__pyx_v_rho * __pyx_v_eta) * __pyx_v_alpha))); + __pyx_v_wscale *= (1.0 - ((__pyx_v_rho * __pyx_v_eta) * __pyx_v_alpha)); - /* "scikits/learn/linear_model/sgd_fast.pyx":374 + /* "/home/fabian/dev/scikit-learn/sklearn/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 < 1e-9); + __pyx_t_8 = (__pyx_v_wscale < 1.0000000000000001e-09); if (__pyx_t_8) { - /* "scikits/learn/linear_model/sgd_fast.pyx":375 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":375 * wscale *= (1.0 - (rho * eta * alpha)) * if wscale < 1e-9: * w *= wscale # <<<<<<<<<<<<<< @@ -5407,14 +5347,14 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO __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); - __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 = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_14 = ((PyArrayObject *)__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_15 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_w); - __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)) { + __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)) { 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); @@ -5425,14 +5365,14 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO } __pyx_bstride_0_w = __pyx_bstruct_w.strides[0]; __pyx_bshape_0_w = __pyx_bstruct_w.shape[0]; - if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_14 = 0; + __pyx_t_15 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_w)); __pyx_v_w = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "scikits/learn/linear_model/sgd_fast.pyx":376 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":376 * if wscale < 1e-9: * w *= wscale * wscale = 1.0 # <<<<<<<<<<<<<< @@ -5447,7 +5387,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO } __pyx_L18:; - /* "scikits/learn/linear_model/sgd_fast.pyx":377 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":377 * w *= wscale * wscale = 1.0 * if penalty_type == L1 or penalty_type == ELASTICNET: # <<<<<<<<<<<<<< @@ -5458,46 +5398,46 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO case 1: case 3: - /* "scikits/learn/linear_model/sgd_fast.pyx":378 + /* "/home/fabian/dev/scikit-learn/sklearn/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 = (__pyx_v_u + (((1.0 - __pyx_v_rho) * __pyx_v_eta) * __pyx_v_alpha)); + __pyx_v_u += (((1.0 - __pyx_v_rho) * __pyx_v_eta) * __pyx_v_alpha); - /* "scikits/learn/linear_model/sgd_fast.pyx":379 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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); + __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); break; } - /* "scikits/learn/linear_model/sgd_fast.pyx":380 + /* "/home/fabian/dev/scikit-learn/sklearn/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 = (__pyx_v_t + 1.0); + __pyx_v_t += 1; - /* "scikits/learn/linear_model/sgd_fast.pyx":381 + /* "/home/fabian/dev/scikit-learn/sklearn/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 = (__pyx_v_count + 1); + __pyx_v_count += 1; } - /* "scikits/learn/linear_model/sgd_fast.pyx":384 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":384 * * # report epoche information * if verbose > 0: # <<<<<<<<<<<<<< @@ -5507,7 +5447,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO __pyx_t_8 = (__pyx_v_verbose > 0); if (__pyx_t_8) { - /* "scikits/learn/linear_model/sgd_fast.pyx":385 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":385 * # report epoche information * if verbose > 0: * wnorm = sqrt(np.dot(w, w) * wscale * wscale) # <<<<<<<<<<<<<< @@ -5520,17 +5460,17 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO __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(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(__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, ((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_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_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__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;} @@ -5547,7 +5487,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_wnorm = sqrt(__pyx_t_16); - /* "scikits/learn/linear_model/sgd_fast.pyx":387 + /* "/home/fabian/dev/scikit-learn/sklearn/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, # <<<<<<<<<<<<<< @@ -5557,7 +5497,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO __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); - /* "scikits/learn/linear_model/sgd_fast.pyx":388 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":388 * print("Norm: %.2f, NNZs: %d, "\ * "Bias: %.6f, T: %d, Avg. loss: %.6f" % (wnorm, * w.nonzero()[0].shape[0], # <<<<<<<<<<<<<< @@ -5579,7 +5519,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "scikits/learn/linear_model/sgd_fast.pyx":389 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":389 * "Bias: %.6f, T: %d, Avg. loss: %.6f" % (wnorm, * w.nonzero()[0].shape[0], * intercept, count, # <<<<<<<<<<<<<< @@ -5591,7 +5531,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO __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); - /* "scikits/learn/linear_model/sgd_fast.pyx":390 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":390 * w.nonzero()[0].shape[0], * intercept, count, * sumloss / count)) # <<<<<<<<<<<<<< @@ -5601,7 +5541,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO __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(((PyObject *)__pyx_t_17)); + __Pyx_GOTREF(__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); @@ -5617,13 +5557,13 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO __pyx_t_4 = 0; __pyx_t_1 = 0; __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; + __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; - /* "scikits/learn/linear_model/sgd_fast.pyx":391 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":391 * intercept, count, * sumloss / count)) * print("Total training time: %.2f seconds." % (time() - t_start)) # <<<<<<<<<<<<<< @@ -5639,15 +5579,15 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO __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(((PyObject *)__pyx_t_17)); + __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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; + 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; goto __pyx_L20; } __pyx_L20:; - /* "scikits/learn/linear_model/sgd_fast.pyx":394 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":394 * * # floating-point under-/overflow check. * if np.any(np.isinf(w)) or np.any(np.isnan(w)) \ # <<<<<<<<<<<<<< @@ -5665,28 +5605,28 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO __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(((PyObject *)__pyx_t_17)); + __Pyx_GOTREF(__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, ((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_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_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0; + __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(((PyObject *)__pyx_t_17)); + __Pyx_GOTREF(__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, ((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_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_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0; + __Pyx_DECREF(__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) { - /* "scikits/learn/linear_model/sgd_fast.pyx":395 + /* "/home/fabian/dev/scikit-learn/sklearn/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): # <<<<<<<<<<<<<< @@ -5699,7 +5639,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "scikits/learn/linear_model/sgd_fast.pyx":394 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":394 * * # floating-point under-/overflow check. * if np.any(np.isinf(w)) or np.any(np.isnan(w)) \ # <<<<<<<<<<<<<< @@ -5712,28 +5652,28 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO __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(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__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, ((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_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_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __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(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__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, ((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_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_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__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) { - /* "scikits/learn/linear_model/sgd_fast.pyx":395 + /* "/home/fabian/dev/scikit-learn/sklearn/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): # <<<<<<<<<<<<<< @@ -5748,14 +5688,14 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO __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(((PyObject *)__pyx_t_17)); + __Pyx_GOTREF(__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, ((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_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_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0; + __Pyx_DECREF(__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) { @@ -5767,14 +5707,14 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO __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(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__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, ((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_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_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__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; @@ -5791,41 +5731,47 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO } if (__pyx_t_18) { - /* "scikits/learn/linear_model/sgd_fast.pyx":396 + /* "/home/fabian/dev/scikit-learn/sklearn/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 = 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_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_Raise(__pyx_t_1, 0, 0); + __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_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:; } - /* "scikits/learn/linear_model/sgd_fast.pyx":398 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":398 * raise ValueError("floating-point under-/overflow occured.") * * w *= wscale # <<<<<<<<<<<<<< * return w, intercept * */ - __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); - __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_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_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_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_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_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_w); - __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); + __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); 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)) { @@ -5839,12 +5785,12 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO __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_14 = 0; + __pyx_t_15 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_w)); - __pyx_v_w = ((PyArrayObject *)__pyx_t_4); - __pyx_t_4 = 0; + __pyx_v_w = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; - /* "scikits/learn/linear_model/sgd_fast.pyx":399 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":399 * * w *= wscale * return w, intercept # <<<<<<<<<<<<<< @@ -5852,18 +5798,18 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO * */ __Pyx_XDECREF(__pyx_r); - __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_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_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_1, 0, ((PyObject *)__pyx_v_w)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_w)); __Pyx_GIVEREF(((PyObject *)__pyx_v_w)); - 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); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -5884,7 +5830,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO __Pyx_SafeReleaseBuffer(&__pyx_bstruct_q); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_w); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast.plain_sgd"); + __Pyx_AddTraceback("sklearn.linear_model.sgd_fast.plain_sgd"); __pyx_r = NULL; goto __pyx_L2; __pyx_L0:; @@ -5899,12 +5845,16 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO __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; } -/* "scikits/learn/linear_model/sgd_fast.pyx":402 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":402 * * * cdef inline double max(double a, double b): # <<<<<<<<<<<<<< @@ -5912,12 +5862,12 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_plain_sgd(PyO * */ -static CYTHON_INLINE double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_max(double __pyx_v_a, double __pyx_v_b) { +static CYTHON_INLINE double __pyx_f_7sklearn_12linear_model_8sgd_fast_max(double __pyx_v_a, double __pyx_v_b) { double __pyx_r; double __pyx_t_1; __Pyx_RefNannySetupContext("max"); - /* "scikits/learn/linear_model/sgd_fast.pyx":403 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":403 * * cdef inline double max(double a, double b): * return a if a >= b else b # <<<<<<<<<<<<<< @@ -5938,7 +5888,7 @@ static CYTHON_INLINE double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_max return __pyx_r; } -/* "scikits/learn/linear_model/sgd_fast.pyx":406 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":406 * * * cdef inline double min(double a, double b): # <<<<<<<<<<<<<< @@ -5946,12 +5896,12 @@ static CYTHON_INLINE double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_max * */ -static CYTHON_INLINE double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_min(double __pyx_v_a, double __pyx_v_b) { +static CYTHON_INLINE double __pyx_f_7sklearn_12linear_model_8sgd_fast_min(double __pyx_v_a, double __pyx_v_b) { double __pyx_r; double __pyx_t_1; __Pyx_RefNannySetupContext("min"); - /* "scikits/learn/linear_model/sgd_fast.pyx":407 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":407 * * cdef inline double min(double a, double b): * return a if a <= b else b # <<<<<<<<<<<<<< @@ -5972,7 +5922,7 @@ static CYTHON_INLINE double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_min return __pyx_r; } -/* "scikits/learn/linear_model/sgd_fast.pyx":410 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":410 * * * cdef double dot(double *w_data_ptr, double *X_data_ptr, # <<<<<<<<<<<<<< @@ -5980,14 +5930,14 @@ static CYTHON_INLINE double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_min * cdef double sum = 0.0 */ -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) { +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) { double __pyx_v_sum; int __pyx_v_j; double __pyx_r; unsigned int __pyx_t_1; __Pyx_RefNannySetupContext("dot"); - /* "scikits/learn/linear_model/sgd_fast.pyx":412 + /* "/home/fabian/dev/scikit-learn/sklearn/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 # <<<<<<<<<<<<<< @@ -5996,7 +5946,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_dot(double *__py */ __pyx_v_sum = 0.0; - /* "scikits/learn/linear_model/sgd_fast.pyx":414 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":414 * cdef double sum = 0.0 * cdef int j * for j from 0 <= j < n_features: # <<<<<<<<<<<<<< @@ -6006,17 +5956,17 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_dot(double *__py __pyx_t_1 = __pyx_v_n_features; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_1; __pyx_v_j++) { - /* "scikits/learn/linear_model/sgd_fast.pyx":415 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_w_data_ptr[__pyx_v_j]) * (__pyx_v_X_data_ptr[(__pyx_v_offset + __pyx_v_j)])); } - /* "scikits/learn/linear_model/sgd_fast.pyx":416 + /* "/home/fabian/dev/scikit-learn/sklearn/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 # <<<<<<<<<<<<<< @@ -6032,7 +5982,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_dot(double *__py return __pyx_r; } -/* "scikits/learn/linear_model/sgd_fast.pyx":419 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":419 * * * cdef double add(double *w_data_ptr, double wscale, double *X_data_ptr, # <<<<<<<<<<<<<< @@ -6040,17 +5990,16 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_dot(double *__py * """Scales example x by constant c and adds it to the weight vector w""" */ -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) { +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) { 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"); - /* "scikits/learn/linear_model/sgd_fast.pyx":425 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":425 * cdef int idx * cdef double val * cdef double innerprod = 0.0 # <<<<<<<<<<<<<< @@ -6059,7 +6008,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_add(double *__py */ __pyx_v_innerprod = 0.0; - /* "scikits/learn/linear_model/sgd_fast.pyx":426 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":426 * cdef double val * cdef double innerprod = 0.0 * cdef double xsqnorm = 0.0 # <<<<<<<<<<<<<< @@ -6068,7 +6017,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_add(double *__py */ __pyx_v_xsqnorm = 0.0; - /* "scikits/learn/linear_model/sgd_fast.pyx":427 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":427 * cdef double innerprod = 0.0 * cdef double xsqnorm = 0.0 * for j from 0 <= j < n_features: # <<<<<<<<<<<<<< @@ -6078,7 +6027,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_add(double *__py __pyx_t_1 = __pyx_v_n_features; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_1; __pyx_v_j++) { - /* "scikits/learn/linear_model/sgd_fast.pyx":428 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":428 * cdef double xsqnorm = 0.0 * for j from 0 <= j < n_features: * val = X_data_ptr[offset + j] # <<<<<<<<<<<<<< @@ -6087,36 +6036,35 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_add(double *__py */ __pyx_v_val = (__pyx_v_X_data_ptr[(__pyx_v_offset + __pyx_v_j)]); - /* "scikits/learn/linear_model/sgd_fast.pyx":429 + /* "/home/fabian/dev/scikit-learn/sklearn/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_innerprod + ((__pyx_v_w_data_ptr[__pyx_v_j]) * __pyx_v_val)); + __pyx_v_innerprod += ((__pyx_v_w_data_ptr[__pyx_v_j]) * __pyx_v_val); - /* "scikits/learn/linear_model/sgd_fast.pyx":430 + /* "/home/fabian/dev/scikit-learn/sklearn/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_xsqnorm + (__pyx_v_val * __pyx_v_val)); + __pyx_v_xsqnorm += (__pyx_v_val * __pyx_v_val); - /* "scikits/learn/linear_model/sgd_fast.pyx":431 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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))); + (__pyx_v_w_data_ptr[__pyx_v_j]) += (__pyx_v_val * (__pyx_v_c / __pyx_v_wscale)); } - /* "scikits/learn/linear_model/sgd_fast.pyx":434 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":434 * * # TODO this is needed for PEGASOS only * return (xsqnorm * c * c) + (2.0 * innerprod * wscale * c) # <<<<<<<<<<<<<< @@ -6132,7 +6080,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_add(double *__py return __pyx_r; } -/* "scikits/learn/linear_model/sgd_fast.pyx":437 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":437 * * * cdef void l1penalty(double *w_data_ptr, double wscale, double *q_data_ptr, # <<<<<<<<<<<<<< @@ -6140,16 +6088,15 @@ static double __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_add(double *__py * """Apply the L1 penalty to each updated feature */ -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) { +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) { 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"); - /* "scikits/learn/linear_model/sgd_fast.pyx":447 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":447 * Empirical results look better this way... * """ * cdef double z = 0.0 # <<<<<<<<<<<<<< @@ -6158,7 +6105,7 @@ static void __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_l1penalty(double * */ __pyx_v_z = 0.0; - /* "scikits/learn/linear_model/sgd_fast.pyx":448 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":448 * """ * cdef double z = 0.0 * cdef int j = 0 # <<<<<<<<<<<<<< @@ -6167,7 +6114,7 @@ static void __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_l1penalty(double * */ __pyx_v_j = 0; - /* "scikits/learn/linear_model/sgd_fast.pyx":449 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":449 * cdef double z = 0.0 * cdef int j = 0 * cdef int idx = 0 # <<<<<<<<<<<<<< @@ -6176,7 +6123,7 @@ static void __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_l1penalty(double * */ __pyx_v_idx = 0; - /* "scikits/learn/linear_model/sgd_fast.pyx":450 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":450 * cdef int j = 0 * cdef int idx = 0 * for j from 0 <= j < n_features: # <<<<<<<<<<<<<< @@ -6186,7 +6133,7 @@ static void __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_l1penalty(double * __pyx_t_1 = __pyx_v_n_features; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_1; __pyx_v_j++) { - /* "scikits/learn/linear_model/sgd_fast.pyx":451 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":451 * cdef int idx = 0 * for j from 0 <= j < n_features: * z = w_data_ptr[j] # <<<<<<<<<<<<<< @@ -6195,7 +6142,7 @@ static void __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_l1penalty(double * */ __pyx_v_z = (__pyx_v_w_data_ptr[__pyx_v_j]); - /* "scikits/learn/linear_model/sgd_fast.pyx":452 + /* "/home/fabian/dev/scikit-learn/sklearn/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: # <<<<<<<<<<<<<< @@ -6205,18 +6152,18 @@ static void __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_l1penalty(double * __pyx_t_2 = ((__pyx_v_wscale * (__pyx_v_w_data_ptr[__pyx_v_j])) > 0.0); if (__pyx_t_2) { - /* "scikits/learn/linear_model/sgd_fast.pyx":453 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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))); + (__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))); goto __pyx_L5; } - /* "scikits/learn/linear_model/sgd_fast.pyx":455 + /* "/home/fabian/dev/scikit-learn/sklearn/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: # <<<<<<<<<<<<<< @@ -6226,31 +6173,30 @@ static void __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_l1penalty(double * __pyx_t_2 = ((__pyx_v_wscale * (__pyx_v_w_data_ptr[__pyx_v_j])) < 0.0); if (__pyx_t_2) { - /* "scikits/learn/linear_model/sgd_fast.pyx":456 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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))); + (__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))); goto __pyx_L5; } __pyx_L5:; - /* "scikits/learn/linear_model/sgd_fast.pyx":458 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_v_q_data_ptr[__pyx_v_j]) += (__pyx_v_wscale * ((__pyx_v_w_data_ptr[__pyx_v_j]) - __pyx_v_z)); } __Pyx_RefNannyFinishContext(); } -/* "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): # <<<<<<<<<<<<<< @@ -6258,8 +6204,8 @@ static void __pyx_f_7scikits_5learn_12linear_model_8sgd_fast_l1penalty(double * * # 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; @@ -6271,21 +6217,22 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ int __pyx_v_offset; int __pyx_v_hasfields; int __pyx_r; - PyObject *__pyx_t_1 = NULL; + int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_t_7; - PyObject *__pyx_t_8 = NULL; + int __pyx_t_8; 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); - /* "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 # <<<<<<<<<<<<<< @@ -6294,7 +6241,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_endian_detector = 1; - /* "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 = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -6303,29 +6250,26 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "numpy.pxd":197 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":196 * cdef bint little_endian = ((&endian_detector)[0] != 0) * * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< * * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - __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; + __pyx_v_ndim = PyArray_NDIM(((PyArrayObject *)__pyx_v_self)); - /* "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): # <<<<<<<<<<<<<< * copy_shape = 1 * else: */ - __pyx_t_2 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); - if (__pyx_t_2) { + __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); + if (__pyx_t_1) { - /* "numpy.pxd":200 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":199 * * if sizeof(npy_intp) != sizeof(Py_ssize_t): * copy_shape = 1 # <<<<<<<<<<<<<< @@ -6337,7 +6281,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } /*else*/ { - /* "numpy.pxd":202 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":201 * copy_shape = 1 * else: * copy_shape = 0 # <<<<<<<<<<<<<< @@ -6348,105 +6292,108 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } __pyx_L5:; - /* "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) # <<<<<<<<<<<<<< * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") */ - __pyx_t_2 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS); - if (__pyx_t_2) { + __pyx_t_1 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS); + if (__pyx_t_1) { - /* "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)): # <<<<<<<<<<<<<< * raise ValueError(u"ndarray is not C contiguous") * */ - __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; + __pyx_t_2 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_v_self), NPY_C_CONTIGUOUS)); + __pyx_t_3 = __pyx_t_2; } else { - __pyx_t_4 = __pyx_t_2; + __pyx_t_3 = __pyx_t_1; } - if (__pyx_t_4) { + if (__pyx_t_3) { - /* "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_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;} + __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;} goto __pyx_L6; } __pyx_L6:; - /* "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) # <<<<<<<<<<<<<< * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") */ - __pyx_t_4 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS); - if (__pyx_t_4) { + __pyx_t_3 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS); + if (__pyx_t_3) { - /* "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)): # <<<<<<<<<<<<<< * raise ValueError(u"ndarray is not Fortran contiguous") * */ - __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; + __pyx_t_1 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_v_self), NPY_F_CONTIGUOUS)); + __pyx_t_2 = __pyx_t_1; } else { - __pyx_t_3 = __pyx_t_4; + __pyx_t_2 = __pyx_t_3; } - if (__pyx_t_3) { + if (__pyx_t_2) { - /* "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_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;} + __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;} goto __pyx_L7; } __pyx_L7:; - /* "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) # <<<<<<<<<<<<<< * info.ndim = ndim * if copy_shape: */ - __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; + __pyx_v_info->buf = PyArray_DATA(((PyArrayObject *)__pyx_v_self)); - /* "numpy.pxd":213 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":212 * * info.buf = PyArray_DATA(self) * info.ndim = ndim # <<<<<<<<<<<<<< @@ -6455,16 +6402,17 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->ndim = __pyx_v_ndim; - /* "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) { - /* "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 = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< @@ -6473,7 +6421,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))); - /* "numpy.pxd":218 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":217 * # as one block, strides first. * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) * info.shape = info.strides + ndim # <<<<<<<<<<<<<< @@ -6482,72 +6430,60 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "numpy.pxd":219 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":218 * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) * info.shape = info.strides + ndim * for i in range(ndim): # <<<<<<<<<<<<<< * info.strides[i] = PyArray_STRIDES(self)[i] * info.shape[i] = PyArray_DIMS(self)[i] */ - __pyx_t_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; + __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; - /* "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] # <<<<<<<<<<<<<< * info.shape[i] = PyArray_DIMS(self)[i] * else: */ - __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; + (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]); - /* "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] # <<<<<<<<<<<<<< * else: * info.strides = PyArray_STRIDES(self) */ - __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; + (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]); } goto __pyx_L8; } /*else*/ { - /* "numpy.pxd":223 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":222 * info.shape[i] = PyArray_DIMS(self)[i] * else: * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL */ - __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; + __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(((PyArrayObject *)__pyx_v_self))); - /* "numpy.pxd":224 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":223 * else: * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(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_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(((PyArrayObject *)__pyx_v_self))); } __pyx_L8:; - /* "numpy.pxd":225 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":224 * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -6556,31 +6492,25 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->suboffsets = NULL; - /* "numpy.pxd":226 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":225 * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< * info.readonly = not PyArray_ISWRITEABLE(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; + __pyx_v_info->itemsize = PyArray_ITEMSIZE(((PyArrayObject *)__pyx_v_self)); - /* "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) # <<<<<<<<<<<<<< * * cdef int t */ - __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; + __pyx_v_info->readonly = (!PyArray_ISWRITEABLE(((PyArrayObject *)__pyx_v_self))); - /* "numpy.pxd":230 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":229 * * cdef int t * cdef char* f = NULL # <<<<<<<<<<<<<< @@ -6589,7 +6519,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_f = NULL; - /* "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 # <<<<<<<<<<<<<< @@ -6599,7 +6529,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; - /* "numpy.pxd":235 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":234 * cdef int offset * * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< @@ -6608,23 +6538,23 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - /* "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: # <<<<<<<<<<<<<< * # do not call releasebuffer * info.obj = None */ - __pyx_t_3 = (!__pyx_v_hasfields); - if (__pyx_t_3) { - __pyx_t_4 = (!__pyx_v_copy_shape); - __pyx_t_2 = __pyx_t_4; + __pyx_t_2 = (!__pyx_v_hasfields); + if (__pyx_t_2) { + __pyx_t_3 = (!__pyx_v_copy_shape); + __pyx_t_1 = __pyx_t_3; } else { - __pyx_t_2 = __pyx_t_3; + __pyx_t_1 = __pyx_t_2; } - if (__pyx_t_2) { + if (__pyx_t_1) { - /* "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 # <<<<<<<<<<<<<< @@ -6640,7 +6570,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } /*else*/ { - /* "numpy.pxd":242 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":241 * else: * # need to call releasebuffer * info.obj = self # <<<<<<<<<<<<<< @@ -6655,17 +6585,17 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } __pyx_L11:; - /* "numpy.pxd":244 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":243 * info.obj = self * * if not hasfields: # <<<<<<<<<<<<<< * t = descr.type_num * if ((descr.byteorder == '>' and little_endian) or */ - __pyx_t_2 = (!__pyx_v_hasfields); - if (__pyx_t_2) { + __pyx_t_1 = (!__pyx_v_hasfields); + if (__pyx_t_1) { - /* "numpy.pxd":245 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":244 * * if not hasfields: * t = descr.type_num # <<<<<<<<<<<<<< @@ -6674,306 +6604,312 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_t = __pyx_v_descr->type_num; - /* "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 # <<<<<<<<<<<<<< * (descr.byteorder == '<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") */ - __pyx_t_2 = (__pyx_v_descr->byteorder == '>'); - if (__pyx_t_2) { - __pyx_t_3 = __pyx_v_little_endian; + __pyx_t_1 = (__pyx_v_descr->byteorder == '>'); + if (__pyx_t_1) { + __pyx_t_2 = __pyx_v_little_endian; } else { - __pyx_t_3 = __pyx_t_2; + __pyx_t_2 = __pyx_t_1; } - if (!__pyx_t_3) { + if (!__pyx_t_2) { - /* "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)): # <<<<<<<<<<<<<< * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" */ - __pyx_t_2 = (__pyx_v_descr->byteorder == '<'); - if (__pyx_t_2) { - __pyx_t_4 = (!__pyx_v_little_endian); - __pyx_t_7 = __pyx_t_4; + __pyx_t_1 = (__pyx_v_descr->byteorder == '<'); + if (__pyx_t_1) { + __pyx_t_3 = (!__pyx_v_little_endian); + __pyx_t_8 = __pyx_t_3; } else { - __pyx_t_7 = __pyx_t_2; + __pyx_t_8 = __pyx_t_1; } - __pyx_t_2 = __pyx_t_7; + __pyx_t_1 = __pyx_t_8; } else { - __pyx_t_2 = __pyx_t_3; + __pyx_t_1 = __pyx_t_2; } - if (__pyx_t_2) { + if (__pyx_t_1) { - /* "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_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;} + __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;} goto __pyx_L13; } __pyx_L13:; - /* "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" # <<<<<<<<<<<<<< * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" */ - __pyx_t_2 = (__pyx_v_t == NPY_BYTE); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_BYTE); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__b; goto __pyx_L14; } - /* "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" # <<<<<<<<<<<<<< * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" */ - __pyx_t_2 = (__pyx_v_t == NPY_UBYTE); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_UBYTE); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__B; goto __pyx_L14; } - /* "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" # <<<<<<<<<<<<<< * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" */ - __pyx_t_2 = (__pyx_v_t == NPY_SHORT); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_SHORT); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__h; goto __pyx_L14; } - /* "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" # <<<<<<<<<<<<<< * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" */ - __pyx_t_2 = (__pyx_v_t == NPY_USHORT); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_USHORT); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__H; goto __pyx_L14; } - /* "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" # <<<<<<<<<<<<<< * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" */ - __pyx_t_2 = (__pyx_v_t == NPY_INT); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_INT); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__i; goto __pyx_L14; } - /* "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" # <<<<<<<<<<<<<< * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" */ - __pyx_t_2 = (__pyx_v_t == NPY_UINT); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_UINT); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__I; goto __pyx_L14; } - /* "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" # <<<<<<<<<<<<<< * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" */ - __pyx_t_2 = (__pyx_v_t == NPY_LONG); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_LONG); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__l; goto __pyx_L14; } - /* "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" # <<<<<<<<<<<<<< * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" */ - __pyx_t_2 = (__pyx_v_t == NPY_ULONG); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_ULONG); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__L; goto __pyx_L14; } - /* "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" # <<<<<<<<<<<<<< * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" */ - __pyx_t_2 = (__pyx_v_t == NPY_LONGLONG); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_LONGLONG); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__q; goto __pyx_L14; } - /* "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" # <<<<<<<<<<<<<< * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" */ - __pyx_t_2 = (__pyx_v_t == NPY_ULONGLONG); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_ULONGLONG); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__Q; goto __pyx_L14; } - /* "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" # <<<<<<<<<<<<<< * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" */ - __pyx_t_2 = (__pyx_v_t == NPY_FLOAT); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_FLOAT); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__f; goto __pyx_L14; } - /* "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" # <<<<<<<<<<<<<< * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" */ - __pyx_t_2 = (__pyx_v_t == NPY_DOUBLE); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_DOUBLE); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__d; goto __pyx_L14; } - /* "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" # <<<<<<<<<<<<<< * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" */ - __pyx_t_2 = (__pyx_v_t == NPY_LONGDOUBLE); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_LONGDOUBLE); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__g; goto __pyx_L14; } - /* "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" # <<<<<<<<<<<<<< * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" */ - __pyx_t_2 = (__pyx_v_t == NPY_CFLOAT); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_CFLOAT); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__Zf; goto __pyx_L14; } - /* "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" # <<<<<<<<<<<<<< * elif t == NPY_CLONGDOUBLE: f = "Zg" * elif t == NPY_OBJECT: f = "O" */ - __pyx_t_2 = (__pyx_v_t == NPY_CDOUBLE); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_CDOUBLE); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__Zd; goto __pyx_L14; } - /* "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" # <<<<<<<<<<<<<< * elif t == NPY_OBJECT: f = "O" * else: */ - __pyx_t_2 = (__pyx_v_t == NPY_CLONGDOUBLE); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_CLONGDOUBLE); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__Zg; goto __pyx_L14; } - /* "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" # <<<<<<<<<<<<<< * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) */ - __pyx_t_2 = (__pyx_v_t == NPY_OBJECT); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_OBJECT); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__O; goto __pyx_L14; } /*else*/ { - /* "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_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_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_L14:; - /* "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 # <<<<<<<<<<<<<< @@ -6982,7 +6918,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->format = __pyx_v_f; - /* "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 # <<<<<<<<<<<<<< @@ -6995,7 +6931,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } /*else*/ { - /* "numpy.pxd":271 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":270 * return * else: * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< @@ -7004,7 +6940,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->format = ((char *)malloc(255)); - /* "numpy.pxd":272 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":271 * else: * info.format = stdlib.malloc(_buffer_format_string_len) * info.format[0] = '^' # Native data types, manual alignment # <<<<<<<<<<<<<< @@ -7013,7 +6949,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ (__pyx_v_info->format[0]) = '^'; - /* "numpy.pxd":273 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":272 * info.format = stdlib.malloc(_buffer_format_string_len) * info.format[0] = '^' # Native data types, manual alignment * offset = 0 # <<<<<<<<<<<<<< @@ -7022,17 +6958,17 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_offset = 0; - /* "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; - /* "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 # <<<<<<<<<<<<<< @@ -7046,8 +6982,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_1); - __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("numpy.ndarray.__getbuffer__"); __pyx_r = -1; __Pyx_GOTREF(__pyx_v_info->obj); @@ -7060,11 +6996,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; } -/* "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): # <<<<<<<<<<<<<< @@ -7072,26 +7009,23 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ * stdlib.free(info.format) */ -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; +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); - /* "numpy.pxd":280 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":279 * * 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 = __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) { + __pyx_t_1 = PyArray_HASFIELDS(((PyArrayObject *)__pyx_v_self)); + if (__pyx_t_1) { - /* "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) # <<<<<<<<<<<<<< @@ -7103,17 +7037,17 @@ static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray_1__releasebuffer__(PyObject * } __pyx_L5:; - /* "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): # <<<<<<<<<<<<<< * stdlib.free(info.strides) * # info.shape was stored after info.strides in the same block */ - __pyx_t_2 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); - if (__pyx_t_2) { + __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); + if (__pyx_t_1) { - /* "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) # <<<<<<<<<<<<<< @@ -7125,10 +7059,11 @@ static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray_1__releasebuffer__(PyObject * } __pyx_L6:; + __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_RefNannyFinishContext(); } -/* "numpy.pxd":756 +/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":755 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -7141,7 +7076,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1"); - /* "numpy.pxd":757 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":756 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -7149,7 +7084,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; @@ -7167,7 +7102,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "numpy.pxd":759 +/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":758 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -7180,7 +7115,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2"); - /* "numpy.pxd":760 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":759 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -7188,7 +7123,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; @@ -7206,7 +7141,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "numpy.pxd":762 +/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":761 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -7219,7 +7154,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3"); - /* "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, a, b, c) # <<<<<<<<<<<<<< @@ -7227,7 +7162,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; @@ -7245,7 +7180,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "numpy.pxd":765 +/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":764 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -7258,7 +7193,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4"); - /* "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, a, b, c, d) # <<<<<<<<<<<<<< @@ -7266,7 +7201,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; @@ -7284,7 +7219,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "numpy.pxd":768 +/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":767 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -7297,7 +7232,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5"); - /* "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, a, b, c, d, e) # <<<<<<<<<<<<<< @@ -7305,7 +7240,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; @@ -7323,7 +7258,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "numpy.pxd":771 +/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":770 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -7349,16 +7284,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; - long __pyx_t_10; - char *__pyx_t_11; + 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_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); - /* "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 # <<<<<<<<<<<<<< @@ -7367,7 +7302,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_endian_detector = 1; - /* "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 = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -7376,17 +7311,18 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "numpy.pxd":782 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":781 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< * fields = descr.fields[childname] * child, new_offset = fields */ - 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;} + 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;} } - __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++; @@ -7394,21 +7330,21 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_v_childname = __pyx_t_3; __pyx_t_3 = 0; - /* "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_v_fields = ((PyObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "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 # <<<<<<<<<<<<<< @@ -7418,7 +7354,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); @@ -7428,51 +7364,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;} } - /* "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) { - /* "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 = 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_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_Raise(__pyx_t_5, 0, 0); + __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_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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;} goto __pyx_L5; } __pyx_L5:; - /* "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 # <<<<<<<<<<<<<< @@ -7487,7 +7429,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } if (!__pyx_t_7) { - /* "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)): # <<<<<<<<<<<<<< @@ -7507,23 +7449,29 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } if (__pyx_t_6) { - /* "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_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_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_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:; - /* "numpy.pxd":801 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":800 * * # Output padding bytes * while offset[0] < new_offset: # <<<<<<<<<<<<<< @@ -7531,16 +7479,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; - /* "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 # <<<<<<<<<<<<<< @@ -7549,37 +7497,35 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ (__pyx_v_f[0]) = 120; - /* "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 # <<<<<<<<<<<<<< * offset[0] += 1 * */ - __pyx_v_f = (__pyx_v_f + 1); + __pyx_v_f += 1; - /* "numpy.pxd":804 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":803 * f[0] = 120 # "x"; pad byte * f += 1 * offset[0] += 1 # <<<<<<<<<<<<<< * * offset[0] += child.itemsize */ - __pyx_t_10 = 0; - (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + 1); + (__pyx_v_offset[0]) += 1; } - /* "numpy.pxd":806 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":805 * offset[0] += 1 * * offset[0] += child.itemsize # <<<<<<<<<<<<<< * * if not PyDataType_HASFIELDS(child): */ - __pyx_t_10 = 0; - (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + __pyx_v_child->elsize); + (__pyx_v_offset[0]) += __pyx_v_child->elsize; - /* "numpy.pxd":808 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":807 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -7589,20 +7535,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) { - /* "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; - /* "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: # <<<<<<<<<<<<<< @@ -7612,402 +7558,408 @@ 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) { - /* "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 = 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_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_Raise(__pyx_t_3, 0, 0); + __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_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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;} goto __pyx_L10; } __pyx_L10:; - /* "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_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_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_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_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 = 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 = 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; } - /* "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_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_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_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_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 = 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]) = 66; goto __pyx_L11; } - /* "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_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_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_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_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 = 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]) = 104; goto __pyx_L11; } - /* "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_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_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_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_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 = 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]) = 72; goto __pyx_L11; } - /* "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_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_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_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_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 = 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]) = 105; goto __pyx_L11; } - /* "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_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_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_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_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 = 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]) = 73; goto __pyx_L11; } - /* "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_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_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_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_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 = 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]) = 108; goto __pyx_L11; } - /* "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_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_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_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_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 = 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]) = 76; goto __pyx_L11; } - /* "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_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_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_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_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 = 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]) = 113; goto __pyx_L11; } - /* "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_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_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_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_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 = 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]) = 81; goto __pyx_L11; } - /* "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_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_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_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_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 = 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]) = 102; goto __pyx_L11; } - /* "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_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_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_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_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 = 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]) = 100; goto __pyx_L11; } - /* "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_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_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_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_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 = 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]) = 103; goto __pyx_L11; } - /* "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_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_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_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_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 = 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]) = 90; (__pyx_v_f[1]) = 102; - __pyx_v_f = (__pyx_v_f + 1); + __pyx_v_f += 1; goto __pyx_L11; } - /* "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_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_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_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_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 = 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]) = 100; - __pyx_v_f = (__pyx_v_f + 1); + __pyx_v_f += 1; goto __pyx_L11; } - /* "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_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_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_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_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 = 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]) = 103; - __pyx_v_f = (__pyx_v_f + 1); + __pyx_v_f += 1; goto __pyx_L11; } - /* "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_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_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_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_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]) = 79; goto __pyx_L11; } /*else*/ { - /* "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_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_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); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); + 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(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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_L11:; - /* "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 # <<<<<<<<<<<<<< * else: * # Cython ignores struct boundary information ("T{...}"), */ - __pyx_v_f = (__pyx_v_f + 1); + __pyx_v_f += 1; goto __pyx_L9; } /*else*/ { - /* "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_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_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; - /* "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 # <<<<<<<<<<<<<< @@ -8032,11 +7984,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; } -/* "numpy.pxd":953 +/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":952 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -8047,10 +8000,11 @@ 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); - /* "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: # <<<<<<<<<<<<<< @@ -8060,7 +8014,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) { - /* "numpy.pxd":956 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":955 * cdef PyObject* baseptr * if base is None: * baseptr = NULL # <<<<<<<<<<<<<< @@ -8072,19 +8026,16 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } /*else*/ { - /* "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! # <<<<<<<<<<<<<< * baseptr = base * Py_XDECREF(arr.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; + Py_INCREF(__pyx_v_base); - /* "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 = base # <<<<<<<<<<<<<< @@ -8095,7 +8046,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } __pyx_L3:; - /* "numpy.pxd":960 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":959 * Py_INCREF(base) # important to do this before decref below! * baseptr = base * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< @@ -8104,7 +8055,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_XDECREF(__pyx_v_arr->base); - /* "numpy.pxd":961 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":960 * baseptr = base * Py_XDECREF(arr.base) * arr.base = baseptr # <<<<<<<<<<<<<< @@ -8113,10 +8064,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(); } -/* "numpy.pxd":963 +/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":962 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -8128,8 +8081,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); - /* "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: # <<<<<<<<<<<<<< @@ -8139,7 +8093,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) { - /* "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 # <<<<<<<<<<<<<< @@ -8154,7 +8108,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py } /*else*/ { - /* "numpy.pxd":967 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":966 * return None * else: * return arr.base # <<<<<<<<<<<<<< @@ -8168,28 +8122,29 @@ 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_7scikits_5learn_12linear_model_8sgd_fast_LossFunction __pyx_vtable_7scikits_5learn_12linear_model_8sgd_fast_LossFunction; +static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_LossFunction __pyx_vtable_7sklearn_12linear_model_8sgd_fast_LossFunction; -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; +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; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; - p = ((struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *)o); - p->__pyx_vtab = __pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_LossFunction; + p = ((struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *)o); + p->__pyx_vtab = __pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_LossFunction; return o; } -static void __pyx_tp_dealloc_7scikits_5learn_12linear_model_8sgd_fast_LossFunction(PyObject *o) { +static void __pyx_tp_dealloc_7sklearn_12linear_model_8sgd_fast_LossFunction(PyObject *o) { (*Py_TYPE(o)->tp_free)(o); } -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)}, +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)}, {0, 0, 0, 0} }; @@ -8217,10 +8172,10 @@ static PyNumberMethods __pyx_tp_as_number_LossFunction = { 0, /*nb_coerce*/ #endif 0, /*nb_int*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_long*/ - #else + #if PY_MAJOR_VERSION >= 3 0, /*reserved*/ + #else + 0, /*nb_long*/ #endif 0, /*nb_float*/ #if PY_MAJOR_VERSION < 3 @@ -8246,7 +8201,7 @@ static PyNumberMethods __pyx_tp_as_number_LossFunction = { 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ - #if PY_VERSION_HEX >= 0x02050000 + #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX) 0, /*nb_index*/ #endif }; @@ -8291,20 +8246,16 @@ static PyBufferProcs __pyx_tp_as_buffer_LossFunction = { #endif }; -static PyTypeObject __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_LossFunction = { +PyTypeObject __pyx_type_7sklearn_12linear_model_8sgd_fast_LossFunction = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("scikits.learn.linear_model.sgd_fast.LossFunction"), /*tp_name*/ - sizeof(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction), /*tp_basicsize*/ + __Pyx_NAMESTR("sklearn.linear_model.sgd_fast.LossFunction"), /*tp_name*/ + sizeof(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_7scikits_5learn_12linear_model_8sgd_fast_LossFunction, /*tp_dealloc*/ + __pyx_tp_dealloc_7sklearn_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*/ @@ -8315,7 +8266,7 @@ static PyTypeObject __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_LossFunc 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_LossFunction, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/ __Pyx_DOCSTR("Base class for convex loss functions"), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ @@ -8323,7 +8274,7 @@ static PyTypeObject __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_LossFunc 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_7scikits_5learn_12linear_model_8sgd_fast_LossFunction, /*tp_methods*/ + __pyx_methods_7sklearn_12linear_model_8sgd_fast_LossFunction, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -8333,7 +8284,7 @@ static PyTypeObject __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_LossFunc 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_7scikits_5learn_12linear_model_8sgd_fast_LossFunction, /*tp_new*/ + __pyx_tp_new_7sklearn_12linear_model_8sgd_fast_LossFunction, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -8346,20 +8297,20 @@ static PyTypeObject __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_LossFunc 0, /*tp_version_tag*/ #endif }; -static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Regression __pyx_vtable_7scikits_5learn_12linear_model_8sgd_fast_Regression; +static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Regression __pyx_vtable_7sklearn_12linear_model_8sgd_fast_Regression; -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); +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); if (!o) return 0; - 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; + 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; return o; } -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)}, +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)}, {0, 0, 0, 0} }; @@ -8387,10 +8338,10 @@ static PyNumberMethods __pyx_tp_as_number_Regression = { 0, /*nb_coerce*/ #endif 0, /*nb_int*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_long*/ - #else + #if PY_MAJOR_VERSION >= 3 0, /*reserved*/ + #else + 0, /*nb_long*/ #endif 0, /*nb_float*/ #if PY_MAJOR_VERSION < 3 @@ -8416,7 +8367,7 @@ static PyNumberMethods __pyx_tp_as_number_Regression = { 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ - #if PY_VERSION_HEX >= 0x02050000 + #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX) 0, /*nb_index*/ #endif }; @@ -8461,20 +8412,16 @@ static PyBufferProcs __pyx_tp_as_buffer_Regression = { #endif }; -static PyTypeObject __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Regression = { +PyTypeObject __pyx_type_7sklearn_12linear_model_8sgd_fast_Regression = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("scikits.learn.linear_model.sgd_fast.Regression"), /*tp_name*/ - sizeof(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Regression), /*tp_basicsize*/ + __Pyx_NAMESTR("sklearn.linear_model.sgd_fast.Regression"), /*tp_name*/ + sizeof(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Regression), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_7scikits_5learn_12linear_model_8sgd_fast_LossFunction, /*tp_dealloc*/ + __pyx_tp_dealloc_7sklearn_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*/ @@ -8485,7 +8432,7 @@ static PyTypeObject __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Regressi 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_Regression, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/ __Pyx_DOCSTR("Base class for loss functions for regression"), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ @@ -8493,7 +8440,7 @@ static PyTypeObject __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Regressi 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_7scikits_5learn_12linear_model_8sgd_fast_Regression, /*tp_methods*/ + __pyx_methods_7sklearn_12linear_model_8sgd_fast_Regression, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -8503,7 +8450,7 @@ static PyTypeObject __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Regressi 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_7scikits_5learn_12linear_model_8sgd_fast_Regression, /*tp_new*/ + __pyx_tp_new_7sklearn_12linear_model_8sgd_fast_Regression, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -8516,20 +8463,20 @@ static PyTypeObject __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Regressi 0, /*tp_version_tag*/ #endif }; -static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Classification __pyx_vtable_7scikits_5learn_12linear_model_8sgd_fast_Classification; +static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Classification __pyx_vtable_7sklearn_12linear_model_8sgd_fast_Classification; -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); +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); if (!o) return 0; - 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; + 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; return o; } -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)}, +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)}, {0, 0, 0, 0} }; @@ -8557,10 +8504,10 @@ static PyNumberMethods __pyx_tp_as_number_Classification = { 0, /*nb_coerce*/ #endif 0, /*nb_int*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_long*/ - #else + #if PY_MAJOR_VERSION >= 3 0, /*reserved*/ + #else + 0, /*nb_long*/ #endif 0, /*nb_float*/ #if PY_MAJOR_VERSION < 3 @@ -8586,7 +8533,7 @@ static PyNumberMethods __pyx_tp_as_number_Classification = { 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ - #if PY_VERSION_HEX >= 0x02050000 + #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX) 0, /*nb_index*/ #endif }; @@ -8631,20 +8578,16 @@ static PyBufferProcs __pyx_tp_as_buffer_Classification = { #endif }; -static PyTypeObject __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Classification = { +PyTypeObject __pyx_type_7sklearn_12linear_model_8sgd_fast_Classification = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("scikits.learn.linear_model.sgd_fast.Classification"), /*tp_name*/ - sizeof(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Classification), /*tp_basicsize*/ + __Pyx_NAMESTR("sklearn.linear_model.sgd_fast.Classification"), /*tp_name*/ + sizeof(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Classification), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_7scikits_5learn_12linear_model_8sgd_fast_LossFunction, /*tp_dealloc*/ + __pyx_tp_dealloc_7sklearn_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*/ @@ -8655,7 +8598,7 @@ static PyTypeObject __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Classifi 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_Classification, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/ __Pyx_DOCSTR("Base class for loss functions for classification"), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ @@ -8663,7 +8606,7 @@ static PyTypeObject __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Classifi 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_7scikits_5learn_12linear_model_8sgd_fast_Classification, /*tp_methods*/ + __pyx_methods_7sklearn_12linear_model_8sgd_fast_Classification, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -8673,7 +8616,7 @@ static PyTypeObject __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Classifi 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_7scikits_5learn_12linear_model_8sgd_fast_Classification, /*tp_new*/ + __pyx_tp_new_7sklearn_12linear_model_8sgd_fast_Classification, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -8686,21 +8629,21 @@ static PyTypeObject __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Classifi 0, /*tp_version_tag*/ #endif }; -static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber __pyx_vtable_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber; +static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_ModifiedHuber __pyx_vtable_7sklearn_12linear_model_8sgd_fast_ModifiedHuber; -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); +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); if (!o) return 0; - 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; + 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; return o; } -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)}, +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)}, {0, 0, 0, 0} }; @@ -8728,10 +8671,10 @@ static PyNumberMethods __pyx_tp_as_number_ModifiedHuber = { 0, /*nb_coerce*/ #endif 0, /*nb_int*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_long*/ - #else + #if PY_MAJOR_VERSION >= 3 0, /*reserved*/ + #else + 0, /*nb_long*/ #endif 0, /*nb_float*/ #if PY_MAJOR_VERSION < 3 @@ -8757,7 +8700,7 @@ static PyNumberMethods __pyx_tp_as_number_ModifiedHuber = { 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ - #if PY_VERSION_HEX >= 0x02050000 + #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX) 0, /*nb_index*/ #endif }; @@ -8802,20 +8745,16 @@ static PyBufferProcs __pyx_tp_as_buffer_ModifiedHuber = { #endif }; -static PyTypeObject __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber = { +PyTypeObject __pyx_type_7sklearn_12linear_model_8sgd_fast_ModifiedHuber = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("scikits.learn.linear_model.sgd_fast.ModifiedHuber"), /*tp_name*/ - sizeof(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber), /*tp_basicsize*/ + __Pyx_NAMESTR("sklearn.linear_model.sgd_fast.ModifiedHuber"), /*tp_name*/ + sizeof(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_ModifiedHuber), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_7scikits_5learn_12linear_model_8sgd_fast_LossFunction, /*tp_dealloc*/ + __pyx_tp_dealloc_7sklearn_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*/ @@ -8826,7 +8765,7 @@ static PyTypeObject __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Modified 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_ModifiedHuber, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*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*/ @@ -8834,7 +8773,7 @@ static PyTypeObject __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Modified 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber, /*tp_methods*/ + __pyx_methods_7sklearn_12linear_model_8sgd_fast_ModifiedHuber, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -8844,7 +8783,7 @@ static PyTypeObject __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Modified 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber, /*tp_new*/ + __pyx_tp_new_7sklearn_12linear_model_8sgd_fast_ModifiedHuber, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -8857,21 +8796,21 @@ static PyTypeObject __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Modified 0, /*tp_version_tag*/ #endif }; -static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Hinge __pyx_vtable_7scikits_5learn_12linear_model_8sgd_fast_Hinge; +static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Hinge __pyx_vtable_7sklearn_12linear_model_8sgd_fast_Hinge; -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); +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); if (!o) return 0; - 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; + 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; return o; } -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)}, +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)}, {0, 0, 0, 0} }; @@ -8899,10 +8838,10 @@ static PyNumberMethods __pyx_tp_as_number_Hinge = { 0, /*nb_coerce*/ #endif 0, /*nb_int*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_long*/ - #else + #if PY_MAJOR_VERSION >= 3 0, /*reserved*/ + #else + 0, /*nb_long*/ #endif 0, /*nb_float*/ #if PY_MAJOR_VERSION < 3 @@ -8928,7 +8867,7 @@ static PyNumberMethods __pyx_tp_as_number_Hinge = { 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ - #if PY_VERSION_HEX >= 0x02050000 + #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX) 0, /*nb_index*/ #endif }; @@ -8973,20 +8912,16 @@ static PyBufferProcs __pyx_tp_as_buffer_Hinge = { #endif }; -static PyTypeObject __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Hinge = { +PyTypeObject __pyx_type_7sklearn_12linear_model_8sgd_fast_Hinge = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("scikits.learn.linear_model.sgd_fast.Hinge"), /*tp_name*/ - sizeof(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Hinge), /*tp_basicsize*/ + __Pyx_NAMESTR("sklearn.linear_model.sgd_fast.Hinge"), /*tp_name*/ + sizeof(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Hinge), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_7scikits_5learn_12linear_model_8sgd_fast_LossFunction, /*tp_dealloc*/ + __pyx_tp_dealloc_7sklearn_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*/ @@ -8997,7 +8932,7 @@ static PyTypeObject __pyx_type_7scikits_5learn_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_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/ __Pyx_DOCSTR("SVM loss for binary classification tasks with y in {-1,1}"), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ @@ -9005,7 +8940,7 @@ static PyTypeObject __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Hinge = 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_7scikits_5learn_12linear_model_8sgd_fast_Hinge, /*tp_methods*/ + __pyx_methods_7sklearn_12linear_model_8sgd_fast_Hinge, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -9015,7 +8950,7 @@ static PyTypeObject __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Hinge = 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_7scikits_5learn_12linear_model_8sgd_fast_Hinge, /*tp_new*/ + __pyx_tp_new_7sklearn_12linear_model_8sgd_fast_Hinge, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -9028,21 +8963,21 @@ static PyTypeObject __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Hinge = 0, /*tp_version_tag*/ #endif }; -static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Log __pyx_vtable_7scikits_5learn_12linear_model_8sgd_fast_Log; +static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Log __pyx_vtable_7sklearn_12linear_model_8sgd_fast_Log; -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); +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); if (!o) return 0; - 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; + 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; return o; } -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)}, +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)}, {0, 0, 0, 0} }; @@ -9070,10 +9005,10 @@ static PyNumberMethods __pyx_tp_as_number_Log = { 0, /*nb_coerce*/ #endif 0, /*nb_int*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_long*/ - #else + #if PY_MAJOR_VERSION >= 3 0, /*reserved*/ + #else + 0, /*nb_long*/ #endif 0, /*nb_float*/ #if PY_MAJOR_VERSION < 3 @@ -9099,7 +9034,7 @@ static PyNumberMethods __pyx_tp_as_number_Log = { 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ - #if PY_VERSION_HEX >= 0x02050000 + #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX) 0, /*nb_index*/ #endif }; @@ -9144,20 +9079,16 @@ static PyBufferProcs __pyx_tp_as_buffer_Log = { #endif }; -static PyTypeObject __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Log = { +PyTypeObject __pyx_type_7sklearn_12linear_model_8sgd_fast_Log = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("scikits.learn.linear_model.sgd_fast.Log"), /*tp_name*/ - sizeof(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Log), /*tp_basicsize*/ + __Pyx_NAMESTR("sklearn.linear_model.sgd_fast.Log"), /*tp_name*/ + sizeof(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Log), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_7scikits_5learn_12linear_model_8sgd_fast_LossFunction, /*tp_dealloc*/ + __pyx_tp_dealloc_7sklearn_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*/ @@ -9168,7 +9099,7 @@ static PyTypeObject __pyx_type_7scikits_5learn_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_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/ __Pyx_DOCSTR("Logistic regression loss for binary classification with y in {-1, 1}"), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ @@ -9176,7 +9107,7 @@ static PyTypeObject __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Log = { 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_7scikits_5learn_12linear_model_8sgd_fast_Log, /*tp_methods*/ + __pyx_methods_7sklearn_12linear_model_8sgd_fast_Log, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -9186,7 +9117,7 @@ static PyTypeObject __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Log = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_7scikits_5learn_12linear_model_8sgd_fast_Log, /*tp_new*/ + __pyx_tp_new_7sklearn_12linear_model_8sgd_fast_Log, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -9199,21 +9130,21 @@ static PyTypeObject __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Log = { 0, /*tp_version_tag*/ #endif }; -static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss __pyx_vtable_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss; +static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_SquaredLoss __pyx_vtable_7sklearn_12linear_model_8sgd_fast_SquaredLoss; -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); +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); if (!o) return 0; - 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; + 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; return o; } -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)}, +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)}, {0, 0, 0, 0} }; @@ -9241,10 +9172,10 @@ static PyNumberMethods __pyx_tp_as_number_SquaredLoss = { 0, /*nb_coerce*/ #endif 0, /*nb_int*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_long*/ - #else + #if PY_MAJOR_VERSION >= 3 0, /*reserved*/ + #else + 0, /*nb_long*/ #endif 0, /*nb_float*/ #if PY_MAJOR_VERSION < 3 @@ -9270,7 +9201,7 @@ static PyNumberMethods __pyx_tp_as_number_SquaredLoss = { 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ - #if PY_VERSION_HEX >= 0x02050000 + #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX) 0, /*nb_index*/ #endif }; @@ -9315,20 +9246,16 @@ static PyBufferProcs __pyx_tp_as_buffer_SquaredLoss = { #endif }; -static PyTypeObject __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss = { +PyTypeObject __pyx_type_7sklearn_12linear_model_8sgd_fast_SquaredLoss = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("scikits.learn.linear_model.sgd_fast.SquaredLoss"), /*tp_name*/ - sizeof(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss), /*tp_basicsize*/ + __Pyx_NAMESTR("sklearn.linear_model.sgd_fast.SquaredLoss"), /*tp_name*/ + sizeof(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_SquaredLoss), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_7scikits_5learn_12linear_model_8sgd_fast_LossFunction, /*tp_dealloc*/ + __pyx_tp_dealloc_7sklearn_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*/ @@ -9339,7 +9266,7 @@ static PyTypeObject __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_SquaredL 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_SquaredLoss, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/ __Pyx_DOCSTR("Squared loss traditional used in linear regression."), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ @@ -9347,7 +9274,7 @@ static PyTypeObject __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_SquaredL 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss, /*tp_methods*/ + __pyx_methods_7sklearn_12linear_model_8sgd_fast_SquaredLoss, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -9357,7 +9284,7 @@ static PyTypeObject __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_SquaredL 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss, /*tp_new*/ + __pyx_tp_new_7sklearn_12linear_model_8sgd_fast_SquaredLoss, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -9370,21 +9297,21 @@ static PyTypeObject __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_SquaredL 0, /*tp_version_tag*/ #endif }; -static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Huber __pyx_vtable_7scikits_5learn_12linear_model_8sgd_fast_Huber; +static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Huber __pyx_vtable_7sklearn_12linear_model_8sgd_fast_Huber; -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); +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); if (!o) return 0; - 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; + 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; return o; } -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)}, +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)}, {0, 0, 0, 0} }; @@ -9412,10 +9339,10 @@ static PyNumberMethods __pyx_tp_as_number_Huber = { 0, /*nb_coerce*/ #endif 0, /*nb_int*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_long*/ - #else + #if PY_MAJOR_VERSION >= 3 0, /*reserved*/ + #else + 0, /*nb_long*/ #endif 0, /*nb_float*/ #if PY_MAJOR_VERSION < 3 @@ -9441,7 +9368,7 @@ static PyNumberMethods __pyx_tp_as_number_Huber = { 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ - #if PY_VERSION_HEX >= 0x02050000 + #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX) 0, /*nb_index*/ #endif }; @@ -9486,20 +9413,16 @@ static PyBufferProcs __pyx_tp_as_buffer_Huber = { #endif }; -static PyTypeObject __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Huber = { +PyTypeObject __pyx_type_7sklearn_12linear_model_8sgd_fast_Huber = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("scikits.learn.linear_model.sgd_fast.Huber"), /*tp_name*/ - sizeof(struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Huber), /*tp_basicsize*/ + __Pyx_NAMESTR("sklearn.linear_model.sgd_fast.Huber"), /*tp_name*/ + sizeof(struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Huber), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_7scikits_5learn_12linear_model_8sgd_fast_LossFunction, /*tp_dealloc*/ + __pyx_tp_dealloc_7sklearn_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*/ @@ -9510,7 +9433,7 @@ static PyTypeObject __pyx_type_7scikits_5learn_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_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*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*/ @@ -9518,7 +9441,7 @@ static PyTypeObject __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Huber = 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_7scikits_5learn_12linear_model_8sgd_fast_Huber, /*tp_methods*/ + __pyx_methods_7sklearn_12linear_model_8sgd_fast_Huber, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -9526,9 +9449,9 @@ static PyTypeObject __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Huber = 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - __pyx_pf_7scikits_5learn_12linear_model_8sgd_fast_5Huber___init__, /*tp_init*/ + __pyx_pf_7sklearn_12linear_model_8sgd_fast_5Huber___init__, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_7scikits_5learn_12linear_model_8sgd_fast_Huber, /*tp_new*/ + __pyx_tp_new_7sklearn_12linear_model_8sgd_fast_Huber, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -9542,10 +9465,13 @@ static PyTypeObject __pyx_type_7scikits_5learn_12linear_model_8sgd_fast_Huber = #endif }; -static PyMethodDef __pyx_methods[] = { +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)}, {0, 0, 0, 0} }; +static void __pyx_init_filenames(void); /*proto*/ + #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { PyModuleDef_HEAD_INIT, @@ -9563,15 +9489,14 @@ 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}, @@ -9579,7 +9504,6 @@ 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}, @@ -9614,7 +9538,6 @@ 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}, @@ -9640,117 +9563,10 @@ 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 = 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(); + __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:; - __Pyx_RefNannyFinishContext(); return -1; } @@ -9783,10 +9599,12 @@ 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 ---*/ @@ -9810,96 +9628,134 @@ 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_scikits__learn__linear_model__sgd_fast) { + if (__pyx_module_is_main_sklearn__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_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; + __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; /*--- 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 ---*/ - /* "scikits/learn/linear_model/sgd_fast.pyx":10 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":10 * # License: BSD Style. * * import numpy as np # <<<<<<<<<<<<<< @@ -9911,7 +9767,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; - /* "scikits/learn/linear_model/sgd_fast.pyx":11 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":11 * * import numpy as np * import sys # <<<<<<<<<<<<<< @@ -9923,7 +9779,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; - /* "scikits/learn/linear_model/sgd_fast.pyx":12 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pyx":12 * import numpy as np * import sys * from time import time # <<<<<<<<<<<<<< @@ -9944,44 +9800,20 @@ PyMODINIT_FUNC PyInit_sgd_fast(void) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "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 + /* "/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:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); if (__pyx_m) { - __Pyx_AddTraceback("init scikits.learn.linear_model.sgd_fast"); + __Pyx_AddTraceback("init sklearn.linear_model.sgd_fast"); Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init scikits.learn.linear_model.sgd_fast"); + PyErr_SetString(PyExc_ImportError, "init sklearn.linear_model.sgd_fast"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); @@ -9992,208 +9824,72 @@ PyMODINIT_FUNC PyInit_sgd_fast(void) #endif } +static const char *__pyx_filenames[] = { + "sgd_fast.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 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_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_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { - PyThreadState *tstate = PyThreadState_GET(); - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; +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; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; + 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); } - -#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 , */ - 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; +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; @@ -10261,26 +9957,6 @@ static int __Pyx_ParseOptionalKeywords( 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; @@ -10400,7 +10076,7 @@ static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) { default: { __Pyx_BufFmt_RaiseUnexpectedChar(ch); return 0; - } + } } } @@ -10444,7 +10120,7 @@ static size_t __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) { default: { __Pyx_BufFmt_RaiseUnexpectedChar(ch); return 0; - } + } } } @@ -10481,7 +10157,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 { @@ -10504,7 +10180,7 @@ static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { ctx->head->parent_offset = parent_offset; continue; } - + __Pyx_BufFmt_RaiseExpected(ctx); return -1; } @@ -10518,7 +10194,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 */ @@ -10551,7 +10227,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) { @@ -10673,7 +10349,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha return NULL; } } - + } } } @@ -10686,7 +10362,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; @@ -10744,10 +10420,33 @@ static void __Pyx_RaiseBufferFallbackError(void) { -static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); +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_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, #if PY_VERSION_HEX < 0x02050000 @@ -10758,13 +10457,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) { @@ -10773,10 +10494,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 @@ -10793,7 +10534,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_1__releasebuffer__(obj, view); +if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pf_5numpy_7ndarray___releasebuffer__(obj, view); Py_DECREF(obj); view->obj = NULL; } @@ -10802,14 +10543,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; @@ -10825,15 +10566,133 @@ 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); + 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 , */ + 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"); @@ -10843,14 +10702,13 @@ static PyObject *__Pyx_GetStdout(void) { return f; } -static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) { +static int __Pyx_Print(PyObject *arg_tuple, int newline) { + PyObject *f; PyObject* v; int i; - if (!f) { - if (!(f = __Pyx_GetStdout())) - return -1; - } + 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) @@ -10878,38 +10736,22 @@ static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) { #else /* Python 3 has a print function */ -static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) { +static int __Pyx_Print(PyObject *arg_tuple, int newline) { PyObject* kwargs = 0; PyObject* result = 0; PyObject* end_string; - if (unlikely(!__pyx_print)) { + if (!__pyx_print) { __pyx_print = __Pyx_GetAttrString(__pyx_b, "print"); if (!__pyx_print) return -1; } - 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)) { + if (!newline) { + if (!__pyx_print_kwargs) { __pyx_print_kwargs = PyDict_New(); - if (unlikely(!__pyx_print_kwargs)) + if (!__pyx_print_kwargs) return -1; end_string = PyUnicode_FromStringAndSize(" ", 1); - if (unlikely(!end_string)) + if (!end_string) return -1; if (PyDict_SetItemString(__pyx_print_kwargs, "end", end_string) < 0) { Py_DECREF(end_string); @@ -10920,27 +10762,20 @@ static int __Pyx_Print(PyObject* stream, 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* f, PyObject *o) { - if (!f) { - if (!(f = __Pyx_GetStdout())) - return -1; - } +static int __Pyx_PrintOne(PyObject *o) { + PyObject *f; + if (!(f = __Pyx_GetStdout())) + return -1; if (PyFile_SoftSpace(f, 0)) { if (PyFile_WriteString(" ", f) < 0) return -1; @@ -10952,19 +10787,19 @@ static int __Pyx_PrintOne(PyObject* f, PyObject *o) { return 0; /* the line below is just to avoid compiler * compiler warnings about unused functions */ - return __Pyx_Print(f, NULL, 0); + return __Pyx_Print(NULL, 0); } #else /* Python 3 has a print function */ -static int __Pyx_PrintOne(PyObject* stream, PyObject *o) { +static int __Pyx_PrintOne(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(stream, arg_tuple, 1); + res = __Pyx_Print(arg_tuple, 1); Py_DECREF(arg_tuple); return res; } @@ -11035,60 +10870,15 @@ static int __Pyx_PrintOne(PyObject* stream, PyObject *o) { z.imag = -a.imag; return z; } - #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 +/* + 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 + } +*/ #endif #if CYTHON_CCOMPLEX @@ -11155,60 +10945,15 @@ static int __Pyx_PrintOne(PyObject* stream, PyObject *o) { z.imag = -a.imag; return z; } - #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 +/* + 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 + } +*/ #endif static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) { @@ -11382,25 +11127,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; @@ -11630,10 +11356,10 @@ static void __Pyx_WriteUnraisable(const char *name) { } static int __Pyx_SetVtable(PyObject *dict, void *vtable) { -#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) - PyObject *ob = PyCapsule_New(vtable, 0, 0); -#else +#if PY_VERSION_HEX < 0x03010000 PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#else + PyObject *ob = PyCapsule_New(vtable, 0, 0); #endif if (!ob) goto bad; @@ -11674,23 +11400,19 @@ 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; @@ -11828,8 +11550,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/scikits/learn/linear_model/sgd_fast.pxd b/sklearn/linear_model/sgd_fast.pxd similarity index 100% rename from scikits/learn/linear_model/sgd_fast.pxd rename to sklearn/linear_model/sgd_fast.pxd diff --git a/scikits/learn/linear_model/sgd_fast.pyx b/sklearn/linear_model/sgd_fast.pyx similarity index 100% rename from scikits/learn/linear_model/sgd_fast.pyx rename to sklearn/linear_model/sgd_fast.pyx diff --git a/scikits/learn/linear_model/sgd_fast_sparse.c b/sklearn/linear_model/sgd_fast_sparse.c similarity index 77% rename from scikits/learn/linear_model/sgd_fast_sparse.c rename to sklearn/linear_model/sgd_fast_sparse.c index 270190221f2e5..b3faa479d76f9 100644 --- a/scikits/learn/linear_model/sgd_fast_sparse.c +++ b/sklearn/linear_model/sgd_fast_sparse.c @@ -1,39 +1,18 @@ -/* Generated by Cython 0.14.1 on Wed May 11 16:17:27 2011 */ +/* Generated by Cython 0.12.1 on Fri Sep 2 11:08:35 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 /* 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,43 +82,14 @@ #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 -#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) @@ -153,42 +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) || (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)) + #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 @@ -208,69 +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 -#define __PYX_HAVE_API__scikits__learn__linear_model__sgd_fast_sparse -#include "stdio.h" +#define __PYX_HAVE_API__sklearn__linear_model__sgd_fast_sparse #include "stdlib.h" +#include "stdio.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 */ -#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*); @@ -280,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 ... */ @@ -300,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) @@ -325,12 +308,6 @@ static const char *__pyx_filename; #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; @@ -369,9 +346,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_7scikits_5learn_12linear_model_8sgd_fast_DOUBLE; +typedef __pyx_t_5numpy_float64_t __pyx_t_7sklearn_12linear_model_8sgd_fast_DOUBLE; -typedef __pyx_t_5numpy_int32_t __pyx_t_7scikits_5learn_12linear_model_8sgd_fast_INTEGER; +typedef __pyx_t_5numpy_int32_t __pyx_t_7sklearn_12linear_model_8sgd_fast_INTEGER; #if CYTHON_CCOMPLEX #ifdef __cplusplus @@ -403,7 +380,7 @@ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; typedef npy_cdouble __pyx_t_5numpy_complex_t; -/* "sgd_fast.pxd":20 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pxd":20 * # ----------------------------------------- * * cdef class LossFunction: # <<<<<<<<<<<<<< @@ -411,12 +388,12 @@ typedef npy_cdouble __pyx_t_5numpy_complex_t; * cpdef double dloss(self, double p, double y) */ -struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction { +struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction { PyObject_HEAD - struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *__pyx_vtab; + struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_LossFunction *__pyx_vtab; }; -/* "sgd_fast.pxd":24 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pxd":24 * cpdef double dloss(self, double p, double y) * * cdef class Regression(LossFunction): # <<<<<<<<<<<<<< @@ -424,23 +401,24 @@ struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction { * cpdef double dloss(self,double p, double y) */ -struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Regression { - struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction __pyx_base; +struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Regression { + struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction __pyx_base; }; -/* "sgd_fast.pxd":44 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/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_obj_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss { - struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Regression __pyx_base; +struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Huber { + struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Regression __pyx_base; + double c; }; -/* "sgd_fast.pxd":28 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pxd":28 * cpdef double dloss(self,double p, double y) * * cdef class Classification(LossFunction): # <<<<<<<<<<<<<< @@ -448,36 +426,35 @@ struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss { * cpdef double dloss(self, double p, double y) */ -struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Classification { - struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction __pyx_base; +struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Classification { + struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction __pyx_base; }; -/* "sgd_fast.pxd":36 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pxd":40 * cpdef double dloss(self, double p, double y) * - * cdef class Hinge(Classification): # <<<<<<<<<<<<<< + * cdef class Log(Classification): # <<<<<<<<<<<<<< * cpdef double loss(self, double p, double y) * cpdef double dloss(self, double p, double y) */ -struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Hinge { - struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Classification __pyx_base; +struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Log { + struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Classification __pyx_base; }; -/* "sgd_fast.pxd":48 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pxd":36 * cpdef double dloss(self, double p, double y) * - * cdef class Huber(Regression): # <<<<<<<<<<<<<< - * cdef double c + * cdef class Hinge(Classification): # <<<<<<<<<<<<<< * cpdef double loss(self, double p, double y) + * cpdef double dloss(self, double p, double y) */ -struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Huber { - struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Regression __pyx_base; - double c; +struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Hinge { + struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Classification __pyx_base; }; -/* "sgd_fast.pxd":32 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pxd":32 * cpdef double dloss(self, double p, double y) * * cdef class ModifiedHuber(Classification): # <<<<<<<<<<<<<< @@ -485,24 +462,24 @@ struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Huber { * cpdef double dloss(self, double p, double y) */ -struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber { - struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Classification __pyx_base; +struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_ModifiedHuber { + struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Classification __pyx_base; }; -/* "sgd_fast.pxd":40 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pxd":44 * cpdef double dloss(self, double p, double y) * - * cdef class Log(Classification): # <<<<<<<<<<<<<< + * cdef class SquaredLoss(Regression): # <<<<<<<<<<<<<< * cpdef double loss(self, double p, double y) * cpdef double dloss(self, double p, double y) */ -struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Log { - struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Classification __pyx_base; +struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_SquaredLoss { + struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Regression __pyx_base; }; -/* "sgd_fast.pxd":20 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pxd":20 * # ----------------------------------------- * * cdef class LossFunction: # <<<<<<<<<<<<<< @@ -510,14 +487,14 @@ struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_Log { * cpdef double dloss(self, double p, double y) */ -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); +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); }; -static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_LossFunction; +static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_LossFunction *__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_LossFunction; -/* "sgd_fast.pxd":24 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pxd":24 * cpdef double dloss(self, double p, double y) * * cdef class Regression(LossFunction): # <<<<<<<<<<<<<< @@ -525,27 +502,27 @@ static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_LossFunc * cpdef double dloss(self,double p, double y) */ -struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Regression { - struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_LossFunction __pyx_base; +struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Regression { + struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_LossFunction __pyx_base; }; -static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Regression *__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Regression; +static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Regression *__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_Regression; -/* "sgd_fast.pxd":48 +/* "/home/fabian/dev/scikit-learn/sklearn/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_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Huber { - struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Regression __pyx_base; +struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_SquaredLoss { + struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Regression __pyx_base; }; -static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Huber *__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Huber; +static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_SquaredLoss *__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_SquaredLoss; -/* "sgd_fast.pxd":28 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pxd":28 * cpdef double dloss(self,double p, double y) * * cdef class Classification(LossFunction): # <<<<<<<<<<<<<< @@ -553,27 +530,27 @@ static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Huber *_ * cpdef double dloss(self, double p, double y) */ -struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Classification { - struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_LossFunction __pyx_base; +struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Classification { + struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_LossFunction __pyx_base; }; -static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Classification *__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Classification; +static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Classification *__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_Classification; -/* "sgd_fast.pxd":36 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pxd":32 * cpdef double dloss(self, double p, double y) * - * cdef class Hinge(Classification): # <<<<<<<<<<<<<< + * cdef class ModifiedHuber(Classification): # <<<<<<<<<<<<<< * cpdef double loss(self, double p, double y) * cpdef double dloss(self, double p, double y) */ -struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Hinge { - struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Classification __pyx_base; +struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_ModifiedHuber { + struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Classification __pyx_base; }; -static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Hinge *__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Hinge; +static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_ModifiedHuber *__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_ModifiedHuber; -/* "sgd_fast.pxd":40 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pxd":40 * cpdef double dloss(self, double p, double y) * * cdef class Log(Classification): # <<<<<<<<<<<<<< @@ -581,38 +558,38 @@ static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Hinge *_ * cpdef double dloss(self, double p, double y) */ -struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Log { - struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Classification __pyx_base; +struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Log { + struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Classification __pyx_base; }; -static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Log *__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_Log; +static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Log *__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_Log; -/* "sgd_fast.pxd":32 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pxd":48 * cpdef double dloss(self, double p, double y) * - * cdef class ModifiedHuber(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_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber { - struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Classification __pyx_base; +struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Huber { + struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Regression __pyx_base; }; -static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber *__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_ModifiedHuber; +static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Huber *__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_Huber; -/* "sgd_fast.pxd":44 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast.pxd":36 * cpdef double dloss(self, double p, double y) * - * cdef class SquaredLoss(Regression): # <<<<<<<<<<<<<< + * cdef class Hinge(Classification): # <<<<<<<<<<<<<< * cpdef double loss(self, double p, double y) * cpdef double dloss(self, double p, double y) */ -struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss { - struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_Regression __pyx_base; +struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Hinge { + struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Classification __pyx_base; }; -static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss *__pyx_vtabptr_7scikits_5learn_12linear_model_8sgd_fast_SquaredLoss; +static struct __pyx_vtabstruct_7sklearn_12linear_model_8sgd_fast_Hinge *__pyx_vtabptr_7sklearn_12linear_model_8sgd_fast_Hinge; #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 @@ -660,19 +637,14 @@ static struct __pyx_vtabstruct_7scikits_5learn_12linear_model_8sgd_fast_SquaredL #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*/ 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_; @@ -695,8 +667,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*/ @@ -712,11 +684,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); @@ -729,14 +701,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); @@ -749,15 +721,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); @@ -771,7 +743,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, PyInt_FromSsize_t(i)); + r = __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i)); } return r; } @@ -779,15 +751,19 @@ 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 void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); -static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(void); -static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); +static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); /*proto*/ +static int __Pyx_EndUnpack(PyObject *); /*proto*/ -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); +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); @@ -801,13 +777,17 @@ Py_ssize_t __Pyx_minusones[] = {-1}; static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ -static int __Pyx_Print(PyObject*, PyObject *, int); /*proto*/ +static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ + +static int __Pyx_Print(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* stream, PyObject *o); /*proto*/ +static int __Pyx_PrintOne(PyObject *o); /*proto*/ + +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ #if CYTHON_CCOMPLEX #ifdef __cplusplus @@ -842,17 +822,11 @@ 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)) - #if 1 - #define __Pyx_c_absf(z) (::std::abs(z)) - #define __Pyx_c_powf(a, b) (::std::pow(a, b)) - #endif + /*#define __Pyx_c_absf(z) (::std::abs(z))*/ #else #define __Pyx_c_is_zerof(z) ((z)==0) #define __Pyx_c_conjf(z) (conjf(z)) - #if 1 - #define __Pyx_c_absf(z) (cabsf(z)) - #define __Pyx_c_powf(a, b) (cpowf(a, b)) - #endif + /*#define __Pyx_c_absf(z) (cabsf(z))*/ #endif #else static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex); @@ -863,10 +837,7 @@ 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); - #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 + /*static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex);*/ #endif static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); @@ -881,17 +852,11 @@ 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)) - #if 1 - #define __Pyx_c_abs(z) (::std::abs(z)) - #define __Pyx_c_pow(a, b) (::std::pow(a, b)) - #endif + /*#define __Pyx_c_abs(z) (::std::abs(z))*/ #else #define __Pyx_c_is_zero(z) ((z)==0) #define __Pyx_c_conj(z) (conj(z)) - #if 1 - #define __Pyx_c_abs(z) (cabs(z)) - #define __Pyx_c_pow(a, b) (cpow(a, b)) - #endif + /*#define __Pyx_c_abs(z) (cabs(z))*/ #endif #else static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex); @@ -902,10 +867,7 @@ 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); - #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 + /*static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex);*/ #endif static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *); @@ -926,8 +888,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 *); @@ -944,20 +904,18 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class static PyObject *__Pyx_ImportModule(const char *name); /*proto*/ -static void* __Pyx_GetVtable(PyObject *dict); /*proto*/ +static int __Pyx_GetVtable(PyObject *dict, void *vtabptr); /*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 */ @@ -978,29 +936,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 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*/ +/* 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*/ 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 "scikits.learn.linear_model.sgd_fast_sparse" -static int __pyx_module_is_main_scikits__learn__linear_model__sgd_fast_sparse = 0; +#define __Pyx_MODULE_NAME "sklearn.linear_model.sgd_fast_sparse" +int __pyx_module_is_main_sklearn__linear_model__sgd_fast_sparse = 0; -/* Implementation of scikits.learn.linear_model.sgd_fast_sparse */ +/* Implementation of sklearn.linear_model.sgd_fast_sparse */ static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_RuntimeError; @@ -1008,13 +966,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_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_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__B[] = "B"; static char __pyx_k__H[] = "H"; static char __pyx_k__I[] = "I"; @@ -1096,15 +1054,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_12; -static PyObject *__pyx_kp_u_13; -static PyObject *__pyx_kp_u_16; -static PyObject *__pyx_n_s_18; +static PyObject *__pyx_kp_u_11; 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; @@ -1168,15 +1126,8 @@ 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; -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 + +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":34 * @cython.wraparound(False) * @cython.cdivision(True) * def plain_sgd(np.ndarray[double, ndim=1] w, # <<<<<<<<<<<<<< @@ -1184,13 +1135,12 @@ static PyObject *__pyx_k_tuple_17; * LossFunction loss, */ -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) { +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) { PyArrayObject *__pyx_v_w = 0; double __pyx_v_intercept; - struct __pyx_obj_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *__pyx_v_loss = 0; + struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_LossFunction *__pyx_v_loss = 0; int __pyx_v_penalty_type; double __pyx_v_alpha; double __pyx_v_rho; @@ -1276,9 +1226,9 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; - unsigned int __pyx_t_13; - PyArrayObject *__pyx_t_14 = NULL; - int __pyx_t_15; + int __pyx_t_13; + unsigned int __pyx_t_14; + PyArrayObject *__pyx_t_15 = NULL; double __pyx_t_16; PyObject *__pyx_t_17 = NULL; int __pyx_t_18; @@ -1447,7 +1397,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain } __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_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *)values[2]); + __pyx_v_loss = ((struct __pyx_obj_7sklearn_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;} @@ -1471,7 +1421,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain } 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_7scikits_5learn_12linear_model_8sgd_fast_LossFunction *)PyTuple_GET_ITEM(__pyx_args, 2)); + __pyx_v_loss = ((struct __pyx_obj_7sklearn_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;} @@ -1495,11 +1445,16 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain __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("scikits.learn.linear_model.sgd_fast_sparse.plain_sgd"); - __Pyx_RefNannyFinishContext(); + __Pyx_AddTraceback("sklearn.linear_model.sgd_fast_sparse.plain_sgd"); 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; @@ -1510,7 +1465,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain __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_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_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_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;} @@ -1553,7 +1508,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain __pyx_bstride_0_sample_weight = __pyx_bstruct_sample_weight.strides[0]; __pyx_bshape_0_sample_weight = __pyx_bstruct_sample_weight.shape[0]; - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":108 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":108 * """ * # get the data information into easy vars * cdef unsigned int n_samples = Y.shape[0] # <<<<<<<<<<<<<< @@ -1562,7 +1517,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain */ __pyx_v_n_samples = (__pyx_v_Y->dimensions[0]); - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":109 + /* "/home/fabian/dev/scikit-learn/sklearn/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] # <<<<<<<<<<<<<< @@ -1571,7 +1526,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain */ __pyx_v_n_features = (__pyx_v_w->dimensions[0]); - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":111 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":111 * cdef unsigned int n_features = w.shape[0] * * cdef double *w_data_ptr = w.data # <<<<<<<<<<<<<< @@ -1580,7 +1535,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain */ __pyx_v_w_data_ptr = ((double *)__pyx_v_w->data); - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":112 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":112 * * cdef double *w_data_ptr = w.data * cdef double *X_data_ptr = X_data.data # <<<<<<<<<<<<<< @@ -1589,7 +1544,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain */ __pyx_v_X_data_ptr = ((double *)__pyx_v_X_data->data); - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":113 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":113 * cdef double *w_data_ptr = w.data * cdef double *X_data_ptr = X_data.data * cdef int *X_indptr_ptr = X_indptr.data # <<<<<<<<<<<<<< @@ -1598,7 +1553,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain */ __pyx_v_X_indptr_ptr = ((int *)__pyx_v_X_indptr->data); - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":114 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":114 * cdef double *X_data_ptr = X_data.data * cdef int *X_indptr_ptr = X_indptr.data * cdef int *X_indices_ptr = X_indices.data # <<<<<<<<<<<<<< @@ -1607,7 +1562,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain */ __pyx_v_X_indices_ptr = ((int *)__pyx_v_X_indices->data); - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":115 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":115 * cdef int *X_indptr_ptr = X_indptr.data * cdef int *X_indices_ptr = X_indices.data * cdef double *Y_data_ptr = Y.data # <<<<<<<<<<<<<< @@ -1616,7 +1571,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain */ __pyx_v_Y_data_ptr = ((double *)__pyx_v_Y->data); - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":117 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":117 * cdef double *Y_data_ptr = Y.data * * cdef double *sample_weight_data = sample_weight.data # <<<<<<<<<<<<<< @@ -1625,7 +1580,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain */ __pyx_v_sample_weight_data = ((double *)__pyx_v_sample_weight->data); - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":119 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":119 * cdef double *sample_weight_data = sample_weight.data * * cdef np.ndarray[int, ndim=1, mode="c"] index = np.arange(n_samples, # <<<<<<<<<<<<<< @@ -1640,14 +1595,14 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain __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(((PyObject *)__pyx_t_3)); + __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 = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":120 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":120 * * cdef np.ndarray[int, ndim=1, mode="c"] index = np.arange(n_samples, * dtype=np.int32) # <<<<<<<<<<<<<< @@ -1661,10 +1616,10 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain __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, ((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_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_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__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); @@ -1681,7 +1636,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain __pyx_v_index = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":121 + /* "/home/fabian/dev/scikit-learn/sklearn/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 = index.data # <<<<<<<<<<<<<< @@ -1690,7 +1645,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain */ __pyx_v_index_data_ptr = ((int *)__pyx_v_index->data); - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":122 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":122 * dtype=np.int32) * cdef int *index_data_ptr = index.data * cdef int offset = 0 # <<<<<<<<<<<<<< @@ -1699,7 +1654,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain */ __pyx_v_offset = 0; - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":123 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":123 * cdef int *index_data_ptr = index.data * cdef int offset = 0 * cdef int xnnz = 0 # <<<<<<<<<<<<<< @@ -1708,7 +1663,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain */ __pyx_v_xnnz = 0; - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":124 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":124 * cdef int offset = 0 * cdef int xnnz = 0 * cdef double wscale = 1.0 # <<<<<<<<<<<<<< @@ -1717,7 +1672,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain */ __pyx_v_wscale = 1.0; - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":125 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":125 * cdef int xnnz = 0 * cdef double wscale = 1.0 * cdef double eta = 0.0 # <<<<<<<<<<<<<< @@ -1726,7 +1681,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain */ __pyx_v_eta = 0.0; - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":126 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":126 * cdef double wscale = 1.0 * cdef double eta = 0.0 * cdef double p = 0.0 # <<<<<<<<<<<<<< @@ -1735,7 +1690,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain */ __pyx_v_p = 0.0; - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":127 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":127 * cdef double eta = 0.0 * cdef double p = 0.0 * cdef double update = 0.0 # <<<<<<<<<<<<<< @@ -1744,7 +1699,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain */ __pyx_v_update = 0.0; - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":128 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":128 * cdef double p = 0.0 * cdef double update = 0.0 * cdef double sumloss = 0.0 # <<<<<<<<<<<<<< @@ -1753,7 +1708,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain */ __pyx_v_sumloss = 0.0; - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":129 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":129 * cdef double update = 0.0 * cdef double sumloss = 0.0 * cdef double wnorm = 0.0 # <<<<<<<<<<<<<< @@ -1762,7 +1717,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain */ __pyx_v_wnorm = 0.0; - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":130 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":130 * cdef double sumloss = 0.0 * cdef double wnorm = 0.0 * cdef double t = 0.0 # <<<<<<<<<<<<<< @@ -1771,7 +1726,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain */ __pyx_v_t = 0.0; - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":131 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":131 * cdef double wnorm = 0.0 * cdef double t = 0.0 * cdef double y = 0.0 # <<<<<<<<<<<<<< @@ -1780,7 +1735,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain */ __pyx_v_y = 0.0; - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":132 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":132 * cdef double t = 0.0 * cdef double y = 0.0 * cdef double class_weight = 1.0 # <<<<<<<<<<<<<< @@ -1789,7 +1744,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain */ __pyx_v_class_weight = 1.0; - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":133 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":133 * cdef double y = 0.0 * cdef double class_weight = 1.0 * cdef unsigned int count = 0 # <<<<<<<<<<<<<< @@ -1798,7 +1753,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain */ __pyx_v_count = 0; - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":134 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":134 * cdef double class_weight = 1.0 * cdef unsigned int count = 0 * cdef unsigned int epoch = 0 # <<<<<<<<<<<<<< @@ -1807,7 +1762,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain */ __pyx_v_epoch = 0; - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":135 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":135 * cdef unsigned int count = 0 * cdef unsigned int epoch = 0 * cdef unsigned int i = 0 # <<<<<<<<<<<<<< @@ -1816,7 +1771,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain */ __pyx_v_i = 0; - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":136 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":136 * cdef unsigned int epoch = 0 * cdef unsigned int i = 0 * cdef int sample_idx = 0 # <<<<<<<<<<<<<< @@ -1825,7 +1780,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain */ __pyx_v_sample_idx = 0; - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":137 + /* "/home/fabian/dev/scikit-learn/sklearn/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 # <<<<<<<<<<<<<< @@ -1846,7 +1801,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain __Pyx_INCREF(Py_None); __pyx_v_q = ((PyArrayObject *)Py_None); - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":139 + /* "/home/fabian/dev/scikit-learn/sklearn/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: # <<<<<<<<<<<<<< @@ -1856,7 +1811,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain __pyx_t_8 = (__pyx_v_penalty_type != 2); if (__pyx_t_8) { - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":140 + /* "/home/fabian/dev/scikit-learn/sklearn/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") # <<<<<<<<<<<<<< @@ -1871,14 +1826,14 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain __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(((PyObject *)__pyx_t_3)); + __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 = 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(((PyObject *)__pyx_t_5)); - PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); + __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 = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); @@ -1890,10 +1845,10 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain 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, ((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_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_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + __Pyx_DECREF(__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); @@ -1919,7 +1874,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain __pyx_v_q = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":141 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":141 * if penalty_type != L2: * q = np.zeros((n_features,), dtype=np.float64, order="c") * q_data_ptr = q.data # <<<<<<<<<<<<<< @@ -1931,7 +1886,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain } __pyx_L6:; - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":142 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":142 * q = np.zeros((n_features,), dtype=np.float64, order="c") * q_data_ptr = q.data * cdef double u = 0.0 # <<<<<<<<<<<<<< @@ -1940,7 +1895,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain */ __pyx_v_u = 0.0; - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":143 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":143 * q_data_ptr = q.data * cdef double u = 0.0 * cdef double typw = sqrt(1.0 / sqrt(alpha)) # <<<<<<<<<<<<<< @@ -1949,7 +1904,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain */ __pyx_v_typw = sqrt((1.0 / sqrt(__pyx_v_alpha))); - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":145 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":145 * cdef double typw = sqrt(1.0 / sqrt(alpha)) * * if learning_rate == OPTIMAL: # <<<<<<<<<<<<<< @@ -1959,19 +1914,19 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain __pyx_t_8 = (__pyx_v_learning_rate == 2); if (__pyx_t_8) { - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":147 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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))); + __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))); goto __pyx_L7; } /*else*/ { - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":149 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":149 * eta0 = typw / max(1.0, loss.dloss(-typw, 1.0)) * else: * eta = eta0 # <<<<<<<<<<<<<< @@ -1982,7 +1937,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain } __pyx_L7:; - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":151 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":151 * eta = eta0 * * if learning_rate == OPTIMAL: # <<<<<<<<<<<<<< @@ -1992,7 +1947,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain __pyx_t_8 = (__pyx_v_learning_rate == 2); if (__pyx_t_8) { - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":153 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -2004,7 +1959,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain } /*else*/ { - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":155 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":155 * t = 1.0 / (eta0 * alpha) * else: * t = 1.0 # <<<<<<<<<<<<<< @@ -2015,7 +1970,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain } __pyx_L8:; - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":157 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":157 * t = 1.0 * * t_start = time() # <<<<<<<<<<<<<< @@ -2031,7 +1986,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain __pyx_v_t_start = __pyx_t_3; __pyx_t_3 = 0; - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":158 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":158 * * t_start = time() * for epoch from 0 <= epoch < n_iter: # <<<<<<<<<<<<<< @@ -2041,7 +1996,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain __pyx_t_9 = __pyx_v_n_iter; for (__pyx_v_epoch = 0; __pyx_v_epoch < __pyx_t_9; __pyx_v_epoch++) { - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":159 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":159 * t_start = time() * for epoch from 0 <= epoch < n_iter: * if verbose > 0: # <<<<<<<<<<<<<< @@ -2051,34 +2006,35 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain __pyx_t_8 = (__pyx_v_verbose > 0); if (__pyx_t_8) { - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":160 + /* "/home/fabian/dev/scikit-learn/sklearn/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 = 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_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_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(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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; + 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; goto __pyx_L11; } __pyx_L11:; - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":161 + /* "/home/fabian/dev/scikit-learn/sklearn/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: */ - if (__pyx_v_shuffle) { + __pyx_t_13 = __pyx_v_shuffle; + if (__pyx_t_13) { - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":162 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":162 * print("-- Epoch %d" % (epoch + 1)) * if shuffle: * np.random.RandomState(seed).shuffle(index) # <<<<<<<<<<<<<< @@ -2096,42 +2052,42 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain __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(((PyObject *)__pyx_t_5)); + __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_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_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_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + __Pyx_DECREF(__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(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(__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, ((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_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_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L12; } __pyx_L12:; - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":163 + /* "/home/fabian/dev/scikit-learn/sklearn/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_13 = __pyx_v_n_samples; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_13; __pyx_v_i++) { + __pyx_t_14 = __pyx_v_n_samples; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_14; __pyx_v_i++) { - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":164 + /* "/home/fabian/dev/scikit-learn/sklearn/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] # <<<<<<<<<<<<<< @@ -2140,7 +2096,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain */ __pyx_v_sample_idx = (__pyx_v_index_data_ptr[__pyx_v_i]); - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":165 + /* "/home/fabian/dev/scikit-learn/sklearn/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] # <<<<<<<<<<<<<< @@ -2149,7 +2105,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain */ __pyx_v_offset = (__pyx_v_X_indptr_ptr[__pyx_v_sample_idx]); - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":166 + /* "/home/fabian/dev/scikit-learn/sklearn/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 # <<<<<<<<<<<<<< @@ -2158,7 +2114,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain */ __pyx_v_xnnz = ((__pyx_v_X_indptr_ptr[(__pyx_v_sample_idx + 1)]) - __pyx_v_offset); - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":167 + /* "/home/fabian/dev/scikit-learn/sklearn/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] # <<<<<<<<<<<<<< @@ -2167,25 +2123,17 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain */ __pyx_v_y = (__pyx_v_Y_data_ptr[__pyx_v_sample_idx]); - /* "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 + /* "/home/fabian/dev/scikit-learn/sklearn/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: - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":169 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":169 * y = Y_data_ptr[sample_idx] * if learning_rate == OPTIMAL: * eta = 1.0 / (alpha * t) # <<<<<<<<<<<<<< @@ -2195,7 +2143,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain __pyx_v_eta = (1.0 / (__pyx_v_alpha * __pyx_v_t)); break; - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":170 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":170 * if learning_rate == OPTIMAL: * eta = 1.0 / (alpha * t) * elif learning_rate == INVSCALING: # <<<<<<<<<<<<<< @@ -2204,7 +2152,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain */ case 3: - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":171 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":171 * eta = 1.0 / (alpha * t) * elif learning_rate == INVSCALING: * eta = eta0 / pow(t, power_t) # <<<<<<<<<<<<<< @@ -2215,35 +2163,35 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain break; } - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":173 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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); + __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); - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":174 + /* "/home/fabian/dev/scikit-learn/sklearn/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 = (__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)); + __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); - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":175 + /* "/home/fabian/dev/scikit-learn/sklearn/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.0); + __pyx_t_8 = (__pyx_v_y > 0); if (__pyx_t_8) { - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":176 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":176 * sumloss += loss.loss(p, y) * if y > 0: * class_weight = weight_pos # <<<<<<<<<<<<<< @@ -2255,7 +2203,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain } /*else*/ { - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":178 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":178 * class_weight = weight_pos * else: * class_weight = weight_neg # <<<<<<<<<<<<<< @@ -2266,16 +2214,16 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain } __pyx_L15:; - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":180 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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])); + __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])); - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":181 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":181 * update = eta * loss.dloss(p, y) * class_weight * \ * sample_weight_data[sample_idx] * if update != 0.0: # <<<<<<<<<<<<<< @@ -2285,16 +2233,16 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain __pyx_t_8 = (__pyx_v_update != 0.0); if (__pyx_t_8) { - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":183 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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)); + __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)); - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":184 + /* "/home/fabian/dev/scikit-learn/sklearn/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: # <<<<<<<<<<<<<< @@ -2304,14 +2252,14 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain __pyx_t_8 = (__pyx_v_fit_intercept == 1); if (__pyx_t_8) { - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":185 + /* "/home/fabian/dev/scikit-learn/sklearn/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_intercept - (__pyx_v_update * 0.01)); + __pyx_v_intercept -= (__pyx_v_update * 0.01); goto __pyx_L17; } __pyx_L17:; @@ -2319,7 +2267,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain } __pyx_L16:; - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":186 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":186 * if fit_intercept == 1: * intercept -= update * 0.01 * if penalty_type != L1: # <<<<<<<<<<<<<< @@ -2329,26 +2277,26 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain __pyx_t_8 = (__pyx_v_penalty_type != 1); if (__pyx_t_8) { - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":187 + /* "/home/fabian/dev/scikit-learn/sklearn/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 = (__pyx_v_wscale * (1.0 - ((__pyx_v_rho * __pyx_v_eta) * __pyx_v_alpha))); + __pyx_v_wscale *= (1.0 - ((__pyx_v_rho * __pyx_v_eta) * __pyx_v_alpha)); - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":188 + /* "/home/fabian/dev/scikit-learn/sklearn/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 < 1e-9); + __pyx_t_8 = (__pyx_v_wscale < 1.0000000000000001e-09); if (__pyx_t_8) { - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":189 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":189 * wscale *= (1.0 - (rho * eta * alpha)) * if wscale < 1e-9: * w *= wscale # <<<<<<<<<<<<<< @@ -2359,14 +2307,14 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain __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); - __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 = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_14 = ((PyArrayObject *)__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_15 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_w); - __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)) { + __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)) { 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); @@ -2377,14 +2325,14 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain } __pyx_bstride_0_w = __pyx_bstruct_w.strides[0]; __pyx_bshape_0_w = __pyx_bstruct_w.shape[0]; - if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_14 = 0; + __pyx_t_15 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_w)); __pyx_v_w = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":190 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":190 * if wscale < 1e-9: * w *= wscale * wscale = 1.0 # <<<<<<<<<<<<<< @@ -2399,7 +2347,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain } __pyx_L18:; - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":191 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":191 * w *= wscale * wscale = 1.0 * if penalty_type == L1 or penalty_type == ELASTICNET: # <<<<<<<<<<<<<< @@ -2410,46 +2358,46 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain case 1: case 3: - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":192 + /* "/home/fabian/dev/scikit-learn/sklearn/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 = (__pyx_v_u + (((1.0 - __pyx_v_rho) * __pyx_v_eta) * __pyx_v_alpha)); + __pyx_v_u += (((1.0 - __pyx_v_rho) * __pyx_v_eta) * __pyx_v_alpha); - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":194 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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); + __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); break; } - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":195 + /* "/home/fabian/dev/scikit-learn/sklearn/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 = (__pyx_v_t + 1.0); + __pyx_v_t += 1; - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":196 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":196 * X_indices_ptr, offset, xnnz, u) * t += 1 * count += 1 # <<<<<<<<<<<<<< * * # report epoche information */ - __pyx_v_count = (__pyx_v_count + 1); + __pyx_v_count += 1; } - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":199 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":199 * * # report epoche information * if verbose > 0: # <<<<<<<<<<<<<< @@ -2459,7 +2407,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain __pyx_t_8 = (__pyx_v_verbose > 0); if (__pyx_t_8) { - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":200 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":200 * # report epoche information * if verbose > 0: * wnorm = sqrt(np.dot(w, w) * wscale * wscale) # <<<<<<<<<<<<<< @@ -2472,17 +2420,17 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain __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(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(__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, ((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_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_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__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;} @@ -2499,7 +2447,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_wnorm = sqrt(__pyx_t_16); - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":202 + /* "/home/fabian/dev/scikit-learn/sklearn/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, # <<<<<<<<<<<<<< @@ -2509,7 +2457,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain __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); - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":203 + /* "/home/fabian/dev/scikit-learn/sklearn/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], # <<<<<<<<<<<<<< @@ -2531,7 +2479,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":204 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":204 * "Bias: %.6f, T: %d, Avg. loss: %.6f" % (wnorm, * w.nonzero()[0].shape[0], * intercept, count, # <<<<<<<<<<<<<< @@ -2543,7 +2491,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain __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); - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":205 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":205 * w.nonzero()[0].shape[0], * intercept, count, * sumloss / count)) # <<<<<<<<<<<<<< @@ -2553,7 +2501,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain __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(((PyObject *)__pyx_t_17)); + __Pyx_GOTREF(__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); @@ -2569,13 +2517,13 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain __pyx_t_4 = 0; __pyx_t_1 = 0; __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; + __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; - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":206 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":206 * intercept, count, * sumloss / count)) * print("Total training time: %.2f seconds." % (time() - t_start)) # <<<<<<<<<<<<<< @@ -2591,15 +2539,15 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain __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(((PyObject *)__pyx_t_17)); + __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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; + 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; goto __pyx_L20; } __pyx_L20:; - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":209 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":209 * * # floating-point under-/overflow check. * if np.any(np.isinf(w)) or np.any(np.isnan(w)) \ # <<<<<<<<<<<<<< @@ -2617,28 +2565,28 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain __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(((PyObject *)__pyx_t_17)); + __Pyx_GOTREF(__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, ((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_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_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0; + __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(((PyObject *)__pyx_t_17)); + __Pyx_GOTREF(__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, ((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_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_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0; + __Pyx_DECREF(__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) { - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":210 + /* "/home/fabian/dev/scikit-learn/sklearn/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): # <<<<<<<<<<<<<< @@ -2651,7 +2599,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":209 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":209 * * # floating-point under-/overflow check. * if np.any(np.isinf(w)) or np.any(np.isnan(w)) \ # <<<<<<<<<<<<<< @@ -2664,28 +2612,28 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain __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(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__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, ((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_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_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __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(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__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, ((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_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_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__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) { - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":210 + /* "/home/fabian/dev/scikit-learn/sklearn/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): # <<<<<<<<<<<<<< @@ -2700,14 +2648,14 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain __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(((PyObject *)__pyx_t_17)); + __Pyx_GOTREF(__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, ((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_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_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0; + __Pyx_DECREF(__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) { @@ -2719,14 +2667,14 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain __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(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__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, ((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_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_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__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; @@ -2743,41 +2691,47 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain } if (__pyx_t_18) { - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":211 + /* "/home/fabian/dev/scikit-learn/sklearn/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 = 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_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_GOTREF(__pyx_t_1); - __Pyx_Raise(__pyx_t_1, 0, 0); + __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_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:; } - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":213 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":213 * raise ValueError("floating-point under-/overflow occured.") * * w *= wscale # <<<<<<<<<<<<<< * return w, intercept * */ - __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); - __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_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_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_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_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_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_w); - __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_w, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_w, (PyObject*)__pyx_t_15, &__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)) { @@ -2791,12 +2745,12 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain __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_14 = 0; + __pyx_t_15 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_w)); - __pyx_v_w = ((PyArrayObject *)__pyx_t_4); - __pyx_t_4 = 0; + __pyx_v_w = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":214 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":214 * * w *= wscale * return w, intercept # <<<<<<<<<<<<<< @@ -2804,18 +2758,18 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain * */ __Pyx_XDECREF(__pyx_r); - __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_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_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_1, 0, ((PyObject *)__pyx_v_w)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_w)); __Pyx_GIVEREF(((PyObject *)__pyx_v_w)); - 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); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -2838,7 +2792,7 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain __Pyx_SafeReleaseBuffer(&__pyx_bstruct_q); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_w); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("scikits.learn.linear_model.sgd_fast_sparse.plain_sgd"); + __Pyx_AddTraceback("sklearn.linear_model.sgd_fast_sparse.plain_sgd"); __pyx_r = NULL; goto __pyx_L2; __pyx_L0:; @@ -2855,12 +2809,18 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain __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; } -/* "scikits/learn/linear_model/sgd_fast_sparse.pyx":217 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":217 * * * cdef inline double max(double a, double b): # <<<<<<<<<<<<<< @@ -2868,12 +2828,12 @@ static PyObject *__pyx_pf_7scikits_5learn_12linear_model_15sgd_fast_sparse_plain * */ -static CYTHON_INLINE double __pyx_f_7scikits_5learn_12linear_model_15sgd_fast_sparse_max(double __pyx_v_a, double __pyx_v_b) { +static CYTHON_INLINE double __pyx_f_7sklearn_12linear_model_15sgd_fast_sparse_max(double __pyx_v_a, double __pyx_v_b) { double __pyx_r; double __pyx_t_1; __Pyx_RefNannySetupContext("max"); - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":218 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":218 * * cdef inline double max(double a, double b): * return a if a >= b else b # <<<<<<<<<<<<<< @@ -2894,7 +2854,7 @@ static CYTHON_INLINE double __pyx_f_7scikits_5learn_12linear_model_15sgd_fast_sp return __pyx_r; } -/* "scikits/learn/linear_model/sgd_fast_sparse.pyx":221 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":221 * * * cdef inline double min(double a, double b): # <<<<<<<<<<<<<< @@ -2902,12 +2862,12 @@ static CYTHON_INLINE double __pyx_f_7scikits_5learn_12linear_model_15sgd_fast_sp * */ -static CYTHON_INLINE double __pyx_f_7scikits_5learn_12linear_model_15sgd_fast_sparse_min(double __pyx_v_a, double __pyx_v_b) { +static CYTHON_INLINE double __pyx_f_7sklearn_12linear_model_15sgd_fast_sparse_min(double __pyx_v_a, double __pyx_v_b) { double __pyx_r; double __pyx_t_1; __Pyx_RefNannySetupContext("min"); - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":222 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":222 * * cdef inline double min(double a, double b): * return a if a <= b else b # <<<<<<<<<<<<<< @@ -2928,7 +2888,7 @@ static CYTHON_INLINE double __pyx_f_7scikits_5learn_12linear_model_15sgd_fast_sp return __pyx_r; } -/* "scikits/learn/linear_model/sgd_fast_sparse.pyx":225 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":225 * * * cdef double dot(double *w_data_ptr, double *X_data_ptr, int *X_indices_ptr, # <<<<<<<<<<<<<< @@ -2936,14 +2896,14 @@ static CYTHON_INLINE double __pyx_f_7scikits_5learn_12linear_model_15sgd_fast_sp * cdef double sum = 0.0 */ -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) { +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) { double __pyx_v_sum; int __pyx_v_j; double __pyx_r; int __pyx_t_1; __Pyx_RefNannySetupContext("dot"); - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":227 + /* "/home/fabian/dev/scikit-learn/sklearn/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 # <<<<<<<<<<<<<< @@ -2952,7 +2912,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_15sgd_fast_sparse_dot(doub */ __pyx_v_sum = 0.0; - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":229 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":229 * cdef double sum = 0.0 * cdef int j * for j from 0 <= j < xnnz: # <<<<<<<<<<<<<< @@ -2962,17 +2922,17 @@ static double __pyx_f_7scikits_5learn_12linear_model_15sgd_fast_sparse_dot(doub __pyx_t_1 = __pyx_v_xnnz; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_1; __pyx_v_j++) { - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":230 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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)])); } - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":231 + /* "/home/fabian/dev/scikit-learn/sklearn/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 # <<<<<<<<<<<<<< @@ -2988,7 +2948,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_15sgd_fast_sparse_dot(doub return __pyx_r; } -/* "scikits/learn/linear_model/sgd_fast_sparse.pyx":234 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":234 * * * cdef double add(double *w_data_ptr, double wscale, double *X_data_ptr, # <<<<<<<<<<<<<< @@ -2996,7 +2956,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_15sgd_fast_sparse_dot(doub * """Scales example x by constant c and adds it to the weight vector w""" */ -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) { +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) { int __pyx_v_j; int __pyx_v_idx; double __pyx_v_val; @@ -3004,10 +2964,9 @@ static double __pyx_f_7scikits_5learn_12linear_model_15sgd_fast_sparse_add(doub double __pyx_v_xsqnorm; double __pyx_r; int __pyx_t_1; - int __pyx_t_2; __Pyx_RefNannySetupContext("add"); - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":240 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":240 * cdef int idx * cdef double val * cdef double innerprod = 0.0 # <<<<<<<<<<<<<< @@ -3016,7 +2975,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_15sgd_fast_sparse_add(doub */ __pyx_v_innerprod = 0.0; - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":241 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":241 * cdef double val * cdef double innerprod = 0.0 * cdef double xsqnorm = 0.0 # <<<<<<<<<<<<<< @@ -3025,7 +2984,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_15sgd_fast_sparse_add(doub */ __pyx_v_xsqnorm = 0.0; - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":242 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":242 * cdef double innerprod = 0.0 * cdef double xsqnorm = 0.0 * for j from 0 <= j < xnnz: # <<<<<<<<<<<<<< @@ -3035,7 +2994,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_15sgd_fast_sparse_add(doub __pyx_t_1 = __pyx_v_xnnz; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_1; __pyx_v_j++) { - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":243 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":243 * cdef double xsqnorm = 0.0 * for j from 0 <= j < xnnz: * idx = X_indices_ptr[offset + j] # <<<<<<<<<<<<<< @@ -3044,7 +3003,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_15sgd_fast_sparse_add(doub */ __pyx_v_idx = (__pyx_v_X_indices_ptr[(__pyx_v_offset + __pyx_v_j)]); - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":244 + /* "/home/fabian/dev/scikit-learn/sklearn/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] # <<<<<<<<<<<<<< @@ -3053,36 +3012,35 @@ static double __pyx_f_7scikits_5learn_12linear_model_15sgd_fast_sparse_add(doub */ __pyx_v_val = (__pyx_v_X_data_ptr[(__pyx_v_offset + __pyx_v_j)]); - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":245 + /* "/home/fabian/dev/scikit-learn/sklearn/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_innerprod + ((__pyx_v_w_data_ptr[__pyx_v_idx]) * __pyx_v_val)); + __pyx_v_innerprod += ((__pyx_v_w_data_ptr[__pyx_v_idx]) * __pyx_v_val); - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":246 + /* "/home/fabian/dev/scikit-learn/sklearn/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_xsqnorm + (__pyx_v_val * __pyx_v_val)); + __pyx_v_xsqnorm += (__pyx_v_val * __pyx_v_val); - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":247 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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))); + (__pyx_v_w_data_ptr[__pyx_v_idx]) += (__pyx_v_val * (__pyx_v_c / __pyx_v_wscale)); } - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":248 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -3098,7 +3056,7 @@ static double __pyx_f_7scikits_5learn_12linear_model_15sgd_fast_sparse_add(doub return __pyx_r; } -/* "scikits/learn/linear_model/sgd_fast_sparse.pyx":251 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":251 * * * cdef void l1penalty(double *w_data_ptr, double wscale, double *q_data_ptr, # <<<<<<<<<<<<<< @@ -3106,16 +3064,15 @@ static double __pyx_f_7scikits_5learn_12linear_model_15sgd_fast_sparse_add(doub * """Apply the L1 penalty to each updated feature */ -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) { +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) { 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"); - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":258 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":258 * [Tsuruoka, Y., Tsujii, J., and Ananiadou, S., 2009]. * """ * cdef double z = 0.0 # <<<<<<<<<<<<<< @@ -3124,7 +3081,7 @@ static void __pyx_f_7scikits_5learn_12linear_model_15sgd_fast_sparse_l1penalty( */ __pyx_v_z = 0.0; - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":259 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":259 * """ * cdef double z = 0.0 * cdef int j = 0 # <<<<<<<<<<<<<< @@ -3133,7 +3090,7 @@ static void __pyx_f_7scikits_5learn_12linear_model_15sgd_fast_sparse_l1penalty( */ __pyx_v_j = 0; - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":260 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":260 * cdef double z = 0.0 * cdef int j = 0 * cdef int idx = 0 # <<<<<<<<<<<<<< @@ -3142,7 +3099,7 @@ static void __pyx_f_7scikits_5learn_12linear_model_15sgd_fast_sparse_l1penalty( */ __pyx_v_idx = 0; - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":261 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":261 * cdef int j = 0 * cdef int idx = 0 * for j from 0 <= j < xnnz: # <<<<<<<<<<<<<< @@ -3152,7 +3109,7 @@ static void __pyx_f_7scikits_5learn_12linear_model_15sgd_fast_sparse_l1penalty( __pyx_t_1 = __pyx_v_xnnz; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_1; __pyx_v_j++) { - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":262 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":262 * cdef int idx = 0 * for j from 0 <= j < xnnz: * idx = X_indices_ptr[offset + j] # <<<<<<<<<<<<<< @@ -3161,7 +3118,7 @@ static void __pyx_f_7scikits_5learn_12linear_model_15sgd_fast_sparse_l1penalty( */ __pyx_v_idx = (__pyx_v_X_indices_ptr[(__pyx_v_offset + __pyx_v_j)]); - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":263 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":263 * for j from 0 <= j < xnnz: * idx = X_indices_ptr[offset + j] * z = w_data_ptr[idx] # <<<<<<<<<<<<<< @@ -3170,7 +3127,7 @@ static void __pyx_f_7scikits_5learn_12linear_model_15sgd_fast_sparse_l1penalty( */ __pyx_v_z = (__pyx_v_w_data_ptr[__pyx_v_idx]); - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":264 + /* "/home/fabian/dev/scikit-learn/sklearn/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: # <<<<<<<<<<<<<< @@ -3180,18 +3137,18 @@ static void __pyx_f_7scikits_5learn_12linear_model_15sgd_fast_sparse_l1penalty( __pyx_t_2 = ((__pyx_v_wscale * (__pyx_v_w_data_ptr[__pyx_v_idx])) > 0.0); if (__pyx_t_2) { - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":265 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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))); + (__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))); goto __pyx_L5; } - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":268 + /* "/home/fabian/dev/scikit-learn/sklearn/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: # <<<<<<<<<<<<<< @@ -3201,31 +3158,30 @@ static void __pyx_f_7scikits_5learn_12linear_model_15sgd_fast_sparse_l1penalty( __pyx_t_2 = ((__pyx_v_wscale * (__pyx_v_w_data_ptr[__pyx_v_idx])) < 0.0); if (__pyx_t_2) { - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":269 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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))); + (__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))); goto __pyx_L5; } __pyx_L5:; - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":272 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_v_q_data_ptr[__pyx_v_idx]) += (__pyx_v_wscale * ((__pyx_v_w_data_ptr[__pyx_v_idx]) - __pyx_v_z)); } __Pyx_RefNannyFinishContext(); } -/* "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): # <<<<<<<<<<<<<< @@ -3233,8 +3189,8 @@ static void __pyx_f_7scikits_5learn_12linear_model_15sgd_fast_sparse_l1penalty( * # 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; @@ -3246,21 +3202,22 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ int __pyx_v_offset; int __pyx_v_hasfields; int __pyx_r; - PyObject *__pyx_t_1 = NULL; + int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_t_7; - PyObject *__pyx_t_8 = NULL; + int __pyx_t_8; 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); - /* "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 # <<<<<<<<<<<<<< @@ -3269,7 +3226,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_endian_detector = 1; - /* "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 = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -3278,29 +3235,26 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "numpy.pxd":197 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":196 * cdef bint little_endian = ((&endian_detector)[0] != 0) * * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< * * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - __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; + __pyx_v_ndim = PyArray_NDIM(((PyArrayObject *)__pyx_v_self)); - /* "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): # <<<<<<<<<<<<<< * copy_shape = 1 * else: */ - __pyx_t_2 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); - if (__pyx_t_2) { + __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); + if (__pyx_t_1) { - /* "numpy.pxd":200 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":199 * * if sizeof(npy_intp) != sizeof(Py_ssize_t): * copy_shape = 1 # <<<<<<<<<<<<<< @@ -3312,7 +3266,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } /*else*/ { - /* "numpy.pxd":202 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":201 * copy_shape = 1 * else: * copy_shape = 0 # <<<<<<<<<<<<<< @@ -3323,105 +3277,108 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } __pyx_L5:; - /* "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) # <<<<<<<<<<<<<< * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") */ - __pyx_t_2 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS); - if (__pyx_t_2) { + __pyx_t_1 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS); + if (__pyx_t_1) { - /* "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)): # <<<<<<<<<<<<<< * raise ValueError(u"ndarray is not C contiguous") * */ - __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; + __pyx_t_2 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_v_self), NPY_C_CONTIGUOUS)); + __pyx_t_3 = __pyx_t_2; } else { - __pyx_t_4 = __pyx_t_2; + __pyx_t_3 = __pyx_t_1; } - if (__pyx_t_4) { + if (__pyx_t_3) { - /* "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_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;} + __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;} goto __pyx_L6; } __pyx_L6:; - /* "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) # <<<<<<<<<<<<<< * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") */ - __pyx_t_4 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS); - if (__pyx_t_4) { + __pyx_t_3 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS); + if (__pyx_t_3) { - /* "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)): # <<<<<<<<<<<<<< * raise ValueError(u"ndarray is not Fortran contiguous") * */ - __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; + __pyx_t_1 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_v_self), NPY_F_CONTIGUOUS)); + __pyx_t_2 = __pyx_t_1; } else { - __pyx_t_3 = __pyx_t_4; + __pyx_t_2 = __pyx_t_3; } - if (__pyx_t_3) { + if (__pyx_t_2) { - /* "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_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;} + __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;} goto __pyx_L7; } __pyx_L7:; - /* "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) # <<<<<<<<<<<<<< * info.ndim = ndim * if copy_shape: */ - __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; + __pyx_v_info->buf = PyArray_DATA(((PyArrayObject *)__pyx_v_self)); - /* "numpy.pxd":213 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":212 * * info.buf = PyArray_DATA(self) * info.ndim = ndim # <<<<<<<<<<<<<< @@ -3430,16 +3387,17 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->ndim = __pyx_v_ndim; - /* "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) { - /* "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 = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< @@ -3448,7 +3406,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))); - /* "numpy.pxd":218 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":217 * # as one block, strides first. * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) * info.shape = info.strides + ndim # <<<<<<<<<<<<<< @@ -3457,72 +3415,60 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "numpy.pxd":219 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":218 * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) * info.shape = info.strides + ndim * for i in range(ndim): # <<<<<<<<<<<<<< * info.strides[i] = PyArray_STRIDES(self)[i] * info.shape[i] = PyArray_DIMS(self)[i] */ - __pyx_t_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; + __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; - /* "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] # <<<<<<<<<<<<<< * info.shape[i] = PyArray_DIMS(self)[i] * else: */ - __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; + (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]); - /* "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] # <<<<<<<<<<<<<< * else: * info.strides = PyArray_STRIDES(self) */ - __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; + (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]); } goto __pyx_L8; } /*else*/ { - /* "numpy.pxd":223 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":222 * info.shape[i] = PyArray_DIMS(self)[i] * else: * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL */ - __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; + __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(((PyArrayObject *)__pyx_v_self))); - /* "numpy.pxd":224 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":223 * else: * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(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_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(((PyArrayObject *)__pyx_v_self))); } __pyx_L8:; - /* "numpy.pxd":225 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":224 * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -3531,31 +3477,25 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->suboffsets = NULL; - /* "numpy.pxd":226 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":225 * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< * info.readonly = not PyArray_ISWRITEABLE(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; + __pyx_v_info->itemsize = PyArray_ITEMSIZE(((PyArrayObject *)__pyx_v_self)); - /* "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) # <<<<<<<<<<<<<< * * cdef int t */ - __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; + __pyx_v_info->readonly = (!PyArray_ISWRITEABLE(((PyArrayObject *)__pyx_v_self))); - /* "numpy.pxd":230 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":229 * * cdef int t * cdef char* f = NULL # <<<<<<<<<<<<<< @@ -3564,7 +3504,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_f = NULL; - /* "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 # <<<<<<<<<<<<<< @@ -3574,7 +3514,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; - /* "numpy.pxd":235 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":234 * cdef int offset * * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< @@ -3583,23 +3523,23 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - /* "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: # <<<<<<<<<<<<<< * # do not call releasebuffer * info.obj = None */ - __pyx_t_3 = (!__pyx_v_hasfields); - if (__pyx_t_3) { - __pyx_t_4 = (!__pyx_v_copy_shape); - __pyx_t_2 = __pyx_t_4; + __pyx_t_2 = (!__pyx_v_hasfields); + if (__pyx_t_2) { + __pyx_t_3 = (!__pyx_v_copy_shape); + __pyx_t_1 = __pyx_t_3; } else { - __pyx_t_2 = __pyx_t_3; + __pyx_t_1 = __pyx_t_2; } - if (__pyx_t_2) { + if (__pyx_t_1) { - /* "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 # <<<<<<<<<<<<<< @@ -3615,7 +3555,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } /*else*/ { - /* "numpy.pxd":242 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":241 * else: * # need to call releasebuffer * info.obj = self # <<<<<<<<<<<<<< @@ -3630,17 +3570,17 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } __pyx_L11:; - /* "numpy.pxd":244 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":243 * info.obj = self * * if not hasfields: # <<<<<<<<<<<<<< * t = descr.type_num * if ((descr.byteorder == '>' and little_endian) or */ - __pyx_t_2 = (!__pyx_v_hasfields); - if (__pyx_t_2) { + __pyx_t_1 = (!__pyx_v_hasfields); + if (__pyx_t_1) { - /* "numpy.pxd":245 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":244 * * if not hasfields: * t = descr.type_num # <<<<<<<<<<<<<< @@ -3649,306 +3589,312 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_t = __pyx_v_descr->type_num; - /* "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 # <<<<<<<<<<<<<< * (descr.byteorder == '<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") */ - __pyx_t_2 = (__pyx_v_descr->byteorder == '>'); - if (__pyx_t_2) { - __pyx_t_3 = __pyx_v_little_endian; + __pyx_t_1 = (__pyx_v_descr->byteorder == '>'); + if (__pyx_t_1) { + __pyx_t_2 = __pyx_v_little_endian; } else { - __pyx_t_3 = __pyx_t_2; + __pyx_t_2 = __pyx_t_1; } - if (!__pyx_t_3) { + if (!__pyx_t_2) { - /* "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)): # <<<<<<<<<<<<<< * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" */ - __pyx_t_2 = (__pyx_v_descr->byteorder == '<'); - if (__pyx_t_2) { - __pyx_t_4 = (!__pyx_v_little_endian); - __pyx_t_7 = __pyx_t_4; + __pyx_t_1 = (__pyx_v_descr->byteorder == '<'); + if (__pyx_t_1) { + __pyx_t_3 = (!__pyx_v_little_endian); + __pyx_t_8 = __pyx_t_3; } else { - __pyx_t_7 = __pyx_t_2; + __pyx_t_8 = __pyx_t_1; } - __pyx_t_2 = __pyx_t_7; + __pyx_t_1 = __pyx_t_8; } else { - __pyx_t_2 = __pyx_t_3; + __pyx_t_1 = __pyx_t_2; } - if (__pyx_t_2) { + if (__pyx_t_1) { - /* "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_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;} + __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;} goto __pyx_L13; } __pyx_L13:; - /* "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" # <<<<<<<<<<<<<< * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" */ - __pyx_t_2 = (__pyx_v_t == NPY_BYTE); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_BYTE); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__b; goto __pyx_L14; } - /* "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" # <<<<<<<<<<<<<< * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" */ - __pyx_t_2 = (__pyx_v_t == NPY_UBYTE); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_UBYTE); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__B; goto __pyx_L14; } - /* "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" # <<<<<<<<<<<<<< * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" */ - __pyx_t_2 = (__pyx_v_t == NPY_SHORT); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_SHORT); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__h; goto __pyx_L14; } - /* "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" # <<<<<<<<<<<<<< * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" */ - __pyx_t_2 = (__pyx_v_t == NPY_USHORT); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_USHORT); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__H; goto __pyx_L14; } - /* "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" # <<<<<<<<<<<<<< * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" */ - __pyx_t_2 = (__pyx_v_t == NPY_INT); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_INT); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__i; goto __pyx_L14; } - /* "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" # <<<<<<<<<<<<<< * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" */ - __pyx_t_2 = (__pyx_v_t == NPY_UINT); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_UINT); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__I; goto __pyx_L14; } - /* "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" # <<<<<<<<<<<<<< * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" */ - __pyx_t_2 = (__pyx_v_t == NPY_LONG); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_LONG); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__l; goto __pyx_L14; } - /* "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" # <<<<<<<<<<<<<< * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" */ - __pyx_t_2 = (__pyx_v_t == NPY_ULONG); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_ULONG); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__L; goto __pyx_L14; } - /* "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" # <<<<<<<<<<<<<< * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" */ - __pyx_t_2 = (__pyx_v_t == NPY_LONGLONG); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_LONGLONG); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__q; goto __pyx_L14; } - /* "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" # <<<<<<<<<<<<<< * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" */ - __pyx_t_2 = (__pyx_v_t == NPY_ULONGLONG); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_ULONGLONG); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__Q; goto __pyx_L14; } - /* "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" # <<<<<<<<<<<<<< * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" */ - __pyx_t_2 = (__pyx_v_t == NPY_FLOAT); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_FLOAT); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__f; goto __pyx_L14; } - /* "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" # <<<<<<<<<<<<<< * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" */ - __pyx_t_2 = (__pyx_v_t == NPY_DOUBLE); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_DOUBLE); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__d; goto __pyx_L14; } - /* "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" # <<<<<<<<<<<<<< * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" */ - __pyx_t_2 = (__pyx_v_t == NPY_LONGDOUBLE); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_LONGDOUBLE); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__g; goto __pyx_L14; } - /* "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" # <<<<<<<<<<<<<< * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" */ - __pyx_t_2 = (__pyx_v_t == NPY_CFLOAT); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_CFLOAT); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__Zf; goto __pyx_L14; } - /* "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" # <<<<<<<<<<<<<< * elif t == NPY_CLONGDOUBLE: f = "Zg" * elif t == NPY_OBJECT: f = "O" */ - __pyx_t_2 = (__pyx_v_t == NPY_CDOUBLE); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_CDOUBLE); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__Zd; goto __pyx_L14; } - /* "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" # <<<<<<<<<<<<<< * elif t == NPY_OBJECT: f = "O" * else: */ - __pyx_t_2 = (__pyx_v_t == NPY_CLONGDOUBLE); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_CLONGDOUBLE); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__Zg; goto __pyx_L14; } - /* "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" # <<<<<<<<<<<<<< * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) */ - __pyx_t_2 = (__pyx_v_t == NPY_OBJECT); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_OBJECT); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__O; goto __pyx_L14; } /*else*/ { - /* "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_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_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_L14:; - /* "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 # <<<<<<<<<<<<<< @@ -3957,7 +3903,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->format = __pyx_v_f; - /* "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 # <<<<<<<<<<<<<< @@ -3970,7 +3916,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } /*else*/ { - /* "numpy.pxd":271 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":270 * return * else: * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< @@ -3979,7 +3925,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->format = ((char *)malloc(255)); - /* "numpy.pxd":272 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":271 * else: * info.format = stdlib.malloc(_buffer_format_string_len) * info.format[0] = '^' # Native data types, manual alignment # <<<<<<<<<<<<<< @@ -3988,7 +3934,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ (__pyx_v_info->format[0]) = '^'; - /* "numpy.pxd":273 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":272 * info.format = stdlib.malloc(_buffer_format_string_len) * info.format[0] = '^' # Native data types, manual alignment * offset = 0 # <<<<<<<<<<<<<< @@ -3997,17 +3943,17 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_offset = 0; - /* "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; - /* "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 # <<<<<<<<<<<<<< @@ -4021,8 +3967,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_1); - __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("numpy.ndarray.__getbuffer__"); __pyx_r = -1; __Pyx_GOTREF(__pyx_v_info->obj); @@ -4035,11 +3981,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; } -/* "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): # <<<<<<<<<<<<<< @@ -4047,26 +3994,23 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ * stdlib.free(info.format) */ -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; +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); - /* "numpy.pxd":280 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":279 * * 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 = __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) { + __pyx_t_1 = PyArray_HASFIELDS(((PyArrayObject *)__pyx_v_self)); + if (__pyx_t_1) { - /* "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) # <<<<<<<<<<<<<< @@ -4078,17 +4022,17 @@ static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray_1__releasebuffer__(PyObject * } __pyx_L5:; - /* "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): # <<<<<<<<<<<<<< * stdlib.free(info.strides) * # info.shape was stored after info.strides in the same block */ - __pyx_t_2 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); - if (__pyx_t_2) { + __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); + if (__pyx_t_1) { - /* "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) # <<<<<<<<<<<<<< @@ -4100,10 +4044,11 @@ static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray_1__releasebuffer__(PyObject * } __pyx_L6:; + __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_RefNannyFinishContext(); } -/* "numpy.pxd":756 +/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":755 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -4116,7 +4061,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1"); - /* "numpy.pxd":757 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":756 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -4124,7 +4069,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; @@ -4142,7 +4087,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "numpy.pxd":759 +/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":758 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -4155,7 +4100,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2"); - /* "numpy.pxd":760 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":759 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -4163,7 +4108,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; @@ -4181,7 +4126,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "numpy.pxd":762 +/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":761 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -4194,7 +4139,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3"); - /* "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, a, b, c) # <<<<<<<<<<<<<< @@ -4202,7 +4147,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; @@ -4220,7 +4165,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "numpy.pxd":765 +/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":764 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -4233,7 +4178,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4"); - /* "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, a, b, c, d) # <<<<<<<<<<<<<< @@ -4241,7 +4186,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; @@ -4259,7 +4204,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "numpy.pxd":768 +/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":767 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -4272,7 +4217,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5"); - /* "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, a, b, c, d, e) # <<<<<<<<<<<<<< @@ -4280,7 +4225,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; @@ -4298,7 +4243,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "numpy.pxd":771 +/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":770 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -4324,16 +4269,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; - long __pyx_t_10; - char *__pyx_t_11; + 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_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); - /* "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 # <<<<<<<<<<<<<< @@ -4342,7 +4287,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_endian_detector = 1; - /* "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 = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -4351,17 +4296,18 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "numpy.pxd":782 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":781 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< * fields = descr.fields[childname] * child, new_offset = fields */ - 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;} + 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;} } - __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++; @@ -4369,21 +4315,21 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_v_childname = __pyx_t_3; __pyx_t_3 = 0; - /* "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_v_fields = ((PyObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "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 # <<<<<<<<<<<<<< @@ -4393,7 +4339,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); @@ -4403,51 +4349,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;} } - /* "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) { - /* "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 = 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_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_Raise(__pyx_t_5, 0, 0); + __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_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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;} goto __pyx_L5; } __pyx_L5:; - /* "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 # <<<<<<<<<<<<<< @@ -4462,7 +4414,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } if (!__pyx_t_7) { - /* "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)): # <<<<<<<<<<<<<< @@ -4482,23 +4434,29 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } if (__pyx_t_6) { - /* "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_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_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_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:; - /* "numpy.pxd":801 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":800 * * # Output padding bytes * while offset[0] < new_offset: # <<<<<<<<<<<<<< @@ -4506,16 +4464,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; - /* "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 # <<<<<<<<<<<<<< @@ -4524,37 +4482,35 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ (__pyx_v_f[0]) = 120; - /* "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 # <<<<<<<<<<<<<< * offset[0] += 1 * */ - __pyx_v_f = (__pyx_v_f + 1); + __pyx_v_f += 1; - /* "numpy.pxd":804 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":803 * f[0] = 120 # "x"; pad byte * f += 1 * offset[0] += 1 # <<<<<<<<<<<<<< * * offset[0] += child.itemsize */ - __pyx_t_10 = 0; - (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + 1); + (__pyx_v_offset[0]) += 1; } - /* "numpy.pxd":806 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":805 * offset[0] += 1 * * offset[0] += child.itemsize # <<<<<<<<<<<<<< * * if not PyDataType_HASFIELDS(child): */ - __pyx_t_10 = 0; - (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + __pyx_v_child->elsize); + (__pyx_v_offset[0]) += __pyx_v_child->elsize; - /* "numpy.pxd":808 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":807 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -4564,20 +4520,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) { - /* "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; - /* "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: # <<<<<<<<<<<<<< @@ -4587,402 +4543,408 @@ 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) { - /* "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 = 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_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_Raise(__pyx_t_3, 0, 0); + __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_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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;} goto __pyx_L10; } __pyx_L10:; - /* "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_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_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_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_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 = 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 = 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; } - /* "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_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_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_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_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 = 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]) = 66; goto __pyx_L11; } - /* "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_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_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_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_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 = 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]) = 104; goto __pyx_L11; } - /* "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_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_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_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_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 = 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]) = 72; goto __pyx_L11; } - /* "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_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_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_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_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 = 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]) = 105; goto __pyx_L11; } - /* "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_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_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_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_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 = 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]) = 73; goto __pyx_L11; } - /* "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_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_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_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_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 = 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]) = 108; goto __pyx_L11; } - /* "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_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_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_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_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 = 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]) = 76; goto __pyx_L11; } - /* "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_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_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_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_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 = 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]) = 113; goto __pyx_L11; } - /* "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_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_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_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_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 = 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]) = 81; goto __pyx_L11; } - /* "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_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_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_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_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 = 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]) = 102; goto __pyx_L11; } - /* "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_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_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_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_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 = 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]) = 100; goto __pyx_L11; } - /* "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_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_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_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_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 = 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]) = 103; goto __pyx_L11; } - /* "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_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_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_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_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 = 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]) = 90; (__pyx_v_f[1]) = 102; - __pyx_v_f = (__pyx_v_f + 1); + __pyx_v_f += 1; goto __pyx_L11; } - /* "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_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_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_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_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 = 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]) = 100; - __pyx_v_f = (__pyx_v_f + 1); + __pyx_v_f += 1; goto __pyx_L11; } - /* "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_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_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_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_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 = 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]) = 103; - __pyx_v_f = (__pyx_v_f + 1); + __pyx_v_f += 1; goto __pyx_L11; } - /* "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_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_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_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_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]) = 79; goto __pyx_L11; } /*else*/ { - /* "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_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_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); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); + 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(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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_L11:; - /* "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 # <<<<<<<<<<<<<< * else: * # Cython ignores struct boundary information ("T{...}"), */ - __pyx_v_f = (__pyx_v_f + 1); + __pyx_v_f += 1; goto __pyx_L9; } /*else*/ { - /* "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_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_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; - /* "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 # <<<<<<<<<<<<<< @@ -5007,11 +4969,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; } -/* "numpy.pxd":953 +/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":952 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -5022,10 +4985,11 @@ 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); - /* "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: # <<<<<<<<<<<<<< @@ -5035,7 +4999,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) { - /* "numpy.pxd":956 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":955 * cdef PyObject* baseptr * if base is None: * baseptr = NULL # <<<<<<<<<<<<<< @@ -5047,19 +5011,16 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } /*else*/ { - /* "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! # <<<<<<<<<<<<<< * baseptr = base * Py_XDECREF(arr.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; + Py_INCREF(__pyx_v_base); - /* "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 = base # <<<<<<<<<<<<<< @@ -5070,7 +5031,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } __pyx_L3:; - /* "numpy.pxd":960 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":959 * Py_INCREF(base) # important to do this before decref below! * baseptr = base * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< @@ -5079,7 +5040,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_XDECREF(__pyx_v_arr->base); - /* "numpy.pxd":961 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":960 * baseptr = base * Py_XDECREF(arr.base) * arr.base = baseptr # <<<<<<<<<<<<<< @@ -5088,10 +5049,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(); } -/* "numpy.pxd":963 +/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":962 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -5103,8 +5066,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); - /* "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: # <<<<<<<<<<<<<< @@ -5114,7 +5078,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) { - /* "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 # <<<<<<<<<<<<<< @@ -5129,7 +5093,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py } /*else*/ { - /* "numpy.pxd":967 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":966 * return None * else: * return arr.base # <<<<<<<<<<<<<< @@ -5143,15 +5107,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("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)}, {0, 0, 0, 0} }; +static void __pyx_init_filenames(void); /*proto*/ + #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { PyModuleDef_HEAD_INIT, @@ -5169,15 +5137,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_u_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 1, 0, 0}, {&__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}, @@ -5244,117 +5212,10 @@ 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 = 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(); + __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:; - __Pyx_RefNannyFinishContext(); return -1; } @@ -5376,6 +5237,7 @@ 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"); @@ -5387,10 +5249,12 @@ 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 ---*/ @@ -5414,42 +5278,40 @@ 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_scikits__learn__linear_model__sgd_fast_sparse) { + if (__pyx_module_is_main_sklearn__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 = 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;} + __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;} /*--- Function import code ---*/ /*--- Execution code ---*/ - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":10 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":10 * # License: BSD Style. * * import numpy as np # <<<<<<<<<<<<<< @@ -5461,7 +5323,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; - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":11 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":11 * * import numpy as np * import sys # <<<<<<<<<<<<<< @@ -5473,7 +5335,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; - /* "scikits/learn/linear_model/sgd_fast_sparse.pyx":12 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sgd_fast_sparse.pyx":12 * import numpy as np * import sys * from time import time # <<<<<<<<<<<<<< @@ -5494,29 +5356,24 @@ 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; - /* "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 + /* "/home/fabian/dev/scikit-learn/sklearn/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; - /* "numpy.pxd":963 + /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":962 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -5527,11 +5384,12 @@ 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 scikits.learn.linear_model.sgd_fast_sparse"); + __Pyx_AddTraceback("init sklearn.linear_model.sgd_fast_sparse"); Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init scikits.learn.linear_model.sgd_fast_sparse"); + PyErr_SetString(PyExc_ImportError, "init sklearn.linear_model.sgd_fast_sparse"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); @@ -5542,14 +5400,29 @@ 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 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( + 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( @@ -5582,19 +5455,6 @@ 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[], @@ -5674,26 +5534,6 @@ static int __Pyx_ParseOptionalKeywords( 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; @@ -5813,7 +5653,7 @@ static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) { default: { __Pyx_BufFmt_RaiseUnexpectedChar(ch); return 0; - } + } } } @@ -5857,7 +5697,7 @@ static size_t __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) { default: { __Pyx_BufFmt_RaiseUnexpectedChar(ch); return 0; - } + } } } @@ -5894,7 +5734,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 { @@ -5917,7 +5757,7 @@ static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { ctx->head->parent_offset = parent_offset; continue; } - + __Pyx_BufFmt_RaiseExpected(ctx); return -1; } @@ -5931,7 +5771,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 */ @@ -5964,7 +5804,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) { @@ -6086,7 +5926,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha return NULL; } } - + } } } @@ -6099,7 +5939,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; @@ -6184,147 +6024,75 @@ 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 , */ - Py_DECREF(value); - value = type; +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, #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; - } + "need more than %d value%s to unpack", (int)index, #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; - } + "need more than %zd value%s to unpack", index, #endif - } - - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; + (index == 1) ? "" : "s"); } -#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; +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(void) { + PyErr_SetString(PyExc_ValueError, "too many values to unpack"); +} - if (PyExceptionInstance_Check(type)) { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto bad; +static PyObject *__Pyx_UnpackItem(PyObject *iter, Py_ssize_t index) { + PyObject *item; + if (!(item = PyIter_Next(iter))) { + if (!PyErr_Occurred()) { + __Pyx_RaiseNeedMoreValuesError(index); } - 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; +} - 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); - } +static int __Pyx_EndUnpack(PyObject *iter) { + PyObject *item; + if ((item = PyIter_Next(iter))) { + Py_DECREF(item); + __Pyx_RaiseTooManyValuesError(); + return -1; } - -bad: - return; + else if (!PyErr_Occurred()) + return 0; + else + return -1; } -#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(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 @@ -6343,7 +6111,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_1__releasebuffer__(obj, view); +if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pf_5numpy_7ndarray___releasebuffer__(obj, view); Py_DECREF(obj); view->obj = NULL; } @@ -6352,14 +6120,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; @@ -6375,15 +6143,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 PyObject *__Pyx_GetStdout(void) { PyObject *f = PySys_GetObject((char *)"stdout"); @@ -6393,14 +6169,13 @@ static PyObject *__Pyx_GetStdout(void) { return f; } -static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) { +static int __Pyx_Print(PyObject *arg_tuple, int newline) { + PyObject *f; PyObject* v; int i; - if (!f) { - if (!(f = __Pyx_GetStdout())) - return -1; - } + 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) @@ -6428,38 +6203,22 @@ static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) { #else /* Python 3 has a print function */ -static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) { +static int __Pyx_Print(PyObject *arg_tuple, int newline) { PyObject* kwargs = 0; PyObject* result = 0; PyObject* end_string; - if (unlikely(!__pyx_print)) { + if (!__pyx_print) { __pyx_print = __Pyx_GetAttrString(__pyx_b, "print"); if (!__pyx_print) return -1; } - 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)) { + if (!newline) { + if (!__pyx_print_kwargs) { __pyx_print_kwargs = PyDict_New(); - if (unlikely(!__pyx_print_kwargs)) + if (!__pyx_print_kwargs) return -1; end_string = PyUnicode_FromStringAndSize(" ", 1); - if (unlikely(!end_string)) + if (!end_string) return -1; if (PyDict_SetItemString(__pyx_print_kwargs, "end", end_string) < 0) { Py_DECREF(end_string); @@ -6470,27 +6229,20 @@ static int __Pyx_Print(PyObject* stream, 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* f, PyObject *o) { - if (!f) { - if (!(f = __Pyx_GetStdout())) - return -1; - } +static int __Pyx_PrintOne(PyObject *o) { + PyObject *f; + if (!(f = __Pyx_GetStdout())) + return -1; if (PyFile_SoftSpace(f, 0)) { if (PyFile_WriteString(" ", f) < 0) return -1; @@ -6502,25 +6254,135 @@ static int __Pyx_PrintOne(PyObject* f, PyObject *o) { return 0; /* the line below is just to avoid compiler * compiler warnings about unused functions */ - return __Pyx_Print(f, NULL, 0); + return __Pyx_Print(NULL, 0); } #else /* Python 3 has a print function */ -static int __Pyx_PrintOne(PyObject* stream, PyObject *o) { +static int __Pyx_PrintOne(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(stream, arg_tuple, 1); + res = __Pyx_Print(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 , */ + 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) { @@ -6585,60 +6447,15 @@ static int __Pyx_PrintOne(PyObject* stream, PyObject *o) { z.imag = -a.imag; return z; } - #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 +/* + 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 + } +*/ #endif #if CYTHON_CCOMPLEX @@ -6705,60 +6522,15 @@ static int __Pyx_PrintOne(PyObject* stream, PyObject *o) { z.imag = -a.imag; return z; } - #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 +/* + 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 + } +*/ #endif static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) { @@ -6932,25 +6704,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; @@ -7189,23 +6942,19 @@ 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; @@ -7240,23 +6989,22 @@ static PyObject *__Pyx_ImportModule(const char *name) { } #endif -static void* __Pyx_GetVtable(PyObject *dict) { - void* ptr; +static int __Pyx_GetVtable(PyObject *dict, void *vtabptr) { PyObject *ob = PyMapping_GetItemString(dict, (char *)"__pyx_vtable__"); if (!ob) goto bad; -#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) - ptr = PyCapsule_GetPointer(ob, 0); +#if PY_VERSION_HEX < 0x03010000 + *(void **)vtabptr = PyCObject_AsVoidPtr(ob); #else - ptr = PyCObject_AsVoidPtr(ob); + *(void **)vtabptr = PyCapsule_GetPointer(ob, 0); #endif - if (!ptr && !PyErr_Occurred()) - PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); + if (!*(void **)vtabptr) + goto bad; Py_DECREF(ob); - return ptr; + return 0; bad: Py_XDECREF(ob); - return NULL; + return -1; } #include "compile.h" @@ -7362,8 +7110,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/scikits/learn/linear_model/sgd_fast_sparse.pyx b/sklearn/linear_model/sgd_fast_sparse.pyx similarity index 100% rename from scikits/learn/linear_model/sgd_fast_sparse.pyx rename to sklearn/linear_model/sgd_fast_sparse.pyx diff --git a/scikits/learn/linear_model/sparse/__init__.py b/sklearn/linear_model/sparse/__init__.py similarity index 60% rename from scikits/learn/linear_model/sparse/__init__.py rename to sklearn/linear_model/sparse/__init__.py index 3037853e51afc..734af9c9d8319 100644 --- a/scikits/learn/linear_model/sparse/__init__.py +++ b/sklearn/linear_model/sparse/__init__.py @@ -1,6 +1,6 @@ """ -:mod:`scikits.learn.linear_model.sparse` is the sparse counterpart -of :mod:`scikits.learn.linear_model`. +:mod:`sklearn.linear_model.sparse` is the sparse counterpart +of :mod:`sklearn.linear_model`. """ diff --git a/scikits/learn/linear_model/sparse/base.py b/sklearn/linear_model/sparse/base.py similarity index 100% rename from scikits/learn/linear_model/sparse/base.py rename to sklearn/linear_model/sparse/base.py diff --git a/scikits/learn/linear_model/sparse/coordinate_descent.py b/sklearn/linear_model/sparse/coordinate_descent.py similarity index 100% rename from scikits/learn/linear_model/sparse/coordinate_descent.py rename to sklearn/linear_model/sparse/coordinate_descent.py diff --git a/scikits/learn/linear_model/sparse/logistic.py b/sklearn/linear_model/sparse/logistic.py similarity index 98% rename from scikits/learn/linear_model/sparse/logistic.py rename to sklearn/linear_model/sparse/logistic.py index 6f01d7caca9bb..74e14e8b3e497 100644 --- a/scikits/learn/linear_model/sparse/logistic.py +++ b/sklearn/linear_model/sparse/logistic.py @@ -1,7 +1,7 @@ """ Sparse Logistic Regression module -This module has the same API as scikits.learn.linear_model.logistic, but is +This module has the same API as sklearn.linear_model.logistic, but is designed to handle efficiently data in sparse matrix format. """ diff --git a/scikits/learn/linear_model/sparse/setup.py b/sklearn/linear_model/sparse/setup.py similarity index 100% rename from scikits/learn/linear_model/sparse/setup.py rename to sklearn/linear_model/sparse/setup.py diff --git a/scikits/learn/linear_model/sparse/src/cd_fast_sparse.c b/sklearn/linear_model/sparse/src/cd_fast_sparse.c similarity index 86% rename from scikits/learn/linear_model/sparse/src/cd_fast_sparse.c rename to sklearn/linear_model/sparse/src/cd_fast_sparse.c index 29f3bb5629cee..b50fee79ab19d 100644 --- a/scikits/learn/linear_model/sparse/src/cd_fast_sparse.c +++ b/sklearn/linear_model/sparse/src/cd_fast_sparse.c @@ -1,18 +1,39 @@ -/* Generated by Cython 0.12.1 on Tue Sep 14 09:45:11 2010 */ +/* Generated by Cython 0.13 on Fri Sep 2 11:30:08 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 /* 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,11 +103,35 @@ #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 + #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 @@ -103,30 +148,23 @@ #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) -#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 + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #endif #if PY_VERSION_HEX < 0x02050000 @@ -146,113 +184,64 @@ #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 #define __PYX_HAVE_API__cd_fast_sparse -#include "stdlib.h" #include "stdio.h" +#include "stdlib.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 */ -#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 +251,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 +271,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 +296,11 @@ static const char **__pyx_f; #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; @@ -426,6 +419,8 @@ 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*/ @@ -434,6 +429,9 @@ 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_; @@ -456,8 +454,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) @@ -474,11 +472,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); @@ -491,14 +489,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); @@ -511,15 +509,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); @@ -533,13 +531,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, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i)); + r = __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } return r; } -#define __Pyx_SetItemInt(o, i, v, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \ - __Pyx_SetItemInt_Fast(o, i, v, size <= sizeof(long)) : \ +#define __Pyx_SetItemInt(o, i, v, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \ + __Pyx_SetItemInt_Fast(o, i, v) : \ __Pyx_SetItemInt_Generic(o, to_py_func(i), v)) static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) { @@ -550,7 +548,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, int fits_long) { +static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v) { if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) { Py_INCREF(v); Py_DECREF(PyList_GET_ITEM(o, i)); @@ -560,7 +558,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 = fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i); + PyObject *j = PyInt_FromSsize_t(i); return __Pyx_SetItemInt_Generic(o, j, v); } } @@ -568,19 +566,13 @@ 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_RaiseNeedMoreValuesError(Py_ssize_t index); - -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); @@ -594,8 +586,6 @@ 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 @@ -699,6 +689,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 *); @@ -718,13 +710,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 */ @@ -749,8 +743,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 = { "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' }; +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' }; #define __Pyx_MODULE_NAME "cd_fast_sparse" int __pyx_module_is_main_cd_fast_sparse = 0; @@ -803,7 +797,6 @@ 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"; @@ -820,6 +813,7 @@ 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"; @@ -882,7 +876,7 @@ static PyObject *__pyx_int_1; static PyObject *__pyx_int_2; static PyObject *__pyx_int_15; -/* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":16 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":16 * double sqrt(double f) * * cdef inline double fmax(double x, double y): # <<<<<<<<<<<<<< @@ -895,7 +889,7 @@ static CYTHON_INLINE double __pyx_f_14cd_fast_sparse_fmax(double __pyx_v_x, doub int __pyx_t_1; __Pyx_RefNannySetupContext("fmax"); - /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":17 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":17 * * cdef inline double fmax(double x, double y): * if x > y: return x # <<<<<<<<<<<<<< @@ -910,7 +904,7 @@ static CYTHON_INLINE double __pyx_f_14cd_fast_sparse_fmax(double __pyx_v_x, doub } __pyx_L3:; - /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":18 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":18 * cdef inline double fmax(double x, double y): * if x > y: return x * return y # <<<<<<<<<<<<<< @@ -926,7 +920,7 @@ static CYTHON_INLINE double __pyx_f_14cd_fast_sparse_fmax(double __pyx_v_x, doub return __pyx_r; } -/* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":20 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":20 * return y * * cdef inline double fsign(double f): # <<<<<<<<<<<<<< @@ -939,39 +933,39 @@ static CYTHON_INLINE double __pyx_f_14cd_fast_sparse_fsign(double __pyx_v_f) { int __pyx_t_1; __Pyx_RefNannySetupContext("fsign"); - /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":21 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/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); + __pyx_t_1 = (__pyx_v_f == 0.0); if (__pyx_t_1) { - /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":22 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/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; + __pyx_r = 0.0; goto __pyx_L0; goto __pyx_L3; } - /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":23 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/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); + __pyx_t_1 = (__pyx_v_f > 0.0); if (__pyx_t_1) { - /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":24 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":24 * return 0 * elif f > 0: * return 1.0 # <<<<<<<<<<<<<< @@ -984,7 +978,7 @@ static CYTHON_INLINE double __pyx_f_14cd_fast_sparse_fsign(double __pyx_v_f) { } /*else*/ { - /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":26 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":26 * return 1.0 * else: * return -1.0 # <<<<<<<<<<<<<< @@ -1002,7 +996,7 @@ static CYTHON_INLINE double __pyx_f_14cd_fast_sparse_fsign(double __pyx_v_f) { return __pyx_r; } -/* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":35 +/* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":35 * @cython.wraparound(False) * @cython.cdivision(True) * def enet_coordinate_descent(np.ndarray[DOUBLE, ndim=1] w, # <<<<<<<<<<<<<< @@ -1072,7 +1066,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; - unsigned long __pyx_t_9; + long __pyx_t_9; __pyx_t_14cd_fast_sparse_DOUBLE __pyx_t_10; unsigned int __pyx_t_11; PyArrayObject *__pyx_t_12 = NULL; @@ -1080,7 +1074,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; - unsigned long __pyx_t_17; + long __pyx_t_17; __pyx_t_14cd_fast_sparse_INTEGER __pyx_t_18; unsigned int __pyx_t_19; unsigned int __pyx_t_20; @@ -1092,20 +1086,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; - unsigned long __pyx_t_29; + 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; - unsigned long __pyx_t_35; + 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; - unsigned long __pyx_t_42; + long __pyx_t_42; unsigned int __pyx_t_43; unsigned int __pyx_t_44; unsigned int __pyx_t_45; @@ -1117,7 +1111,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; - unsigned long __pyx_t_54; + long __pyx_t_54; unsigned int __pyx_t_55; unsigned int __pyx_t_56; unsigned int __pyx_t_57; @@ -1226,13 +1220,9 @@ 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); @@ -1283,7 +1273,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/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":53 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":53 * * # get the data information into easy vars * cdef unsigned int n_samples = y.shape[0] # <<<<<<<<<<<<<< @@ -1292,7 +1282,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p */ __pyx_v_n_samples = (__pyx_v_y->dimensions[0]); - /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":54 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/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] # <<<<<<<<<<<<<< @@ -1301,7 +1291,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p */ __pyx_v_n_features = (__pyx_v_w->dimensions[0]); - /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":58 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/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, # <<<<<<<<<<<<<< @@ -1316,7 +1306,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/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":59 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/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) # <<<<<<<<<<<<<< @@ -1355,7 +1345,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/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":60 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/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): # <<<<<<<<<<<<<< @@ -1366,7 +1356,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/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":61 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/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() # <<<<<<<<<<<<<< @@ -1392,7 +1382,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/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":71 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":71 * cdef double w_max * cdef double d_w_ii * cdef double gap = tol + 1.0 # <<<<<<<<<<<<<< @@ -1401,7 +1391,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p */ __pyx_v_gap = (__pyx_v_tol + 1.0); - /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":72 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":72 * cdef double d_w_ii * cdef double gap = tol + 1.0 * cdef double d_w_tol = tol # <<<<<<<<<<<<<< @@ -1410,7 +1400,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p */ __pyx_v_d_w_tol = __pyx_v_tol; - /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":77 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":77 * * # initialize the residuals * R = y.copy() # <<<<<<<<<<<<<< @@ -1446,7 +1436,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/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":78 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":78 * # initialize the residuals * R = y.copy() * for ii in xrange(n_features): # <<<<<<<<<<<<<< @@ -1457,7 +1447,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/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":80 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/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]): # <<<<<<<<<<<<<< @@ -1470,7 +1460,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/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":81 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/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] # <<<<<<<<<<<<<< @@ -1485,7 +1475,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p } } - /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":83 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":83 * R[X_indices[jj]] -= X_data[jj] * w[ii] * * tol = tol * linalg.norm(y) ** 2 # <<<<<<<<<<<<<< @@ -1519,7 +1509,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/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":85 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":85 * tol = tol * linalg.norm(y) ** 2 * * for n_iter in range(max_iter): # <<<<<<<<<<<<<< @@ -1530,7 +1520,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/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":87 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":87 * for n_iter in range(max_iter): * * w_max = 0.0 # <<<<<<<<<<<<<< @@ -1539,7 +1529,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p */ __pyx_v_w_max = 0.0; - /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":88 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":88 * * w_max = 0.0 * d_w_max = 0.0 # <<<<<<<<<<<<<< @@ -1548,7 +1538,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p */ __pyx_v_d_w_max = 0.0; - /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":90 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":90 * d_w_max = 0.0 * * for ii in xrange(n_features): # Loop over coordinates # <<<<<<<<<<<<<< @@ -1559,7 +1549,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/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":91 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":91 * * for ii in xrange(n_features): # Loop over coordinates * if norm_cols_X[ii] == 0.0: # <<<<<<<<<<<<<< @@ -1570,7 +1560,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/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":92 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":92 * for ii in xrange(n_features): # Loop over coordinates * if norm_cols_X[ii] == 0.0: * continue # <<<<<<<<<<<<<< @@ -1582,7 +1572,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p } __pyx_L16:; - /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":94 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":94 * continue * * w_ii = w[ii] # Store previous value # <<<<<<<<<<<<<< @@ -1592,7 +1582,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/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":96 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":96 * w_ii = w[ii] # Store previous value * * if w_ii != 0.0: # <<<<<<<<<<<<<< @@ -1602,7 +1592,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/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":98 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/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]): # <<<<<<<<<<<<<< @@ -1615,7 +1605,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/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":99 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/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 # <<<<<<<<<<<<<< @@ -1631,7 +1621,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p } __pyx_L17:; - /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":102 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":102 * * # tmp = (X[:,ii] * R).sum() * tmp = 0.0 # <<<<<<<<<<<<<< @@ -1640,7 +1630,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p */ __pyx_v_tmp = 0.0; - /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":103 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/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]): # <<<<<<<<<<<<<< @@ -1653,7 +1643,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/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":104 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/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] # <<<<<<<<<<<<<< @@ -1666,7 +1656,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/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":107 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":107 * * w[ii] = fsign(tmp) * fmax(fabs(tmp) - alpha, 0) \ * / (norm_cols_X[ii] + beta) # <<<<<<<<<<<<<< @@ -1675,7 +1665,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p */ __pyx_t_36 = __pyx_v_ii; - /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":106 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":106 * tmp += R[X_indices[jj]] * X_data[jj] * * w[ii] = fsign(tmp) * fmax(fabs(tmp) - alpha, 0) \ # <<<<<<<<<<<<<< @@ -1683,9 +1673,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)) / ((*__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.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/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":109 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":109 * / (norm_cols_X[ii] + beta) * * if w[ii] != 0.0: # <<<<<<<<<<<<<< @@ -1696,7 +1686,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/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":111 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/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]): # <<<<<<<<<<<<<< @@ -1709,7 +1699,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/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":112 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/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] # <<<<<<<<<<<<<< @@ -1726,7 +1716,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p } __pyx_L22:; - /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":115 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":115 * * # update the maximum absolute coefficient update * d_w_ii = fabs(w[ii] - w_ii) # <<<<<<<<<<<<<< @@ -1736,7 +1726,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/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":116 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/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: # <<<<<<<<<<<<<< @@ -1746,7 +1736,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/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":117 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/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 # <<<<<<<<<<<<<< @@ -1758,7 +1748,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p } __pyx_L25:; - /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":119 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":119 * d_w_max = d_w_ii * * if w[ii] > w_max: # <<<<<<<<<<<<<< @@ -1769,7 +1759,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/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":120 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":120 * * if w[ii] > w_max: * w_max = w[ii] # <<<<<<<<<<<<<< @@ -1784,7 +1774,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p __pyx_L14_continue:; } - /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":122 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/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: # <<<<<<<<<<<<<< @@ -1806,7 +1796,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p } if (__pyx_t_51) { - /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":128 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":128 * * # sparse X.T / dense R dot product * X_T_R = np.zeros(n_features) # <<<<<<<<<<<<<< @@ -1833,7 +1823,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/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":129 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/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): # <<<<<<<<<<<<<< @@ -1844,7 +1834,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/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":130 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/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]): # <<<<<<<<<<<<<< @@ -1857,7 +1847,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/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":131 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/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]] # <<<<<<<<<<<<<< @@ -1880,7 +1870,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p } } - /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":133 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/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) # <<<<<<<<<<<<<< @@ -1921,7 +1911,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/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":135 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/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) # <<<<<<<<<<<<<< @@ -1946,7 +1936,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/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":136 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":136 * # TODO: use squared L2 norm directly * R_norm = linalg.norm(R) * w_norm = linalg.norm(w, 2) # <<<<<<<<<<<<<< @@ -1974,7 +1964,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/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":137 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":137 * R_norm = linalg.norm(R) * w_norm = linalg.norm(w, 2) * if (dual_norm_XtA > alpha): # <<<<<<<<<<<<<< @@ -1990,7 +1980,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/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":138 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":138 * w_norm = linalg.norm(w, 2) * if (dual_norm_XtA > alpha): * const = alpha / dual_norm_XtA # <<<<<<<<<<<<<< @@ -2006,7 +1996,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p __pyx_v_const = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":139 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":139 * if (dual_norm_XtA > alpha): * const = alpha / dual_norm_XtA * A_norm = R_norm * const # <<<<<<<<<<<<<< @@ -2019,7 +2009,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/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":140 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/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) # <<<<<<<<<<<<<< @@ -2047,7 +2037,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p } /*else*/ { - /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":142 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":142 * gap = 0.5 * (R_norm ** 2 + A_norm ** 2) * else: * const = 1.0 # <<<<<<<<<<<<<< @@ -2060,7 +2050,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p __pyx_v_const = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":143 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":143 * else: * const = 1.0 * gap = R_norm ** 2 # <<<<<<<<<<<<<< @@ -2075,7 +2065,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p } __pyx_L32:; - /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":145 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":145 * gap = R_norm ** 2 * * gap += alpha * linalg.norm(w, 1) - const * np.dot(R.T, y) + \ # <<<<<<<<<<<<<< @@ -2132,7 +2122,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/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":146 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/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) # <<<<<<<<<<<<<< @@ -2164,7 +2154,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/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":148 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":148 * 0.5 * beta * (1 + const ** 2) * (w_norm ** 2) * * if gap < tol: # <<<<<<<<<<<<<< @@ -2174,7 +2164,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/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":150 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":150 * if gap < tol: * # return if we reached desired tolerance * break # <<<<<<<<<<<<<< @@ -2191,7 +2181,7 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p } __pyx_L13_break:; - /* "/home/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":152 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":152 * break * * return w, gap, tol # <<<<<<<<<<<<<< @@ -2254,17 +2244,12 @@ 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; } -/* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":187 +/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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): # <<<<<<<<<<<<<< @@ -2272,8 +2257,8 @@ static PyObject *__pyx_pf_14cd_fast_sparse_enet_coordinate_descent(PyObject *__p * # 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; @@ -2298,9 +2283,8 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf 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/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":193 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":194 * # of flags * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -2309,7 +2293,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ __pyx_v_endian_detector = 1; - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":194 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":195 * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -2318,7 +2302,7 @@ 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/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":196 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":197 * cdef bint little_endian = ((&endian_detector)[0] != 0) * * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< @@ -2327,7 +2311,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ __pyx_v_ndim = PyArray_NDIM(((PyArrayObject *)__pyx_v_self)); - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":198 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":199 * ndim = PyArray_NDIM(self) * * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -2337,7 +2321,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); if (__pyx_t_1) { - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":199 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":200 * * if sizeof(npy_intp) != sizeof(Py_ssize_t): * copy_shape = 1 # <<<<<<<<<<<<<< @@ -2349,7 +2333,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf } /*else*/ { - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":201 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":202 * copy_shape = 1 * else: * copy_shape = 0 # <<<<<<<<<<<<<< @@ -2360,7 +2344,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf } __pyx_L5:; - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":203 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":204 * copy_shape = 0 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -2370,7 +2354,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf __pyx_t_1 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS); if (__pyx_t_1) { - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":204 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":205 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -2384,29 +2368,29 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf } if (__pyx_t_3) { - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":205 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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 = 205; __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 = 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_filename = __pyx_f[1]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":207 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":208 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -2416,7 +2400,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf __pyx_t_3 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS); if (__pyx_t_3) { - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":208 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":209 * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -2430,29 +2414,29 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf } if (__pyx_t_2) { - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":209 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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 = 209; __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 = 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_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L7; } __pyx_L7:; - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":211 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":212 * raise ValueError(u"ndarray is not Fortran contiguous") * * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< @@ -2461,7 +2445,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ __pyx_v_info->buf = PyArray_DATA(((PyArrayObject *)__pyx_v_self)); - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":212 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":213 * * info.buf = PyArray_DATA(self) * info.ndim = ndim # <<<<<<<<<<<<<< @@ -2470,17 +2454,16 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ __pyx_v_info->ndim = __pyx_v_ndim; - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":213 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":216 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":217 * # Allocate new buffer for strides and shape info. This is allocated * # as one block, strides first. * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< @@ -2489,7 +2472,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/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":217 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":218 * # as one block, strides first. * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) * info.shape = info.strides + ndim # <<<<<<<<<<<<<< @@ -2498,7 +2481,7 @@ 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/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":218 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":219 * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) * info.shape = info.strides + ndim * for i in range(ndim): # <<<<<<<<<<<<<< @@ -2509,7 +2492,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":219 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":220 * info.shape = info.strides + ndim * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< @@ -2518,7 +2501,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]); - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":220 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":221 * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< @@ -2531,7 +2514,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf } /*else*/ { - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":222 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":223 * info.shape[i] = PyArray_DIMS(self)[i] * else: * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< @@ -2540,7 +2523,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(((PyArrayObject *)__pyx_v_self))); - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":223 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":224 * else: * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< @@ -2551,7 +2534,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf } __pyx_L8:; - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":224 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":225 * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -2560,7 +2543,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ __pyx_v_info->suboffsets = NULL; - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":225 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":226 * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< @@ -2569,7 +2552,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ __pyx_v_info->itemsize = PyArray_ITEMSIZE(((PyArrayObject *)__pyx_v_self)); - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":226 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":227 * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< @@ -2578,7 +2561,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ __pyx_v_info->readonly = (!PyArray_ISWRITEABLE(((PyArrayObject *)__pyx_v_self))); - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":229 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":230 * * cdef int t * cdef char* f = NULL # <<<<<<<<<<<<<< @@ -2587,7 +2570,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ __pyx_v_f = NULL; - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":230 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":231 * cdef int t * cdef char* f = NULL * cdef dtype descr = self.descr # <<<<<<<<<<<<<< @@ -2597,7 +2580,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/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":234 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":235 * cdef int offset * * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< @@ -2606,7 +2589,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":236 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":237 * cdef bint hasfields = PyDataType_HASFIELDS(descr) * * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< @@ -2622,7 +2605,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf } if (__pyx_t_1) { - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":238 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":239 * if not hasfields and not copy_shape: * # do not call releasebuffer * info.obj = None # <<<<<<<<<<<<<< @@ -2638,7 +2621,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf } /*else*/ { - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":241 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":242 * else: * # need to call releasebuffer * info.obj = self # <<<<<<<<<<<<<< @@ -2653,7 +2636,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf } __pyx_L11:; - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":243 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":244 * info.obj = self * * if not hasfields: # <<<<<<<<<<<<<< @@ -2663,7 +2646,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf __pyx_t_1 = (!__pyx_v_hasfields); if (__pyx_t_1) { - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":244 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":245 * * if not hasfields: * t = descr.type_num # <<<<<<<<<<<<<< @@ -2672,7 +2655,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ __pyx_v_t = __pyx_v_descr->type_num; - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":245 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":246 * if not hasfields: * t = descr.type_num * if ((descr.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< @@ -2687,7 +2670,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf } if (!__pyx_t_2) { - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":246 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":247 * t = descr.type_num * if ((descr.byteorder == '>' and little_endian) or * (descr.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< @@ -2707,29 +2690,29 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf } if (__pyx_t_1) { - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":247 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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 = 247; __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 = 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_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L13; } __pyx_L13:; - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":248 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":249 * (descr.byteorder == '<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< @@ -2742,7 +2725,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf goto __pyx_L14; } - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":249 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":250 * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< @@ -2755,7 +2738,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf goto __pyx_L14; } - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":250 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":251 * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< @@ -2768,7 +2751,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf goto __pyx_L14; } - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":251 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":252 * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< @@ -2781,7 +2764,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf goto __pyx_L14; } - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":252 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":253 * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< @@ -2794,7 +2777,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf goto __pyx_L14; } - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":253 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":254 * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< @@ -2807,7 +2790,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf goto __pyx_L14; } - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":254 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":255 * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< @@ -2820,7 +2803,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf goto __pyx_L14; } - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":255 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":256 * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< @@ -2833,7 +2816,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf goto __pyx_L14; } - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":256 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":257 * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< @@ -2846,7 +2829,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf goto __pyx_L14; } - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":257 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":258 * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< @@ -2859,7 +2842,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf goto __pyx_L14; } - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":258 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":259 * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< @@ -2872,7 +2855,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf goto __pyx_L14; } - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":259 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":260 * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< @@ -2885,7 +2868,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf goto __pyx_L14; } - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":260 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":261 * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< @@ -2898,7 +2881,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf goto __pyx_L14; } - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":261 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":262 * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< @@ -2911,7 +2894,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf goto __pyx_L14; } - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":262 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":263 * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< @@ -2924,7 +2907,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf goto __pyx_L14; } - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":263 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":264 * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< @@ -2937,7 +2920,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf goto __pyx_L14; } - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":264 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":265 * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< @@ -2951,33 +2934,33 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf } /*else*/ { - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":266 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_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_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_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, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); + 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 = 266; __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 = 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_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L14:; - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":267 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":268 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f # <<<<<<<<<<<<<< @@ -2986,7 +2969,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ __pyx_v_info->format = __pyx_v_f; - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":268 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":269 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f * return # <<<<<<<<<<<<<< @@ -2999,7 +2982,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf } /*else*/ { - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":270 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":271 * return * else: * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< @@ -3008,7 +2991,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ __pyx_v_info->format = ((char *)malloc(255)); - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":271 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":272 * else: * info.format = stdlib.malloc(_buffer_format_string_len) * info.format[0] = '^' # Native data types, manual alignment # <<<<<<<<<<<<<< @@ -3017,7 +3000,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ (__pyx_v_info->format[0]) = '^'; - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":272 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":273 * info.format = stdlib.malloc(_buffer_format_string_len) * info.format[0] = '^' # Native data types, manual alignment * offset = 0 # <<<<<<<<<<<<<< @@ -3026,17 +3009,17 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ __pyx_v_offset = 0; - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":275 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":276 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":277 * info.format + _buffer_format_string_len, * &offset) * f[0] = 0 # Terminate format string # <<<<<<<<<<<<<< @@ -3064,12 +3047,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/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":278 +/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":279 * f[0] = 0 # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -3077,13 +3059,12 @@ 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) { +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; __Pyx_RefNannySetupContext("__releasebuffer__"); - __Pyx_INCREF((PyObject *)__pyx_v_self); - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":279 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":280 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -3093,7 +3074,7 @@ static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, P __pyx_t_1 = PyArray_HASFIELDS(((PyArrayObject *)__pyx_v_self)); if (__pyx_t_1) { - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":280 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":281 * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): * stdlib.free(info.format) # <<<<<<<<<<<<<< @@ -3105,7 +3086,7 @@ static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, P } __pyx_L5:; - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":281 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":282 * if PyArray_HASFIELDS(self): * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -3115,7 +3096,7 @@ static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, P __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); if (__pyx_t_1) { - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":282 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":283 * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): * stdlib.free(info.strides) # <<<<<<<<<<<<<< @@ -3127,11 +3108,10 @@ static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, P } __pyx_L6:; - __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_RefNannyFinishContext(); } -/* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":755 +/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":756 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -3144,7 +3124,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1"); - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":756 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":757 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -3152,7 +3132,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; @@ -3170,7 +3150,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":758 +/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":759 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -3183,7 +3163,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2"); - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":759 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":760 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -3191,7 +3171,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; @@ -3209,7 +3189,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":761 +/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":762 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -3222,7 +3202,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3"); - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":762 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":763 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -3230,7 +3210,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; @@ -3248,7 +3228,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":764 +/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":765 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -3261,7 +3241,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4"); - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":765 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":766 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< @@ -3269,7 +3249,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; @@ -3287,7 +3267,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":767 +/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":768 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -3300,7 +3280,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5"); - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":768 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":769 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< @@ -3308,7 +3288,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; @@ -3326,7 +3306,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":770 +/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":771 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -3354,14 +3334,13 @@ 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); - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":777 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":778 * cdef int delta_offset * cdef tuple i * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -3370,7 +3349,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_endian_detector = 1; - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":778 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":779 * cdef tuple i * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -3379,7 +3358,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":781 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":782 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -3389,7 +3368,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 = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } for (;;) { if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break; @@ -3398,21 +3377,21 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_v_childname = __pyx_t_3; __pyx_t_3 = 0; - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":782 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_t_3 = 0; - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":783 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":784 * for childname in descr.names: * fields = descr.fields[childname] * child, new_offset = fields # <<<<<<<<<<<<<< @@ -3422,7 +3401,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); @@ -3432,57 +3411,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 = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":785 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":786 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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 = PyTuple_New(1); 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_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 = 786; __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 = 787; __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 = 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/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":788 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":789 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< @@ -3497,7 +3476,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } if (!__pyx_t_7) { - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":789 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":790 * * if ((child.byteorder == '>' and little_endian) or * (child.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< @@ -3517,29 +3496,29 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } if (__pyx_t_6) { - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":790 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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 = 790; __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 = 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/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":800 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":801 * * # Output padding bytes * while offset[0] < new_offset: # <<<<<<<<<<<<<< @@ -3547,16 +3526,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/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":801 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":802 * # Output padding bytes * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< @@ -3565,7 +3544,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ (__pyx_v_f[0]) = 120; - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":802 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":803 * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte * f += 1 # <<<<<<<<<<<<<< @@ -3574,7 +3553,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f += 1; - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":803 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":804 * f[0] = 120 # "x"; pad byte * f += 1 * offset[0] += 1 # <<<<<<<<<<<<<< @@ -3584,7 +3563,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx (__pyx_v_offset[0]) += 1; } - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":805 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":806 * offset[0] += 1 * * offset[0] += child.itemsize # <<<<<<<<<<<<<< @@ -3593,7 +3572,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ (__pyx_v_offset[0]) += __pyx_v_child->elsize; - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":807 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":808 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -3603,20 +3582,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/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":808 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":809 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":810 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -3626,288 +3605,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) { - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":810 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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 = PyTuple_New(1); 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_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 = 810; __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 = 811; __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 = 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/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":813 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/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" */ - __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_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 = 813; __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 = 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_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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 98; goto __pyx_L11; } - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":814 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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 = 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 = 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_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_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 66; goto __pyx_L11; } - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":815 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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 = 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 = 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_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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 104; goto __pyx_L11; } - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":816 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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 = 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 = 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_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_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 72; goto __pyx_L11; } - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":817 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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 = 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 = 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_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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 105; goto __pyx_L11; } - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":818 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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 = 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 = 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_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_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 73; goto __pyx_L11; } - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":819 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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 = 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 = 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_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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 108; goto __pyx_L11; } - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":820 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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 = 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 = 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_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_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 76; goto __pyx_L11; } - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":821 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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 = 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 = 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_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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 113; goto __pyx_L11; } - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":822 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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 = 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 = 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_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_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 81; goto __pyx_L11; } - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":823 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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 = 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 = 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_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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 102; goto __pyx_L11; } - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":824 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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 = 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 = 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_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_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 100; goto __pyx_L11; } - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":825 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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 = 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 = 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_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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 103; goto __pyx_L11; } - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":826 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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 = 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 = 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_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_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -3916,19 +3895,19 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":827 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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 = 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 = 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_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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -3937,19 +3916,19 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":828 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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 = 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 = 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_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_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -3958,19 +3937,19 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":829 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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 = 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 = 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_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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 79; @@ -3978,30 +3957,30 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } /*else*/ { - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":831 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_GOTREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); + 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 = 831; __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 = 832; __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 = 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/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":832 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":833 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * f += 1 # <<<<<<<<<<<<<< @@ -4013,21 +3992,21 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } /*else*/ { - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":836 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_L9:; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":837 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":838 * # so don't output it * f = _util_dtypestring(child, f, end, offset) * return f # <<<<<<<<<<<<<< @@ -4052,12 +4031,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/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":952 +/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":953 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -4069,10 +4047,8 @@ 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); - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":954 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":955 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -4082,7 +4058,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/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":955 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":956 * cdef PyObject* baseptr * if base is None: * baseptr = NULL # <<<<<<<<<<<<<< @@ -4094,7 +4070,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } /*else*/ { - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":957 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":958 * baseptr = NULL * else: * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< @@ -4103,7 +4079,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_INCREF(__pyx_v_base); - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":958 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":959 * else: * Py_INCREF(base) # important to do this before decref below! * baseptr = base # <<<<<<<<<<<<<< @@ -4114,7 +4090,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } __pyx_L3:; - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":959 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":960 * Py_INCREF(base) # important to do this before decref below! * baseptr = base * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< @@ -4123,7 +4099,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_XDECREF(__pyx_v_arr->base); - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":960 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":961 * baseptr = base * Py_XDECREF(arr.base) * arr.base = baseptr # <<<<<<<<<<<<<< @@ -4132,12 +4108,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/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":962 +/* "/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 * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -4149,9 +4123,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/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":963 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":964 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -4161,7 +4134,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/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":964 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":965 * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: * return None # <<<<<<<<<<<<<< @@ -4176,7 +4149,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py } /*else*/ { - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/numpy.pxd":966 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":967 * return None * else: * return arr.base # <<<<<<<<<<<<<< @@ -4190,19 +4163,16 @@ 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[] = { +static 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, @@ -4278,8 +4248,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 = 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;} + __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;} return 0; __pyx_L1_error:; return -1; @@ -4317,12 +4287,10 @@ 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 ---*/ @@ -4355,15 +4323,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 = 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/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":8 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":8 * * cimport numpy as np * import numpy as np # <<<<<<<<<<<<<< @@ -4375,7 +4343,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/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":9 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":9 * cimport numpy as np * import numpy as np * import numpy.linalg as linalg # <<<<<<<<<<<<<< @@ -4393,7 +4361,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/ogrisel/coding/scikit-learn/scikits/learn/glm/sparse/src/cd_fast_sparse.pyx":1 + /* "/home/fabian/dev/scikit-learn/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx":1 * # Author: Alexandre Gramfort # <<<<<<<<<<<<<< * # Fabian Pedregosa * # Olivier Grisel @@ -4402,7 +4370,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__"); + __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_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;} @@ -4410,11 +4378,12 @@ 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; - /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/stdlib.pxd":2 + /* "/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 * - * cdef extern from "stdlib.h" nogil: # <<<<<<<<<<<<<< - * void free(void *ptr) - * void *malloc(size_t size) + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None */ goto __pyx_L0; __pyx_L1_error:; @@ -4436,15 +4405,14 @@ PyMODINIT_FUNC PyInit_cd_fast_sparse(void) #endif } -static const char *__pyx_filenames[] = { - "cd_fast_sparse.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( @@ -4569,6 +4537,26 @@ static int __Pyx_ParseOptionalKeywords( 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; @@ -4974,7 +4962,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; @@ -5060,6 +5048,10 @@ 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 @@ -5070,35 +5062,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) { @@ -5107,28 +5077,8 @@ 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(); - } -} - -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; + __Pyx_RaiseTooManyValuesError(index); } - 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 @@ -5156,14 +5106,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; @@ -5179,38 +5129,37 @@ 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; -} - static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_npy_int32(npy_int32 val) { - 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)) { + 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))) { return PyInt_FromLong((long)val); - } else if (sizeof(npy_int32) == sizeof(long)) { + } else if ((sizeof(npy_int32) == sizeof(int)) || + (sizeof(npy_int32) == sizeof(long))) { if (is_unsigned) return PyLong_FromUnsignedLong((unsigned long)val); else return PyInt_FromLong((long)val); - } else { /* (sizeof(npy_int32) > sizeof(long)) */ + } else if (sizeof(npy_int32) == sizeof(PY_LONG_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); } } @@ -5645,6 +5594,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; @@ -5892,7 +5860,11 @@ 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, @@ -6033,8 +6005,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/scikits/learn/linear_model/sparse/src/cd_fast_sparse.pyx b/sklearn/linear_model/sparse/src/cd_fast_sparse.pyx similarity index 100% rename from scikits/learn/linear_model/sparse/src/cd_fast_sparse.pyx rename to sklearn/linear_model/sparse/src/cd_fast_sparse.pyx diff --git a/scikits/learn/linear_model/sparse/stochastic_gradient.py b/sklearn/linear_model/sparse/stochastic_gradient.py similarity index 99% rename from scikits/learn/linear_model/sparse/stochastic_gradient.py rename to sklearn/linear_model/sparse/stochastic_gradient.py index 0202838676723..6c6fe5b59f52d 100644 --- a/scikits/learn/linear_model/sparse/stochastic_gradient.py +++ b/sklearn/linear_model/sparse/stochastic_gradient.py @@ -105,7 +105,7 @@ class SGDClassifier(BaseSGDClassifier): Examples -------- >>> import numpy as np - >>> from scikits.learn import linear_model + >>> from sklearn 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 scikits.learn import linear_model + >>> from sklearn import linear_model >>> n_samples, n_features = 10, 5 >>> np.random.seed(0) >>> y = np.random.randn(n_samples) diff --git a/scikits/learn/linear_model/sparse/tests/__init__.py b/sklearn/linear_model/sparse/tests/__init__.py similarity index 100% rename from scikits/learn/linear_model/sparse/tests/__init__.py rename to sklearn/linear_model/sparse/tests/__init__.py diff --git a/scikits/learn/linear_model/sparse/tests/test_coordinate_descent.py b/sklearn/linear_model/sparse/tests/test_coordinate_descent.py similarity index 94% rename from scikits/learn/linear_model/sparse/tests/test_coordinate_descent.py rename to sklearn/linear_model/sparse/tests/test_coordinate_descent.py index 90e5cee442698..0a5d0c74528ab 100644 --- a/scikits/learn/linear_model/sparse/tests/test_coordinate_descent.py +++ b/sklearn/linear_model/sparse/tests/test_coordinate_descent.py @@ -4,10 +4,10 @@ from numpy.testing import assert_almost_equal from numpy.testing import assert_equal -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 +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 def test_sparse_predict(): diff --git a/scikits/learn/linear_model/sparse/tests/test_logistic.py b/sklearn/linear_model/sparse/tests/test_logistic.py similarity index 95% rename from scikits/learn/linear_model/sparse/tests/test_logistic.py rename to sklearn/linear_model/sparse/tests/test_logistic.py index 81274cda47607..564b888e0eec5 100644 --- a/scikits/learn/linear_model/sparse/tests/test_logistic.py +++ b/sklearn/linear_model/sparse/tests/test_logistic.py @@ -4,8 +4,8 @@ import nose from nose.tools import assert_raises -from scikits.learn.linear_model.sparse import logistic -from scikits.learn import datasets +from sklearn.linear_model.sparse import logistic +from sklearn import datasets import scipy.sparse as sp diff --git a/scikits/learn/linear_model/stochastic_gradient.py b/sklearn/linear_model/stochastic_gradient.py similarity index 99% rename from scikits/learn/linear_model/stochastic_gradient.py rename to sklearn/linear_model/stochastic_gradient.py index 62f5695ddd00e..1c7d2d94990fd 100644 --- a/scikits/learn/linear_model/stochastic_gradient.py +++ b/sklearn/linear_model/stochastic_gradient.py @@ -98,7 +98,7 @@ class SGDClassifier(BaseSGDClassifier): Examples -------- >>> import numpy as np - >>> from scikits.learn import linear_model + >>> from sklearn 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 scikits.learn import linear_model + >>> from sklearn import linear_model >>> n_samples, n_features = 10, 5 >>> np.random.seed(0) >>> y = np.random.randn(n_samples) diff --git a/scikits/learn/linear_model/tests/__init__.py b/sklearn/linear_model/tests/__init__.py similarity index 100% rename from scikits/learn/linear_model/tests/__init__.py rename to sklearn/linear_model/tests/__init__.py diff --git a/scikits/learn/linear_model/tests/test_base.py b/sklearn/linear_model/tests/test_base.py similarity index 100% rename from scikits/learn/linear_model/tests/test_base.py rename to sklearn/linear_model/tests/test_base.py diff --git a/scikits/learn/linear_model/tests/test_bayes.py b/sklearn/linear_model/tests/test_bayes.py similarity index 97% rename from scikits/learn/linear_model/tests/test_bayes.py rename to sklearn/linear_model/tests/test_bayes.py index 6c94ebacbe52f..f5048c24d65fc 100644 --- a/scikits/learn/linear_model/tests/test_bayes.py +++ b/sklearn/linear_model/tests/test_bayes.py @@ -11,7 +11,7 @@ from ..bayes import BayesianRidge, ARDRegression -from scikits.learn import datasets +from sklearn import datasets def test_bayesian_on_diabetes(): diff --git a/scikits/learn/linear_model/tests/test_coordinate_descent.py b/sklearn/linear_model/tests/test_coordinate_descent.py similarity index 100% rename from scikits/learn/linear_model/tests/test_coordinate_descent.py rename to sklearn/linear_model/tests/test_coordinate_descent.py diff --git a/scikits/learn/linear_model/tests/test_least_angle.py b/sklearn/linear_model/tests/test_least_angle.py similarity index 99% rename from scikits/learn/linear_model/tests/test_least_angle.py rename to sklearn/linear_model/tests/test_least_angle.py index ceadcb33cf65c..1f954bb610916 100644 --- a/scikits/learn/linear_model/tests/test_least_angle.py +++ b/sklearn/linear_model/tests/test_least_angle.py @@ -1,7 +1,7 @@ import numpy as np from numpy.testing import assert_array_almost_equal -from scikits.learn import linear_model, datasets +from sklearn import linear_model, datasets diabetes = datasets.load_diabetes() X, y = diabetes.data, diabetes.target diff --git a/scikits/learn/linear_model/tests/test_logistic.py b/sklearn/linear_model/tests/test_logistic.py similarity index 96% rename from scikits/learn/linear_model/tests/test_logistic.py rename to sklearn/linear_model/tests/test_logistic.py index 83bc11f7316f1..0f3785160acfa 100644 --- a/scikits/learn/linear_model/tests/test_logistic.py +++ b/sklearn/linear_model/tests/test_logistic.py @@ -4,8 +4,8 @@ import nose from nose.tools import assert_raises, raises -from scikits.learn.linear_model import logistic -from scikits.learn import datasets +from sklearn.linear_model import logistic +from sklearn import datasets X = [[-1, 0], [0, 1], [1, 1]] Y1 = [0, 1, 1] diff --git a/scikits/learn/linear_model/tests/test_omp.py b/sklearn/linear_model/tests/test_omp.py similarity index 100% rename from scikits/learn/linear_model/tests/test_omp.py rename to sklearn/linear_model/tests/test_omp.py diff --git a/scikits/learn/linear_model/tests/test_ridge.py b/sklearn/linear_model/tests/test_ridge.py similarity index 94% rename from scikits/learn/linear_model/tests/test_ridge.py rename to sklearn/linear_model/tests/test_ridge.py index d5ca7fb31b849..85761972f4e4c 100644 --- a/scikits/learn/linear_model/tests/test_ridge.py +++ b/sklearn/linear_model/tests/test_ridge.py @@ -4,19 +4,19 @@ from numpy.testing import assert_almost_equal, assert_array_almost_equal, \ assert_equal, assert_array_equal -from scikits.learn import datasets -from scikits.learn.metrics import mean_square_error +from sklearn import datasets +from sklearn.metrics import mean_square_error -from scikits.learn.linear_model.base import LinearRegression +from sklearn.linear_model.base import LinearRegression -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.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.cross_val import KFold +from sklearn.cross_val import KFold diabetes = datasets.load_diabetes() diff --git a/scikits/learn/linear_model/tests/test_sgd.py b/sklearn/linear_model/tests/test_sgd.py similarity index 99% rename from scikits/learn/linear_model/tests/test_sgd.py rename to sklearn/linear_model/tests/test_sgd.py index 58e3e086ca3de..331116aecd822 100644 --- a/scikits/learn/linear_model/tests/test_sgd.py +++ b/sklearn/linear_model/tests/test_sgd.py @@ -2,8 +2,8 @@ from numpy.testing import assert_array_equal, assert_approx_equal from numpy.testing import assert_almost_equal, assert_array_almost_equal -from scikits.learn import linear_model, datasets, metrics -from scikits.learn import preprocessing +from sklearn import linear_model, datasets, metrics +from sklearn import preprocessing import unittest from nose.tools import raises diff --git a/scikits/learn/manifold/__init__.py b/sklearn/manifold/__init__.py similarity index 100% rename from scikits/learn/manifold/__init__.py rename to sklearn/manifold/__init__.py diff --git a/scikits/learn/manifold/isomap.py b/sklearn/manifold/isomap.py similarity index 99% rename from scikits/learn/manifold/isomap.py rename to sklearn/manifold/isomap.py index c78fed1707512..98015b76e03da 100644 --- a/scikits/learn/manifold/isomap.py +++ b/sklearn/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_` : scikits.learn.neighbors.BallTree instance + `ball_tree_` : sklearn.neighbors.BallTree instance Stores ball tree of training data for faster transform `dist_matrix_` : array-like, shape (n_samples, n_samples) diff --git a/scikits/learn/manifold/locally_linear.py b/sklearn/manifold/locally_linear.py similarity index 100% rename from scikits/learn/manifold/locally_linear.py rename to sklearn/manifold/locally_linear.py diff --git a/scikits/learn/manifold/tests/test_isomap.py b/sklearn/manifold/tests/test_isomap.py similarity index 94% rename from scikits/learn/manifold/tests/test_isomap.py rename to sklearn/manifold/tests/test_isomap.py index 19e66259b7227..b89fe9124bb3e 100644 --- a/scikits/learn/manifold/tests/test_isomap.py +++ b/sklearn/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 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 +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 eigen_solvers = ['auto', 'dense', 'arpack'] path_methods = ['auto', 'FW', 'D'] diff --git a/scikits/learn/manifold/tests/test_locally_linear.py b/sklearn/manifold/tests/test_locally_linear.py similarity index 95% rename from scikits/learn/manifold/tests/test_locally_linear.py rename to sklearn/manifold/tests/test_locally_linear.py index 01007484d72e8..1a89516d62345 100644 --- a/scikits/learn/manifold/tests/test_locally_linear.py +++ b/sklearn/manifold/tests/test_locally_linear.py @@ -1,8 +1,8 @@ import numpy as np from numpy.testing import assert_almost_equal -from scikits.learn import neighbors, manifold -from scikits.learn.utils.fixes import product +from sklearn import neighbors, manifold +from sklearn.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 scikits.learn import pipeline, datasets + from sklearn import pipeline, datasets iris = datasets.load_iris() clf = pipeline.Pipeline( [('filter', manifold.LocallyLinearEmbedding()), diff --git a/scikits/learn/metrics/__init__.py b/sklearn/metrics/__init__.py similarity index 100% rename from scikits/learn/metrics/__init__.py rename to sklearn/metrics/__init__.py diff --git a/scikits/learn/metrics/cluster.py b/sklearn/metrics/cluster.py similarity index 98% rename from scikits/learn/metrics/cluster.py rename to sklearn/metrics/cluster.py index 2dc3fd2546b58..1bc242937f9ac 100644 --- a/scikits/learn/metrics/cluster.py +++ b/sklearn/metrics/cluster.py @@ -158,7 +158,7 @@ def homogeneity_score(labels_true, labels_pred): Perfect labelings are homegenous:: - >>> from scikits.learn.metrics.cluster import homogeneity_score + >>> from sklearn.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 scikits.learn.metrics.cluster import completeness_score + >>> from sklearn.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 scikits.learn.metrics.cluster import v_measure_score + >>> from sklearn.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/scikits/learn/metrics/metrics.py b/sklearn/metrics/metrics.py similarity index 99% rename from scikits/learn/metrics/metrics.py rename to sklearn/metrics/metrics.py index 18903e1684a82..4704788db5599 100644 --- a/scikits/learn/metrics/metrics.py +++ b/sklearn/metrics/metrics.py @@ -99,7 +99,7 @@ def roc_curve(y_true, y_score): Examples -------- >>> import numpy as np - >>> from scikits.learn import metrics + >>> from sklearn 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 scikits.learn import metrics + >>> from sklearn 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/scikits/learn/metrics/pairwise.py b/sklearn/metrics/pairwise.py similarity index 98% rename from scikits/learn/metrics/pairwise.py rename to sklearn/metrics/pairwise.py index 4bc270d49d3b5..c92dc3862d0e0 100644 --- a/scikits/learn/metrics/pairwise.py +++ b/sklearn/metrics/pairwise.py @@ -91,7 +91,7 @@ def euclidean_distances(X, Y=None, Y_norm_squared=None, squared=False): Examples -------- - >>> from scikits.learn.metrics.pairwise import euclidean_distances + >>> from sklearn.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 scikits.learn.metrics.pairwise import l1_distances + >>> from sklearn.metrics.pairwise import l1_distances >>> l1_distances(3, 3) array([[0]]) >>> l1_distances(3, 2) diff --git a/scikits/learn/metrics/tests/__init__.py b/sklearn/metrics/tests/__init__.py similarity index 100% rename from scikits/learn/metrics/tests/__init__.py rename to sklearn/metrics/tests/__init__.py diff --git a/scikits/learn/metrics/tests/test_cluster.py b/sklearn/metrics/tests/test_cluster.py similarity index 88% rename from scikits/learn/metrics/tests/test_cluster.py rename to sklearn/metrics/tests/test_cluster.py index 7307a4e55a8d1..e62379b2efd9a 100644 --- a/scikits/learn/metrics/tests/test_cluster.py +++ b/sklearn/metrics/tests/test_cluster.py @@ -1,8 +1,8 @@ -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 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 nose.tools import assert_almost_equal diff --git a/scikits/learn/metrics/tests/test_metrics.py b/sklearn/metrics/tests/test_metrics.py similarity index 100% rename from scikits/learn/metrics/tests/test_metrics.py rename to sklearn/metrics/tests/test_metrics.py diff --git a/scikits/learn/metrics/tests/test_pairwise.py b/sklearn/metrics/tests/test_pairwise.py similarity index 100% rename from scikits/learn/metrics/tests/test_pairwise.py rename to sklearn/metrics/tests/test_pairwise.py diff --git a/scikits/learn/mixture/__init__.py b/sklearn/mixture/__init__.py similarity index 100% rename from scikits/learn/mixture/__init__.py rename to sklearn/mixture/__init__.py diff --git a/scikits/learn/mixture/dpgmm.py b/sklearn/mixture/dpgmm.py similarity index 100% rename from scikits/learn/mixture/dpgmm.py rename to sklearn/mixture/dpgmm.py diff --git a/scikits/learn/mixture/gmm.py b/sklearn/mixture/gmm.py similarity index 99% rename from scikits/learn/mixture/gmm.py rename to sklearn/mixture/gmm.py index 54aeff41eac06..7fc4276a693ce 100644 --- a/scikits/learn/mixture/gmm.py +++ b/sklearn/mixture/gmm.py @@ -198,7 +198,7 @@ class GMM(BaseEstimator): Examples -------- >>> import numpy as np - >>> from scikits.learn import mixture + >>> from sklearn import mixture >>> np.random.seed(1) >>> g = mixture.GMM(n_components=2) diff --git a/scikits/learn/mixture/tests/__init__.py b/sklearn/mixture/tests/__init__.py similarity index 100% rename from scikits/learn/mixture/tests/__init__.py rename to sklearn/mixture/tests/__init__.py diff --git a/scikits/learn/mixture/tests/test_dpgmm.py b/sklearn/mixture/tests/test_dpgmm.py similarity index 93% rename from scikits/learn/mixture/tests/test_dpgmm.py rename to sklearn/mixture/tests/test_dpgmm.py index 516882bf157cf..e65b8a2ce84af 100644 --- a/scikits/learn/mixture/tests/test_dpgmm.py +++ b/sklearn/mixture/tests/test_dpgmm.py @@ -4,8 +4,8 @@ import numpy as np -from scikits.learn.mixture import DPGMM, VBGMM -from scikits.learn.mixture.dpgmm import log_normalize +from sklearn.mixture import DPGMM, VBGMM +from sklearn.mixture.dpgmm import log_normalize from .test_gmm import GMMTester np.seterr(all='warn') diff --git a/scikits/learn/mixture/tests/test_gmm.py b/sklearn/mixture/tests/test_gmm.py similarity index 98% rename from scikits/learn/mixture/tests/test_gmm.py rename to sklearn/mixture/tests/test_gmm.py index 4618e13d339fa..dd11fc75ca6c2 100644 --- a/scikits/learn/mixture/tests/test_gmm.py +++ b/sklearn/mixture/tests/test_gmm.py @@ -6,8 +6,8 @@ assert_raises from scipy import stats -from scikits.learn import mixture -from scikits.learn.datasets.samples_generator import make_spd_matrix +from sklearn import mixture +from sklearn.datasets.samples_generator import make_spd_matrix rng = np.random.RandomState(0) diff --git a/scikits/learn/multiclass.py b/sklearn/multiclass.py similarity index 100% rename from scikits/learn/multiclass.py rename to sklearn/multiclass.py diff --git a/scikits/learn/naive_bayes.py b/sklearn/naive_bayes.py similarity index 98% rename from scikits/learn/naive_bayes.py rename to sklearn/naive_bayes.py index 4c71c33bdb05f..3680efdff5772 100644 --- a/scikits/learn/naive_bayes.py +++ b/sklearn/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 scikits.learn.naive_bayes import GaussianNB + >>> from sklearn.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 scikits.learn.naive_bayes import MultinomialNB + >>> from sklearn.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 scikits.learn.naive_bayes import BernoulliNB + >>> from sklearn.naive_bayes import BernoulliNB >>> clf = BernoulliNB() >>> clf.fit(X, Y) BernoulliNB(alpha=1.0, binarize=0.0, fit_prior=True) diff --git a/scikits/learn/neighbors.py b/sklearn/neighbors.py similarity index 98% rename from scikits/learn/neighbors.py rename to sklearn/neighbors.py index 4cfd05b320c5e..495f51c187533 100644 --- a/scikits/learn/neighbors.py +++ b/sklearn/neighbors.py @@ -41,7 +41,7 @@ class NeighborsClassifier(BaseEstimator, ClassifierMixin): -------- >>> samples = [[0, 0, 2], [1, 0, 0]] >>> labels = [0, 1] - >>> from scikits.learn.neighbors import NeighborsClassifier + >>> from sklearn.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 from an array representing our data set and ask who's >>> samples = [[0., 0., 0.], [0., .5, 0.], [1., 1., .5]] >>> labels = [0, 0, 1] - >>> from scikits.learn.neighbors import NeighborsClassifier + >>> from sklearn.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 scikits.learn.neighbors import NeighborsRegressor + >>> from sklearn.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 scikits.learn.neighbors import kneighbors_graph + >>> from sklearn.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 scikits.learn.neighbors import radius_neighbors_graph + >>> from sklearn.neighbors import radius_neighbors_graph >>> A = radius_neighbors_graph(X, 1.5) >>> A.todense() matrix([[ 1., 0., 1.], diff --git a/scikits/learn/pipeline.py b/sklearn/pipeline.py similarity index 95% rename from scikits/learn/pipeline.py rename to sklearn/pipeline.py index d871a19aea487..7815b7ae79358 100644 --- a/scikits/learn/pipeline.py +++ b/sklearn/pipeline.py @@ -57,11 +57,11 @@ class Pipeline(BaseEstimator): Example ======= - >>> 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 + >>> 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 >>> # generate some data to play with >>> X, y = samples_generator.make_classification( diff --git a/scikits/learn/pls.py b/sklearn/pls.py similarity index 99% rename from scikits/learn/pls.py rename to sklearn/pls.py index 3d8a1235f05be..e1d15f4e2fab0 100644 --- a/scikits/learn/pls.py +++ b/sklearn/pls.py @@ -5,7 +5,7 @@ # License: BSD Style. from .base import BaseEstimator -#from scikits.learn.base import BaseEstimator +#from sklearn.base import BaseEstimator import warnings import numpy as np from scipy import linalg @@ -468,7 +468,7 @@ class PLSRegression(_PLS): Examples -------- - >>> from scikits.learn.pls import PLSCanonical, PLSRegression, CCA + >>> from sklearn.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 scikits.learn.pls import PLSCanonical, PLSRegression, CCA + >>> from sklearn.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 scikits.learn.pls import PLSCanonical, PLSRegression, CCA + >>> from sklearn.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/scikits/learn/preprocessing/__init__.py b/sklearn/preprocessing/__init__.py similarity index 96% rename from scikits/learn/preprocessing/__init__.py rename to sklearn/preprocessing/__init__.py index 45a8a9b23b3fe..32cd8b6379b99 100644 --- a/scikits/learn/preprocessing/__init__.py +++ b/sklearn/preprocessing/__init__.py @@ -70,9 +70,9 @@ def scale(X, axis=0, with_mean=True, with_std=True, copy=True): See also -------- - :class:`scikits.learn.preprocessing.Scaler` to perform centering and + :class:`sklearn.preprocessing.Scaler` to perform centering and scaling using the ``Transformer`` API (e.g. as part of a preprocessing - :class:`scikits.learn.pipeline.Pipeline`) + :class:`sklearn.pipeline.Pipeline`) """ if sp.issparse(X): raise NotImplementedError( @@ -135,10 +135,10 @@ class Scaler(BaseEstimator, TransformerMixin): See also -------- - :func:`scikits.learn.preprocessing.scale` to perform centering and + :func:`sklearn.preprocessing.scale` to perform centering and scaling without using the ``Transformer`` object oriented API - :class:`scikits.learn.decomposition.RandomizedPCA` with `whiten=True` + :class:`sklearn.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:`scikits.learn.preprocessing.Normalizer` to perform normalization + :class:`sklearn.preprocessing.Normalizer` to perform normalization using the ``Transformer`` API (e.g. as part of a preprocessing - :class:`scikits.learn.pipeline.Pipeline`) + :class:`sklearn.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:`scikits.learn.preprocessing.normalize` equivalent function + :func:`sklearn.preprocessing.normalize` equivalent function without the object oriented API """ @@ -352,9 +352,9 @@ def binarize(X, threshold=0.0, copy=True): See also -------- - :class:`scikits.learn.preprocessing.Binarizer` to perform binarization + :class:`sklearn.preprocessing.Binarizer` to perform binarization using the ``Transformer`` API (e.g. as part of a preprocessing - :class:`scikits.learn.pipeline.Pipeline`) + :class:`sklearn.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 scikits.learn import preprocessing + >>> from sklearn 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 - scikits.learn.preprocessing.Scaler(with_std=False). + sklearn.preprocessing.Scaler(with_std=False). """ def fit(self, K): diff --git a/scikits/learn/preprocessing/setup.py b/sklearn/preprocessing/setup.py similarity index 100% rename from scikits/learn/preprocessing/setup.py rename to sklearn/preprocessing/setup.py diff --git a/scikits/learn/preprocessing/src/_preprocessing.c b/sklearn/preprocessing/src/_preprocessing.c similarity index 100% rename from scikits/learn/preprocessing/src/_preprocessing.c rename to sklearn/preprocessing/src/_preprocessing.c diff --git a/scikits/learn/preprocessing/src/_preprocessing.pyx b/sklearn/preprocessing/src/_preprocessing.pyx similarity index 100% rename from scikits/learn/preprocessing/src/_preprocessing.pyx rename to sklearn/preprocessing/src/_preprocessing.pyx diff --git a/scikits/learn/preprocessing/tests/__init__.py b/sklearn/preprocessing/tests/__init__.py similarity index 100% rename from scikits/learn/preprocessing/tests/__init__.py rename to sklearn/preprocessing/tests/__init__.py diff --git a/scikits/learn/preprocessing/tests/test_preprocessing.py b/sklearn/preprocessing/tests/test_preprocessing.py similarity index 96% rename from scikits/learn/preprocessing/tests/test_preprocessing.py rename to sklearn/preprocessing/tests/test_preprocessing.py index 446a1c63adf54..330d5902b9803 100644 --- a/scikits/learn/preprocessing/tests/test_preprocessing.py +++ b/sklearn/preprocessing/tests/test_preprocessing.py @@ -9,16 +9,16 @@ from nose.tools import assert_raises -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 +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 np.random.seed(0) diff --git a/scikits/learn/qda.py b/sklearn/qda.py similarity index 99% rename from scikits/learn/qda.py rename to sklearn/qda.py index b275410dc50a0..37784b778b78c 100644 --- a/scikits/learn/qda.py +++ b/sklearn/qda.py @@ -45,7 +45,7 @@ class QDA(BaseEstimator, ClassifierMixin): Examples -------- - >>> from scikits.learn.qda import QDA + >>> from sklearn.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/scikits/learn/setup.py b/sklearn/setup.py similarity index 100% rename from scikits/learn/setup.py rename to sklearn/setup.py diff --git a/scikits/learn/src/cblas/ATL_drefcopy.c b/sklearn/src/cblas/ATL_drefcopy.c similarity index 100% rename from scikits/learn/src/cblas/ATL_drefcopy.c rename to sklearn/src/cblas/ATL_drefcopy.c diff --git a/scikits/learn/src/cblas/ATL_drefrot.c b/sklearn/src/cblas/ATL_drefrot.c similarity index 100% rename from scikits/learn/src/cblas/ATL_drefrot.c rename to sklearn/src/cblas/ATL_drefrot.c diff --git a/scikits/learn/src/cblas/ATL_drefrotg.c b/sklearn/src/cblas/ATL_drefrotg.c similarity index 100% rename from scikits/learn/src/cblas/ATL_drefrotg.c rename to sklearn/src/cblas/ATL_drefrotg.c diff --git a/scikits/learn/src/cblas/ATL_dreftrsv.c b/sklearn/src/cblas/ATL_dreftrsv.c similarity index 100% rename from scikits/learn/src/cblas/ATL_dreftrsv.c rename to sklearn/src/cblas/ATL_dreftrsv.c diff --git a/scikits/learn/src/cblas/ATL_dreftrsvLNN.c b/sklearn/src/cblas/ATL_dreftrsvLNN.c similarity index 100% rename from scikits/learn/src/cblas/ATL_dreftrsvLNN.c rename to sklearn/src/cblas/ATL_dreftrsvLNN.c diff --git a/scikits/learn/src/cblas/ATL_dreftrsvLNU.c b/sklearn/src/cblas/ATL_dreftrsvLNU.c similarity index 100% rename from scikits/learn/src/cblas/ATL_dreftrsvLNU.c rename to sklearn/src/cblas/ATL_dreftrsvLNU.c diff --git a/scikits/learn/src/cblas/ATL_dreftrsvLTN.c b/sklearn/src/cblas/ATL_dreftrsvLTN.c similarity index 100% rename from scikits/learn/src/cblas/ATL_dreftrsvLTN.c rename to sklearn/src/cblas/ATL_dreftrsvLTN.c diff --git a/scikits/learn/src/cblas/ATL_dreftrsvLTU.c b/sklearn/src/cblas/ATL_dreftrsvLTU.c similarity index 100% rename from scikits/learn/src/cblas/ATL_dreftrsvLTU.c rename to sklearn/src/cblas/ATL_dreftrsvLTU.c diff --git a/scikits/learn/src/cblas/ATL_dreftrsvUNN.c b/sklearn/src/cblas/ATL_dreftrsvUNN.c similarity index 100% rename from scikits/learn/src/cblas/ATL_dreftrsvUNN.c rename to sklearn/src/cblas/ATL_dreftrsvUNN.c diff --git a/scikits/learn/src/cblas/ATL_dreftrsvUNU.c b/sklearn/src/cblas/ATL_dreftrsvUNU.c similarity index 100% rename from scikits/learn/src/cblas/ATL_dreftrsvUNU.c rename to sklearn/src/cblas/ATL_dreftrsvUNU.c diff --git a/scikits/learn/src/cblas/ATL_dreftrsvUTN.c b/sklearn/src/cblas/ATL_dreftrsvUTN.c similarity index 100% rename from scikits/learn/src/cblas/ATL_dreftrsvUTN.c rename to sklearn/src/cblas/ATL_dreftrsvUTN.c diff --git a/scikits/learn/src/cblas/ATL_dreftrsvUTU.c b/sklearn/src/cblas/ATL_dreftrsvUTU.c similarity index 100% rename from scikits/learn/src/cblas/ATL_dreftrsvUTU.c rename to sklearn/src/cblas/ATL_dreftrsvUTU.c diff --git a/scikits/learn/src/cblas/ATL_srefcopy.c b/sklearn/src/cblas/ATL_srefcopy.c similarity index 100% rename from scikits/learn/src/cblas/ATL_srefcopy.c rename to sklearn/src/cblas/ATL_srefcopy.c diff --git a/scikits/learn/src/cblas/ATL_srefrot.c b/sklearn/src/cblas/ATL_srefrot.c similarity index 100% rename from scikits/learn/src/cblas/ATL_srefrot.c rename to sklearn/src/cblas/ATL_srefrot.c diff --git a/scikits/learn/src/cblas/ATL_srefrotg.c b/sklearn/src/cblas/ATL_srefrotg.c similarity index 100% rename from scikits/learn/src/cblas/ATL_srefrotg.c rename to sklearn/src/cblas/ATL_srefrotg.c diff --git a/scikits/learn/src/cblas/ATL_sreftrsv.c b/sklearn/src/cblas/ATL_sreftrsv.c similarity index 100% rename from scikits/learn/src/cblas/ATL_sreftrsv.c rename to sklearn/src/cblas/ATL_sreftrsv.c diff --git a/scikits/learn/src/cblas/ATL_sreftrsvLNN.c b/sklearn/src/cblas/ATL_sreftrsvLNN.c similarity index 100% rename from scikits/learn/src/cblas/ATL_sreftrsvLNN.c rename to sklearn/src/cblas/ATL_sreftrsvLNN.c diff --git a/scikits/learn/src/cblas/ATL_sreftrsvLNU.c b/sklearn/src/cblas/ATL_sreftrsvLNU.c similarity index 100% rename from scikits/learn/src/cblas/ATL_sreftrsvLNU.c rename to sklearn/src/cblas/ATL_sreftrsvLNU.c diff --git a/scikits/learn/src/cblas/ATL_sreftrsvLTN.c b/sklearn/src/cblas/ATL_sreftrsvLTN.c similarity index 100% rename from scikits/learn/src/cblas/ATL_sreftrsvLTN.c rename to sklearn/src/cblas/ATL_sreftrsvLTN.c diff --git a/scikits/learn/src/cblas/ATL_sreftrsvLTU.c b/sklearn/src/cblas/ATL_sreftrsvLTU.c similarity index 100% rename from scikits/learn/src/cblas/ATL_sreftrsvLTU.c rename to sklearn/src/cblas/ATL_sreftrsvLTU.c diff --git a/scikits/learn/src/cblas/ATL_sreftrsvUNN.c b/sklearn/src/cblas/ATL_sreftrsvUNN.c similarity index 100% rename from scikits/learn/src/cblas/ATL_sreftrsvUNN.c rename to sklearn/src/cblas/ATL_sreftrsvUNN.c diff --git a/scikits/learn/src/cblas/ATL_sreftrsvUNU.c b/sklearn/src/cblas/ATL_sreftrsvUNU.c similarity index 100% rename from scikits/learn/src/cblas/ATL_sreftrsvUNU.c rename to sklearn/src/cblas/ATL_sreftrsvUNU.c diff --git a/scikits/learn/src/cblas/ATL_sreftrsvUTN.c b/sklearn/src/cblas/ATL_sreftrsvUTN.c similarity index 100% rename from scikits/learn/src/cblas/ATL_sreftrsvUTN.c rename to sklearn/src/cblas/ATL_sreftrsvUTN.c diff --git a/scikits/learn/src/cblas/ATL_sreftrsvUTU.c b/sklearn/src/cblas/ATL_sreftrsvUTU.c similarity index 100% rename from scikits/learn/src/cblas/ATL_sreftrsvUTU.c rename to sklearn/src/cblas/ATL_sreftrsvUTU.c diff --git a/scikits/learn/src/cblas/README.txt b/sklearn/src/cblas/README.txt similarity index 100% rename from scikits/learn/src/cblas/README.txt rename to sklearn/src/cblas/README.txt diff --git a/scikits/learn/src/cblas/atlas_aux.h b/sklearn/src/cblas/atlas_aux.h similarity index 100% rename from scikits/learn/src/cblas/atlas_aux.h rename to sklearn/src/cblas/atlas_aux.h diff --git a/scikits/learn/src/cblas/atlas_dsysinfo.h b/sklearn/src/cblas/atlas_dsysinfo.h similarity index 100% rename from scikits/learn/src/cblas/atlas_dsysinfo.h rename to sklearn/src/cblas/atlas_dsysinfo.h diff --git a/scikits/learn/src/cblas/atlas_enum.h b/sklearn/src/cblas/atlas_enum.h similarity index 100% rename from scikits/learn/src/cblas/atlas_enum.h rename to sklearn/src/cblas/atlas_enum.h diff --git a/scikits/learn/src/cblas/atlas_level1.h b/sklearn/src/cblas/atlas_level1.h similarity index 100% rename from scikits/learn/src/cblas/atlas_level1.h rename to sklearn/src/cblas/atlas_level1.h diff --git a/scikits/learn/src/cblas/atlas_level2.h b/sklearn/src/cblas/atlas_level2.h similarity index 100% rename from scikits/learn/src/cblas/atlas_level2.h rename to sklearn/src/cblas/atlas_level2.h diff --git a/scikits/learn/src/cblas/atlas_misc.h b/sklearn/src/cblas/atlas_misc.h similarity index 100% rename from scikits/learn/src/cblas/atlas_misc.h rename to sklearn/src/cblas/atlas_misc.h diff --git a/scikits/learn/src/cblas/atlas_refalias1.h b/sklearn/src/cblas/atlas_refalias1.h similarity index 100% rename from scikits/learn/src/cblas/atlas_refalias1.h rename to sklearn/src/cblas/atlas_refalias1.h diff --git a/scikits/learn/src/cblas/atlas_refalias2.h b/sklearn/src/cblas/atlas_refalias2.h similarity index 100% rename from scikits/learn/src/cblas/atlas_refalias2.h rename to sklearn/src/cblas/atlas_refalias2.h diff --git a/scikits/learn/src/cblas/atlas_reflevel1.h b/sklearn/src/cblas/atlas_reflevel1.h similarity index 100% rename from scikits/learn/src/cblas/atlas_reflevel1.h rename to sklearn/src/cblas/atlas_reflevel1.h diff --git a/scikits/learn/src/cblas/atlas_reflevel2.h b/sklearn/src/cblas/atlas_reflevel2.h similarity index 100% rename from scikits/learn/src/cblas/atlas_reflevel2.h rename to sklearn/src/cblas/atlas_reflevel2.h diff --git a/scikits/learn/src/cblas/atlas_reflvl2.h b/sklearn/src/cblas/atlas_reflvl2.h similarity index 100% rename from scikits/learn/src/cblas/atlas_reflvl2.h rename to sklearn/src/cblas/atlas_reflvl2.h diff --git a/scikits/learn/src/cblas/atlas_refmisc.h b/sklearn/src/cblas/atlas_refmisc.h similarity index 100% rename from scikits/learn/src/cblas/atlas_refmisc.h rename to sklearn/src/cblas/atlas_refmisc.h diff --git a/scikits/learn/src/cblas/atlas_ssysinfo.h b/sklearn/src/cblas/atlas_ssysinfo.h similarity index 100% rename from scikits/learn/src/cblas/atlas_ssysinfo.h rename to sklearn/src/cblas/atlas_ssysinfo.h diff --git a/scikits/learn/src/cblas/atlas_type.h b/sklearn/src/cblas/atlas_type.h similarity index 100% rename from scikits/learn/src/cblas/atlas_type.h rename to sklearn/src/cblas/atlas_type.h diff --git a/scikits/learn/src/cblas/cblas.h b/sklearn/src/cblas/cblas.h similarity index 100% rename from scikits/learn/src/cblas/cblas.h rename to sklearn/src/cblas/cblas.h diff --git a/scikits/learn/src/cblas/cblas_daxpy.c b/sklearn/src/cblas/cblas_daxpy.c similarity index 100% rename from scikits/learn/src/cblas/cblas_daxpy.c rename to sklearn/src/cblas/cblas_daxpy.c diff --git a/scikits/learn/src/cblas/cblas_dcopy.c b/sklearn/src/cblas/cblas_dcopy.c similarity index 100% rename from scikits/learn/src/cblas/cblas_dcopy.c rename to sklearn/src/cblas/cblas_dcopy.c diff --git a/scikits/learn/src/cblas/cblas_ddot.c b/sklearn/src/cblas/cblas_ddot.c similarity index 100% rename from scikits/learn/src/cblas/cblas_ddot.c rename to sklearn/src/cblas/cblas_ddot.c diff --git a/scikits/learn/src/cblas/cblas_dnrm2.c b/sklearn/src/cblas/cblas_dnrm2.c similarity index 100% rename from scikits/learn/src/cblas/cblas_dnrm2.c rename to sklearn/src/cblas/cblas_dnrm2.c diff --git a/scikits/learn/src/cblas/cblas_drot.c b/sklearn/src/cblas/cblas_drot.c similarity index 100% rename from scikits/learn/src/cblas/cblas_drot.c rename to sklearn/src/cblas/cblas_drot.c diff --git a/scikits/learn/src/cblas/cblas_drotg.c b/sklearn/src/cblas/cblas_drotg.c similarity index 100% rename from scikits/learn/src/cblas/cblas_drotg.c rename to sklearn/src/cblas/cblas_drotg.c diff --git a/scikits/learn/src/cblas/cblas_dscal.c b/sklearn/src/cblas/cblas_dscal.c similarity index 100% rename from scikits/learn/src/cblas/cblas_dscal.c rename to sklearn/src/cblas/cblas_dscal.c diff --git a/scikits/learn/src/cblas/cblas_dtrsv.c b/sklearn/src/cblas/cblas_dtrsv.c similarity index 100% rename from scikits/learn/src/cblas/cblas_dtrsv.c rename to sklearn/src/cblas/cblas_dtrsv.c diff --git a/scikits/learn/src/cblas/cblas_errprn.c b/sklearn/src/cblas/cblas_errprn.c similarity index 100% rename from scikits/learn/src/cblas/cblas_errprn.c rename to sklearn/src/cblas/cblas_errprn.c diff --git a/scikits/learn/src/cblas/cblas_scopy.c b/sklearn/src/cblas/cblas_scopy.c similarity index 100% rename from scikits/learn/src/cblas/cblas_scopy.c rename to sklearn/src/cblas/cblas_scopy.c diff --git a/scikits/learn/src/cblas/cblas_srot.c b/sklearn/src/cblas/cblas_srot.c similarity index 100% rename from scikits/learn/src/cblas/cblas_srot.c rename to sklearn/src/cblas/cblas_srot.c diff --git a/scikits/learn/src/cblas/cblas_srotg.c b/sklearn/src/cblas/cblas_srotg.c similarity index 100% rename from scikits/learn/src/cblas/cblas_srotg.c rename to sklearn/src/cblas/cblas_srotg.c diff --git a/scikits/learn/src/cblas/cblas_strsv.c b/sklearn/src/cblas/cblas_strsv.c similarity index 100% rename from scikits/learn/src/cblas/cblas_strsv.c rename to sklearn/src/cblas/cblas_strsv.c diff --git a/scikits/learn/src/cblas/cblas_xerbla.c b/sklearn/src/cblas/cblas_xerbla.c similarity index 100% rename from scikits/learn/src/cblas/cblas_xerbla.c rename to sklearn/src/cblas/cblas_xerbla.c diff --git a/scikits/learn/svm/__init__.py b/sklearn/svm/__init__.py similarity index 100% rename from scikits/learn/svm/__init__.py rename to sklearn/svm/__init__.py diff --git a/scikits/learn/svm/base.py b/sklearn/svm/base.py similarity index 100% rename from scikits/learn/svm/base.py rename to sklearn/svm/base.py diff --git a/scikits/learn/svm/bounds.py b/sklearn/svm/bounds.py similarity index 100% rename from scikits/learn/svm/bounds.py rename to sklearn/svm/bounds.py diff --git a/scikits/learn/svm/classes.py b/sklearn/svm/classes.py similarity index 99% rename from scikits/learn/svm/classes.py rename to sklearn/svm/classes.py index ba96899e01e59..038e35758df02 100644 --- a/scikits/learn/svm/classes.py +++ b/sklearn/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 scikits.learn.svm import SVC + >>> from sklearn.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 scikits.learn.svm import NuSVC + >>> from sklearn.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 scikits.learn.svm import SVR + >>> from sklearn.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 scikits.learn.svm import NuSVR + >>> from sklearn.svm import NuSVR >>> import numpy as np >>> n_samples, n_features = 10, 5 >>> np.random.seed(0) diff --git a/scikits/learn/svm/liblinear.c b/sklearn/svm/liblinear.c similarity index 88% rename from scikits/learn/svm/liblinear.c rename to sklearn/svm/liblinear.c index c336bfe023d6b..729949476594f 100644 --- a/scikits/learn/svm/liblinear.c +++ b/sklearn/svm/liblinear.c @@ -1,18 +1,39 @@ -/* Generated by Cython 0.12.1 on Wed Mar 30 16:06:46 2011 */ +/* Generated by Cython 0.13 on Fri Sep 2 11:25:23 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 /* 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,11 +103,35 @@ #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 + #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 @@ -103,30 +148,23 @@ #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) -#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 + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #endif #if PY_VERSION_HEX < 0x02050000 @@ -146,114 +184,65 @@ #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 -#define __PYX_HAVE_API__scikits__learn__svm__liblinear -#include "stdlib.h" +#define __PYX_HAVE_API__sklearn__svm__liblinear #include "stdio.h" +#include "stdlib.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 */ -#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*); @@ -263,7 +252,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 ... */ @@ -283,7 +272,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) @@ -309,6 +297,11 @@ static const char **__pyx_f; #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; @@ -423,6 +416,8 @@ 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*/ @@ -431,6 +426,9 @@ 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_; @@ -453,8 +451,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,19 +461,13 @@ 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_RaiseNeedMoreValuesError(Py_ssize_t index); - -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); @@ -489,11 +481,9 @@ 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_npy_intp(npy_intp); +static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_Py_intptr_t(Py_intptr_t); #if CYTHON_CCOMPLEX #ifdef __cplusplus @@ -594,6 +584,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 *); @@ -613,13 +605,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 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 */ @@ -638,14 +632,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 scikits.learn.svm.liblinear */ +/* Module declarations from sklearn.svm.liblinear */ -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; +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; -/* Implementation of scikits.learn.svm.liblinear */ +/* Implementation of sklearn.svm.liblinear */ static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_MemoryError; static PyObject *__pyx_builtin_range; @@ -803,10 +797,9 @@ 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/scikits/learn/svm/liblinear.pyx":59 +/* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":59 * * * def train_wrap ( np.ndarray[np.float64_t, ndim=2, mode='c'] X, # <<<<<<<<<<<<<< @@ -814,9 +807,9 @@ static PyObject *__pyx_int_15; * solver_type, double eps, double bias, double C, */ -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) { +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) { PyArrayObject *__pyx_v_X = 0; PyArrayObject *__pyx_v_Y = 0; int __pyx_v_solver_type; @@ -962,13 +955,10 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_train_wrap(PyObject *_ __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("scikits.learn.svm.liblinear.train_wrap"); + __Pyx_AddTraceback("sklearn.svm.liblinear.train_wrap"); + __Pyx_RefNannyFinishContext(); 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; @@ -1006,7 +996,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_train_wrap(PyObject *_ __pyx_bstride_0_weight = __pyx_bstruct_weight.strides[0]; __pyx_bshape_0_weight = __pyx_bstruct_weight.shape[0]; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":73 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":73 * cdef int len_w * * problem = set_problem(X.data, Y.data, X.shape, bias) # <<<<<<<<<<<<<< @@ -1015,7 +1005,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_train_wrap(PyObject *_ */ __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/scikits/learn/svm/liblinear.pyx":75 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -1024,7 +1014,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_train_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/scikits/learn/svm/liblinear.pyx":77 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -1033,7 +1023,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_train_wrap(PyObject *_ */ __pyx_v_error_msg = check_parameter(__pyx_v_problem, __pyx_v_param); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":78 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":78 * * error_msg = check_parameter(problem, param) * if error_msg: # <<<<<<<<<<<<<< @@ -1043,7 +1033,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_train_wrap(PyObject *_ __pyx_t_1 = (__pyx_v_error_msg != 0); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":79 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":79 * error_msg = check_parameter(problem, param) * if error_msg: * free_problem(problem) # <<<<<<<<<<<<<< @@ -1052,7 +1042,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_train_wrap(PyObject *_ */ free_problem(__pyx_v_problem); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":80 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":80 * if error_msg: * free_problem(problem) * free_parameter(param) # <<<<<<<<<<<<<< @@ -1061,14 +1051,14 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_train_wrap(PyObject *_ */ free_parameter(__pyx_v_param); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":81 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":81 * free_problem(problem) * free_parameter(param) * raise ValueError(error_msg) # <<<<<<<<<<<<<< * * # early return */ - __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_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_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); @@ -1085,7 +1075,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_train_wrap(PyObject *_ } __pyx_L6:; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":84 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":84 * * # early return * model = train(problem, param) # <<<<<<<<<<<<<< @@ -1094,7 +1084,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_train_wrap(PyObject *_ */ __pyx_v_model = train(__pyx_v_problem, __pyx_v_param); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":88 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -1103,7 +1093,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_train_wrap(PyObject *_ */ __pyx_v_nr_class = get_nr_class(__pyx_v_model); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":89 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -1112,21 +1102,21 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_train_wrap(PyObject *_ */ __pyx_v_nr_feature = get_nr_feature(__pyx_v_model); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":90 + /* "/home/fabian/dev/scikit-learn/sklearn/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); + __pyx_t_1 = (__pyx_v_bias > 0.0); if (__pyx_t_1) { __pyx_v_nr_feature = (__pyx_v_nr_feature + 1); goto __pyx_L7; } __pyx_L7:; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":91 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":91 * cdef int nr_feature = get_nr_feature(model) * if bias > 0: nr_feature = nr_feature + 1 * if nr_class == 2: # <<<<<<<<<<<<<< @@ -1136,7 +1126,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_train_wrap(PyObject *_ __pyx_t_1 = (__pyx_v_nr_class == 2); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":92 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":92 * if bias > 0: nr_feature = nr_feature + 1 * if nr_class == 2: * w = np.empty((1, nr_feature),order='F') # <<<<<<<<<<<<<< @@ -1195,7 +1185,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_train_wrap(PyObject *_ __pyx_v_w = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":93 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":93 * if nr_class == 2: * w = np.empty((1, nr_feature),order='F') * copy_w(w.data, model, nr_feature) # <<<<<<<<<<<<<< @@ -1207,7 +1197,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_train_wrap(PyObject *_ } /*else*/ { - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":95 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":95 * copy_w(w.data, model, nr_feature) * else: * len_w = (nr_class) * nr_feature # <<<<<<<<<<<<<< @@ -1216,7 +1206,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_train_wrap(PyObject *_ */ __pyx_v_len_w = (__pyx_v_nr_class * __pyx_v_nr_feature); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":96 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":96 * else: * len_w = (nr_class) * nr_feature * w = np.empty((nr_class, nr_feature),order='F') # <<<<<<<<<<<<<< @@ -1277,7 +1267,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_train_wrap(PyObject *_ __pyx_v_w = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":97 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -1288,7 +1278,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_train_wrap(PyObject *_ } __pyx_L8:; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":100 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":100 * * cdef np.ndarray[np.int32_t, ndim=1, mode='c'] label * label = np.empty(nr_class, dtype=np.int32) # <<<<<<<<<<<<<< @@ -1345,7 +1335,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_train_wrap(PyObject *_ __pyx_v_label = ((PyArrayObject *)__pyx_t_11); __pyx_t_11 = 0; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":101 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -1354,7 +1344,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_train_wrap(PyObject *_ */ copy_label(__pyx_v_label->data, __pyx_v_model, __pyx_v_nr_class); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":104 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":104 * * ### FREE * free_and_destroy_model(&model) # <<<<<<<<<<<<<< @@ -1363,7 +1353,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_train_wrap(PyObject *_ */ free_and_destroy_model((&__pyx_v_model)); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":105 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":105 * ### FREE * free_and_destroy_model(&model) * free_problem(problem) # <<<<<<<<<<<<<< @@ -1372,7 +1362,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_train_wrap(PyObject *_ */ free_problem(__pyx_v_problem); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":106 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":106 * free_and_destroy_model(&model) * free_problem(problem) * free_parameter(param) # <<<<<<<<<<<<<< @@ -1381,7 +1371,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_train_wrap(PyObject *_ */ free_parameter(__pyx_v_param); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":109 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":109 * # destroy_param(param) don't call this or it will destroy weight_label and weight * * return w, label # <<<<<<<<<<<<<< @@ -1418,7 +1408,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_train_wrap(PyObject *_ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_X); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_label); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("scikits.learn.svm.liblinear.train_wrap"); + __Pyx_AddTraceback("sklearn.svm.liblinear.train_wrap"); __pyx_r = NULL; goto __pyx_L2; __pyx_L0:; @@ -1431,16 +1421,12 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_train_wrap(PyObject *_ __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/scikits/learn/svm/liblinear.pyx":111 +/* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":111 * return w, label * * def csr_train_wrap ( int n_features, # <<<<<<<<<<<<<< @@ -1448,9 +1434,9 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_train_wrap(PyObject *_ * np.ndarray[np.int32_t, ndim=1, mode='c'] X_indices, */ -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) { +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) { int __pyx_v_n_features; PyArrayObject *__pyx_v_X_values = 0; PyArrayObject *__pyx_v_X_indices = 0; @@ -1630,15 +1616,10 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_train_wrap(PyObjec __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("scikits.learn.svm.liblinear.csr_train_wrap"); + __Pyx_AddTraceback("sklearn.svm.liblinear.csr_train_wrap"); + __Pyx_RefNannyFinishContext(); 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; @@ -1692,7 +1673,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_train_wrap(PyObjec __pyx_bstride_0_weight = __pyx_bstruct_weight.strides[0]; __pyx_bshape_0_weight = __pyx_bstruct_weight.shape[0]; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":131 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -1701,7 +1682,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_train_wrap(PyObjec */ __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/scikits/learn/svm/liblinear.pyx":133 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -1710,7 +1691,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_train_wrap(PyObjec */ __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/scikits/learn/svm/liblinear.pyx":135 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -1719,7 +1700,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_train_wrap(PyObjec */ __pyx_v_error_msg = check_parameter(__pyx_v_problem, __pyx_v_param); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":136 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":136 * * error_msg = check_parameter(problem, param) * if error_msg: # <<<<<<<<<<<<<< @@ -1729,7 +1710,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_train_wrap(PyObjec __pyx_t_1 = (__pyx_v_error_msg != 0); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":137 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":137 * error_msg = check_parameter(problem, param) * if error_msg: * free_problem(problem) # <<<<<<<<<<<<<< @@ -1738,7 +1719,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_train_wrap(PyObjec */ free_problem(__pyx_v_problem); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":138 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":138 * if error_msg: * free_problem(problem) * free_parameter(param) # <<<<<<<<<<<<<< @@ -1747,14 +1728,14 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_train_wrap(PyObjec */ free_parameter(__pyx_v_param); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":139 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":139 * free_problem(problem) * free_parameter(param) * raise ValueError(error_msg) # <<<<<<<<<<<<<< * * # early return */ - __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_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_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); @@ -1771,7 +1752,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_train_wrap(PyObjec } __pyx_L6:; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":142 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":142 * * # early return * model = train(problem, param) # <<<<<<<<<<<<<< @@ -1780,7 +1761,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_train_wrap(PyObjec */ __pyx_v_model = train(__pyx_v_problem, __pyx_v_param); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":146 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -1789,7 +1770,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_train_wrap(PyObjec */ __pyx_v_nr_class = get_nr_class(__pyx_v_model); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":147 + /* "/home/fabian/dev/scikit-learn/sklearn/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 # <<<<<<<<<<<<<< @@ -1798,21 +1779,21 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_train_wrap(PyObjec */ __pyx_v_nr_feature = __pyx_v_n_features; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":148 + /* "/home/fabian/dev/scikit-learn/sklearn/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); + __pyx_t_1 = (__pyx_v_bias > 0.0); if (__pyx_t_1) { __pyx_v_nr_feature = (__pyx_v_nr_feature + 1); goto __pyx_L7; } __pyx_L7:; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":149 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":149 * cdef int nr_feature = n_features * if bias > 0: nr_feature = nr_feature + 1 * if nr_class == 2: # <<<<<<<<<<<<<< @@ -1822,7 +1803,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_train_wrap(PyObjec __pyx_t_1 = (__pyx_v_nr_class == 2); if (__pyx_t_1) { - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":150 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":150 * if bias > 0: nr_feature = nr_feature + 1 * if nr_class == 2: * w = np.empty((1, nr_feature),order='F') # <<<<<<<<<<<<<< @@ -1881,7 +1862,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_train_wrap(PyObjec __pyx_v_w = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":151 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":151 * if nr_class == 2: * w = np.empty((1, nr_feature),order='F') * copy_w(w.data, model, nr_feature) # <<<<<<<<<<<<<< @@ -1893,7 +1874,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_train_wrap(PyObjec } /*else*/ { - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":153 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":153 * copy_w(w.data, model, nr_feature) * else: * len_w = (nr_class * nr_feature) # <<<<<<<<<<<<<< @@ -1902,7 +1883,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_train_wrap(PyObjec */ __pyx_v_len_w = (__pyx_v_nr_class * __pyx_v_nr_feature); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":154 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":154 * else: * len_w = (nr_class * nr_feature) * w = np.empty((nr_class, nr_feature),order='F') # <<<<<<<<<<<<<< @@ -1963,7 +1944,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_train_wrap(PyObjec __pyx_v_w = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":155 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -1974,7 +1955,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_train_wrap(PyObjec } __pyx_L8:; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":158 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":158 * * cdef np.ndarray[np.int32_t, ndim=1, mode='c'] label * label = np.empty((nr_class), dtype=np.int32) # <<<<<<<<<<<<<< @@ -2031,7 +2012,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_train_wrap(PyObjec __pyx_v_label = ((PyArrayObject *)__pyx_t_11); __pyx_t_11 = 0; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":159 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -2040,7 +2021,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_train_wrap(PyObjec */ copy_label(__pyx_v_label->data, __pyx_v_model, __pyx_v_nr_class); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":162 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":162 * * ### FREE * free_and_destroy_model(&model) # <<<<<<<<<<<<<< @@ -2049,7 +2030,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_train_wrap(PyObjec */ free_and_destroy_model((&__pyx_v_model)); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":163 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":163 * ### FREE * free_and_destroy_model(&model) * free_problem(problem) # <<<<<<<<<<<<<< @@ -2058,7 +2039,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_train_wrap(PyObjec */ free_problem(__pyx_v_problem); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":164 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":164 * free_and_destroy_model(&model) * free_problem(problem) * free_parameter(param) # <<<<<<<<<<<<<< @@ -2067,7 +2048,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_train_wrap(PyObjec */ free_parameter(__pyx_v_param); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":167 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":167 * # destroy_param(param) don't call this or it will destroy weight_label and weight * * return w, label # <<<<<<<<<<<<<< @@ -2106,7 +2087,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_train_wrap(PyObjec __Pyx_SafeReleaseBuffer(&__pyx_bstruct_Y); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_label); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("scikits.learn.svm.liblinear.csr_train_wrap"); + __Pyx_AddTraceback("sklearn.svm.liblinear.csr_train_wrap"); __pyx_r = NULL; goto __pyx_L2; __pyx_L0:; @@ -2121,18 +2102,12 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_train_wrap(PyObjec __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/scikits/learn/svm/liblinear.pyx":170 +/* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":170 * * * def decision_function_wrap( # <<<<<<<<<<<<<< @@ -2140,8 +2115,8 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_train_wrap(PyObjec * np.ndarray[np.float64_t, ndim=2, mode='fortran'] coef_, */ -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) { +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) { PyArrayObject *__pyx_v_T = 0; PyArrayObject *__pyx_v_coef_ = 0; int __pyx_v_solver_type; @@ -2154,7 +2129,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_decision_function_wrap PyArrayObject *__pyx_v_dec_values; struct parameter *__pyx_v_param; struct model *__pyx_v_model; - PyObject *__pyx_v_n_class; + long __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; @@ -2180,8 +2155,8 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_decision_function_wrap Py_ssize_t __pyx_bshape_0_T = 0; Py_ssize_t __pyx_bshape_1_T = 0; PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; @@ -2293,16 +2268,11 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_decision_function_wrap __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("scikits.learn.svm.liblinear.decision_function_wrap"); + __Pyx_AddTraceback("sklearn.svm.liblinear.decision_function_wrap"); + __Pyx_RefNannyFinishContext(); 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; @@ -2345,7 +2315,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_decision_function_wrap __pyx_bstride_0_label = __pyx_bstruct_label.strides[0]; __pyx_bshape_0_label = __pyx_bstruct_label.shape[0]; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":184 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":184 * * param = set_parameter( * solver_type, eps, C, weight.shape[0], weight_label.data, weight.data) # <<<<<<<<<<<<<< @@ -2354,7 +2324,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_decision_function_wrap */ __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/scikits/learn/svm/liblinear.pyx":186 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -2363,79 +2333,72 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_decision_function_wrap */ __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/scikits/learn/svm/liblinear.pyx":188 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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; + __pyx_v_n_class = (__pyx_v_label->dimensions[0]); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":189 + /* "/home/fabian/dev/scikit-learn/sklearn/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 = 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; + __pyx_t_1 = (__pyx_v_n_class <= 2); + if (__pyx_t_1) { + __pyx_v_n_class = 1; goto __pyx_L6; } __pyx_L6:; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":190 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_GOTREF(__pyx_t_3); - __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_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_GOTREF(__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_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); __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_2 = 0; __pyx_t_4 = 0; - __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_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_GOTREF(__pyx_t_6); - __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_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_6); __pyx_t_6 = 0; - __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_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_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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 = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); { @@ -2460,18 +2423,17 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_decision_function_wrap __pyx_v_dec_values = ((PyArrayObject *)__pyx_t_6); __pyx_t_6 = 0; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":192 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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) { + __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) { - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":193 + /* "/home/fabian/dev/scikit-learn/sklearn/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") # <<<<<<<<<<<<<< @@ -2483,17 +2445,17 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_decision_function_wrap __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_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_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_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_Raise(__pyx_t_5, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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/scikits/learn/svm/liblinear.pyx":196 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":196 * * ### FREE * free_parameter(param) # <<<<<<<<<<<<<< @@ -2502,7 +2464,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_decision_function_wrap */ free_parameter(__pyx_v_param); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":197 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":197 * ### FREE * free_parameter(param) * free_and_destroy_model(&model) # <<<<<<<<<<<<<< @@ -2511,7 +2473,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_decision_function_wrap */ free_and_destroy_model((&__pyx_v_model)); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":198 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":198 * free_parameter(param) * free_and_destroy_model(&model) * return dec_values # <<<<<<<<<<<<<< @@ -2526,7 +2488,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_decision_function_wrap __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); @@ -2540,7 +2502,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_decision_function_wrap __Pyx_SafeReleaseBuffer(&__pyx_bstruct_coef_); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_T); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("scikits.learn.svm.liblinear.decision_function_wrap"); + __Pyx_AddTraceback("sklearn.svm.liblinear.decision_function_wrap"); __pyx_r = NULL; goto __pyx_L2; __pyx_L0:; @@ -2552,18 +2514,12 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_decision_function_wrap __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/scikits/learn/svm/liblinear.pyx":202 +/* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":202 * * * def csr_decision_function_wrap( # <<<<<<<<<<<<<< @@ -2571,9 +2527,9 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_decision_function_wrap * np.ndarray[np.float64_t, ndim=1, mode='c'] T_values, */ -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) { +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) { int __pyx_v_n_features; PyArrayObject *__pyx_v_T_values = 0; PyArrayObject *__pyx_v_T_indices = 0; @@ -2589,7 +2545,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_decision_function_ PyArrayObject *__pyx_v_dec_values; struct parameter *__pyx_v_param; struct model *__pyx_v_model; - PyObject *__pyx_v_n_class; + long __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; @@ -2619,8 +2575,8 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_decision_function_ Py_ssize_t __pyx_bstride_0_label = 0; Py_ssize_t __pyx_bshape_0_label = 0; PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; @@ -2759,18 +2715,11 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_decision_function_ __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("scikits.learn.svm.liblinear.csr_decision_function_wrap"); + __Pyx_AddTraceback("sklearn.svm.liblinear.csr_decision_function_wrap"); + __Pyx_RefNannyFinishContext(); 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; @@ -2829,7 +2778,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_decision_function_ __pyx_bstride_0_label = __pyx_bstruct_label.strides[0]; __pyx_bshape_0_label = __pyx_bstruct_label.shape[0]; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":224 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":224 * * param = set_parameter( * solver_type, eps, C, weight.shape[0], weight_label.data, weight.data) # <<<<<<<<<<<<<< @@ -2838,7 +2787,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_decision_function_ */ __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/scikits/learn/svm/liblinear.pyx":226 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -2847,79 +2796,72 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_decision_function_ */ __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/scikits/learn/svm/liblinear.pyx":228 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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; + __pyx_v_n_class = (__pyx_v_label->dimensions[0]); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":229 + /* "/home/fabian/dev/scikit-learn/sklearn/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 = 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; + __pyx_t_1 = (__pyx_v_n_class <= 2); + if (__pyx_t_1) { + __pyx_v_n_class = 1; goto __pyx_L6; } __pyx_L6:; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":231 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_GOTREF(__pyx_t_3); - __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_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_GOTREF(__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_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); __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_2 = 0; __pyx_t_4 = 0; - __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_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_GOTREF(__pyx_t_6); - __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_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_6); __pyx_t_6 = 0; - __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_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_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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 = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); { @@ -2944,18 +2886,17 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_decision_function_ __pyx_v_dec_values = ((PyArrayObject *)__pyx_t_6); __pyx_t_6 = 0; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":236 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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) { + __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) { - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":237 + /* "/home/fabian/dev/scikit-learn/sklearn/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") # <<<<<<<<<<<<<< @@ -2967,17 +2908,17 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_decision_function_ __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_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_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_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_Raise(__pyx_t_5, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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/scikits/learn/svm/liblinear.pyx":240 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":240 * * ### FREE * free_parameter(param) # <<<<<<<<<<<<<< @@ -2986,7 +2927,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_decision_function_ */ free_parameter(__pyx_v_param); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":241 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":241 * ### FREE * free_parameter(param) * free_and_destroy_model(&model) # <<<<<<<<<<<<<< @@ -2995,7 +2936,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_decision_function_ */ free_and_destroy_model((&__pyx_v_model)); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":242 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":242 * free_parameter(param) * free_and_destroy_model(&model) * return dec_values # <<<<<<<<<<<<<< @@ -3010,7 +2951,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_decision_function_ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); @@ -3026,7 +2967,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_decision_function_ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_dec_values); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_label); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("scikits.learn.svm.liblinear.csr_decision_function_wrap"); + __Pyx_AddTraceback("sklearn.svm.liblinear.csr_decision_function_wrap"); __pyx_r = NULL; goto __pyx_L2; __pyx_L0:; @@ -3040,20 +2981,12 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_decision_function_ __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/scikits/learn/svm/liblinear.pyx":245 +/* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":245 * * * def predict_wrap( # <<<<<<<<<<<<<< @@ -3061,8 +2994,8 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_decision_function_ * np.ndarray[np.float64_t, ndim=2, mode='fortran'] coef_, */ -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) { +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) { PyArrayObject *__pyx_v_T = 0; PyArrayObject *__pyx_v_coef_ = 0; int __pyx_v_solver_type; @@ -3211,14 +3144,10 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_predict_wrap(PyObject __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("scikits.learn.svm.liblinear.predict_wrap"); + __Pyx_AddTraceback("sklearn.svm.liblinear.predict_wrap"); + __Pyx_RefNannyFinishContext(); 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; @@ -3262,7 +3191,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_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/scikits/learn/svm/liblinear.pyx":258 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":258 * cdef model *model * * param = set_parameter(solver_type, eps, C, weight.shape[0], weight_label.data, weight.data) # <<<<<<<<<<<<<< @@ -3271,7 +3200,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_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/scikits/learn/svm/liblinear.pyx":260 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -3280,7 +3209,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_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/scikits/learn/svm/liblinear.pyx":262 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -3292,7 +3221,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_predict_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 = 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_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_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_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); @@ -3337,7 +3266,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_predict_wrap(PyObject __pyx_v_dec_values = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":263 + /* "/home/fabian/dev/scikit-learn/sklearn/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: # <<<<<<<<<<<<<< @@ -3347,7 +3276,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_predict_wrap(PyObject __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/scikits/learn/svm/liblinear.pyx":264 + /* "/home/fabian/dev/scikit-learn/sklearn/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") # <<<<<<<<<<<<<< @@ -3369,7 +3298,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_predict_wrap(PyObject } __pyx_L6:; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":267 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":267 * * ### FREE * free_parameter(param) # <<<<<<<<<<<<<< @@ -3378,7 +3307,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_predict_wrap(PyObject */ free_parameter(__pyx_v_param); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":268 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":268 * ### FREE * free_parameter(param) * free_and_destroy_model(&model) # <<<<<<<<<<<<<< @@ -3387,7 +3316,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_predict_wrap(PyObject */ free_and_destroy_model((&__pyx_v_model)); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":269 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":269 * free_parameter(param) * free_and_destroy_model(&model) * return dec_values # <<<<<<<<<<<<<< @@ -3416,7 +3345,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_predict_wrap(PyObject __Pyx_SafeReleaseBuffer(&__pyx_bstruct_coef_); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_T); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("scikits.learn.svm.liblinear.predict_wrap"); + __Pyx_AddTraceback("sklearn.svm.liblinear.predict_wrap"); __pyx_r = NULL; goto __pyx_L2; __pyx_L0:; @@ -3428,17 +3357,12 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_predict_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/scikits/learn/svm/liblinear.pyx":272 +/* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":272 * * * def csr_predict_wrap( # <<<<<<<<<<<<<< @@ -3446,9 +3370,9 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_predict_wrap(PyObject * np.ndarray[np.float64_t, ndim=1, mode='c'] T_values, */ -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) { +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) { int __pyx_v_n_features; PyArrayObject *__pyx_v_T_values = 0; PyArrayObject *__pyx_v_T_indices = 0; @@ -3631,16 +3555,10 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_predict_wrap(PyObj __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("scikits.learn.svm.liblinear.csr_predict_wrap"); + __Pyx_AddTraceback("sklearn.svm.liblinear.csr_predict_wrap"); + __Pyx_RefNannyFinishContext(); 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; @@ -3700,7 +3618,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_predict_wrap(PyObj __pyx_bstride_0_label = __pyx_bstruct_label.strides[0]; __pyx_bshape_0_label = __pyx_bstruct_label.shape[0]; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":293 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":293 * cdef model *model * * param = set_parameter(solver_type, eps, C, weight.shape[0], weight_label.data, weight.data) # <<<<<<<<<<<<<< @@ -3709,7 +3627,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_predict_wrap(PyObj */ __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/scikits/learn/svm/liblinear.pyx":295 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -3718,7 +3636,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_predict_wrap(PyObj */ __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/scikits/learn/svm/liblinear.pyx":297 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -3775,7 +3693,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_predict_wrap(PyObj __pyx_v_dec_values = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":301 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":301 * T_indices.shape, T_indices.data, * T_indptr.shape, T_indptr.data, * model, dec_values.data) < 0: # <<<<<<<<<<<<<< @@ -3785,7 +3703,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_predict_wrap(PyObj __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/scikits/learn/svm/liblinear.pyx":302 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":302 * T_indptr.shape, T_indptr.data, * model, dec_values.data) < 0: * raise MemoryError("We've run out of of memory") # <<<<<<<<<<<<<< @@ -3807,7 +3725,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_predict_wrap(PyObj } __pyx_L6:; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":305 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":305 * * ### FREE * free_parameter(param) # <<<<<<<<<<<<<< @@ -3816,7 +3734,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_predict_wrap(PyObj */ free_parameter(__pyx_v_param); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":306 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":306 * ### FREE * free_parameter(param) * free_and_destroy_model(&model) # <<<<<<<<<<<<<< @@ -3825,7 +3743,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_predict_wrap(PyObj */ free_and_destroy_model((&__pyx_v_model)); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":307 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":307 * free_parameter(param) * free_and_destroy_model(&model) * return dec_values # <<<<<<<<<<<<<< @@ -3856,7 +3774,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_predict_wrap(PyObj __Pyx_SafeReleaseBuffer(&__pyx_bstruct_dec_values); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_label); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("scikits.learn.svm.liblinear.csr_predict_wrap"); + __Pyx_AddTraceback("sklearn.svm.liblinear.csr_predict_wrap"); __pyx_r = NULL; goto __pyx_L2; __pyx_L0:; @@ -3870,19 +3788,12 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_predict_wrap(PyObj __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/scikits/learn/svm/liblinear.pyx":312 +/* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":312 * * * def predict_prob_wrap(np.ndarray[np.float64_t, ndim=2, mode='c'] T, # <<<<<<<<<<<<<< @@ -3890,9 +3801,9 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_predict_wrap(PyObj * int solver_type, double eps, double C, */ -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) { +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) { PyArrayObject *__pyx_v_T = 0; PyArrayObject *__pyx_v_coef_ = 0; int __pyx_v_solver_type; @@ -4044,14 +3955,10 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_predict_prob_wrap(PyOb __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("scikits.learn.svm.liblinear.predict_prob_wrap"); + __Pyx_AddTraceback("sklearn.svm.liblinear.predict_prob_wrap"); + __Pyx_RefNannyFinishContext(); 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; @@ -4095,7 +4002,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_predict_prob_wrap(PyOb __pyx_bstride_0_label = __pyx_bstruct_label.strides[0]; __pyx_bshape_0_label = __pyx_bstruct_label.shape[0]; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":349 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":349 * cdef model *model * * param = set_parameter(solver_type, eps, C, weight.shape[0], weight_label.data, weight.data) # <<<<<<<<<<<<<< @@ -4104,7 +4011,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_predict_prob_wrap(PyOb */ __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/scikits/learn/svm/liblinear.pyx":351 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -4113,7 +4020,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_predict_prob_wrap(PyOb */ __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/scikits/learn/svm/liblinear.pyx":353 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":353 * model = set_model(param, coef_.data, coef_.shape, label.data, bias) * * cdef int nr_class = get_nr_class(model) # <<<<<<<<<<<<<< @@ -4122,7 +4029,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_predict_prob_wrap(PyOb */ __pyx_v_nr_class = get_nr_class(__pyx_v_model); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":354 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":354 * * cdef int nr_class = get_nr_class(model) * dec_values = np.empty((T.shape[0], nr_class), dtype=np.float64) # <<<<<<<<<<<<<< @@ -4134,7 +4041,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_predict_prob_wrap(PyOb __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_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_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_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); @@ -4189,7 +4096,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_predict_prob_wrap(PyOb __pyx_v_dec_values = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":355 + /* "/home/fabian/dev/scikit-learn/sklearn/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: # <<<<<<<<<<<<<< @@ -4199,7 +4106,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_predict_prob_wrap(PyOb __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/scikits/learn/svm/liblinear.pyx":356 + /* "/home/fabian/dev/scikit-learn/sklearn/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") # <<<<<<<<<<<<<< @@ -4221,7 +4128,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_predict_prob_wrap(PyOb } __pyx_L6:; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":359 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":359 * * ### FREE * free_parameter(param) # <<<<<<<<<<<<<< @@ -4230,7 +4137,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_predict_prob_wrap(PyOb */ free_parameter(__pyx_v_param); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":360 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":360 * ### FREE * free_parameter(param) * free_and_destroy_model(&model) # <<<<<<<<<<<<<< @@ -4239,7 +4146,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_predict_prob_wrap(PyOb */ free_and_destroy_model((&__pyx_v_model)); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":362 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":362 * free_and_destroy_model(&model) * * return dec_values # <<<<<<<<<<<<<< @@ -4268,7 +4175,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_predict_prob_wrap(PyOb __Pyx_SafeReleaseBuffer(&__pyx_bstruct_coef_); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_T); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("scikits.learn.svm.liblinear.predict_prob_wrap"); + __Pyx_AddTraceback("sklearn.svm.liblinear.predict_prob_wrap"); __pyx_r = NULL; goto __pyx_L2; __pyx_L0:; @@ -4280,17 +4187,12 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_predict_prob_wrap(PyOb __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/scikits/learn/svm/liblinear.pyx":366 +/* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":366 * * * def csr_predict_prob( # <<<<<<<<<<<<<< @@ -4298,9 +4200,9 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_predict_prob_wrap(PyOb * np.ndarray[np.float64_t, ndim=1, mode='c'] T_values, */ -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) { +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) { int __pyx_v_n_features; PyArrayObject *__pyx_v_T_values = 0; PyArrayObject *__pyx_v_T_indices = 0; @@ -4486,16 +4388,10 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_predict_prob(PyObj __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("scikits.learn.svm.liblinear.csr_predict_prob"); + __Pyx_AddTraceback("sklearn.svm.liblinear.csr_predict_prob"); + __Pyx_RefNannyFinishContext(); 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; @@ -4555,7 +4451,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_predict_prob(PyObj __pyx_bstride_0_label = __pyx_bstruct_label.strides[0]; __pyx_bshape_0_label = __pyx_bstruct_label.shape[0]; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":388 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":388 * * param = set_parameter(solver_type, eps, C, weight.shape[0], * weight_label.data, weight.data) # <<<<<<<<<<<<<< @@ -4564,7 +4460,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_predict_prob(PyObj */ __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/scikits/learn/svm/liblinear.pyx":390 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":390 * weight_label.data, weight.data) * * model = set_model(param, coef_.data, coef_.shape, label.data, bias) # <<<<<<<<<<<<<< @@ -4573,7 +4469,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_predict_prob(PyObj */ __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/scikits/learn/svm/liblinear.pyx":391 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":391 * * model = set_model(param, coef_.data, coef_.shape, label.data, bias) * cdef int nr_class = get_nr_class(model) # <<<<<<<<<<<<<< @@ -4582,7 +4478,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_predict_prob(PyObj */ __pyx_v_nr_class = get_nr_class(__pyx_v_model); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":392 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -4649,7 +4545,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_predict_prob(PyObj __pyx_v_dec_values = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":397 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":397 * T_indices.shape, T_indices.data, * T_indptr.shape, T_indptr.data, * model, dec_values.data) < 0: # <<<<<<<<<<<<<< @@ -4659,7 +4555,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_predict_prob(PyObj __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/scikits/learn/svm/liblinear.pyx":398 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":398 * T_indptr.shape, T_indptr.data, * model, dec_values.data) < 0: * raise MemoryError("We've run out of of memory") # <<<<<<<<<<<<<< @@ -4681,7 +4577,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_predict_prob(PyObj } __pyx_L6:; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":401 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":401 * * ### FREE * free_parameter(param) # <<<<<<<<<<<<<< @@ -4690,7 +4586,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_predict_prob(PyObj */ free_parameter(__pyx_v_param); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":402 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":402 * ### FREE * free_parameter(param) * free_and_destroy_model(&model) # <<<<<<<<<<<<<< @@ -4698,7 +4594,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_predict_prob(PyObj */ free_and_destroy_model((&__pyx_v_model)); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/liblinear.pyx":403 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":403 * free_parameter(param) * free_and_destroy_model(&model) * return dec_values # <<<<<<<<<<<<<< @@ -4727,7 +4623,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_predict_prob(PyObj __Pyx_SafeReleaseBuffer(&__pyx_bstruct_dec_values); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_label); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("scikits.learn.svm.liblinear.csr_predict_prob"); + __Pyx_AddTraceback("sklearn.svm.liblinear.csr_predict_prob"); __pyx_r = NULL; goto __pyx_L2; __pyx_L0:; @@ -4741,19 +4637,12 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_predict_prob(PyObj __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; } -/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":187 +/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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): # <<<<<<<<<<<<<< @@ -4761,8 +4650,8 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_9liblinear_csr_predict_prob(PyObj * # 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; @@ -4787,9 +4676,8 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf 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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":194 * # of flags * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -4798,7 +4686,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":195 * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -4807,7 +4695,7 @@ 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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":197 * cdef bint little_endian = ((&endian_detector)[0] != 0) * * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< @@ -4816,7 +4704,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ __pyx_v_ndim = PyArray_NDIM(((PyArrayObject *)__pyx_v_self)); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":198 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":199 * ndim = PyArray_NDIM(self) * * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -4826,7 +4714,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); if (__pyx_t_1) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":199 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":200 * * if sizeof(npy_intp) != sizeof(Py_ssize_t): * copy_shape = 1 # <<<<<<<<<<<<<< @@ -4838,7 +4726,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":202 * copy_shape = 1 * else: * copy_shape = 0 # <<<<<<<<<<<<<< @@ -4849,7 +4737,7 @@ 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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":204 * copy_shape = 0 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -4859,7 +4747,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf __pyx_t_1 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS); if (__pyx_t_1) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":204 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":205 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -4873,29 +4761,29 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf } if (__pyx_t_3) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":205 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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 = 205; __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 = 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_filename = __pyx_f[1]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":208 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -4905,7 +4793,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf __pyx_t_3 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS); if (__pyx_t_3) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":208 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":209 * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -4919,29 +4807,29 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf } if (__pyx_t_2) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":209 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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 = 209; __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 = 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_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":212 * raise ValueError(u"ndarray is not Fortran contiguous") * * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< @@ -4950,7 +4838,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ __pyx_v_info->buf = PyArray_DATA(((PyArrayObject *)__pyx_v_self)); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":212 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":213 * * info.buf = PyArray_DATA(self) * info.ndim = ndim # <<<<<<<<<<<<<< @@ -4959,17 +4847,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":217 * # Allocate new buffer for strides and shape info. This is allocated * # as one block, strides first. * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< @@ -4978,7 +4865,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":218 * # as one block, strides first. * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) * info.shape = info.strides + ndim # <<<<<<<<<<<<<< @@ -4987,7 +4874,7 @@ 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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":219 * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) * info.shape = info.strides + ndim * for i in range(ndim): # <<<<<<<<<<<<<< @@ -4998,7 +4885,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":219 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":220 * info.shape = info.strides + ndim * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< @@ -5007,7 +4894,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":220 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":221 * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< @@ -5020,7 +4907,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf } /*else*/ { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":222 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":223 * info.shape[i] = PyArray_DIMS(self)[i] * else: * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< @@ -5029,7 +4916,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(((PyArrayObject *)__pyx_v_self))); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":223 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":224 * else: * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< @@ -5040,7 +4927,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf } __pyx_L8:; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":224 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":225 * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -5049,7 +4936,7 @@ 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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":226 * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< @@ -5058,7 +4945,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ __pyx_v_info->itemsize = PyArray_ITEMSIZE(((PyArrayObject *)__pyx_v_self)); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":226 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":227 * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< @@ -5067,7 +4954,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ __pyx_v_info->readonly = (!PyArray_ISWRITEABLE(((PyArrayObject *)__pyx_v_self))); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":229 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":230 * * cdef int t * cdef char* f = NULL # <<<<<<<<<<<<<< @@ -5076,7 +4963,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":231 * cdef int t * cdef char* f = NULL * cdef dtype descr = self.descr # <<<<<<<<<<<<<< @@ -5086,7 +4973,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":235 * cdef int offset * * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< @@ -5095,7 +4982,7 @@ 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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":237 * cdef bint hasfields = PyDataType_HASFIELDS(descr) * * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< @@ -5111,7 +4998,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf } if (__pyx_t_1) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":238 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":239 * if not hasfields and not copy_shape: * # do not call releasebuffer * info.obj = None # <<<<<<<<<<<<<< @@ -5127,7 +5014,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":242 * else: * # need to call releasebuffer * info.obj = self # <<<<<<<<<<<<<< @@ -5142,7 +5029,7 @@ 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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":244 * info.obj = self * * if not hasfields: # <<<<<<<<<<<<<< @@ -5152,7 +5039,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf __pyx_t_1 = (!__pyx_v_hasfields); if (__pyx_t_1) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":244 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":245 * * if not hasfields: * t = descr.type_num # <<<<<<<<<<<<<< @@ -5161,7 +5048,7 @@ 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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":246 * if not hasfields: * t = descr.type_num * if ((descr.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< @@ -5176,7 +5063,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf } if (!__pyx_t_2) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":246 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":247 * t = descr.type_num * if ((descr.byteorder == '>' and little_endian) or * (descr.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< @@ -5196,29 +5083,29 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf } if (__pyx_t_1) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":247 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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 = 247; __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 = 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_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":249 * (descr.byteorder == '<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< @@ -5231,7 +5118,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":249 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":250 * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< @@ -5244,7 +5131,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":250 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":251 * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< @@ -5257,7 +5144,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":251 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":252 * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< @@ -5270,7 +5157,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":252 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":253 * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< @@ -5283,7 +5170,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":253 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":254 * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< @@ -5296,7 +5183,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":254 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":255 * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< @@ -5309,7 +5196,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":255 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":256 * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< @@ -5322,7 +5209,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":256 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":257 * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< @@ -5335,7 +5222,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":257 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":258 * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< @@ -5348,7 +5235,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":258 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":259 * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< @@ -5361,7 +5248,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":259 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":260 * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< @@ -5374,7 +5261,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":260 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":261 * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< @@ -5387,7 +5274,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":261 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":262 * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< @@ -5400,7 +5287,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":262 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":263 * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< @@ -5413,7 +5300,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":263 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":264 * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< @@ -5426,7 +5313,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":264 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":265 * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< @@ -5440,33 +5327,33 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf } /*else*/ { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":266 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_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_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_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, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); + 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 = 266; __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 = 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_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":268 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f # <<<<<<<<<<<<<< @@ -5475,7 +5362,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":269 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f * return # <<<<<<<<<<<<<< @@ -5488,7 +5375,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":271 * return * else: * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< @@ -5497,7 +5384,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":272 * else: * info.format = stdlib.malloc(_buffer_format_string_len) * info.format[0] = '^' # Native data types, manual alignment # <<<<<<<<<<<<<< @@ -5506,7 +5393,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":273 * info.format = stdlib.malloc(_buffer_format_string_len) * info.format[0] = '^' # Native data types, manual alignment * offset = 0 # <<<<<<<<<<<<<< @@ -5515,17 +5402,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":277 * info.format + _buffer_format_string_len, * &offset) * f[0] = 0 # Terminate format string # <<<<<<<<<<<<<< @@ -5553,12 +5440,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 +/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":279 * f[0] = 0 # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -5566,13 +5452,12 @@ 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) { +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; __Pyx_RefNannySetupContext("__releasebuffer__"); - __Pyx_INCREF((PyObject *)__pyx_v_self); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":279 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":280 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -5582,7 +5467,7 @@ static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, P __pyx_t_1 = PyArray_HASFIELDS(((PyArrayObject *)__pyx_v_self)); if (__pyx_t_1) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":280 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":281 * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): * stdlib.free(info.format) # <<<<<<<<<<<<<< @@ -5594,7 +5479,7 @@ static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, P } __pyx_L5:; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":281 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":282 * if PyArray_HASFIELDS(self): * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -5604,7 +5489,7 @@ static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, P __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); if (__pyx_t_1) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":282 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":283 * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): * stdlib.free(info.strides) # <<<<<<<<<<<<<< @@ -5616,11 +5501,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 +/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":756 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -5633,7 +5517,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":757 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -5641,7 +5525,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; @@ -5659,7 +5543,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":758 +/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":759 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -5672,7 +5556,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":760 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -5680,7 +5564,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; @@ -5698,7 +5582,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":761 +/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":762 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -5711,7 +5595,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":763 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -5719,7 +5603,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; @@ -5737,7 +5621,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":764 +/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":765 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -5750,7 +5634,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":766 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< @@ -5758,7 +5642,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; @@ -5776,7 +5660,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":767 +/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":768 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -5789,7 +5673,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":769 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< @@ -5797,7 +5681,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; @@ -5815,7 +5699,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":770 +/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":771 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -5843,14 +5727,13 @@ 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); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":777 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":778 * cdef int delta_offset * cdef tuple i * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -5859,7 +5742,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":779 * cdef tuple i * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -5868,7 +5751,7 @@ 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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":782 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -5878,7 +5761,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 = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } for (;;) { if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break; @@ -5887,21 +5770,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_t_3 = 0; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":783 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":784 * for childname in descr.names: * fields = descr.fields[childname] * child, new_offset = fields # <<<<<<<<<<<<<< @@ -5911,7 +5794,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); @@ -5921,57 +5804,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 = 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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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 = PyTuple_New(1); 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_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 = 786; __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 = 787; __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 = 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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":789 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< @@ -5986,7 +5869,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":790 * * if ((child.byteorder == '>' and little_endian) or * (child.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< @@ -6006,29 +5889,29 @@ 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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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 = 790; __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 = 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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":801 * * # Output padding bytes * while offset[0] < new_offset: # <<<<<<<<<<<<<< @@ -6036,16 +5919,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":802 * # Output padding bytes * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< @@ -6054,7 +5937,7 @@ 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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":803 * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte * f += 1 # <<<<<<<<<<<<<< @@ -6063,7 +5946,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f += 1; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":803 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":804 * f[0] = 120 # "x"; pad byte * f += 1 * offset[0] += 1 # <<<<<<<<<<<<<< @@ -6073,7 +5956,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx (__pyx_v_offset[0]) += 1; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":805 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":806 * offset[0] += 1 * * offset[0] += child.itemsize # <<<<<<<<<<<<<< @@ -6082,7 +5965,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ (__pyx_v_offset[0]) += __pyx_v_child->elsize; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":807 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":808 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -6092,20 +5975,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":810 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -6115,288 +5998,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) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":810 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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 = PyTuple_New(1); 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_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 = 810; __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 = 811; __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 = 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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/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" */ - __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_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 = 813; __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 = 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_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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 98; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":814 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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 = 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 = 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_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_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 66; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":815 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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 = 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 = 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_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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 104; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":816 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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 = 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 = 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_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_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 72; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":817 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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 = 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 = 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_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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 105; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":818 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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 = 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 = 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_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_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 73; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":819 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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 = 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 = 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_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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 108; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":820 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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 = 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 = 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_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_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 76; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":821 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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 = 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 = 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_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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 113; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":822 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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 = 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 = 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_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_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 81; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":823 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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 = 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 = 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_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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 102; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":824 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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 = 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 = 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_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_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 100; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":825 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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 = 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 = 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_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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 103; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":826 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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 = 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 = 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_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_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -6405,19 +6288,19 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":827 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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 = 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 = 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_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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -6426,19 +6309,19 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":828 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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 = 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 = 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_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_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -6447,19 +6330,19 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":829 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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 = 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 = 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_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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 79; @@ -6467,30 +6350,30 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } /*else*/ { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":831 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_GOTREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); + 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 = 831; __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 = 832; __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 = 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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":833 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * f += 1 # <<<<<<<<<<<<<< @@ -6502,21 +6385,21 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } /*else*/ { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":836 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_L9:; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":837 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":838 * # so don't output it * f = _util_dtypestring(child, f, end, offset) * return f # <<<<<<<<<<<<<< @@ -6541,12 +6424,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 +/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":953 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -6558,10 +6440,8 @@ 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); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":954 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":955 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -6571,7 +6451,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":956 * cdef PyObject* baseptr * if base is None: * baseptr = NULL # <<<<<<<<<<<<<< @@ -6583,7 +6463,7 @@ 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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":958 * baseptr = NULL * else: * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< @@ -6592,7 +6472,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_INCREF(__pyx_v_base); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":958 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":959 * else: * Py_INCREF(base) # important to do this before decref below! * baseptr = base # <<<<<<<<<<<<<< @@ -6603,7 +6483,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":960 * Py_INCREF(base) # important to do this before decref below! * baseptr = base * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< @@ -6612,7 +6492,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":961 * baseptr = base * Py_XDECREF(arr.base) * arr.base = baseptr # <<<<<<<<<<<<<< @@ -6621,12 +6501,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 +/* "/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 * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -6638,9 +6516,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":964 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -6650,7 +6527,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":965 * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: * return None # <<<<<<<<<<<<<< @@ -6665,7 +6542,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py } /*else*/ { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":966 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":967 * return None * else: * return arr.base # <<<<<<<<<<<<<< @@ -6679,26 +6556,23 @@ 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("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)}, +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)}, {0, 0, 0, 0} }; -static void __pyx_init_filenames(void); /*proto*/ - #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { PyModuleDef_HEAD_INIT, @@ -6786,8 +6660,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 = 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; @@ -6796,7 +6670,6 @@ 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:; @@ -6825,12 +6698,10 @@ 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 ---*/ @@ -6854,7 +6725,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_scikits__learn__svm__liblinear) { + if (__pyx_module_is_main_sklearn__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 ---*/ @@ -6863,15 +6734,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 = 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/scikits/learn/svm/liblinear.pyx":7 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":7 * """ * * import numpy as np # <<<<<<<<<<<<<< @@ -6883,7 +6754,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/scikits/learn/svm/liblinear.pyx":1 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/liblinear.pyx":1 * """ # <<<<<<<<<<<<<< * Wrapper for liblinear * @@ -6892,42 +6763,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__"); + __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_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__"); + __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_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__"); + __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_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__"); + __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_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__"); + __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_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__"); + __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_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;} @@ -6935,11 +6806,12 @@ 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; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/stdlib.pxd":2 + /* "/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 * - * cdef extern from "stdlib.h" nogil: # <<<<<<<<<<<<<< - * void free(void *ptr) - * void *malloc(size_t size) + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None */ goto __pyx_L0; __pyx_L1_error:; @@ -6947,10 +6819,10 @@ PyMODINIT_FUNC PyInit_liblinear(void) __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); if (__pyx_m) { - __Pyx_AddTraceback("init scikits.learn.svm.liblinear"); + __Pyx_AddTraceback("init sklearn.svm.liblinear"); Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init scikits.learn.svm.liblinear"); + PyErr_SetString(PyExc_ImportError, "init sklearn.svm.liblinear"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); @@ -6961,15 +6833,14 @@ PyMODINIT_FUNC PyInit_liblinear(void) #endif } -static const char *__pyx_filenames[] = { - "liblinear.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( @@ -7094,6 +6965,26 @@ static int __Pyx_ParseOptionalKeywords( 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; @@ -7499,7 +7390,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; @@ -7583,6 +7474,10 @@ 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 @@ -7593,35 +7488,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) { @@ -7630,30 +7503,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 @@ -7679,14 +7532,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; @@ -7702,23 +7555,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); @@ -7829,21 +7674,28 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { } #endif -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)) { +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))) { return PyInt_FromLong((long)val); - } else if (sizeof(npy_intp) == sizeof(long)) { + } else if ((sizeof(Py_intptr_t) == sizeof(int)) || + (sizeof(Py_intptr_t) == sizeof(long))) { if (is_unsigned) return PyLong_FromUnsignedLong((unsigned long)val); else return PyInt_FromLong((long)val); - } else { /* (sizeof(npy_intp) > sizeof(long)) */ + } else if (sizeof(Py_intptr_t) == sizeof(PY_LONG_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); } } @@ -8168,6 +8020,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; @@ -8415,7 +8286,11 @@ 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, @@ -8556,8 +8431,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/scikits/learn/svm/liblinear.pyx b/sklearn/svm/liblinear.pyx similarity index 100% rename from scikits/learn/svm/liblinear.pyx rename to sklearn/svm/liblinear.pyx diff --git a/scikits/learn/svm/libsvm.c b/sklearn/svm/libsvm.c similarity index 77% rename from scikits/learn/svm/libsvm.c rename to sklearn/svm/libsvm.c index 74d46ba337441..6e6e7477af14e 100644 --- a/scikits/learn/svm/libsvm.c +++ b/sklearn/svm/libsvm.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.14.1 on Mon Jul 11 18:25:49 2011 */ +/* Generated by Cython 0.13 on Fri Sep 2 11:25:18 2011 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -126,20 +126,15 @@ #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) @@ -156,7 +151,7 @@ #endif #if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject + #define PyBoolObject PyLongObject #endif @@ -168,25 +163,6 @@ #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 @@ -219,7 +195,7 @@ #define _USE_MATH_DEFINES #endif #include -#define __PYX_HAVE_API__scikits__learn__svm__libsvm +#define __PYX_HAVE_API__sklearn__svm__libsvm #include "stdio.h" #include "stdlib.h" #include "numpy/arrayobject.h" @@ -227,11 +203,6 @@ #include "svm.h" #include "libsvm_helper.c" -#ifdef PYREX_WITHOUT_ASSERTIONS -#define CYTHON_WITHOUT_ASSERTIONS -#endif - - /* inline attribute */ #ifndef CYTHON_INLINE #if defined(__GNUC__) @@ -241,7 +212,7 @@ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else - #define CYTHON_INLINE + #define CYTHON_INLINE #endif #endif @@ -249,14 +220,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 @@ -281,7 +252,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 ... */ @@ -447,12 +418,12 @@ typedef npy_cdouble __pyx_t_5numpy_complex_t; 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 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 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, @@ -490,8 +461,6 @@ 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); @@ -516,6 +485,8 @@ 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()) @@ -549,17 +520,11 @@ 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)) - #if 1 - #define __Pyx_c_absf(z) (::std::abs(z)) - #define __Pyx_c_powf(a, b) (::std::pow(a, b)) - #endif + /*#define __Pyx_c_absf(z) (::std::abs(z))*/ #else #define __Pyx_c_is_zerof(z) ((z)==0) #define __Pyx_c_conjf(z) (conjf(z)) - #if 1 - #define __Pyx_c_absf(z) (cabsf(z)) - #define __Pyx_c_powf(a, b) (cpowf(a, b)) - #endif + /*#define __Pyx_c_absf(z) (cabsf(z))*/ #endif #else static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex); @@ -570,10 +535,7 @@ 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); - #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 + /*static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex);*/ #endif static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); @@ -588,17 +550,11 @@ 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)) - #if 1 - #define __Pyx_c_abs(z) (::std::abs(z)) - #define __Pyx_c_pow(a, b) (::std::pow(a, b)) - #endif + /*#define __Pyx_c_abs(z) (::std::abs(z))*/ #else #define __Pyx_c_is_zero(z) ((z)==0) #define __Pyx_c_conj(z) (conj(z)) - #if 1 - #define __Pyx_c_abs(z) (cabs(z)) - #define __Pyx_c_pow(a, b) (cpow(a, b)) - #endif + /*#define __Pyx_c_abs(z) (cabs(z))*/ #endif #else static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex); @@ -609,10 +565,7 @@ 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); - #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 + /*static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex);*/ #endif static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *); @@ -681,29 +634,36 @@ 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 scikits.learn.svm.libsvm */ +/* Module declarations from sklearn.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 "scikits.learn.svm.libsvm" -static int __pyx_module_is_main_scikits__learn__svm__libsvm = 0; +#define __Pyx_MODULE_NAME "sklearn.svm.libsvm" +int __pyx_module_is_main_sklearn__svm__libsvm = 0; -/* Implementation of scikits.learn.svm.libsvm */ +/* Implementation of sklearn.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_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 \n Gael Varoquaux \n"; -static char __pyx_k_48[] = "scikits.learn.svm.libsvm"; +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 \n Gael Varoquaux \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__B[] = "B"; static char __pyx_k__C[] = "C"; static char __pyx_k__H[] = "H"; @@ -790,16 +750,23 @@ 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_30; +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_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; @@ -877,7 +844,11 @@ static PyObject *__pyx_int_15; static PyArrayObject *__pyx_k_1; static PyArrayObject *__pyx_k_2; static PyArrayObject *__pyx_k_3; -static PyArrayObject *__pyx_k_12; +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_13; static PyArrayObject *__pyx_k_14; static PyArrayObject *__pyx_k_15; @@ -891,46 +862,8 @@ static PyArrayObject *__pyx_k_22; static PyArrayObject *__pyx_k_23; static PyArrayObject *__pyx_k_24; static PyArrayObject *__pyx_k_25; -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 + +/* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":47 * # Wrapper functions * * def fit( # <<<<<<<<<<<<<< @@ -938,10 +871,9 @@ static PyObject *__pyx_k_tuple_66; * np.ndarray[np.float64_t, ndim=1, mode='c'] Y, */ -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) { +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) { PyArrayObject *__pyx_v_X = 0; PyArrayObject *__pyx_v_Y = 0; int __pyx_v_svm_type; @@ -1020,9 +952,9 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, Py_ssize_t __pyx_bstride_0_support = 0; Py_ssize_t __pyx_bshape_0_support = 0; PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - int __pyx_t_3; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; @@ -1032,39 +964,21 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = 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; + 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; 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; @@ -1186,7 +1100,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, } 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 { @@ -1196,7 +1110,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, __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 { - /* "scikits/learn/svm/libsvm.pyx":51 + /* "/home/fabian/dev/scikit-learn/sklearn/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, # <<<<<<<<<<<<<< @@ -1219,7 +1133,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, __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 { - /* "scikits/learn/svm/libsvm.pyx":52 + /* "/home/fabian/dev/scikit-learn/sklearn/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, # <<<<<<<<<<<<<< @@ -1255,7 +1169,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, __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 { - /* "scikits/learn/svm/libsvm.pyx":60 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":60 * sample_weight=np.empty(0), * int shrinking=1, int probability=0, * double cache_size=100.): # <<<<<<<<<<<<<< @@ -1266,10 +1180,10 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, } } 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); - /* "scikits/learn/svm/libsvm.pyx":51 + /* "/home/fabian/dev/scikit-learn/sklearn/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, # <<<<<<<<<<<<<< @@ -1280,7 +1194,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, __pyx_v_coef0 = ((double)0.); __pyx_v_tol = ((double)1e-3); - /* "scikits/learn/svm/libsvm.pyx":52 + /* "/home/fabian/dev/scikit-learn/sklearn/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, # <<<<<<<<<<<<<< @@ -1296,7 +1210,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, __pyx_v_shrinking = ((int)1); __pyx_v_probability = ((int)0); - /* "scikits/learn/svm/libsvm.pyx":60 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":60 * sample_weight=np.empty(0), * int shrinking=1, int probability=0, * double cache_size=100.): # <<<<<<<<<<<<<< @@ -1332,7 +1246,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, 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: @@ -1346,7 +1260,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, __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("scikits.learn.svm.libsvm.fit"); + __Pyx_AddTraceback("sklearn.svm.libsvm.fit"); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; @@ -1376,7 +1290,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, __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;} @@ -1411,53 +1325,50 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, __pyx_bstride_0_sample_weight = __pyx_bstruct_sample_weight.strides[0]; __pyx_bshape_0_sample_weight = __pyx_bstruct_sample_weight.shape[0]; - /* "scikits/learn/svm/libsvm.pyx":132 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":132 * * * if len(sample_weight) == 0: # <<<<<<<<<<<<<< * sample_weight = np.ones(X.shape[0], dtype=np.float64) * else: */ - __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) { + __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) { - /* "scikits/learn/svm/libsvm.pyx":133 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_GOTREF(__pyx_t_4); - __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_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_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(((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_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_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_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;} + 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;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __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_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_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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 = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = ((PyArrayObject *)__pyx_t_7); { @@ -1485,17 +1396,17 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, } /*else*/ { - /* "scikits/learn/svm/libsvm.pyx":135 + /* "/home/fabian/dev/scikit-learn/sklearn/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 CYTHON_WITHOUT_ASSERTIONS + #ifndef PYREX_WITHOUT_ASSERTIONS if (unlikely(!((__pyx_v_sample_weight->dimensions[0]) == (__pyx_v_X->dimensions[0])))) { - /* "scikits/learn/svm/libsvm.pyx":138 + /* "/home/fabian/dev/scikit-learn/sklearn/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]) # <<<<<<<<<<<<<< @@ -1504,22 +1415,22 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, */ __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_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_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_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(((PyObject *)__pyx_t_5)); + __Pyx_GOTREF(__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_1); - __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); __pyx_t_7 = 0; - __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_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_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __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 = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -1528,7 +1439,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, } __pyx_L6:; - /* "scikits/learn/svm/libsvm.pyx":141 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":141 * * # set problem * kernel_index = LIBSVM_KERNEL_TYPES.index(kernel) # <<<<<<<<<<<<<< @@ -1537,100 +1448,83 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, */ __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_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_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_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(((PyObject *)__pyx_t_5)); + __Pyx_GOTREF(__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_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_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_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_v_kernel_index); __pyx_v_kernel_index = __pyx_t_7; __pyx_t_7 = 0; - /* "scikits/learn/svm/libsvm.pyx":143 + /* "/home/fabian/dev/scikit-learn/sklearn/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_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_t_9); + 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); - /* "scikits/learn/svm/libsvm.pyx":144 + /* "/home/fabian/dev/scikit-learn/sklearn/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_3 = (__pyx_v_problem.x == NULL); - if (__pyx_t_3) { + __pyx_t_2 = (__pyx_v_problem.x == NULL); + if (__pyx_t_2) { - /* "scikits/learn/svm/libsvm.pyx":145 + /* "/home/fabian/dev/scikit-learn/sklearn/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 */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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;} goto __pyx_L7; } __pyx_L7:; - /* "scikits/learn/svm/libsvm.pyx":149 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":149 * # set parameters * set_parameter( * ¶m, svm_type, kernel_index, degree, gamma, coef0, nu, cache_size, # <<<<<<<<<<<<<< * C, tol, epsilon, shrinking, probability, class_weight.shape[0], * class_weight_label.data, class_weight.data) */ - __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, 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])); + __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;} - /* "scikits/learn/svm/libsvm.pyx":151 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":151 * ¶m, svm_type, kernel_index, degree, gamma, coef0, nu, cache_size, * C, tol, epsilon, shrinking, probability, class_weight.shape[0], * class_weight_label.data, class_weight.data) # <<<<<<<<<<<<<< * * # check parameters */ - __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); + 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); - /* "scikits/learn/svm/libsvm.pyx":154 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":154 * * # check parameters * error_msg = svm_check_parameter(&problem, ¶m) # <<<<<<<<<<<<<< @@ -1639,41 +1533,41 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, */ __pyx_v_error_msg = svm_check_parameter((&__pyx_v_problem), (&__pyx_v_param)); - /* "scikits/learn/svm/libsvm.pyx":155 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":155 * # check parameters * error_msg = svm_check_parameter(&problem, ¶m) * if error_msg: # <<<<<<<<<<<<<< * raise ValueError(error_msg) * */ - __pyx_t_3 = (__pyx_v_error_msg != 0); - if (__pyx_t_3) { + __pyx_t_2 = (__pyx_v_error_msg != 0); + if (__pyx_t_2) { - /* "scikits/learn/svm/libsvm.pyx":156 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_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 = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_7, 0, 0); + 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(__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:; - /* "scikits/learn/svm/libsvm.pyx":159 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":159 * * # this does the real work * model = svm_train(&problem, ¶m) # <<<<<<<<<<<<<< @@ -1682,7 +1576,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, */ __pyx_v_model = svm_train((&__pyx_v_problem), (&__pyx_v_param)); - /* "scikits/learn/svm/libsvm.pyx":163 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":163 * # from here until the end, we just copy the data returned by * # svm_train * SV_len = get_l(model) # <<<<<<<<<<<<<< @@ -1691,69 +1585,69 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, */ __pyx_v_SV_len = get_l(__pyx_v_model); - /* "scikits/learn/svm/libsvm.pyx":164 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":164 * # svm_train * SV_len = get_l(model) * n_class = get_nr(model) # <<<<<<<<<<<<<< * * # copy model.sv_coef */ - __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_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_DECREF(__pyx_v_n_class); - __pyx_v_n_class = __pyx_t_7; - __pyx_t_7 = 0; + __pyx_v_n_class = __pyx_t_5; + __pyx_t_5 = 0; - /* "scikits/learn/svm/libsvm.pyx":168 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_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_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_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_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_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_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_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(((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_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_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_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_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_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __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 = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __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_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_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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 = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_31 = ((PyArrayObject *)__pyx_t_6); + __pyx_t_13 = ((PyArrayObject *)__pyx_t_6); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_sv_coef); - __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)) { + __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)) { 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); @@ -1764,14 +1658,14 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, } __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_30 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_31 = 0; + __pyx_t_13 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_sv_coef)); __pyx_v_sv_coef = ((PyArrayObject *)__pyx_t_6); __pyx_t_6 = 0; - /* "scikits/learn/svm/libsvm.pyx":169 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -1780,7 +1674,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, */ copy_sv_coef(__pyx_v_sv_coef->data, __pyx_v_model); - /* "scikits/learn/svm/libsvm.pyx":174 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -1794,38 +1688,38 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, __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_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_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_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __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_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_GOTREF(__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_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_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_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_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_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_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 = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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_GOTREF(__pyx_t_5); __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); + 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_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); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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 = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_32 = ((PyArrayObject *)__pyx_t_7); + 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); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_intercept); - __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)) { + __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)) { 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); @@ -1836,14 +1730,14 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, } __pyx_bstride_0_intercept = __pyx_bstruct_intercept.strides[0]; __pyx_bshape_0_intercept = __pyx_bstruct_intercept.shape[0]; - if (unlikely(__pyx_t_30 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_32 = 0; + __pyx_t_14 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_intercept)); - __pyx_v_intercept = ((PyArrayObject *)__pyx_t_7); - __pyx_t_7 = 0; + __pyx_v_intercept = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; - /* "scikits/learn/svm/libsvm.pyx":175 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -1852,46 +1746,46 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, */ copy_intercept(__pyx_v_intercept->data, __pyx_v_model, __pyx_v_intercept->dimensions); - /* "scikits/learn/svm/libsvm.pyx":178 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_GOTREF(__pyx_t_6); - __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_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_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_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_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_DECREF(__pyx_t_4); __pyx_t_4 = 0; - 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); + 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); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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_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_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_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_support); - __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)) { + __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)) { 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); @@ -1902,14 +1796,14 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, } __pyx_bstride_0_support = __pyx_bstruct_support.strides[0]; __pyx_bshape_0_support = __pyx_bstruct_support.shape[0]; - if (unlikely(__pyx_t_30 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_33 = 0; + __pyx_t_15 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_support)); - __pyx_v_support = ((PyArrayObject *)__pyx_t_5); - __pyx_t_5 = 0; + __pyx_v_support = ((PyArrayObject *)__pyx_t_7); + __pyx_t_7 = 0; - /* "scikits/learn/svm/libsvm.pyx":179 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -1918,51 +1812,65 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, */ copy_support(__pyx_v_support->data, __pyx_v_model); - /* "scikits/learn/svm/libsvm.pyx":183 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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) { + __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) { - /* "scikits/learn/svm/libsvm.pyx":184 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_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 = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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_GOTREF(__pyx_t_7); - __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_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_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 = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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_6); __pyx_t_6 = 0; - __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); + 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_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_support_vectors); - __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)) { + __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)) { 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); @@ -1973,66 +1881,66 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, } __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_30 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_34 = 0; + __pyx_t_16 = 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; goto __pyx_L9; } /*else*/ { - /* "scikits/learn/svm/libsvm.pyx":186 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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 = __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_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_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_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_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 = 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_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_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_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_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_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_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_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_support_vectors); - __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)) { + __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)) { 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); @@ -2043,14 +1951,14 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, } __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_30 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_34 = 0; + __pyx_t_16 = 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; - /* "scikits/learn/svm/libsvm.pyx":187 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -2061,44 +1969,44 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, } __pyx_L9:; - /* "scikits/learn/svm/libsvm.pyx":192 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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 = 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_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_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_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_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_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_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_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_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_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_n_class_SV); - __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)) { + __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)) { 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); @@ -2109,14 +2017,14 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, } __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_30 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_35 = 0; + __pyx_t_17 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_n_class_SV)); - __pyx_v_n_class_SV = ((PyArrayObject *)__pyx_t_6); - __pyx_t_6 = 0; + __pyx_v_n_class_SV = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; - /* "scikits/learn/svm/libsvm.pyx":193 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -2125,44 +2033,44 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, */ copy_nSV(__pyx_v_n_class_SV->data, __pyx_v_model); - /* "scikits/learn/svm/libsvm.pyx":197 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_INCREF(__pyx_v_n_class); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_n_class); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_n_class); __Pyx_GIVEREF(__pyx_v_n_class); - __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_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_GOTREF(__pyx_t_5); - __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_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_5); __pyx_t_5 = 0; - __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); + 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_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; - __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); + 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_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_label); - __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)) { + __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)) { 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); @@ -2173,14 +2081,14 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, } __pyx_bstride_0_label = __pyx_bstruct_label.strides[0]; __pyx_bshape_0_label = __pyx_bstruct_label.shape[0]; - if (unlikely(__pyx_t_30 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_36 = 0; + __pyx_t_18 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_label)); - __pyx_v_label = ((PyArrayObject *)__pyx_t_5); - __pyx_t_5 = 0; + __pyx_v_label = ((PyArrayObject *)__pyx_t_7); + __pyx_t_7 = 0; - /* "scikits/learn/svm/libsvm.pyx":198 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -2189,72 +2097,72 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, */ copy_label(__pyx_v_label->data, __pyx_v_model); - /* "scikits/learn/svm/libsvm.pyx":203 + /* "/home/fabian/dev/scikit-learn/sklearn/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_3 = (__pyx_v_probability != 0); - if (__pyx_t_3) { + __pyx_t_2 = (__pyx_v_probability != 0); + if (__pyx_t_2) { - /* "scikits/learn/svm/libsvm.pyx":204 + /* "/home/fabian/dev/scikit-learn/sklearn/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_3 = (__pyx_v_svm_type < 2); - if (__pyx_t_3) { + __pyx_t_2 = (__pyx_v_svm_type < 2); + if (__pyx_t_2) { - /* "scikits/learn/svm/libsvm.pyx":205 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_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_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_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_GOTREF(__pyx_t_5); - __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_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_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __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_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_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_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_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_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_probA); - __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)) { + __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)) { 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); @@ -2265,59 +2173,59 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, } __pyx_bstride_0_probA = __pyx_bstruct_probA.strides[0]; __pyx_bshape_0_probA = __pyx_bstruct_probA.shape[0]; - if (unlikely(__pyx_t_30 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_37 = 0; + __pyx_t_19 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_probA)); - __pyx_v_probA = ((PyArrayObject *)__pyx_t_1); - __pyx_t_1 = 0; + __pyx_v_probA = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; - /* "scikits/learn/svm/libsvm.pyx":206 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_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_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; - __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_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_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - 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_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_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_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_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_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); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_probB); - __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)) { + __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)) { 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); @@ -2328,14 +2236,14 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, } __pyx_bstride_0_probB = __pyx_bstruct_probB.strides[0]; __pyx_bshape_0_probB = __pyx_bstruct_probB.shape[0]; - if (unlikely(__pyx_t_30 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_38 = 0; + __pyx_t_20 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_probB)); - __pyx_v_probB = ((PyArrayObject *)__pyx_t_7); - __pyx_t_7 = 0; + __pyx_v_probB = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; - /* "scikits/learn/svm/libsvm.pyx":207 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -2347,38 +2255,44 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, } /*else*/ { - /* "scikits/learn/svm/libsvm.pyx":209 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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; - __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_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_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_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; - 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_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_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __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_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_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_probA); - __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)) { + __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)) { 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); @@ -2389,45 +2303,51 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, } __pyx_bstride_0_probA = __pyx_bstruct_probA.strides[0]; __pyx_bshape_0_probA = __pyx_bstruct_probA.shape[0]; - if (unlikely(__pyx_t_30 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_37 = 0; + __pyx_t_19 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_probA)); - __pyx_v_probA = ((PyArrayObject *)__pyx_t_5); - __pyx_t_5 = 0; + __pyx_v_probA = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; - /* "scikits/learn/svm/libsvm.pyx":210 + /* "/home/fabian/dev/scikit-learn/sklearn/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__empty); 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__float64); 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; - __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_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); + 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_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_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_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_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_probB); - __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)) { + __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)) { 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); @@ -2438,16 +2358,16 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, } __pyx_bstride_0_probB = __pyx_bstruct_probB.strides[0]; __pyx_bshape_0_probB = __pyx_bstruct_probB.shape[0]; - if (unlikely(__pyx_t_30 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_38 = 0; + __pyx_t_20 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_probB)); - __pyx_v_probB = ((PyArrayObject *)__pyx_t_6); - __pyx_t_6 = 0; + __pyx_v_probB = ((PyArrayObject *)__pyx_t_7); + __pyx_t_7 = 0; } __pyx_L11:; - /* "scikits/learn/svm/libsvm.pyx":211 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -2459,38 +2379,44 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, } /*else*/ { - /* "scikits/learn/svm/libsvm.pyx":213 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_DECREF(__pyx_t_7); __pyx_t_7 = 0; - 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_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;} __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_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); + 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); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_probA); - __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)) { + __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)) { 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); @@ -2501,45 +2427,51 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, } __pyx_bstride_0_probA = __pyx_bstruct_probA.strides[0]; __pyx_bshape_0_probA = __pyx_bstruct_probA.shape[0]; - if (unlikely(__pyx_t_30 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_37 = 0; + __pyx_t_19 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_probA)); - __pyx_v_probA = ((PyArrayObject *)__pyx_t_1); - __pyx_t_1 = 0; + __pyx_v_probA = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; - /* "scikits/learn/svm/libsvm.pyx":214 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_DECREF(__pyx_t_5); __pyx_t_5 = 0; - 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_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); __Pyx_DECREF(__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 = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_37 = ((PyArrayObject *)__pyx_t_7); + __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_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_probA); - __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)) { + __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)) { 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); @@ -2550,16 +2482,16 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, } __pyx_bstride_0_probA = __pyx_bstruct_probA.strides[0]; __pyx_bshape_0_probA = __pyx_bstruct_probA.shape[0]; - if (unlikely(__pyx_t_30 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_37 = 0; + __pyx_t_19 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_probA)); - __pyx_v_probA = ((PyArrayObject *)__pyx_t_7); - __pyx_t_7 = 0; + __pyx_v_probA = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; } __pyx_L10:; - /* "scikits/learn/svm/libsvm.pyx":217 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":217 * * # memory deallocation * svm_free_and_destroy_model(&model) # <<<<<<<<<<<<<< @@ -2568,7 +2500,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, */ svm_free_and_destroy_model((&__pyx_v_model)); - /* "scikits/learn/svm/libsvm.pyx":218 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":218 * # memory deallocation * svm_free_and_destroy_model(&model) * free(problem.x) # <<<<<<<<<<<<<< @@ -2577,7 +2509,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, */ free(__pyx_v_problem.x); - /* "scikits/learn/svm/libsvm.pyx":219 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":219 * svm_free_and_destroy_model(&model) * free(problem.x) * return support, support_vectors, n_class_SV, sv_coef, intercept, label, \ # <<<<<<<<<<<<<< @@ -2586,47 +2518,47 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, */ __Pyx_XDECREF(__pyx_r); - /* "scikits/learn/svm/libsvm.pyx":220 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":220 * free(problem.x) * return support, support_vectors, n_class_SV, sv_coef, intercept, label, \ * probA, probB # <<<<<<<<<<<<<< * * */ - __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_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_INCREF(((PyObject *)__pyx_v_support)); - PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_support)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_support)); __Pyx_GIVEREF(((PyObject *)__pyx_v_support)); __Pyx_INCREF(((PyObject *)__pyx_v_support_vectors)); - PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)__pyx_v_support_vectors)); + PyTuple_SET_ITEM(__pyx_t_4, 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_7, 2, ((PyObject *)__pyx_v_n_class_SV)); + PyTuple_SET_ITEM(__pyx_t_4, 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_7, 3, ((PyObject *)__pyx_v_sv_coef)); + PyTuple_SET_ITEM(__pyx_t_4, 3, ((PyObject *)__pyx_v_sv_coef)); __Pyx_GIVEREF(((PyObject *)__pyx_v_sv_coef)); __Pyx_INCREF(((PyObject *)__pyx_v_intercept)); - PyTuple_SET_ITEM(__pyx_t_7, 4, ((PyObject *)__pyx_v_intercept)); + PyTuple_SET_ITEM(__pyx_t_4, 4, ((PyObject *)__pyx_v_intercept)); __Pyx_GIVEREF(((PyObject *)__pyx_v_intercept)); __Pyx_INCREF(((PyObject *)__pyx_v_label)); - PyTuple_SET_ITEM(__pyx_t_7, 5, ((PyObject *)__pyx_v_label)); + PyTuple_SET_ITEM(__pyx_t_4, 5, ((PyObject *)__pyx_v_label)); __Pyx_GIVEREF(((PyObject *)__pyx_v_label)); __Pyx_INCREF(((PyObject *)__pyx_v_probA)); - PyTuple_SET_ITEM(__pyx_t_7, 6, ((PyObject *)__pyx_v_probA)); + PyTuple_SET_ITEM(__pyx_t_4, 6, ((PyObject *)__pyx_v_probA)); __Pyx_GIVEREF(((PyObject *)__pyx_v_probA)); __Pyx_INCREF(((PyObject *)__pyx_v_probB)); - PyTuple_SET_ITEM(__pyx_t_7, 7, ((PyObject *)__pyx_v_probB)); + PyTuple_SET_ITEM(__pyx_t_4, 7, ((PyObject *)__pyx_v_probB)); __Pyx_GIVEREF(((PyObject *)__pyx_v_probB)); - __pyx_r = ((PyObject *)__pyx_t_7); - __pyx_t_7 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); @@ -2647,7 +2579,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, __Pyx_SafeReleaseBuffer(&__pyx_bstruct_n_class_SV); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_support); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("scikits.learn.svm.libsvm.fit"); + __Pyx_AddTraceback("sklearn.svm.libsvm.fit"); __pyx_r = NULL; goto __pyx_L2; __pyx_L0:; @@ -2681,7 +2613,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, return __pyx_r; } -/* "scikits/learn/svm/libsvm.pyx":223 +/* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":223 * * * def predict(np.ndarray[np.float64_t, ndim=2, mode='c'] X, # <<<<<<<<<<<<<< @@ -2689,10 +2621,9 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_fit(PyObject *__pyx_self, * np.ndarray[np.float64_t, ndim=2, mode='c'] SV, */ -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) { +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) { PyArrayObject *__pyx_v_X = 0; PyArrayObject *__pyx_v_support = 0; PyArrayObject *__pyx_v_SV = 0; @@ -2770,38 +2701,24 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_1predict(PyObject *__pyx_ PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; - 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; + 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; 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_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; + 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; 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); @@ -2974,7 +2891,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_1predict(PyObject *__pyx_ } 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 { @@ -2984,7 +2901,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_1predict(PyObject *__pyx_ __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 { - /* "scikits/learn/svm/libsvm.pyx":233 + /* "/home/fabian/dev/scikit-learn/sklearn/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, # <<<<<<<<<<<<<< @@ -3007,7 +2924,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_1predict(PyObject *__pyx_ __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 { - /* "scikits/learn/svm/libsvm.pyx":234 + /* "/home/fabian/dev/scikit-learn/sklearn/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, # <<<<<<<<<<<<<< @@ -3043,7 +2960,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_1predict(PyObject *__pyx_ __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 { - /* "scikits/learn/svm/libsvm.pyx":242 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":242 * sample_weight=np.empty(0), * int shrinking=0, int probability=0, * double cache_size=100.): # <<<<<<<<<<<<<< @@ -3053,13 +2970,13 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_1predict(PyObject *__pyx_ __pyx_v_cache_size = ((double)100.); } } else { - __pyx_v_probA = __pyx_k_12; - __pyx_v_probB = __pyx_k_13; + __pyx_v_probA = __pyx_k_7; + __pyx_v_probB = __pyx_k_8; __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); - /* "scikits/learn/svm/libsvm.pyx":233 + /* "/home/fabian/dev/scikit-learn/sklearn/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, # <<<<<<<<<<<<<< @@ -3070,7 +2987,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_1predict(PyObject *__pyx_ __pyx_v_coef0 = ((double)0.); __pyx_v_tol = ((double)1e-3); - /* "scikits/learn/svm/libsvm.pyx":234 + /* "/home/fabian/dev/scikit-learn/sklearn/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, # <<<<<<<<<<<<<< @@ -3080,13 +2997,13 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_1predict(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_14; - __pyx_v_class_weight = __pyx_k_15; - __pyx_v_sample_weight = __pyx_k_16; + __pyx_v_class_weight_label = __pyx_k_9; + __pyx_v_class_weight = __pyx_k_10; + __pyx_v_sample_weight = __pyx_k_11; __pyx_v_shrinking = ((int)0); __pyx_v_probability = ((int)0); - /* "scikits/learn/svm/libsvm.pyx":242 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":242 * sample_weight=np.empty(0), * int shrinking=0, int probability=0, * double cache_size=100.): # <<<<<<<<<<<<<< @@ -3122,7 +3039,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_1predict(PyObject *__pyx_ 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: @@ -3145,7 +3062,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_1predict(PyObject *__pyx_ __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("scikits.learn.svm.libsvm.predict"); + __Pyx_AddTraceback("sklearn.svm.libsvm.predict"); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; @@ -3173,7 +3090,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_1predict(PyObject *__pyx_ 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;} @@ -3250,7 +3167,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_1predict(PyObject *__pyx_ __pyx_bstride_0_sample_weight = __pyx_bstruct_sample_weight.strides[0]; __pyx_bshape_0_sample_weight = __pyx_bstruct_sample_weight.shape[0]; - /* "scikits/learn/svm/libsvm.pyx":288 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":288 * cdef svm_model *model * * kernel_index = LIBSVM_KERNEL_TYPES.index(kernel) # <<<<<<<<<<<<<< @@ -3263,67 +3180,37 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_1predict(PyObject *__pyx_ __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(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__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, ((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_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_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_v_kernel_index); __pyx_v_kernel_index = __pyx_t_3; __pyx_t_3 = 0; - /* "scikits/learn/svm/libsvm.pyx":289 + /* "/home/fabian/dev/scikit-learn/sklearn/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, class_weight.shape[0], */ - __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, 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, 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_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;} - /* "scikits/learn/svm/libsvm.pyx":292 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":292 * nu, cache_size, C, tol, epsilon, shrinking, * probability, class_weight.shape[0], * class_weight_label.data, class_weight.data) # <<<<<<<<<<<<<< * * model = set_model(¶m, nSV.shape[0], SV.data, SV.shape, */ - __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); + 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); - /* "scikits/learn/svm/libsvm.pyx":297 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":297 * support.data, support.shape, sv_coef.strides, * sv_coef.data, intercept.data, nSV.data, * label.data, probA.data, probB.data) # <<<<<<<<<<<<<< @@ -3332,7 +3219,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_1predict(PyObject *__pyx_ */ __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); - /* "scikits/learn/svm/libsvm.pyx":300 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":300 * * #TODO: use check_model * dec_values = np.empty(X.shape[0]) # <<<<<<<<<<<<<< @@ -3347,61 +3234,71 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_1predict(PyObject *__pyx_ __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(((PyObject *)__pyx_t_2)); + __Pyx_GOTREF(__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, ((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_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_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__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_19 = ((PyArrayObject *)__pyx_t_3); + __pyx_t_5 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_dec_values); - __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); + __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); 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_20); Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_22); + Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); __Pyx_RaiseBufferFallbackError(); } else { - PyErr_Restore(__pyx_t_20, __pyx_t_21, __pyx_t_22); + PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8); } } __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_17 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_19 = 0; + __pyx_t_5 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_dec_values)); __pyx_v_dec_values = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "scikits/learn/svm/libsvm.pyx":301 + /* "/home/fabian/dev/scikit-learn/sklearn/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_23 = (copy_predict(__pyx_v_X->data, __pyx_v_model, __pyx_v_X->dimensions, __pyx_v_dec_values->data) < 0); - if (__pyx_t_23) { + __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) { - /* "scikits/learn/svm/libsvm.pyx":302 + /* "/home/fabian/dev/scikit-learn/sklearn/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 */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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;} goto __pyx_L6; } __pyx_L6:; - /* "scikits/learn/svm/libsvm.pyx":303 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -3410,7 +3307,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_1predict(PyObject *__pyx_ */ free_model(__pyx_v_model); - /* "scikits/learn/svm/libsvm.pyx":304 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":304 * raise MemoryError("We've run out of of memory") * free_model(model) * return dec_values # <<<<<<<<<<<<<< @@ -3444,7 +3341,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_1predict(PyObject *__pyx_ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_SV); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_class_weight_label); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("scikits.learn.svm.libsvm.predict"); + __Pyx_AddTraceback("sklearn.svm.libsvm.predict"); __pyx_r = NULL; goto __pyx_L2; __pyx_L0:; @@ -3469,7 +3366,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_1predict(PyObject *__pyx_ return __pyx_r; } -/* "scikits/learn/svm/libsvm.pyx":308 +/* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":308 * * * def predict_proba( # <<<<<<<<<<<<<< @@ -3477,10 +3374,9 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_1predict(PyObject *__pyx_ * np.ndarray[np.int32_t, ndim=1, mode='c'] support, */ -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) { +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) { PyArrayObject *__pyx_v_X = 0; PyArrayObject *__pyx_v_support = 0; PyArrayObject *__pyx_v_SV = 0; @@ -3561,40 +3457,26 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_2predict_proba(PyObject * PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; - 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; + 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; 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_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; + 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; 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); @@ -3767,7 +3649,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_2predict_proba(PyObject * } 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 { @@ -3777,7 +3659,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_2predict_proba(PyObject * __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 { - /* "scikits/learn/svm/libsvm.pyx":319 + /* "/home/fabian/dev/scikit-learn/sklearn/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, # <<<<<<<<<<<<<< @@ -3800,7 +3682,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_2predict_proba(PyObject * __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 { - /* "scikits/learn/svm/libsvm.pyx":320 + /* "/home/fabian/dev/scikit-learn/sklearn/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, # <<<<<<<<<<<<<< @@ -3836,7 +3718,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_2predict_proba(PyObject * __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 { - /* "scikits/learn/svm/libsvm.pyx":328 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":328 * sample_weight=np.empty(0), * int shrinking=0, int probability=0, * double cache_size=100.): # <<<<<<<<<<<<<< @@ -3846,13 +3728,13 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_2predict_proba(PyObject * __pyx_v_cache_size = ((double)100.); } } else { - __pyx_v_probA = __pyx_k_17; - __pyx_v_probB = __pyx_k_18; + __pyx_v_probA = __pyx_k_13; + __pyx_v_probB = __pyx_k_14; __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); - /* "scikits/learn/svm/libsvm.pyx":319 + /* "/home/fabian/dev/scikit-learn/sklearn/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, # <<<<<<<<<<<<<< @@ -3863,7 +3745,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_2predict_proba(PyObject * __pyx_v_coef0 = ((double)0.); __pyx_v_tol = ((double)1e-3); - /* "scikits/learn/svm/libsvm.pyx":320 + /* "/home/fabian/dev/scikit-learn/sklearn/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, # <<<<<<<<<<<<<< @@ -3873,13 +3755,13 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_2predict_proba(PyObject * __pyx_v_C = ((double)1.); __pyx_v_nu = ((double)0.5); __pyx_v_epsilon = ((double)0.1); - __pyx_v_class_weight_label = __pyx_k_19; - __pyx_v_class_weight = __pyx_k_20; - __pyx_v_sample_weight = __pyx_k_21; + __pyx_v_class_weight_label = __pyx_k_15; + __pyx_v_class_weight = __pyx_k_16; + __pyx_v_sample_weight = __pyx_k_17; __pyx_v_shrinking = ((int)0); __pyx_v_probability = ((int)0); - /* "scikits/learn/svm/libsvm.pyx":328 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":328 * sample_weight=np.empty(0), * int shrinking=0, int probability=0, * double cache_size=100.): # <<<<<<<<<<<<<< @@ -3915,7 +3797,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_2predict_proba(PyObject * 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: @@ -3938,7 +3820,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_2predict_proba(PyObject * __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("scikits.learn.svm.libsvm.predict_proba"); + __Pyx_AddTraceback("sklearn.svm.libsvm.predict_proba"); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; @@ -3966,7 +3848,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_2predict_proba(PyObject * 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;} @@ -4043,7 +3925,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_2predict_proba(PyObject * __pyx_bstride_0_sample_weight = __pyx_bstruct_sample_weight.strides[0]; __pyx_bshape_0_sample_weight = __pyx_bstruct_sample_weight.shape[0]; - /* "scikits/learn/svm/libsvm.pyx":362 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":362 * cdef svm_model *model * * kernel_index = LIBSVM_KERNEL_TYPES.index(kernel) # <<<<<<<<<<<<<< @@ -4056,67 +3938,37 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_2predict_proba(PyObject * __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(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__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, ((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_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_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_v_kernel_index); __pyx_v_kernel_index = __pyx_t_3; __pyx_t_3 = 0; - /* "scikits/learn/svm/libsvm.pyx":363 + /* "/home/fabian/dev/scikit-learn/sklearn/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, class_weight.shape[0], class_weight_label.data, */ - __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, 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, 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; + __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;} - /* "scikits/learn/svm/libsvm.pyx":366 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":366 * coef0, nu, cache_size, C, tol, epsilon, shrinking, * probability, class_weight.shape[0], class_weight_label.data, * class_weight.data) # <<<<<<<<<<<<<< * * model = set_model(¶m, nSV.shape[0], SV.data, SV.shape, */ - 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); + 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); - /* "scikits/learn/svm/libsvm.pyx":371 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":371 * support.data, support.shape, sv_coef.strides, * sv_coef.data, intercept.data, nSV.data, * label.data, probA.data, probB.data) # <<<<<<<<<<<<<< @@ -4125,7 +3977,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_2predict_proba(PyObject * */ __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); - /* "scikits/learn/svm/libsvm.pyx":373 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":373 * label.data, probA.data, probB.data) * * cdef np.npy_intp n_class = get_nr(model) # <<<<<<<<<<<<<< @@ -4134,7 +3986,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_2predict_proba(PyObject * */ __pyx_v_n_class = get_nr(__pyx_v_model); - /* "scikits/learn/svm/libsvm.pyx":374 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -4150,80 +4002,90 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_2predict_proba(PyObject * __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_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_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_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_5, 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(((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_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_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_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_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_DECREF(__pyx_t_3); __pyx_t_3 = 0; - 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); + 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); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __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_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_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_dec_values); - __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); + __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); 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_22); Py_XDECREF(__pyx_t_23); Py_XDECREF(__pyx_t_24); + Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); __Pyx_RaiseBufferFallbackError(); } else { - PyErr_Restore(__pyx_t_22, __pyx_t_23, __pyx_t_24); + PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); } } __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_17 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_21 = 0; + __pyx_t_7 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_dec_values)); - __pyx_v_dec_values = ((PyArrayObject *)__pyx_t_20); - __pyx_t_20 = 0; + __pyx_v_dec_values = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; - /* "scikits/learn/svm/libsvm.pyx":375 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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) { + __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) { - /* "scikits/learn/svm/libsvm.pyx":376 + /* "/home/fabian/dev/scikit-learn/sklearn/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) */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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;} goto __pyx_L6; } __pyx_L6:; - /* "scikits/learn/svm/libsvm.pyx":378 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":378 * raise MemoryError("We've run out of of memory") * # free model and param * free_model(model) # <<<<<<<<<<<<<< @@ -4232,7 +4094,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_2predict_proba(PyObject * */ free_model(__pyx_v_model); - /* "scikits/learn/svm/libsvm.pyx":379 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":379 * # free model and param * free_model(model) * return dec_values # <<<<<<<<<<<<<< @@ -4250,8 +4112,8 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_2predict_proba(PyObject * __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_19); - __Pyx_XDECREF(__pyx_t_20); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_probA); @@ -4268,7 +4130,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_2predict_proba(PyObject * __Pyx_SafeReleaseBuffer(&__pyx_bstruct_SV); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_class_weight_label); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("scikits.learn.svm.libsvm.predict_proba"); + __Pyx_AddTraceback("sklearn.svm.libsvm.predict_proba"); __pyx_r = NULL; goto __pyx_L2; __pyx_L0:; @@ -4293,7 +4155,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_2predict_proba(PyObject * return __pyx_r; } -/* "scikits/learn/svm/libsvm.pyx":382 +/* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":382 * * * def decision_function( # <<<<<<<<<<<<<< @@ -4301,10 +4163,9 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_2predict_proba(PyObject * * np.ndarray[np.int32_t, ndim=1, mode='c'] support, */ -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) { +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) { PyArrayObject *__pyx_v_X = 0; PyArrayObject *__pyx_v_support = 0; PyArrayObject *__pyx_v_SV = 0; @@ -4385,40 +4246,26 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_3decision_function(PyObje PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; - struct svm_parameter *__pyx_t_4; + int __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; - 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; + 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; 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_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; + 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; 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); @@ -4591,7 +4438,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_3decision_function(PyObje } 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 { @@ -4601,7 +4448,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_3decision_function(PyObje __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 { - /* "scikits/learn/svm/libsvm.pyx":393 + /* "/home/fabian/dev/scikit-learn/sklearn/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, # <<<<<<<<<<<<<< @@ -4624,7 +4471,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_3decision_function(PyObje __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 { - /* "scikits/learn/svm/libsvm.pyx":394 + /* "/home/fabian/dev/scikit-learn/sklearn/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, # <<<<<<<<<<<<<< @@ -4660,7 +4507,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_3decision_function(PyObje __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 { - /* "scikits/learn/svm/libsvm.pyx":402 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":402 * sample_weight=np.empty(0), * int shrinking=0, int probability=0, * double cache_size=100.): # <<<<<<<<<<<<<< @@ -4670,13 +4517,13 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_3decision_function(PyObje __pyx_v_cache_size = ((double)100.); } } else { - __pyx_v_probA = __pyx_k_22; - __pyx_v_probB = __pyx_k_23; + __pyx_v_probA = __pyx_k_18; + __pyx_v_probB = __pyx_k_19; __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); - /* "scikits/learn/svm/libsvm.pyx":393 + /* "/home/fabian/dev/scikit-learn/sklearn/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, # <<<<<<<<<<<<<< @@ -4687,7 +4534,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_3decision_function(PyObje __pyx_v_coef0 = ((double)0.); __pyx_v_tol = ((double)1e-3); - /* "scikits/learn/svm/libsvm.pyx":394 + /* "/home/fabian/dev/scikit-learn/sklearn/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, # <<<<<<<<<<<<<< @@ -4697,13 +4544,13 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_3decision_function(PyObje __pyx_v_C = ((double)1.); __pyx_v_nu = ((double)0.5); __pyx_v_epsilon = ((double)0.1); - __pyx_v_class_weight_label = __pyx_k_24; - __pyx_v_class_weight = __pyx_k_25; - __pyx_v_sample_weight = __pyx_k_26; + __pyx_v_class_weight_label = __pyx_k_20; + __pyx_v_class_weight = __pyx_k_21; + __pyx_v_sample_weight = __pyx_k_22; __pyx_v_shrinking = ((int)0); __pyx_v_probability = ((int)0); - /* "scikits/learn/svm/libsvm.pyx":402 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":402 * sample_weight=np.empty(0), * int shrinking=0, int probability=0, * double cache_size=100.): # <<<<<<<<<<<<<< @@ -4739,7 +4586,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_3decision_function(PyObje 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: @@ -4762,7 +4609,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_3decision_function(PyObje __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("scikits.learn.svm.libsvm.decision_function"); + __Pyx_AddTraceback("sklearn.svm.libsvm.decision_function"); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; @@ -4790,7 +4637,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_3decision_function(PyObje 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;} @@ -4867,7 +4714,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_3decision_function(PyObje __pyx_bstride_0_sample_weight = __pyx_bstruct_sample_weight.strides[0]; __pyx_bshape_0_sample_weight = __pyx_bstruct_sample_weight.shape[0]; - /* "scikits/learn/svm/libsvm.pyx":414 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":414 * cdef np.npy_intp n_class * * kernel_index = LIBSVM_KERNEL_TYPES.index(kernel) # <<<<<<<<<<<<<< @@ -4880,67 +4727,37 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_3decision_function(PyObje __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(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__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, ((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_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_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_v_kernel_index); __pyx_v_kernel_index = __pyx_t_3; __pyx_t_3 = 0; - /* "scikits/learn/svm/libsvm.pyx":415 + /* "/home/fabian/dev/scikit-learn/sklearn/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, class_weight.shape[0], class_weight_label.data, */ - __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, 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, 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; + __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;} - /* "scikits/learn/svm/libsvm.pyx":418 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":418 * coef0, nu, cache_size, C, tol, epsilon, shrinking, * probability, class_weight.shape[0], class_weight_label.data, * class_weight.data) # <<<<<<<<<<<<<< * * model = set_model(¶m, nSV.shape[0], SV.data, SV.shape, */ - 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); + 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); - /* "scikits/learn/svm/libsvm.pyx":423 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":423 * support.data, support.shape, sv_coef.strides, * sv_coef.data, intercept.data, nSV.data, * label.data, probA.data, probB.data) # <<<<<<<<<<<<<< @@ -4949,17 +4766,17 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_3decision_function(PyObje */ __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); - /* "scikits/learn/svm/libsvm.pyx":425 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":425 * label.data, probA.data, probB.data) * * if svm_type > 1: # <<<<<<<<<<<<<< * n_class = 1 * else: */ - __pyx_t_19 = (__pyx_v_svm_type > 1); - if (__pyx_t_19) { + __pyx_t_5 = (__pyx_v_svm_type > 1); + if (__pyx_t_5) { - /* "scikits/learn/svm/libsvm.pyx":426 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":426 * * if svm_type > 1: * n_class = 1 # <<<<<<<<<<<<<< @@ -4971,7 +4788,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_3decision_function(PyObje } /*else*/ { - /* "scikits/learn/svm/libsvm.pyx":428 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":428 * n_class = 1 * else: * n_class = get_nr(model) # <<<<<<<<<<<<<< @@ -4980,7 +4797,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_3decision_function(PyObje */ __pyx_v_n_class = get_nr(__pyx_v_model); - /* "scikits/learn/svm/libsvm.pyx":429 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":429 * else: * n_class = get_nr(model) * n_class = n_class * (n_class - 1) / 2 # <<<<<<<<<<<<<< @@ -4991,7 +4808,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_3decision_function(PyObje } __pyx_L6:; - /* "scikits/learn/svm/libsvm.pyx":431 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":431 * n_class = n_class * (n_class - 1) / 2 * * dec_values = np.empty((X.shape[0], n_class), dtype=np.float64) # <<<<<<<<<<<<<< @@ -5007,80 +4824,90 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_3decision_function(PyObje __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_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_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_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_6, 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(((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_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_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_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_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_DECREF(__pyx_t_3); __pyx_t_3 = 0; - 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); + 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); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __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_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_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_dec_values); - __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); + __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); 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_23); Py_XDECREF(__pyx_t_24); Py_XDECREF(__pyx_t_25); + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); __Pyx_RaiseBufferFallbackError(); } else { - PyErr_Restore(__pyx_t_23, __pyx_t_24, __pyx_t_25); + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); } } __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_17 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_22 = 0; + __pyx_t_8 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_dec_values)); - __pyx_v_dec_values = ((PyArrayObject *)__pyx_t_21); - __pyx_t_21 = 0; + __pyx_v_dec_values = ((PyArrayObject *)__pyx_t_7); + __pyx_t_7 = 0; - /* "scikits/learn/svm/libsvm.pyx":432 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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) { + __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) { - /* "scikits/learn/svm/libsvm.pyx":433 + /* "/home/fabian/dev/scikit-learn/sklearn/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) */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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;} goto __pyx_L7; } __pyx_L7:; - /* "scikits/learn/svm/libsvm.pyx":435 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":435 * raise MemoryError("We've run out of of memory") * # free model and param * free_model(model) # <<<<<<<<<<<<<< @@ -5089,7 +4916,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_3decision_function(PyObje */ free_model(__pyx_v_model); - /* "scikits/learn/svm/libsvm.pyx":436 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":436 * # free model and param * free_model(model) * return dec_values # <<<<<<<<<<<<<< @@ -5107,8 +4934,8 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_3decision_function(PyObje __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_20); - __Pyx_XDECREF(__pyx_t_21); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_probA); @@ -5125,7 +4952,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_3decision_function(PyObje __Pyx_SafeReleaseBuffer(&__pyx_bstruct_SV); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_class_weight_label); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("scikits.learn.svm.libsvm.decision_function"); + __Pyx_AddTraceback("sklearn.svm.libsvm.decision_function"); __pyx_r = NULL; goto __pyx_L2; __pyx_L0:; @@ -5150,7 +4977,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_3decision_function(PyObje return __pyx_r; } -/* "scikits/learn/svm/libsvm.pyx":439 +/* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":439 * * * def cross_validation( # <<<<<<<<<<<<<< @@ -5158,10 +4985,9 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_3decision_function(PyObje * np.ndarray[np.float64_t, ndim=1, mode='c'] Y, */ -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) { +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) { PyArrayObject *__pyx_v_X = 0; PyArrayObject *__pyx_v_Y = 0; int __pyx_v_n_fold; @@ -5206,9 +5032,9 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_4cross_validation(PyObjec Py_ssize_t __pyx_bstride_0_target = 0; Py_ssize_t __pyx_bshape_0_target = 0; PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - int __pyx_t_3; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; @@ -5218,25 +5044,8 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_4cross_validation(PyObjec PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = 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; + int __pyx_t_13; + PyArrayObject *__pyx_t_14 = 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; @@ -5244,10 +5053,10 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_4cross_validation(PyObjec 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_27; - values[13] = (PyObject *)__pyx_k_28; - values[14] = (PyObject *)__pyx_k_29; + 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; 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); @@ -5370,7 +5179,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_4cross_validation(PyObjec __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 { @@ -5380,7 +5189,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_4cross_validation(PyObjec __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 { - /* "scikits/learn/svm/libsvm.pyx":443 + /* "/home/fabian/dev/scikit-learn/sklearn/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, # <<<<<<<<<<<<<< @@ -5403,7 +5212,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_4cross_validation(PyObjec __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 { - /* "scikits/learn/svm/libsvm.pyx":444 + /* "/home/fabian/dev/scikit-learn/sklearn/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, # <<<<<<<<<<<<<< @@ -5439,7 +5248,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_4cross_validation(PyObjec __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 { - /* "scikits/learn/svm/libsvm.pyx":451 + /* "/home/fabian/dev/scikit-learn/sklearn/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.): # <<<<<<<<<<<<<< @@ -5450,10 +5259,10 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_4cross_validation(PyObjec } } 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); - /* "scikits/learn/svm/libsvm.pyx":443 + /* "/home/fabian/dev/scikit-learn/sklearn/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, # <<<<<<<<<<<<<< @@ -5464,7 +5273,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_4cross_validation(PyObjec __pyx_v_coef0 = ((double)0.); __pyx_v_tol = ((double)1e-3); - /* "scikits/learn/svm/libsvm.pyx":444 + /* "/home/fabian/dev/scikit-learn/sklearn/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, # <<<<<<<<<<<<<< @@ -5474,13 +5283,13 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_4cross_validation(PyObjec __pyx_v_C = ((double)1.); __pyx_v_nu = ((double)0.5); __pyx_v_epsilon = ((double)0.1); - __pyx_v_class_weight_label = __pyx_k_27; - __pyx_v_class_weight = __pyx_k_28; - __pyx_v_sample_weight = __pyx_k_29; + __pyx_v_class_weight_label = __pyx_k_23; + __pyx_v_class_weight = __pyx_k_24; + __pyx_v_sample_weight = __pyx_k_25; __pyx_v_shrinking = ((int)0); __pyx_v_probability = ((int)0); - /* "scikits/learn/svm/libsvm.pyx":451 + /* "/home/fabian/dev/scikit-learn/sklearn/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.): # <<<<<<<<<<<<<< @@ -5516,7 +5325,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_4cross_validation(PyObjec 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: @@ -5531,7 +5340,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_4cross_validation(PyObjec __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("scikits.learn.svm.libsvm.cross_validation"); + __Pyx_AddTraceback("sklearn.svm.libsvm.cross_validation"); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; @@ -5546,7 +5355,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_4cross_validation(PyObjec __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;} @@ -5581,53 +5390,50 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_4cross_validation(PyObjec __pyx_bstride_0_sample_weight = __pyx_bstruct_sample_weight.strides[0]; __pyx_bshape_0_sample_weight = __pyx_bstruct_sample_weight.shape[0]; - /* "scikits/learn/svm/libsvm.pyx":504 + /* "/home/fabian/dev/scikit-learn/sklearn/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 *)__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) { + __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) { - /* "scikits/learn/svm/libsvm.pyx":505 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_GOTREF(__pyx_t_4); - __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_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_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(((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_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_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_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;} + 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;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __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_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_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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 = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = ((PyArrayObject *)__pyx_t_7); { @@ -5655,17 +5461,17 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_4cross_validation(PyObjec } /*else*/ { - /* "scikits/learn/svm/libsvm.pyx":507 + /* "/home/fabian/dev/scikit-learn/sklearn/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 CYTHON_WITHOUT_ASSERTIONS + #ifndef PYREX_WITHOUT_ASSERTIONS if (unlikely(!((__pyx_v_sample_weight->dimensions[0]) == (__pyx_v_X->dimensions[0])))) { - /* "scikits/learn/svm/libsvm.pyx":510 + /* "/home/fabian/dev/scikit-learn/sklearn/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]) # <<<<<<<<<<<<<< @@ -5674,22 +5480,22 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_4cross_validation(PyObjec */ __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_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_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_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(((PyObject *)__pyx_t_5)); + __Pyx_GOTREF(__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_1); - __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); __pyx_t_7 = 0; - __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_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_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __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 = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -5698,143 +5504,125 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_4cross_validation(PyObjec } __pyx_L6:; - /* "scikits/learn/svm/libsvm.pyx":512 + /* "/home/fabian/dev/scikit-learn/sklearn/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_3 = ((__pyx_v_X->dimensions[0]) < __pyx_v_n_fold); - if (__pyx_t_3) { + __pyx_t_2 = ((__pyx_v_X->dimensions[0]) < __pyx_v_n_fold); + if (__pyx_t_2) { - /* "scikits/learn/svm/libsvm.pyx":513 + /* "/home/fabian/dev/scikit-learn/sklearn/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 = 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_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_GOTREF(__pyx_t_5); - __Pyx_Raise(__pyx_t_5, 0, 0); + __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_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:; - /* "scikits/learn/svm/libsvm.pyx":516 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_GOTREF(__pyx_t_5); - __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_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_INCREF(((PyObject *)__pyx_v_kernel)); - PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_kernel)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_kernel)); __Pyx_GIVEREF(((PyObject *)__pyx_v_kernel)); - __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_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_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_v_kernel_index); __pyx_v_kernel_index = __pyx_t_7; __pyx_t_7 = 0; - /* "scikits/learn/svm/libsvm.pyx":518 + /* "/home/fabian/dev/scikit-learn/sklearn/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_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_t_9); + 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); - /* "scikits/learn/svm/libsvm.pyx":519 + /* "/home/fabian/dev/scikit-learn/sklearn/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_3 = (__pyx_v_problem.x == NULL); - if (__pyx_t_3) { + __pyx_t_2 = (__pyx_v_problem.x == NULL); + if (__pyx_t_2) { - /* "scikits/learn/svm/libsvm.pyx":520 + /* "/home/fabian/dev/scikit-learn/sklearn/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 */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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;} goto __pyx_L8; } __pyx_L8:; - /* "scikits/learn/svm/libsvm.pyx":524 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":524 * # set parameters * set_parameter( * ¶m, svm_type, kernel_index, degree, gamma, coef0, nu, cache_size, # <<<<<<<<<<<<<< * C, tol, tol, shrinking, probability, * 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_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, # <<<<<<<<<<<<<< - * 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, - * 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; + __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;} - /* "scikits/learn/svm/libsvm.pyx":527 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":527 * C, tol, tol, shrinking, probability, * class_weight.shape[0], class_weight_label.data, * class_weight.data) # <<<<<<<<<<<<<< * * error_msg = svm_check_parameter(&problem, ¶m); */ - 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); + 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); - /* "scikits/learn/svm/libsvm.pyx":529 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":529 * class_weight.data) * * error_msg = svm_check_parameter(&problem, ¶m); # <<<<<<<<<<<<<< @@ -5843,80 +5631,80 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_4cross_validation(PyObjec */ __pyx_v_error_msg = svm_check_parameter((&__pyx_v_problem), (&__pyx_v_param)); - /* "scikits/learn/svm/libsvm.pyx":530 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":530 * * error_msg = svm_check_parameter(&problem, ¶m); * if error_msg: # <<<<<<<<<<<<<< * raise ValueError(error_msg) * */ - __pyx_t_3 = (__pyx_v_error_msg != 0); - if (__pyx_t_3) { + __pyx_t_2 = (__pyx_v_error_msg != 0); + if (__pyx_t_2) { - /* "scikits/learn/svm/libsvm.pyx":531 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_GOTREF(__pyx_t_7); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_7, 0, 0); + 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(__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:; - /* "scikits/learn/svm/libsvm.pyx":534 + /* "/home/fabian/dev/scikit-learn/sklearn/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, target.data) * */ - __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_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_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 = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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_GOTREF(__pyx_t_5); - __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)); + 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_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_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;} + 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;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __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_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_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_1)); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 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_31 = ((PyArrayObject *)__pyx_t_6); + __pyx_t_14 = ((PyArrayObject *)__pyx_t_6); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_target); - __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)) { + __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)) { 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); @@ -5927,14 +5715,14 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_4cross_validation(PyObjec } __pyx_bstride_0_target = __pyx_bstruct_target.strides[0]; __pyx_bshape_0_target = __pyx_bstruct_target.shape[0]; - if (unlikely(__pyx_t_30 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_31 = 0; + __pyx_t_14 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_target)); __pyx_v_target = ((PyArrayObject *)__pyx_t_6); __pyx_t_6 = 0; - /* "scikits/learn/svm/libsvm.pyx":535 + /* "/home/fabian/dev/scikit-learn/sklearn/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, target.data) # <<<<<<<<<<<<<< @@ -5943,7 +5731,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_4cross_validation(PyObjec */ svm_cross_validation((&__pyx_v_problem), (&__pyx_v_param), __pyx_v_n_fold, ((double *)__pyx_v_target->data)); - /* "scikits/learn/svm/libsvm.pyx":537 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":537 * svm_cross_validation(&problem, ¶m, n_fold, target.data) * * free(problem.x) # <<<<<<<<<<<<<< @@ -5952,7 +5740,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_4cross_validation(PyObjec */ free(__pyx_v_problem.x); - /* "scikits/learn/svm/libsvm.pyx":538 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":538 * * free(problem.x) * return target # <<<<<<<<<<<<<< @@ -5967,7 +5755,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_4cross_validation(PyObjec __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); @@ -5981,7 +5769,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_4cross_validation(PyObjec __Pyx_SafeReleaseBuffer(&__pyx_bstruct_X); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_target); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("scikits.learn.svm.libsvm.cross_validation"); + __Pyx_AddTraceback("sklearn.svm.libsvm.cross_validation"); __pyx_r = NULL; goto __pyx_L2; __pyx_L0:; @@ -6000,7 +5788,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_4cross_validation(PyObjec return __pyx_r; } -/* "scikits/learn/svm/libsvm.pyx":540 +/* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":540 * return target * * def set_verbosity_wrap(int verbosity): # <<<<<<<<<<<<<< @@ -6008,10 +5796,9 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_4cross_validation(PyObjec * Control verbosity of libsvm library */ -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) { +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) { int __pyx_v_verbosity; PyObject *__pyx_r = NULL; __Pyx_RefNannySetupContext("set_verbosity_wrap"); @@ -6021,12 +5808,12 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_5set_verbosity_wrap(PyObj } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - __Pyx_AddTraceback("scikits.learn.svm.libsvm.set_verbosity_wrap"); + __Pyx_AddTraceback("sklearn.svm.libsvm.set_verbosity_wrap"); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - /* "scikits/learn/svm/libsvm.pyx":544 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":544 * Control verbosity of libsvm library * """ * set_verbosity(verbosity) # <<<<<<<<<<<<<< @@ -6039,7 +5826,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6libsvm_5set_verbosity_wrap(PyObj return __pyx_r; } -/* "numpy.pxd":188 +/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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): # <<<<<<<<<<<<<< @@ -6060,21 +5847,21 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ int __pyx_v_offset; int __pyx_v_hasfields; int __pyx_r; - PyObject *__pyx_t_1 = NULL; + int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_t_7; - PyObject *__pyx_t_8 = NULL; + int __pyx_t_8; 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); - /* "numpy.pxd":194 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":194 * # of flags * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -6083,7 +5870,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_endian_detector = 1; - /* "numpy.pxd":195 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":195 * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -6092,29 +5879,26 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "numpy.pxd":197 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":197 * cdef bint little_endian = ((&endian_detector)[0] != 0) * * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< * * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - __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; + __pyx_v_ndim = PyArray_NDIM(((PyArrayObject *)__pyx_v_self)); - /* "numpy.pxd":199 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":199 * ndim = PyArray_NDIM(self) * * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< * copy_shape = 1 * else: */ - __pyx_t_2 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); - if (__pyx_t_2) { + __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); + if (__pyx_t_1) { - /* "numpy.pxd":200 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":200 * * if sizeof(npy_intp) != sizeof(Py_ssize_t): * copy_shape = 1 # <<<<<<<<<<<<<< @@ -6126,7 +5910,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } /*else*/ { - /* "numpy.pxd":202 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":202 * copy_shape = 1 * else: * copy_shape = 0 # <<<<<<<<<<<<<< @@ -6137,105 +5921,108 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } __pyx_L5:; - /* "numpy.pxd":204 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_2 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS); - if (__pyx_t_2) { + __pyx_t_1 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS); + if (__pyx_t_1) { - /* "numpy.pxd":205 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/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") * */ - __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; + __pyx_t_2 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_v_self), NPY_C_CONTIGUOUS)); + __pyx_t_3 = __pyx_t_2; } else { - __pyx_t_4 = __pyx_t_2; + __pyx_t_3 = __pyx_t_1; } - if (__pyx_t_4) { + if (__pyx_t_3) { - /* "numpy.pxd":206 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_filename = __pyx_f[1]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; - /* "numpy.pxd":208 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_4 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS); - if (__pyx_t_4) { + __pyx_t_3 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS); + if (__pyx_t_3) { - /* "numpy.pxd":209 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/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") * */ - __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; + __pyx_t_1 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_v_self), NPY_F_CONTIGUOUS)); + __pyx_t_2 = __pyx_t_1; } else { - __pyx_t_3 = __pyx_t_4; + __pyx_t_2 = __pyx_t_3; } - if (__pyx_t_3) { + if (__pyx_t_2) { - /* "numpy.pxd":210 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_filename = __pyx_f[1]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L7; } __pyx_L7:; - /* "numpy.pxd":212 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":212 * raise ValueError(u"ndarray is not Fortran contiguous") * * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< * info.ndim = ndim * if copy_shape: */ - __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; + __pyx_v_info->buf = PyArray_DATA(((PyArrayObject *)__pyx_v_self)); - /* "numpy.pxd":213 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":213 * * info.buf = PyArray_DATA(self) * info.ndim = ndim # <<<<<<<<<<<<<< @@ -6244,7 +6031,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->ndim = __pyx_v_ndim; - /* "numpy.pxd":214 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":214 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if copy_shape: # <<<<<<<<<<<<<< @@ -6253,7 +6040,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ if (__pyx_v_copy_shape) { - /* "numpy.pxd":217 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":217 * # Allocate new buffer for strides and shape info. This is allocated * # as one block, strides first. * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< @@ -6262,7 +6049,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))); - /* "numpy.pxd":218 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":218 * # as one block, strides first. * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) * info.shape = info.strides + ndim # <<<<<<<<<<<<<< @@ -6271,72 +6058,60 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "numpy.pxd":219 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":219 * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) * info.shape = info.strides + ndim * for i in range(ndim): # <<<<<<<<<<<<<< * info.strides[i] = PyArray_STRIDES(self)[i] * info.shape[i] = PyArray_DIMS(self)[i] */ - __pyx_t_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; + __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; - /* "numpy.pxd":220 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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; + (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]); - /* "numpy.pxd":221 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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 = PyArray_STRIDES(self) */ - __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; + (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]); } goto __pyx_L8; } /*else*/ { - /* "numpy.pxd":223 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":223 * info.shape[i] = PyArray_DIMS(self)[i] * else: * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL */ - __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; + __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(((PyArrayObject *)__pyx_v_self))); - /* "numpy.pxd":224 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":224 * else: * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(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_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(((PyArrayObject *)__pyx_v_self))); } __pyx_L8:; - /* "numpy.pxd":225 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":225 * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -6345,31 +6120,25 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->suboffsets = NULL; - /* "numpy.pxd":226 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":226 * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< * info.readonly = not PyArray_ISWRITEABLE(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; + __pyx_v_info->itemsize = PyArray_ITEMSIZE(((PyArrayObject *)__pyx_v_self)); - /* "numpy.pxd":227 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":227 * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< * * cdef int t */ - __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; + __pyx_v_info->readonly = (!PyArray_ISWRITEABLE(((PyArrayObject *)__pyx_v_self))); - /* "numpy.pxd":230 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":230 * * cdef int t * cdef char* f = NULL # <<<<<<<<<<<<<< @@ -6378,7 +6147,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_f = NULL; - /* "numpy.pxd":231 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":231 * cdef int t * cdef char* f = NULL * cdef dtype descr = self.descr # <<<<<<<<<<<<<< @@ -6388,7 +6157,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; - /* "numpy.pxd":235 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":235 * cdef int offset * * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< @@ -6397,23 +6166,23 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - /* "numpy.pxd":237 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_3 = (!__pyx_v_hasfields); - if (__pyx_t_3) { - __pyx_t_4 = (!__pyx_v_copy_shape); - __pyx_t_2 = __pyx_t_4; + __pyx_t_2 = (!__pyx_v_hasfields); + if (__pyx_t_2) { + __pyx_t_3 = (!__pyx_v_copy_shape); + __pyx_t_1 = __pyx_t_3; } else { - __pyx_t_2 = __pyx_t_3; + __pyx_t_1 = __pyx_t_2; } - if (__pyx_t_2) { + if (__pyx_t_1) { - /* "numpy.pxd":239 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":239 * if not hasfields and not copy_shape: * # do not call releasebuffer * info.obj = None # <<<<<<<<<<<<<< @@ -6429,7 +6198,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } /*else*/ { - /* "numpy.pxd":242 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":242 * else: * # need to call releasebuffer * info.obj = self # <<<<<<<<<<<<<< @@ -6444,17 +6213,17 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } __pyx_L11:; - /* "numpy.pxd":244 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":244 * info.obj = self * * if not hasfields: # <<<<<<<<<<<<<< * t = descr.type_num * if ((descr.byteorder == '>' and little_endian) or */ - __pyx_t_2 = (!__pyx_v_hasfields); - if (__pyx_t_2) { + __pyx_t_1 = (!__pyx_v_hasfields); + if (__pyx_t_1) { - /* "numpy.pxd":245 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":245 * * if not hasfields: * t = descr.type_num # <<<<<<<<<<<<<< @@ -6463,306 +6232,312 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_t = __pyx_v_descr->type_num; - /* "numpy.pxd":246 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_2 = (__pyx_v_descr->byteorder == '>'); - if (__pyx_t_2) { - __pyx_t_3 = __pyx_v_little_endian; + __pyx_t_1 = (__pyx_v_descr->byteorder == '>'); + if (__pyx_t_1) { + __pyx_t_2 = __pyx_v_little_endian; } else { - __pyx_t_3 = __pyx_t_2; + __pyx_t_2 = __pyx_t_1; } - if (!__pyx_t_3) { + if (!__pyx_t_2) { - /* "numpy.pxd":247 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_2 = (__pyx_v_descr->byteorder == '<'); - if (__pyx_t_2) { - __pyx_t_4 = (!__pyx_v_little_endian); - __pyx_t_7 = __pyx_t_4; + __pyx_t_1 = (__pyx_v_descr->byteorder == '<'); + if (__pyx_t_1) { + __pyx_t_3 = (!__pyx_v_little_endian); + __pyx_t_8 = __pyx_t_3; } else { - __pyx_t_7 = __pyx_t_2; + __pyx_t_8 = __pyx_t_1; } - __pyx_t_2 = __pyx_t_7; + __pyx_t_1 = __pyx_t_8; } else { - __pyx_t_2 = __pyx_t_3; + __pyx_t_1 = __pyx_t_2; } - if (__pyx_t_2) { + if (__pyx_t_1) { - /* "numpy.pxd":248 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_filename = __pyx_f[1]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L13; } __pyx_L13:; - /* "numpy.pxd":249 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_2 = (__pyx_v_t == NPY_BYTE); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_BYTE); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__b; goto __pyx_L14; } - /* "numpy.pxd":250 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_2 = (__pyx_v_t == NPY_UBYTE); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_UBYTE); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__B; goto __pyx_L14; } - /* "numpy.pxd":251 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_2 = (__pyx_v_t == NPY_SHORT); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_SHORT); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__h; goto __pyx_L14; } - /* "numpy.pxd":252 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_2 = (__pyx_v_t == NPY_USHORT); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_USHORT); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__H; goto __pyx_L14; } - /* "numpy.pxd":253 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_2 = (__pyx_v_t == NPY_INT); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_INT); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__i; goto __pyx_L14; } - /* "numpy.pxd":254 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_2 = (__pyx_v_t == NPY_UINT); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_UINT); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__I; goto __pyx_L14; } - /* "numpy.pxd":255 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_2 = (__pyx_v_t == NPY_LONG); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_LONG); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__l; goto __pyx_L14; } - /* "numpy.pxd":256 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_2 = (__pyx_v_t == NPY_ULONG); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_ULONG); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__L; goto __pyx_L14; } - /* "numpy.pxd":257 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_2 = (__pyx_v_t == NPY_LONGLONG); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_LONGLONG); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__q; goto __pyx_L14; } - /* "numpy.pxd":258 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_2 = (__pyx_v_t == NPY_ULONGLONG); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_ULONGLONG); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__Q; goto __pyx_L14; } - /* "numpy.pxd":259 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_2 = (__pyx_v_t == NPY_FLOAT); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_FLOAT); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__f; goto __pyx_L14; } - /* "numpy.pxd":260 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_2 = (__pyx_v_t == NPY_DOUBLE); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_DOUBLE); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__d; goto __pyx_L14; } - /* "numpy.pxd":261 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_2 = (__pyx_v_t == NPY_LONGDOUBLE); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_LONGDOUBLE); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__g; goto __pyx_L14; } - /* "numpy.pxd":262 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_2 = (__pyx_v_t == NPY_CFLOAT); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_CFLOAT); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__Zf; goto __pyx_L14; } - /* "numpy.pxd":263 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_2 = (__pyx_v_t == NPY_CDOUBLE); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_CDOUBLE); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__Zd; goto __pyx_L14; } - /* "numpy.pxd":264 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_2 = (__pyx_v_t == NPY_CLONGDOUBLE); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_CLONGDOUBLE); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__Zg; goto __pyx_L14; } - /* "numpy.pxd":265 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_2 = (__pyx_v_t == NPY_OBJECT); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_t == NPY_OBJECT); + if (__pyx_t_1) { __pyx_v_f = __pyx_k__O; goto __pyx_L14; } /*else*/ { - /* "numpy.pxd":267 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L14:; - /* "numpy.pxd":268 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":268 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f # <<<<<<<<<<<<<< @@ -6771,7 +6546,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->format = __pyx_v_f; - /* "numpy.pxd":269 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":269 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f * return # <<<<<<<<<<<<<< @@ -6784,7 +6559,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ } /*else*/ { - /* "numpy.pxd":271 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":271 * return * else: * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< @@ -6793,7 +6568,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_info->format = ((char *)malloc(255)); - /* "numpy.pxd":272 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":272 * else: * info.format = stdlib.malloc(_buffer_format_string_len) * info.format[0] = '^' # Native data types, manual alignment # <<<<<<<<<<<<<< @@ -6802,7 +6577,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ (__pyx_v_info->format[0]) = '^'; - /* "numpy.pxd":273 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":273 * info.format = stdlib.malloc(_buffer_format_string_len) * info.format[0] = '^' # Native data types, manual alignment * offset = 0 # <<<<<<<<<<<<<< @@ -6811,7 +6586,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ */ __pyx_v_offset = 0; - /* "numpy.pxd":276 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":276 * f = _util_dtypestring(descr, info.format + 1, * info.format + _buffer_format_string_len, * &offset) # <<<<<<<<<<<<<< @@ -6821,7 +6596,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; - /* "numpy.pxd":277 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":277 * info.format + _buffer_format_string_len, * &offset) * f[0] = 0 # Terminate format string # <<<<<<<<<<<<<< @@ -6835,8 +6610,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_1); - __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("numpy.ndarray.__getbuffer__"); __pyx_r = -1; __Pyx_GOTREF(__pyx_v_info->obj); @@ -6853,7 +6628,7 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ return __pyx_r; } -/* "numpy.pxd":279 +/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":279 * f[0] = 0 # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -6861,26 +6636,22 @@ static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_ * stdlib.free(info.format) */ -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; +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; __Pyx_RefNannySetupContext("__releasebuffer__"); - /* "numpy.pxd":280 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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 = __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) { + __pyx_t_1 = PyArray_HASFIELDS(((PyArrayObject *)__pyx_v_self)); + if (__pyx_t_1) { - /* "numpy.pxd":281 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":281 * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): * stdlib.free(info.format) # <<<<<<<<<<<<<< @@ -6892,17 +6663,17 @@ static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray_1__releasebuffer__(PyObject * } __pyx_L5:; - /* "numpy.pxd":282 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_2 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); - if (__pyx_t_2) { + __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); + if (__pyx_t_1) { - /* "numpy.pxd":283 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":283 * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): * stdlib.free(info.strides) # <<<<<<<<<<<<<< @@ -6917,7 +6688,7 @@ static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray_1__releasebuffer__(PyObject * __Pyx_RefNannyFinishContext(); } -/* "numpy.pxd":756 +/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":756 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -6930,7 +6701,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1"); - /* "numpy.pxd":757 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":757 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -6956,7 +6727,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "numpy.pxd":759 +/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":759 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -6969,7 +6740,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2"); - /* "numpy.pxd":760 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":760 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -6995,7 +6766,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "numpy.pxd":762 +/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":762 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -7008,7 +6779,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3"); - /* "numpy.pxd":763 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":763 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -7034,7 +6805,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "numpy.pxd":765 +/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":765 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -7047,7 +6818,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4"); - /* "numpy.pxd":766 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":766 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< @@ -7073,7 +6844,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "numpy.pxd":768 +/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":768 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -7086,7 +6857,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5"); - /* "numpy.pxd":769 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":769 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< @@ -7112,7 +6883,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "numpy.pxd":771 +/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":771 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -7138,16 +6909,15 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx int __pyx_t_7; int __pyx_t_8; int __pyx_t_9; - long __pyx_t_10; - char *__pyx_t_11; + char *__pyx_t_10; __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); - /* "numpy.pxd":778 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":778 * cdef int delta_offset * cdef tuple i * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -7156,7 +6926,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_endian_detector = 1; - /* "numpy.pxd":779 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":779 * cdef tuple i * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -7165,17 +6935,18 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "numpy.pxd":782 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":782 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< * fields = descr.fields[childname] * child, new_offset = fields */ - 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;} + 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;} } - __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++; @@ -7183,7 +6954,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_v_childname = __pyx_t_3; __pyx_t_3 = 0; - /* "numpy.pxd":783 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":783 * * for childname in descr.names: * fields = descr.fields[childname] # <<<<<<<<<<<<<< @@ -7194,10 +6965,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; - /* "numpy.pxd":784 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":784 * for childname in descr.names: * fields = descr.fields[childname] * child, new_offset = fields # <<<<<<<<<<<<<< @@ -7220,7 +6991,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;} } - /* "numpy.pxd":786 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":786 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< @@ -7245,23 +7016,29 @@ 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) { - /* "numpy.pxd":787 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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 = 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_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_GOTREF(__pyx_t_5); - __Pyx_Raise(__pyx_t_5, 0, 0); + __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_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:; - /* "numpy.pxd":789 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":789 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< @@ -7276,7 +7053,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } if (!__pyx_t_7) { - /* "numpy.pxd":790 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":790 * * if ((child.byteorder == '>' and little_endian) or * (child.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< @@ -7296,15 +7073,21 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } if (__pyx_t_6) { - /* "numpy.pxd":791 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_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;} @@ -7312,7 +7095,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L6:; - /* "numpy.pxd":801 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":801 * * # Output padding bytes * while offset[0] < new_offset: # <<<<<<<<<<<<<< @@ -7329,7 +7112,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; - /* "numpy.pxd":802 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":802 * # Output padding bytes * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< @@ -7338,37 +7121,35 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ (__pyx_v_f[0]) = 120; - /* "numpy.pxd":803 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":803 * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte * f += 1 # <<<<<<<<<<<<<< * offset[0] += 1 * */ - __pyx_v_f = (__pyx_v_f + 1); + __pyx_v_f += 1; - /* "numpy.pxd":804 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":804 * f[0] = 120 # "x"; pad byte * f += 1 * offset[0] += 1 # <<<<<<<<<<<<<< * * offset[0] += child.itemsize */ - __pyx_t_10 = 0; - (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + 1); + (__pyx_v_offset[0]) += 1; } - /* "numpy.pxd":806 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":806 * offset[0] += 1 * * offset[0] += child.itemsize # <<<<<<<<<<<<<< * * if not PyDataType_HASFIELDS(child): */ - __pyx_t_10 = 0; - (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + __pyx_v_child->elsize); + (__pyx_v_offset[0]) += __pyx_v_child->elsize; - /* "numpy.pxd":808 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":808 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -7378,7 +7159,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) { - /* "numpy.pxd":809 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":809 * * if not PyDataType_HASFIELDS(child): * t = child.type_num # <<<<<<<<<<<<<< @@ -7391,7 +7172,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_v_t = __pyx_t_3; __pyx_t_3 = 0; - /* "numpy.pxd":810 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":810 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -7401,402 +7182,408 @@ 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) { - /* "numpy.pxd":811 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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 = 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_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_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0); + __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_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:; - /* "numpy.pxd":814 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/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" */ - __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_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_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_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 = 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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 98; goto __pyx_L11; } - /* "numpy.pxd":815 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_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_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 = 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_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 66; goto __pyx_L11; } - /* "numpy.pxd":816 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_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_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 = 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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 104; goto __pyx_L11; } - /* "numpy.pxd":817 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_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_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 = 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_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 72; goto __pyx_L11; } - /* "numpy.pxd":818 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_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_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 = 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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 105; goto __pyx_L11; } - /* "numpy.pxd":819 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_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_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 = 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_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 73; goto __pyx_L11; } - /* "numpy.pxd":820 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_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_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 = 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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 108; goto __pyx_L11; } - /* "numpy.pxd":821 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_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_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 = 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_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 76; goto __pyx_L11; } - /* "numpy.pxd":822 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_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_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 = 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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 113; goto __pyx_L11; } - /* "numpy.pxd":823 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_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_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 = 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_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 81; goto __pyx_L11; } - /* "numpy.pxd":824 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_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_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 = 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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 102; goto __pyx_L11; } - /* "numpy.pxd":825 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_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_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 = 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_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 100; goto __pyx_L11; } - /* "numpy.pxd":826 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_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_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 = 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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 103; goto __pyx_L11; } - /* "numpy.pxd":827 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_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_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 = 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_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; (__pyx_v_f[1]) = 102; - __pyx_v_f = (__pyx_v_f + 1); + __pyx_v_f += 1; goto __pyx_L11; } - /* "numpy.pxd":828 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_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_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 = 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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; (__pyx_v_f[1]) = 100; - __pyx_v_f = (__pyx_v_f + 1); + __pyx_v_f += 1; goto __pyx_L11; } - /* "numpy.pxd":829 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_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_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 = 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_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; (__pyx_v_f[1]) = 103; - __pyx_v_f = (__pyx_v_f + 1); + __pyx_v_f += 1; goto __pyx_L11; } - /* "numpy.pxd":830 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_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_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_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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 79; goto __pyx_L11; } /*else*/ { - /* "numpy.pxd":832 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_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_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_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); + 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(__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:; - /* "numpy.pxd":833 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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 = (__pyx_v_f + 1); + __pyx_v_f += 1; goto __pyx_L9; } /*else*/ { - /* "numpy.pxd":837 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_L9:; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "numpy.pxd":838 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":838 * # so don't output it * f = _util_dtypestring(child, f, end, offset) * return f # <<<<<<<<<<<<<< @@ -7825,7 +7612,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx return __pyx_r; } -/* "numpy.pxd":953 +/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":953 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -7836,10 +7623,9 @@ 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"); - /* "numpy.pxd":955 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":955 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -7849,7 +7635,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) { - /* "numpy.pxd":956 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":956 * cdef PyObject* baseptr * if base is None: * baseptr = NULL # <<<<<<<<<<<<<< @@ -7861,19 +7647,16 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } /*else*/ { - /* "numpy.pxd":958 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":958 * baseptr = NULL * else: * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< * baseptr = base * Py_XDECREF(arr.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; + Py_INCREF(__pyx_v_base); - /* "numpy.pxd":959 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":959 * else: * Py_INCREF(base) # important to do this before decref below! * baseptr = base # <<<<<<<<<<<<<< @@ -7884,7 +7667,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } __pyx_L3:; - /* "numpy.pxd":960 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":960 * Py_INCREF(base) # important to do this before decref below! * baseptr = base * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< @@ -7893,7 +7676,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_XDECREF(__pyx_v_arr->base); - /* "numpy.pxd":961 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":961 * baseptr = base * Py_XDECREF(arr.base) * arr.base = baseptr # <<<<<<<<<<<<<< @@ -7905,7 +7688,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyFinishContext(); } -/* "numpy.pxd":963 +/* "/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 * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -7918,7 +7701,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base"); - /* "numpy.pxd":964 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":964 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -7928,7 +7711,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) { - /* "numpy.pxd":965 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":965 * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: * return None # <<<<<<<<<<<<<< @@ -7943,7 +7726,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py } /*else*/ { - /* "numpy.pxd":967 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":967 * return None * else: * return arr.base # <<<<<<<<<<<<<< @@ -7963,6 +7746,12 @@ 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} }; @@ -7970,7 +7759,7 @@ static PyMethodDef __pyx_methods[] = { static struct PyModuleDef __pyx_moduledef = { PyModuleDef_HEAD_INIT, __Pyx_NAMESTR("libsvm"), - __Pyx_DOCSTR(__pyx_k_44), /* m_doc */ + __Pyx_DOCSTR(__pyx_k_33), /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ @@ -7981,16 +7770,23 @@ static struct PyModuleDef __pyx_moduledef = { #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp_s_30, __pyx_k_30, sizeof(__pyx_k_30), 0, 0, 1, 0}, + {&__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_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}, @@ -8072,497 +7868,17 @@ static int __Pyx_InitCachedBuiltins(void) { return -1; } -static int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants"); - - /* "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; -} +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*/ @@ -8576,6 +7892,7 @@ PyMODINIT_FUNC PyInit_libsvm(void) 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"); @@ -8601,7 +7918,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_44), 0, PYTHON_API_VERSION); + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("libsvm"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_33), 0, PYTHON_API_VERSION); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif @@ -8614,13 +7931,11 @@ 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_scikits__learn__svm__libsvm) { + if (__pyx_module_is_main_sklearn__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 ---*/ @@ -8633,7 +7948,7 @@ PyMODINIT_FUNC PyInit_libsvm(void) /*--- Function import code ---*/ /*--- Execution code ---*/ - /* "scikits/learn/svm/libsvm.pyx":33 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":33 * """ * * import numpy as np # <<<<<<<<<<<<<< @@ -8645,7 +7960,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; - /* "scikits/learn/svm/libsvm.pyx":41 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":41 * ################################################################################ * # Internal variables * LIBSVM_KERNEL_TYPES = ['linear', 'poly', 'rbf', 'sigmoid', 'precomputed'] # <<<<<<<<<<<<<< @@ -8672,7 +7987,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; - /* "scikits/learn/svm/libsvm.pyx":54 + /* "/home/fabian/dev/scikit-learn/sklearn/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), # <<<<<<<<<<<<<< @@ -8684,199 +7999,223 @@ 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 = 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_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_GOTREF(__pyx_t_4); - __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_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_4); __pyx_t_4 = 0; - __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); + 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_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 = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_k_1 = ((PyArrayObject *)__pyx_t_4); - __Pyx_GIVEREF(__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_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; - /* "scikits/learn/svm/libsvm.pyx":56 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_GOTREF(__pyx_t_1); - __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; + __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; - /* "scikits/learn/svm/libsvm.pyx":58 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_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_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; - 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; + __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_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_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; - /* "scikits/learn/svm/libsvm.pyx":230 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_GOTREF(__pyx_t_1); - __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_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_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 = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_k_12 = ((PyArrayObject *)__pyx_t_4); - __Pyx_GIVEREF(__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 = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_7 = ((PyArrayObject *)__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; - /* "scikits/learn/svm/libsvm.pyx":231 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_GOTREF(__pyx_t_1); - __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; + __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; - /* "scikits/learn/svm/libsvm.pyx":236 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_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_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_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_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_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_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_DECREF(__pyx_t_2); __pyx_t_2 = 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); + 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; __Pyx_DECREF(__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 = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_k_14 = ((PyArrayObject *)__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 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; - /* "scikits/learn/svm/libsvm.pyx":238 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_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 = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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_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_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; + 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; - /* "scikits/learn/svm/libsvm.pyx":240 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_GOTREF(__pyx_t_4); - __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_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_GOTREF(__pyx_t_3); - 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; + __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; - /* "scikits/learn/svm/libsvm.pyx":316 + /* "/home/fabian/dev/scikit-learn/sklearn/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), # <<<<<<<<<<<<<< @@ -8885,68 +8224,86 @@ 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_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_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 = 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_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_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; + __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_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; - /* "scikits/learn/svm/libsvm.pyx":317 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_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 = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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_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_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; + 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; - /* "scikits/learn/svm/libsvm.pyx":322 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __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_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_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_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_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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, ((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_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_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_19 = ((PyArrayObject *)__pyx_t_2); + __pyx_k_15 = ((PyArrayObject *)__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - /* "scikits/learn/svm/libsvm.pyx":324 + /* "/home/fabian/dev/scikit-learn/sklearn/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), # <<<<<<<<<<<<<< @@ -8958,67 +8315,73 @@ 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 = 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_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_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; - 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; + __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; - /* "scikits/learn/svm/libsvm.pyx":326 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_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 = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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; + __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; - /* "scikits/learn/svm/libsvm.pyx":390 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_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_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_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_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_22 = ((PyArrayObject *)__pyx_t_2); + __pyx_k_18 = ((PyArrayObject *)__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - /* "scikits/learn/svm/libsvm.pyx":391 + /* "/home/fabian/dev/scikit-learn/sklearn/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), # <<<<<<<<<<<<<< @@ -9030,65 +8393,83 @@ 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 = 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_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_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; - 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; + __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; - /* "scikits/learn/svm/libsvm.pyx":396 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_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 = 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_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_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_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_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_DECREF(__pyx_t_4); __pyx_t_4 = 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;} + 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; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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; + __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; - /* "scikits/learn/svm/libsvm.pyx":398 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_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_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __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 = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_k_25 = ((PyArrayObject *)__pyx_t_1); + __pyx_k_21 = ((PyArrayObject *)__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "scikits/learn/svm/libsvm.pyx":400 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":400 * class_weight=np.empty(0), * np.ndarray[np.float64_t, ndim=1, mode='c'] * sample_weight=np.empty(0), # <<<<<<<<<<<<<< @@ -9097,60 +8478,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_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_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_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __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_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_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_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_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_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; - /* "scikits/learn/svm/libsvm.pyx":446 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_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_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_GOTREF(__pyx_t_1); __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_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_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_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_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 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_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_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; 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_27 = ((PyArrayObject *)__pyx_t_4); + __pyx_k_23 = ((PyArrayObject *)__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "scikits/learn/svm/libsvm.pyx":448 + /* "/home/fabian/dev/scikit-learn/sklearn/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), # <<<<<<<<<<<<<< @@ -9159,72 +8540,102 @@ 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_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_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_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __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_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_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 = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_k_28 = ((PyArrayObject *)__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; + __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; - /* "scikits/learn/svm/libsvm.pyx":450 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_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 = 450; __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 = 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_DECREF(__pyx_t_4); __pyx_t_4 = 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; + __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; - /* "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, + /* "/home/fabian/dev/scikit-learn/sklearn/svm/libsvm.pyx":1 + * """ # <<<<<<<<<<<<<< + * Binding for libsvm_skl + * ---------------------- */ - __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_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); - 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_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; - - /* "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_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); - 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_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_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;} + __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;} + __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_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; - /* "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 + /* "/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 * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -9237,11 +8648,12 @@ 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 scikits.learn.svm.libsvm"); + __Pyx_AddTraceback("init sklearn.svm.libsvm"); Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init scikits.learn.svm.libsvm"); + PyErr_SetString(PyExc_ImportError, "init sklearn.svm.libsvm"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); @@ -9262,6 +8674,19 @@ 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, @@ -9287,22 +8712,9 @@ 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)", - #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)); + "%s() takes %s %zd positional argument%s (%zd given)", #endif + func_name, more_or_less, num_expected, number, num_found); } static int __Pyx_ParseOptionalKeywords( @@ -9523,7 +8935,7 @@ static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) { default: { __Pyx_BufFmt_RaiseUnexpectedChar(ch); return 0; - } + } } } @@ -9567,7 +8979,7 @@ static size_t __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) { default: { __Pyx_BufFmt_RaiseUnexpectedChar(ch); return 0; - } + } } } @@ -9604,7 +9016,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 { @@ -9627,7 +9039,7 @@ static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { ctx->head->parent_offset = parent_offset; continue; } - + __Pyx_BufFmt_RaiseExpected(ctx); return -1; } @@ -9641,7 +9053,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 */ @@ -9674,7 +9086,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) { @@ -9796,7 +9208,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha return NULL; } } - + } } } @@ -9893,116 +9305,6 @@ 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 , */ - 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; @@ -10059,7 +9361,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_1__releasebuffer__(obj, view); +if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pf_5numpy_7ndarray___releasebuffer__(obj, view); Py_DECREF(obj); view->obj = NULL; } @@ -10125,6 +9427,116 @@ 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 , */ + 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) { @@ -10189,60 +9601,15 @@ static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_Py_intptr_t(Py_intptr_t val) { z.imag = -a.imag; return z; } - #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 +/* + 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 + } +*/ #endif #if CYTHON_CCOMPLEX @@ -10309,60 +9676,15 @@ static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_Py_intptr_t(Py_intptr_t val) { z.imag = -a.imag; return z; } - #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 +/* + 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 + } +*/ #endif static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) { @@ -10793,13 +10115,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 @@ -10809,7 +10131,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/scikits/learn/svm/libsvm.pxd b/sklearn/svm/libsvm.pxd similarity index 100% rename from scikits/learn/svm/libsvm.pxd rename to sklearn/svm/libsvm.pxd diff --git a/scikits/learn/svm/libsvm.pyx b/sklearn/svm/libsvm.pyx similarity index 100% rename from scikits/learn/svm/libsvm.pyx rename to sklearn/svm/libsvm.pyx diff --git a/scikits/learn/svm/setup.py b/sklearn/svm/setup.py similarity index 100% rename from scikits/learn/svm/setup.py rename to sklearn/svm/setup.py diff --git a/scikits/learn/svm/sparse/__init__.py b/sklearn/svm/sparse/__init__.py similarity index 90% rename from scikits/learn/svm/sparse/__init__.py rename to sklearn/svm/sparse/__init__.py index 99c102121e482..1e246e136584f 100644 --- a/scikits/learn/svm/sparse/__init__.py +++ b/sklearn/svm/sparse/__init__.py @@ -1,7 +1,7 @@ """ Support Vector Machine algorithms for sparse matrices. -This module should have the same API as :mod:`scikits.learn.svm`, except +This module should have the same API as :mod:`sklearn.svm`, except that matrices are expected to be in some sparse format supported by scipy.sparse. diff --git a/scikits/learn/svm/sparse/base.py b/sklearn/svm/sparse/base.py similarity index 100% rename from scikits/learn/svm/sparse/base.py rename to sklearn/svm/sparse/base.py diff --git a/scikits/learn/svm/sparse/classes.py b/sklearn/svm/sparse/classes.py similarity index 93% rename from scikits/learn/svm/sparse/classes.py rename to sklearn/svm/sparse/classes.py index 16ed1a51a3288..95cb431b0d0c3 100644 --- a/scikits/learn/svm/sparse/classes.py +++ b/sklearn/svm/sparse/classes.py @@ -7,7 +7,7 @@ class SVC(SparseBaseLibSVM, ClassifierMixin): """SVC for sparse matrices (csr). - See :class:`scikits.learn.svm.SVC` for a complete list of parameters + See :class:`sklearn.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 scikits.learn.svm.sparse import SVC + >>> from sklearn.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 @@ def __init__(self, C=1.0, kernel='rbf', degree=3, gamma=0.0, class NuSVC (SparseBaseLibSVM, ClassifierMixin): """NuSVC for sparse matrices (csr). - See :class:`scikits.learn.svm.NuSVC` for a complete list of parameters + See :class:`sklearn.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 scikits.learn.svm.sparse import NuSVC + >>> from sklearn.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 @@ def __init__(self, nu=0.5, kernel='rbf', degree=3, gamma=0.0, class SVR (SparseBaseLibSVM, RegressorMixin): """SVR for sparse matrices (csr) - See :class:`scikits.learn.svm.SVR` for a complete list of parameters + See :class:`sklearn.svm.SVR` for a complete list of parameters Notes ----- @@ -89,7 +89,7 @@ class SVR (SparseBaseLibSVM, RegressorMixin): Examples -------- - >>> from scikits.learn.svm.sparse import SVR + >>> from sklearn.svm.sparse import SVR >>> import numpy as np >>> n_samples, n_features = 10, 5 >>> np.random.seed(0) @@ -116,7 +116,7 @@ def __init__(self, kernel='rbf', degree=3, gamma=0.0, coef0=0.0, class NuSVR (SparseBaseLibSVM, RegressorMixin): """NuSVR for sparse matrices (csr) - See :class:`scikits.learn.svm.NuSVC` for a complete list of parameters + See :class:`sklearn.svm.NuSVC` for a complete list of parameters Notes ----- @@ -126,7 +126,7 @@ class NuSVR (SparseBaseLibSVM, RegressorMixin): Examples -------- - >>> from scikits.learn.svm.sparse import NuSVR + >>> from sklearn.svm.sparse import NuSVR >>> import numpy as np >>> n_samples, n_features = 10, 5 >>> np.random.seed(0) @@ -151,7 +151,7 @@ def __init__(self, nu=0.5, C=1.0, kernel='rbf', degree=3, class OneClassSVM (SparseBaseLibSVM): """NuSVR for sparse matrices (csr) - See :class:`scikits.learn.svm.NuSVC` for a complete list of parameters + See :class:`sklearn.svm.NuSVC` for a complete list of parameters Notes ----- diff --git a/scikits/learn/svm/sparse/libsvm.c b/sklearn/svm/sparse/libsvm.c similarity index 89% rename from scikits/learn/svm/sparse/libsvm.c rename to sklearn/svm/sparse/libsvm.c index 769e7fb7f9eab..3887dce84b6d8 100644 --- a/scikits/learn/svm/sparse/libsvm.c +++ b/sklearn/svm/sparse/libsvm.c @@ -1,18 +1,39 @@ -/* Generated by Cython 0.12.1 on Mon May 16 14:50:27 2011 */ +/* Generated by Cython 0.13 on Fri Sep 2 11:25:52 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 /* 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,11 +103,35 @@ #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 + #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 @@ -103,30 +148,23 @@ #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) -#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 + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #endif #if PY_VERSION_HEX < 0x02050000 @@ -146,114 +184,65 @@ #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 -#define __PYX_HAVE_API__scikits__learn__svm__sparse__libsvm -#include "stdlib.h" +#define __PYX_HAVE_API__sklearn__svm__sparse__libsvm #include "stdio.h" +#include "stdlib.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 */ -#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*); @@ -263,7 +252,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 ... */ @@ -283,7 +272,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) @@ -309,6 +297,11 @@ static const char **__pyx_f; #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; @@ -423,6 +416,8 @@ 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*/ @@ -431,6 +426,9 @@ 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_; @@ -453,8 +451,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*/ @@ -465,19 +463,13 @@ 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_RaiseNeedMoreValuesError(Py_ssize_t index); +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(void); +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); -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); @@ -491,9 +483,7 @@ 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 CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_npy_intp(npy_intp); +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*/ @@ -596,6 +586,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 *); @@ -615,13 +607,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 */ @@ -640,14 +634,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 scikits.learn.svm.sparse.libsvm */ +/* Module declarations from sklearn.svm.sparse.libsvm */ -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; +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; -/* Implementation of scikits.learn.svm.sparse.libsvm */ +/* Implementation of sklearn.svm.sparse.libsvm */ static PyObject *__pyx_builtin_MemoryError; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_range; @@ -839,7 +833,7 @@ static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; static PyObject *__pyx_int_15; -/* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":58 +/* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":58 * * * def libsvm_sparse_train ( int n_features, # <<<<<<<<<<<<<< @@ -847,9 +841,9 @@ static PyObject *__pyx_int_15; * np.ndarray[np.int32_t, ndim=1, mode='c'] indices, */ -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) { +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) { int __pyx_v_n_features; PyArrayObject *__pyx_v_values = 0; PyArrayObject *__pyx_v_indices = 0; @@ -1207,22 +1201,11 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra __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("scikits.learn.svm.sparse.libsvm.libsvm_sparse_train"); + __Pyx_AddTraceback("sklearn.svm.sparse.libsvm.libsvm_sparse_train"); + __Pyx_RefNannyFinishContext(); 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); @@ -1334,7 +1317,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra __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/scikits/learn/svm/sparse/libsvm.pyx":104 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":104 * cdef char *error_msg * * if len(sample_weight) == 0: # <<<<<<<<<<<<<< @@ -1345,7 +1328,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra __pyx_t_2 = (__pyx_t_1 == 0); if (__pyx_t_2) { - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":105 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":105 * * if len(sample_weight) == 0: * sample_weight = np.ones(Y.shape[0], dtype=np.float64) # <<<<<<<<<<<<<< @@ -1357,7 +1340,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra __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_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_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_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); @@ -1405,7 +1388,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra } /*else*/ { - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":107 + /* "/home/fabian/dev/scikit-learn/sklearn/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, \ # <<<<<<<<<<<<<< @@ -1415,14 +1398,14 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra #ifndef PYREX_WITHOUT_ASSERTIONS if (unlikely(!((__pyx_v_sample_weight->dimensions[0]) == ((__pyx_v_indptr->dimensions[0]) - 1)))) { - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":110 + /* "/home/fabian/dev/scikit-learn/sklearn/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_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_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_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); @@ -1435,20 +1418,20 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra __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(__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_GOTREF(((PyObject *)__pyx_t_3)); __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/scikits/learn/svm/sparse/libsvm.pyx":115 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -1457,7 +1440,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra */ __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/scikits/learn/svm/sparse/libsvm.pyx":121 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":121 * nu, cache_size, C, eps, p, shrinking, * probability, weight.shape[0], * weight_label.data, weight.data) # <<<<<<<<<<<<<< @@ -1466,7 +1449,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra */ __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/scikits/learn/svm/sparse/libsvm.pyx":124 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":124 * * # check parameters * if (param == NULL or problem == NULL): # <<<<<<<<<<<<<< @@ -1482,7 +1465,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra } if (__pyx_t_14) { - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":125 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":125 * # check parameters * if (param == NULL or problem == NULL): * raise MemoryError("Seems we've run out of of memory") # <<<<<<<<<<<<<< @@ -1504,7 +1487,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra } __pyx_L7:; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":126 + /* "/home/fabian/dev/scikit-learn/sklearn/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); # <<<<<<<<<<<<<< @@ -1513,7 +1496,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra */ __pyx_v_error_msg = svm_csr_check_parameter(__pyx_v_problem, __pyx_v_param); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":127 + /* "/home/fabian/dev/scikit-learn/sklearn/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: # <<<<<<<<<<<<<< @@ -1523,7 +1506,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra __pyx_t_14 = (__pyx_v_error_msg != 0); if (__pyx_t_14) { - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":128 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":128 * error_msg = svm_csr_check_parameter(problem, param); * if error_msg: * free_problem(problem) # <<<<<<<<<<<<<< @@ -1532,7 +1515,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra */ free_problem(__pyx_v_problem); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":129 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":129 * if error_msg: * free_problem(problem) * free_param(param) # <<<<<<<<<<<<<< @@ -1541,14 +1524,14 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra */ free_param(__pyx_v_param); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":130 + /* "/home/fabian/dev/scikit-learn/sklearn/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 = __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_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_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); @@ -1565,7 +1548,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra } __pyx_L8:; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":133 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":133 * * # call svm_train, this does the real work * model = svm_csr_train(problem, param) # <<<<<<<<<<<<<< @@ -1574,7 +1557,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra */ __pyx_v_model = svm_csr_train(__pyx_v_problem, __pyx_v_param); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":135 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":135 * model = svm_csr_train(problem, param) * * cdef np.npy_intp SV_len = get_l(model) # <<<<<<<<<<<<<< @@ -1583,7 +1566,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra */ __pyx_v_SV_len = get_l(__pyx_v_model); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":136 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":136 * * cdef np.npy_intp SV_len = get_l(model) * cdef np.npy_intp n_class = get_nr(model) # <<<<<<<<<<<<<< @@ -1592,7 +1575,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra */ __pyx_v_n_class = get_nr(__pyx_v_model); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":141 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -1621,7 +1604,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":142 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -1630,7 +1613,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra */ copy_sv_coef(__pyx_v_sv_coef_data->data, __pyx_v_model); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":146 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -1659,7 +1642,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":147 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -1668,7 +1651,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra */ copy_intercept(__pyx_v_intercept->data, __pyx_v_model, __pyx_v_intercept->dimensions); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":153 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":153 * # TODO: custom kernel * cdef np.npy_intp nonzero_SV * nonzero_SV = get_nonzero_SV (model) # <<<<<<<<<<<<<< @@ -1677,7 +1660,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra */ __pyx_v_nonzero_SV = get_nonzero_SV(__pyx_v_model); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":156 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":156 * * # SV_data.resize((0,0), refcheck=False) # why is this needed ? * SV_data.resize (nonzero_SV, refcheck=False) # <<<<<<<<<<<<<< @@ -1686,7 +1669,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra */ __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_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_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_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); @@ -1706,7 +1689,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":157 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -1715,7 +1698,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra */ __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_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_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_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); @@ -1735,7 +1718,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":158 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":158 * SV_data.resize (nonzero_SV, refcheck=False) * SV_indices.resize (nonzero_SV, refcheck=False) * SV_indptr.resize ( SV_len + 1, refcheck=False) # <<<<<<<<<<<<<< @@ -1744,7 +1727,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra */ __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((((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_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_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); @@ -1764,7 +1747,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":160 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":160 * SV_indptr.resize ( 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) # <<<<<<<<<<<<<< @@ -1773,7 +1756,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra */ 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/scikits/learn/svm/sparse/libsvm.pyx":164 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":164 * # copy model.nSV * # TODO: do only in classification * nclass_SV.resize(n_class, refcheck=False) # <<<<<<<<<<<<<< @@ -1782,7 +1765,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra */ __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_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_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_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); @@ -1802,7 +1785,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":165 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":165 * # TODO: do only in classification * nclass_SV.resize(n_class, refcheck=False) * copy_nSV(nclass_SV.data, model) # <<<<<<<<<<<<<< @@ -1811,7 +1794,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra */ copy_nSV(__pyx_v_nclass_SV->data, __pyx_v_model); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":169 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -1823,7 +1806,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra __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_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_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_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); @@ -1868,7 +1851,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra __pyx_v_label = ((PyArrayObject *)__pyx_t_6); __pyx_t_6 = 0; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":170 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -1877,7 +1860,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra */ copy_label(__pyx_v_label->data, __pyx_v_model); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":175 + /* "/home/fabian/dev/scikit-learn/sklearn/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: # <<<<<<<<<<<<<< @@ -1887,7 +1870,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra __pyx_t_14 = (__pyx_v_probability != 0); if (__pyx_t_14) { - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":176 + /* "/home/fabian/dev/scikit-learn/sklearn/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 # <<<<<<<<<<<<<< @@ -1897,7 +1880,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra __pyx_t_14 = (__pyx_v_svm_type < 2); if (__pyx_t_14) { - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":177 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -1954,7 +1937,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra __pyx_v_probA = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":178 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -2011,7 +1994,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra __pyx_v_probB = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":179 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -2023,7 +2006,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra } /*else*/ { - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":181 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":181 * copy_probB(probB.data, model, probB.shape) * else: * probA = np.empty(1, dtype=np.float64) # <<<<<<<<<<<<<< @@ -2078,7 +2061,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra __pyx_v_probA = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":182 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":182 * else: * probA = np.empty(1, dtype=np.float64) * probB = np.empty(0, dtype=np.float64) # <<<<<<<<<<<<<< @@ -2135,7 +2118,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra } __pyx_L10:; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":183 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -2147,7 +2130,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra } __pyx_L9:; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":185 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":185 * copy_probA(probA.data, model, probA.shape) * * svm_csr_free_and_destroy_model (&model) # <<<<<<<<<<<<<< @@ -2156,7 +2139,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra */ svm_csr_free_and_destroy_model((&__pyx_v_model)); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":186 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":186 * * svm_csr_free_and_destroy_model (&model) * free_problem(problem) # <<<<<<<<<<<<<< @@ -2165,7 +2148,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra */ free_problem(__pyx_v_problem); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":187 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":187 * svm_csr_free_and_destroy_model (&model) * free_problem(problem) * free_param(param) # <<<<<<<<<<<<<< @@ -2174,7 +2157,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra */ free_param(__pyx_v_param); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":189 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":189 * free_param(param) * * return label, probA, probB # <<<<<<<<<<<<<< @@ -2224,7 +2207,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_indices); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("scikits.learn.svm.sparse.libsvm.libsvm_sparse_train"); + __Pyx_AddTraceback("sklearn.svm.sparse.libsvm.libsvm_sparse_train"); __pyx_r = NULL; goto __pyx_L2; __pyx_L0:; @@ -2248,25 +2231,13 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra __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/scikits/learn/svm/sparse/libsvm.pyx":193 +/* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":193 * * * def libsvm_sparse_predict (np.ndarray[np.float64_t, ndim=1, mode='c'] T_data, # <<<<<<<<<<<<<< @@ -2274,9 +2245,9 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_tra * np.ndarray[np.int32_t, ndim=1, mode='c'] T_indptr, */ -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) { +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) { PyArrayObject *__pyx_v_T_data = 0; PyArrayObject *__pyx_v_T_indices = 0; PyArrayObject *__pyx_v_T_indptr = 0; @@ -2606,23 +2577,10 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_pre __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("scikits.learn.svm.sparse.libsvm.libsvm_sparse_predict"); + __Pyx_AddTraceback("sklearn.svm.sparse.libsvm.libsvm_sparse_predict"); + __Pyx_RefNannyFinishContext(); 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; @@ -2738,16 +2696,16 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_pre __pyx_bstride_0_probB = __pyx_bstruct_probB.strides[0]; __pyx_bshape_0_probB = __pyx_bstruct_probB.shape[0]; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":244 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":244 * C, eps, p, shrinking, * probability, weight.shape[0], weight_label.data, * weight.data) # <<<<<<<<<<<<<< * * model = csr_set_model(param, 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.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); + __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); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":250 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":250 * SV_indptr.shape, SV_indptr.data, * sv_coef.data, intercept.data, * nSV.data, label.data, probA.data, probB.data) # <<<<<<<<<<<<<< @@ -2756,7 +2714,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_pre */ __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/scikits/learn/svm/sparse/libsvm.pyx":252 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -2803,7 +2761,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_pre __pyx_v_dec_values = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":256 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":256 * T_indices.shape, T_indices.data, * T_indptr.shape, T_indptr.data, * model, dec_values.data) < 0: # <<<<<<<<<<<<<< @@ -2813,7 +2771,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_pre __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/scikits/learn/svm/sparse/libsvm.pyx":257 + /* "/home/fabian/dev/scikit-learn/sklearn/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") # <<<<<<<<<<<<<< @@ -2835,7 +2793,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_pre } __pyx_L6:; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":259 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":259 * raise MemoryError("We've run out of of memory") * # free model and param * free_model_SV(model) # <<<<<<<<<<<<<< @@ -2844,7 +2802,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_pre */ free_model_SV(__pyx_v_model); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":260 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":260 * # free model and param * free_model_SV(model) * free_model(model) # <<<<<<<<<<<<<< @@ -2853,7 +2811,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_pre */ free_model(__pyx_v_model); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":261 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":261 * free_model_SV(model) * free_model(model) * free_param(param) # <<<<<<<<<<<<<< @@ -2862,7 +2820,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_pre */ free_param(__pyx_v_param); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":262 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":262 * free_model(model) * free_param(param) * return dec_values # <<<<<<<<<<<<<< @@ -2898,7 +2856,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_pre __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nSV); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_T_indptr); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("scikits.learn.svm.sparse.libsvm.libsvm_sparse_predict"); + __Pyx_AddTraceback("sklearn.svm.sparse.libsvm.libsvm_sparse_predict"); __pyx_r = NULL; goto __pyx_L2; __pyx_L0:; @@ -2919,26 +2877,12 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_pre __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/scikits/learn/svm/sparse/libsvm.pyx":267 +/* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":267 * * * def libsvm_sparse_predict_proba( # <<<<<<<<<<<<<< @@ -2946,9 +2890,9 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_pre * np.ndarray[np.int32_t, ndim=1, mode='c'] T_indices, */ -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) { +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) { PyArrayObject *__pyx_v_T_data = 0; PyArrayObject *__pyx_v_T_indices = 0; PyArrayObject *__pyx_v_T_indptr = 0; @@ -3283,23 +3227,10 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_pre __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("scikits.learn.svm.sparse.libsvm.libsvm_sparse_predict_proba"); + __Pyx_AddTraceback("sklearn.svm.sparse.libsvm.libsvm_sparse_predict_proba"); + __Pyx_RefNannyFinishContext(); 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; @@ -3415,16 +3346,16 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_pre __pyx_bstride_0_probB = __pyx_bstruct_probB.strides[0]; __pyx_bshape_0_probB = __pyx_bstruct_probB.shape[0]; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":297 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":297 * C, eps, p, shrinking, * probability, weight.shape[0], weight_label.data, * weight.data) # <<<<<<<<<<<<<< * * model = csr_set_model(param, 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.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); + __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); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":303 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":303 * SV_indptr.shape, SV_indptr.data, * sv_coef.data, intercept.data, * nSV.data, label.data, probA.data, probB.data) # <<<<<<<<<<<<<< @@ -3433,7 +3364,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_pre */ __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/scikits/learn/svm/sparse/libsvm.pyx":305 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -3442,7 +3373,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_pre */ __pyx_v_n_class = get_nr(__pyx_v_model); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":306 + /* "/home/fabian/dev/scikit-learn/sklearn/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) # <<<<<<<<<<<<<< @@ -3456,7 +3387,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_pre __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_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_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_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); @@ -3509,7 +3440,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_pre __pyx_v_dec_values = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":310 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":310 * T_indices.shape, T_indices.data, * T_indptr.shape, T_indptr.data, * model, dec_values.data) < 0: # <<<<<<<<<<<<<< @@ -3519,7 +3450,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_pre __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/scikits/learn/svm/sparse/libsvm.pyx":311 + /* "/home/fabian/dev/scikit-learn/sklearn/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") # <<<<<<<<<<<<<< @@ -3541,7 +3472,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_pre } __pyx_L6:; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":313 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":313 * raise MemoryError("We've run out of of memory") * # free model and param * free_model_SV(model) # <<<<<<<<<<<<<< @@ -3550,7 +3481,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_pre */ free_model_SV(__pyx_v_model); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":314 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":314 * # free model and param * free_model_SV(model) * free_model(model) # <<<<<<<<<<<<<< @@ -3559,7 +3490,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_pre */ free_model(__pyx_v_model); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":315 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":315 * free_model_SV(model) * free_model(model) * free_param(param) # <<<<<<<<<<<<<< @@ -3568,7 +3499,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_pre */ free_param(__pyx_v_param); - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":316 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":316 * free_model(model) * free_param(param) * return dec_values # <<<<<<<<<<<<<< @@ -3606,7 +3537,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_pre __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nSV); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_T_indptr); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("scikits.learn.svm.sparse.libsvm.libsvm_sparse_predict_proba"); + __Pyx_AddTraceback("sklearn.svm.sparse.libsvm.libsvm_sparse_predict_proba"); __pyx_r = NULL; goto __pyx_L2; __pyx_L0:; @@ -3627,26 +3558,12 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_pre __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/scikits/learn/svm/sparse/libsvm.pyx":320 +/* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":320 * * * def set_verbosity_wrap(int verbosity): # <<<<<<<<<<<<<< @@ -3654,9 +3571,9 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_libsvm_sparse_pre * Control verbosity of libsvm library */ -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) { +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) { int __pyx_v_verbosity; PyObject *__pyx_r = NULL; __Pyx_RefNannySetupContext("set_verbosity_wrap"); @@ -3666,11 +3583,12 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_set_verbosity_wra } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - __Pyx_AddTraceback("scikits.learn.svm.sparse.libsvm.set_verbosity_wrap"); + __Pyx_AddTraceback("sklearn.svm.sparse.libsvm.set_verbosity_wrap"); + __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - /* "/home/fabian/dev/scikit-learn/scikits/learn/svm/sparse/libsvm.pyx":324 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":324 * Control verbosity of libsvm library * """ * set_verbosity(verbosity) # <<<<<<<<<<<<<< @@ -3683,7 +3601,7 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_set_verbosity_wra return __pyx_r; } -/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":187 +/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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): # <<<<<<<<<<<<<< @@ -3691,8 +3609,8 @@ static PyObject *__pyx_pf_7scikits_5learn_3svm_6sparse_6libsvm_set_verbosity_wra * # 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; @@ -3717,9 +3635,8 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf 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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":194 * # of flags * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -3728,7 +3645,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":195 * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -3737,7 +3654,7 @@ 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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":197 * cdef bint little_endian = ((&endian_detector)[0] != 0) * * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< @@ -3746,7 +3663,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ __pyx_v_ndim = PyArray_NDIM(((PyArrayObject *)__pyx_v_self)); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":198 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":199 * ndim = PyArray_NDIM(self) * * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -3756,7 +3673,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); if (__pyx_t_1) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":199 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":200 * * if sizeof(npy_intp) != sizeof(Py_ssize_t): * copy_shape = 1 # <<<<<<<<<<<<<< @@ -3768,7 +3685,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":202 * copy_shape = 1 * else: * copy_shape = 0 # <<<<<<<<<<<<<< @@ -3779,7 +3696,7 @@ 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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":204 * copy_shape = 0 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -3789,7 +3706,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf __pyx_t_1 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS); if (__pyx_t_1) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":204 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":205 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -3803,29 +3720,29 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf } if (__pyx_t_3) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":205 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_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_filename = __pyx_f[1]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":208 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -3835,7 +3752,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf __pyx_t_3 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS); if (__pyx_t_3) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":208 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":209 * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -3849,29 +3766,29 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf } if (__pyx_t_2) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":209 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_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_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":212 * raise ValueError(u"ndarray is not Fortran contiguous") * * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< @@ -3880,7 +3797,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ __pyx_v_info->buf = PyArray_DATA(((PyArrayObject *)__pyx_v_self)); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":212 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":213 * * info.buf = PyArray_DATA(self) * info.ndim = ndim # <<<<<<<<<<<<<< @@ -3889,17 +3806,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":217 * # Allocate new buffer for strides and shape info. This is allocated * # as one block, strides first. * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< @@ -3908,7 +3824,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":218 * # as one block, strides first. * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) * info.shape = info.strides + ndim # <<<<<<<<<<<<<< @@ -3917,7 +3833,7 @@ 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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":219 * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) * info.shape = info.strides + ndim * for i in range(ndim): # <<<<<<<<<<<<<< @@ -3928,7 +3844,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":219 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":220 * info.shape = info.strides + ndim * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< @@ -3937,7 +3853,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":220 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":221 * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< @@ -3950,7 +3866,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf } /*else*/ { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":222 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":223 * info.shape[i] = PyArray_DIMS(self)[i] * else: * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< @@ -3959,7 +3875,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(((PyArrayObject *)__pyx_v_self))); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":223 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":224 * else: * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< @@ -3970,7 +3886,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf } __pyx_L8:; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":224 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":225 * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -3979,7 +3895,7 @@ 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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":226 * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< @@ -3988,7 +3904,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ __pyx_v_info->itemsize = PyArray_ITEMSIZE(((PyArrayObject *)__pyx_v_self)); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":226 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":227 * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< @@ -3997,7 +3913,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf */ __pyx_v_info->readonly = (!PyArray_ISWRITEABLE(((PyArrayObject *)__pyx_v_self))); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":229 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":230 * * cdef int t * cdef char* f = NULL # <<<<<<<<<<<<<< @@ -4006,7 +3922,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":231 * cdef int t * cdef char* f = NULL * cdef dtype descr = self.descr # <<<<<<<<<<<<<< @@ -4016,7 +3932,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":235 * cdef int offset * * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< @@ -4025,7 +3941,7 @@ 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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":237 * cdef bint hasfields = PyDataType_HASFIELDS(descr) * * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< @@ -4041,7 +3957,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf } if (__pyx_t_1) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":238 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":239 * if not hasfields and not copy_shape: * # do not call releasebuffer * info.obj = None # <<<<<<<<<<<<<< @@ -4057,7 +3973,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":242 * else: * # need to call releasebuffer * info.obj = self # <<<<<<<<<<<<<< @@ -4072,7 +3988,7 @@ 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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":244 * info.obj = self * * if not hasfields: # <<<<<<<<<<<<<< @@ -4082,7 +3998,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf __pyx_t_1 = (!__pyx_v_hasfields); if (__pyx_t_1) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":244 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":245 * * if not hasfields: * t = descr.type_num # <<<<<<<<<<<<<< @@ -4091,7 +4007,7 @@ 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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":246 * if not hasfields: * t = descr.type_num * if ((descr.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< @@ -4106,7 +4022,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf } if (!__pyx_t_2) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":246 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":247 * t = descr.type_num * if ((descr.byteorder == '>' and little_endian) or * (descr.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< @@ -4126,29 +4042,29 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf } if (__pyx_t_1) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":247 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_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_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":249 * (descr.byteorder == '<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< @@ -4161,7 +4077,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":249 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":250 * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< @@ -4174,7 +4090,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":250 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":251 * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< @@ -4187,7 +4103,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":251 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":252 * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< @@ -4200,7 +4116,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":252 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":253 * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< @@ -4213,7 +4129,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":253 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":254 * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< @@ -4226,7 +4142,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":254 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":255 * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< @@ -4239,7 +4155,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":255 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":256 * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< @@ -4252,7 +4168,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":256 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":257 * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< @@ -4265,7 +4181,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":257 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":258 * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< @@ -4278,7 +4194,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":258 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":259 * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< @@ -4291,7 +4207,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":259 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":260 * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< @@ -4304,7 +4220,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":260 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":261 * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< @@ -4317,7 +4233,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":261 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":262 * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< @@ -4330,7 +4246,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":262 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":263 * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< @@ -4343,7 +4259,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":263 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":264 * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< @@ -4356,7 +4272,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf goto __pyx_L14; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":264 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":265 * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< @@ -4370,33 +4286,33 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buf } /*else*/ { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":266 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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_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_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_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, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); + 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 = 266; __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 = 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_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":268 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f # <<<<<<<<<<<<<< @@ -4405,7 +4321,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":269 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f * return # <<<<<<<<<<<<<< @@ -4418,7 +4334,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":271 * return * else: * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< @@ -4427,7 +4343,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":272 * else: * info.format = stdlib.malloc(_buffer_format_string_len) * info.format[0] = '^' # Native data types, manual alignment # <<<<<<<<<<<<<< @@ -4436,7 +4352,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":273 * info.format = stdlib.malloc(_buffer_format_string_len) * info.format[0] = '^' # Native data types, manual alignment * offset = 0 # <<<<<<<<<<<<<< @@ -4445,17 +4361,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":277 * info.format + _buffer_format_string_len, * &offset) * f[0] = 0 # Terminate format string # <<<<<<<<<<<<<< @@ -4483,12 +4399,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 +/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":279 * f[0] = 0 # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -4496,13 +4411,12 @@ 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) { +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; __Pyx_RefNannySetupContext("__releasebuffer__"); - __Pyx_INCREF((PyObject *)__pyx_v_self); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":279 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":280 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -4512,7 +4426,7 @@ static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, P __pyx_t_1 = PyArray_HASFIELDS(((PyArrayObject *)__pyx_v_self)); if (__pyx_t_1) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":280 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":281 * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): * stdlib.free(info.format) # <<<<<<<<<<<<<< @@ -4524,7 +4438,7 @@ static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, P } __pyx_L5:; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":281 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":282 * if PyArray_HASFIELDS(self): * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -4534,7 +4448,7 @@ static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, P __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); if (__pyx_t_1) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":282 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":283 * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): * stdlib.free(info.strides) # <<<<<<<<<<<<<< @@ -4546,11 +4460,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 +/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":756 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -4563,7 +4476,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":757 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -4571,7 +4484,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; @@ -4589,7 +4502,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":758 +/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":759 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -4602,7 +4515,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":760 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -4610,7 +4523,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; @@ -4628,7 +4541,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":761 +/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":762 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -4641,7 +4554,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":763 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -4649,7 +4562,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; @@ -4667,7 +4580,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":764 +/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":765 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -4680,7 +4593,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":766 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< @@ -4688,7 +4601,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; @@ -4706,7 +4619,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":767 +/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":768 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -4719,7 +4632,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":769 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< @@ -4727,7 +4640,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; @@ -4745,7 +4658,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":770 +/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":771 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -4773,14 +4686,13 @@ 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); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":777 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":778 * cdef int delta_offset * cdef tuple i * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -4789,7 +4701,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":779 * cdef tuple i * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -4798,7 +4710,7 @@ 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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":782 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -4808,7 +4720,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 = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } for (;;) { if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break; @@ -4817,21 +4729,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_t_3 = 0; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":783 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":784 * for childname in descr.names: * fields = descr.fields[childname] * child, new_offset = fields # <<<<<<<<<<<<<< @@ -4841,7 +4753,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); @@ -4851,57 +4763,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 = 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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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 = PyTuple_New(1); 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_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_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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":789 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< @@ -4916,7 +4828,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":790 * * if ((child.byteorder == '>' and little_endian) or * (child.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< @@ -4936,29 +4848,29 @@ 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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_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, __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_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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":801 * * # Output padding bytes * while offset[0] < new_offset: # <<<<<<<<<<<<<< @@ -4966,16 +4878,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":802 * # Output padding bytes * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< @@ -4984,7 +4896,7 @@ 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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":803 * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte * f += 1 # <<<<<<<<<<<<<< @@ -4993,7 +4905,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f += 1; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":803 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":804 * f[0] = 120 # "x"; pad byte * f += 1 * offset[0] += 1 # <<<<<<<<<<<<<< @@ -5003,7 +4915,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx (__pyx_v_offset[0]) += 1; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":805 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":806 * offset[0] += 1 * * offset[0] += child.itemsize # <<<<<<<<<<<<<< @@ -5012,7 +4924,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ (__pyx_v_offset[0]) += __pyx_v_child->elsize; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":807 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":808 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -5022,20 +4934,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":810 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -5045,288 +4957,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) { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":810 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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 = PyTuple_New(1); 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_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_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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/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" */ - __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_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 = 813; __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 = 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_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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 98; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":814 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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 = 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 = 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_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_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 66; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":815 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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 = 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 = 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_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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 104; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":816 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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 = 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 = 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_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_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 72; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":817 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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 = 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 = 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_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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 105; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":818 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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 = 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 = 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_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_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 73; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":819 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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 = 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 = 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_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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 108; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":820 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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 = 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 = 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_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_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 76; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":821 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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 = 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 = 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_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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 113; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":822 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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 = 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 = 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_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_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 81; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":823 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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 = 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 = 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_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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 102; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":824 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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 = 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 = 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_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_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 100; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":825 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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 = 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 = 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_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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 103; goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":826 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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 = 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 = 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_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_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -5335,19 +5247,19 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":827 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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 = 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 = 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_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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -5356,19 +5268,19 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":828 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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 = 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 = 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_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_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -5377,19 +5289,19 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":829 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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 = 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 = 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_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_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 79; @@ -5397,30 +5309,30 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } /*else*/ { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":831 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_GOTREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); + 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 = 831; __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 = 832; __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 = 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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":833 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * f += 1 # <<<<<<<<<<<<<< @@ -5432,21 +5344,21 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } /*else*/ { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":836 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/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_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_L9:; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":837 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":838 * # so don't output it * f = _util_dtypestring(child, f, end, offset) * return f # <<<<<<<<<<<<<< @@ -5471,12 +5383,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 +/* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":953 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -5488,10 +5399,8 @@ 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); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":954 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":955 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -5501,7 +5410,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":956 * cdef PyObject* baseptr * if base is None: * baseptr = NULL # <<<<<<<<<<<<<< @@ -5513,7 +5422,7 @@ 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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":958 * baseptr = NULL * else: * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< @@ -5522,7 +5431,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_INCREF(__pyx_v_base); - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":958 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":959 * else: * Py_INCREF(base) # important to do this before decref below! * baseptr = base # <<<<<<<<<<<<<< @@ -5533,7 +5442,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":960 * Py_INCREF(base) # important to do this before decref below! * baseptr = base * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< @@ -5542,7 +5451,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":961 * baseptr = base * Py_XDECREF(arr.base) * arr.base = baseptr # <<<<<<<<<<<<<< @@ -5551,12 +5460,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 +/* "/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 * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -5568,9 +5475,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":964 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -5580,7 +5486,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 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":965 * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: * return None # <<<<<<<<<<<<<< @@ -5595,7 +5501,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py } /*else*/ { - /* "/usr/lib/pymodules/python2.6/Cython/Includes/numpy.pxd":966 + /* "/home/fabian/envs/p27/lib/python2.7/site-packages/Cython-0.13-py2.7-linux-x86_64.egg/Cython/Includes/numpy.pxd":967 * return None * else: * return arr.base # <<<<<<<<<<<<<< @@ -5609,22 +5515,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 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)}, +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)}, {0, 0, 0, 0} }; -static void __pyx_init_filenames(void); /*proto*/ - #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { PyModuleDef_HEAD_INIT, @@ -5728,8 +5631,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 = 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; @@ -5767,12 +5670,10 @@ 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 ---*/ @@ -5796,7 +5697,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_scikits__learn__svm__sparse__libsvm) { + if (__pyx_module_is_main_sklearn__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 ---*/ @@ -5805,15 +5706,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 = 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/scikits/learn/svm/sparse/libsvm.pyx":2 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":2 * * import numpy as np # <<<<<<<<<<<<<< * cimport numpy as np @@ -5824,7 +5725,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/scikits/learn/svm/sparse/libsvm.pyx":320 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":320 * * * def set_verbosity_wrap(int verbosity): # <<<<<<<<<<<<<< @@ -5834,7 +5735,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/scikits/learn/svm/sparse/libsvm.pyx":2 + /* "/home/fabian/dev/scikit-learn/sklearn/svm/sparse/libsvm.pyx":2 * * import numpy as np # <<<<<<<<<<<<<< * cimport numpy as np @@ -5842,28 +5743,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__"); + __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_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__"); + __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_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__"); + __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_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__"); + __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_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;} @@ -5871,10 +5772,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; - /* "/usr/lib/pymodules/python2.6/Cython/Includes/python_ref.pxd":1 - * cdef extern from "Python.h": # <<<<<<<<<<<<<< - * ctypedef struct PyTypeObject - * ctypedef struct PyObject: + /* "/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 # <<<<<<<<<<<<<< + * + * cdef extern from *: */ goto __pyx_L0; __pyx_L1_error:; @@ -5882,10 +5783,10 @@ PyMODINIT_FUNC PyInit_libsvm(void) __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); if (__pyx_m) { - __Pyx_AddTraceback("init scikits.learn.svm.sparse.libsvm"); + __Pyx_AddTraceback("init sklearn.svm.sparse.libsvm"); Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init scikits.learn.svm.sparse.libsvm"); + PyErr_SetString(PyExc_ImportError, "init sklearn.svm.sparse.libsvm"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); @@ -5896,15 +5797,14 @@ PyMODINIT_FUNC PyInit_libsvm(void) #endif } -static const char *__pyx_filenames[] = { - "libsvm.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( @@ -6029,6 +5929,26 @@ static int __Pyx_ParseOptionalKeywords( 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; @@ -6434,7 +6354,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; @@ -6525,6 +6445,10 @@ 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 @@ -6535,35 +6459,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) { @@ -6572,28 +6474,8 @@ 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(); - } -} - -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; + __Pyx_RaiseTooManyValuesError(index); } - 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 @@ -6621,14 +6503,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; @@ -6644,38 +6526,37 @@ 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; -} - -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)) { +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))) { return PyInt_FromLong((long)val); - } else if (sizeof(npy_intp) == sizeof(long)) { + } else if ((sizeof(Py_intptr_t) == sizeof(int)) || + (sizeof(Py_intptr_t) == sizeof(long))) { if (is_unsigned) return PyLong_FromUnsignedLong((unsigned long)val); else return PyInt_FromLong((long)val); - } else { /* (sizeof(npy_intp) > sizeof(long)) */ + } else if (sizeof(Py_intptr_t) == sizeof(PY_LONG_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); } } @@ -7110,6 +6991,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; @@ -7357,7 +7257,11 @@ 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, @@ -7498,8 +7402,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/scikits/learn/svm/sparse/libsvm.pyx b/sklearn/svm/sparse/libsvm.pyx similarity index 100% rename from scikits/learn/svm/sparse/libsvm.pyx rename to sklearn/svm/sparse/libsvm.pyx diff --git a/scikits/learn/svm/sparse/setup.py b/sklearn/svm/sparse/setup.py similarity index 100% rename from scikits/learn/svm/sparse/setup.py rename to sklearn/svm/sparse/setup.py diff --git a/scikits/learn/svm/src/blas/Makefile b/sklearn/svm/src/blas/Makefile similarity index 100% rename from scikits/learn/svm/src/blas/Makefile rename to sklearn/svm/src/blas/Makefile diff --git a/scikits/learn/svm/src/blas/blas.h b/sklearn/svm/src/blas/blas.h similarity index 100% rename from scikits/learn/svm/src/blas/blas.h rename to sklearn/svm/src/blas/blas.h diff --git a/scikits/learn/svm/src/blas/blasp.h b/sklearn/svm/src/blas/blasp.h similarity index 100% rename from scikits/learn/svm/src/blas/blasp.h rename to sklearn/svm/src/blas/blasp.h diff --git a/scikits/learn/svm/src/blas/daxpy.c b/sklearn/svm/src/blas/daxpy.c similarity index 100% rename from scikits/learn/svm/src/blas/daxpy.c rename to sklearn/svm/src/blas/daxpy.c diff --git a/scikits/learn/svm/src/blas/ddot.c b/sklearn/svm/src/blas/ddot.c similarity index 100% rename from scikits/learn/svm/src/blas/ddot.c rename to sklearn/svm/src/blas/ddot.c diff --git a/scikits/learn/svm/src/blas/dnrm2.c b/sklearn/svm/src/blas/dnrm2.c similarity index 100% rename from scikits/learn/svm/src/blas/dnrm2.c rename to sklearn/svm/src/blas/dnrm2.c diff --git a/scikits/learn/svm/src/blas/dscal.c b/sklearn/svm/src/blas/dscal.c similarity index 100% rename from scikits/learn/svm/src/blas/dscal.c rename to sklearn/svm/src/blas/dscal.c diff --git a/scikits/learn/svm/src/liblinear/COPYRIGHT b/sklearn/svm/src/liblinear/COPYRIGHT similarity index 100% rename from scikits/learn/svm/src/liblinear/COPYRIGHT rename to sklearn/svm/src/liblinear/COPYRIGHT diff --git a/scikits/learn/svm/src/liblinear/LIBLINEAR_CHANGES b/sklearn/svm/src/liblinear/LIBLINEAR_CHANGES similarity index 100% rename from scikits/learn/svm/src/liblinear/LIBLINEAR_CHANGES rename to sklearn/svm/src/liblinear/LIBLINEAR_CHANGES diff --git a/scikits/learn/svm/src/liblinear/liblinear_helper.c b/sklearn/svm/src/liblinear/liblinear_helper.c similarity index 100% rename from scikits/learn/svm/src/liblinear/liblinear_helper.c rename to sklearn/svm/src/liblinear/liblinear_helper.c diff --git a/scikits/learn/svm/src/liblinear/linear.cpp b/sklearn/svm/src/liblinear/linear.cpp similarity index 100% rename from scikits/learn/svm/src/liblinear/linear.cpp rename to sklearn/svm/src/liblinear/linear.cpp diff --git a/scikits/learn/svm/src/liblinear/linear.h b/sklearn/svm/src/liblinear/linear.h similarity index 100% rename from scikits/learn/svm/src/liblinear/linear.h rename to sklearn/svm/src/liblinear/linear.h diff --git a/scikits/learn/svm/src/liblinear/tron.cpp b/sklearn/svm/src/liblinear/tron.cpp similarity index 100% rename from scikits/learn/svm/src/liblinear/tron.cpp rename to sklearn/svm/src/liblinear/tron.cpp diff --git a/scikits/learn/svm/src/liblinear/tron.h b/sklearn/svm/src/liblinear/tron.h similarity index 100% rename from scikits/learn/svm/src/liblinear/tron.h rename to sklearn/svm/src/liblinear/tron.h diff --git a/scikits/learn/svm/src/libsvm/LIBSVM_CHANGES b/sklearn/svm/src/libsvm/LIBSVM_CHANGES similarity index 100% rename from scikits/learn/svm/src/libsvm/LIBSVM_CHANGES rename to sklearn/svm/src/libsvm/LIBSVM_CHANGES diff --git a/scikits/learn/svm/src/libsvm/_libsvm_sparse.c b/sklearn/svm/src/libsvm/_libsvm_sparse.c similarity index 100% rename from scikits/learn/svm/src/libsvm/_libsvm_sparse.c rename to sklearn/svm/src/libsvm/_libsvm_sparse.c diff --git a/scikits/learn/svm/src/libsvm/libsvm_helper.c b/sklearn/svm/src/libsvm/libsvm_helper.c similarity index 100% rename from scikits/learn/svm/src/libsvm/libsvm_helper.c rename to sklearn/svm/src/libsvm/libsvm_helper.c diff --git a/scikits/learn/svm/src/libsvm/libsvm_sparse_helper.c b/sklearn/svm/src/libsvm/libsvm_sparse_helper.c similarity index 100% rename from scikits/learn/svm/src/libsvm/libsvm_sparse_helper.c rename to sklearn/svm/src/libsvm/libsvm_sparse_helper.c diff --git a/scikits/learn/svm/src/libsvm/libsvm_template.cpp b/sklearn/svm/src/libsvm/libsvm_template.cpp similarity index 100% rename from scikits/learn/svm/src/libsvm/libsvm_template.cpp rename to sklearn/svm/src/libsvm/libsvm_template.cpp diff --git a/scikits/learn/svm/src/libsvm/svm.cpp b/sklearn/svm/src/libsvm/svm.cpp similarity index 100% rename from scikits/learn/svm/src/libsvm/svm.cpp rename to sklearn/svm/src/libsvm/svm.cpp diff --git a/scikits/learn/svm/src/libsvm/svm.h b/sklearn/svm/src/libsvm/svm.h similarity index 100% rename from scikits/learn/svm/src/libsvm/svm.h rename to sklearn/svm/src/libsvm/svm.h diff --git a/scikits/learn/svm/tests/__init__.py b/sklearn/svm/tests/__init__.py similarity index 100% rename from scikits/learn/svm/tests/__init__.py rename to sklearn/svm/tests/__init__.py diff --git a/scikits/learn/svm/tests/test_bounds.py b/sklearn/svm/tests/test_bounds.py similarity index 87% rename from scikits/learn/svm/tests/test_bounds.py rename to sklearn/svm/tests/test_bounds.py index 141171e292f35..2ed8d94a4d9c8 100644 --- a/scikits/learn/svm/tests/test_bounds.py +++ b/sklearn/svm/tests/test_bounds.py @@ -3,11 +3,11 @@ import numpy as np from scipy import sparse as sp -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 \ +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 \ SparseLogRegression diff --git a/scikits/learn/svm/tests/test_sparse.py b/sklearn/svm/tests/test_sparse.py similarity index 98% rename from scikits/learn/svm/tests/test_sparse.py rename to sklearn/svm/tests/test_sparse.py index 39bed65f294c0..fd5f3335e8881 100644 --- a/scikits/learn/svm/tests/test_sparse.py +++ b/sklearn/svm/tests/test_sparse.py @@ -1,11 +1,11 @@ import numpy as np import scipy.sparse -from scikits.learn import datasets, svm, linear_model +from sklearn 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 scikits.learn.datasets.samples_generator import make_classification +from sklearn.datasets.samples_generator import make_classification from . import test_svm # test sample 1 diff --git a/scikits/learn/svm/tests/test_svm.py b/sklearn/svm/tests/test_svm.py similarity index 97% rename from scikits/learn/svm/tests/test_svm.py rename to sklearn/svm/tests/test_svm.py index 6f200757c3c89..2f9d42bd7f05c 100644 --- a/scikits/learn/svm/tests/test_svm.py +++ b/sklearn/svm/tests/test_svm.py @@ -1,5 +1,5 @@ """ -Testing for Support Vector Machine module (scikits.learn.svm) +Testing for Support Vector Machine module (sklearn.svm) TODO: remove hard coded numerical results when possible """ @@ -9,8 +9,8 @@ assert_almost_equal from nose.tools import assert_raises -from scikits.learn import svm, linear_model, datasets, metrics -from scikits.learn.datasets.samples_generator import make_classification +from sklearn import svm, linear_model, datasets, metrics +from sklearn.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 scikits.learn.linear_model import LogisticRegression + from sklearn.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 scikits.learn.svm.base import _get_class_weight + from sklearn.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/scikits/learn/tests/__init__.py b/sklearn/tests/__init__.py similarity index 100% rename from scikits/learn/tests/__init__.py rename to sklearn/tests/__init__.py diff --git a/scikits/learn/tests/test_base.py b/sklearn/tests/test_base.py similarity index 95% rename from scikits/learn/tests/test_base.py rename to sklearn/tests/test_base.py index 4d1fb4ab572b3..a19650b32d9d8 100644 --- a/scikits/learn/tests/test_base.py +++ b/sklearn/tests/test_base.py @@ -40,7 +40,7 @@ def test_clone(): and check that the obtained copy is a correct deep copy. """ - from scikits.learn.feature_selection import SelectFpr, f_classif + from sklearn.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 scikits.learn.feature_selection import SelectFpr, f_classif + from sklearn.feature_selection import SelectFpr, f_classif selector = SelectFpr(f_classif, alpha=0.1) selector.own_attribute = "test" diff --git a/scikits/learn/tests/test_cross_val.py b/sklearn/tests/test_cross_val.py similarity index 100% rename from scikits/learn/tests/test_cross_val.py rename to sklearn/tests/test_cross_val.py diff --git a/scikits/learn/tests/test_grid_search.py b/sklearn/tests/test_grid_search.py similarity index 88% rename from scikits/learn/tests/test_grid_search.py rename to sklearn/tests/test_grid_search.py index 83e18ab46766d..3cef223727319 100644 --- a/scikits/learn/tests/test_grid_search.py +++ b/sklearn/tests/test_grid_search.py @@ -1,5 +1,5 @@ """ -Testing for grid search module (scikits.learn.grid_search) +Testing for grid search module (sklearn.grid_search) """ from nose.tools import assert_equal, assert_raises @@ -8,12 +8,12 @@ import numpy as np import scipy.sparse as sp -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 +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 class MockClassifier(BaseEstimator): diff --git a/scikits/learn/tests/test_hmm.py b/sklearn/tests/test_hmm.py similarity index 99% rename from scikits/learn/tests/test_hmm.py rename to sklearn/tests/test_hmm.py index 3400b2695fcaa..7a4e9f755b2ea 100644 --- a/scikits/learn/tests/test_hmm.py +++ b/sklearn/tests/test_hmm.py @@ -3,9 +3,9 @@ from numpy.testing import assert_array_equal, assert_array_almost_equal from unittest import TestCase -from scikits.learn.datasets.samples_generator import make_spd_matrix -from scikits.learn import hmm -from scikits.learn.utils.extmath import logsum +from sklearn.datasets.samples_generator import make_spd_matrix +from sklearn import hmm +from sklearn.utils.extmath import logsum np.seterr(all='warn') @@ -522,7 +522,7 @@ def test_fit_emissionprob(self): def create_random_gmm(n_mix, n_features, cvtype, prng=prng): - from scikits.learn import mixture + from sklearn import mixture g = mixture.GMM(n_mix, cvtype=cvtype) g.means = prng.randint(-20, 20, (n_mix, n_features)) diff --git a/scikits/learn/tests/test_init.py b/sklearn/tests/test_init.py similarity index 94% rename from scikits/learn/tests/test_init.py rename to sklearn/tests/test_init.py index ece6bbd0e6df8..18fb44b2a0601 100644 --- a/scikits/learn/tests/test_init.py +++ b/sklearn/tests/test_init.py @@ -10,7 +10,7 @@ from nose.tools import assert_equal try: - from scikits.learn import * + from sklearn import * _top_import_error = None except Exception, e: _top_import_error = e diff --git a/scikits/learn/tests/test_lda.py b/sklearn/tests/test_lda.py similarity index 100% rename from scikits/learn/tests/test_lda.py rename to sklearn/tests/test_lda.py diff --git a/scikits/learn/tests/test_multiclass.py b/sklearn/tests/test_multiclass.py similarity index 89% rename from scikits/learn/tests/test_multiclass.py rename to sklearn/tests/test_multiclass.py index e1a28dd2f1520..d386f24fe5c49 100644 --- a/scikits/learn/tests/test_multiclass.py +++ b/sklearn/tests/test_multiclass.py @@ -7,13 +7,13 @@ from nose.tools import assert_true from nose.tools import assert_raises -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 +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 iris = datasets.load_iris() perm = np.random.permutation(iris.target.size) diff --git a/scikits/learn/tests/test_naive_bayes.py b/sklearn/tests/test_naive_bayes.py similarity index 100% rename from scikits/learn/tests/test_naive_bayes.py rename to sklearn/tests/test_naive_bayes.py diff --git a/scikits/learn/tests/test_neighbors.py b/sklearn/tests/test_neighbors.py similarity index 99% rename from scikits/learn/tests/test_neighbors.py rename to sklearn/tests/test_neighbors.py index be5d228fc5c88..df1d1a7881385 100644 --- a/scikits/learn/tests/test_neighbors.py +++ b/sklearn/tests/test_neighbors.py @@ -3,7 +3,7 @@ from scipy.sparse import (bsr_matrix, coo_matrix, csc_matrix, csr_matrix, dok_matrix, lil_matrix) -from scikits.learn import neighbors, datasets, ball_tree +from sklearn import neighbors, datasets, ball_tree # load and shuffle iris dataset iris = datasets.load_iris() diff --git a/scikits/learn/tests/test_pipeline.py b/sklearn/tests/test_pipeline.py similarity index 100% rename from scikits/learn/tests/test_pipeline.py rename to sklearn/tests/test_pipeline.py diff --git a/scikits/learn/tests/test_pls.py b/sklearn/tests/test_pls.py similarity index 98% rename from scikits/learn/tests/test_pls.py rename to sklearn/tests/test_pls.py index b227337caf02f..8d51c090f5666 100644 --- a/scikits/learn/tests/test_pls.py +++ b/sklearn/tests/test_pls.py @@ -1,7 +1,7 @@ import numpy as np from numpy.testing import assert_array_almost_equal -from scikits.learn.datasets import load_linnerud -from scikits.learn import pls +from sklearn.datasets import load_linnerud +from sklearn import pls d = load_linnerud() X = d['data_exercise'] diff --git a/scikits/learn/tests/test_qda.py b/sklearn/tests/test_qda.py similarity index 100% rename from scikits/learn/tests/test_qda.py rename to sklearn/tests/test_qda.py diff --git a/scikits/learn/utils/__init__.py b/sklearn/utils/__init__.py similarity index 97% rename from scikits/learn/utils/__init__.py rename to sklearn/utils/__init__.py index 4921a34e80175..4d4dac86e033b 100644 --- a/scikits/learn/utils/__init__.py +++ b/sklearn/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 scikits.learn.utils import deprecated + >>> from sklearn.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 scikits.learn.utils import resample + >>> from sklearn.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:`scikits.learn.cross_val.Bootstrap` - :func:`scikits.learn.utils.shuffle` + :class:`sklearn.cross_val.Bootstrap` + :func:`sklearn.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 scikits.learn.utils import shuffle + >>> from sklearn.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:`scikits.learn.utils.resample` + :func:`sklearn.utils.resample` """ options['replace'] = False return resample(*arrays, **options) @@ -409,7 +409,7 @@ def gen_even_slices(n, n_packs): Examples -------- - >>> from scikits.learn.utils import gen_even_slices + >>> from sklearn.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/scikits/learn/utils/_csgraph.py b/sklearn/utils/_csgraph.py similarity index 100% rename from scikits/learn/utils/_csgraph.py rename to sklearn/utils/_csgraph.py diff --git a/scikits/learn/utils/arpack.py b/sklearn/utils/arpack.py similarity index 99% rename from scikits/learn/utils/arpack.py rename to sklearn/utils/arpack.py index d0814c1ec30e3..c1a90a38ef33f 100644 --- a/scikits/learn/utils/arpack.py +++ b/sklearn/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 scikits.learn.utils.arpack import eigs + >>> from sklearn.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 scikits.learn.utils.arpack import eigsh + >>> from sklearn.utils.arpack import eigsh >>> id = np.identity(13) >>> vals, vecs = eigsh(id, k=6) >>> vals # doctest: +SKIP diff --git a/scikits/learn/utils/arrayfuncs.c b/sklearn/utils/arrayfuncs.c similarity index 100% rename from scikits/learn/utils/arrayfuncs.c rename to sklearn/utils/arrayfuncs.c diff --git a/scikits/learn/utils/arrayfuncs.pyx b/sklearn/utils/arrayfuncs.pyx similarity index 100% rename from scikits/learn/utils/arrayfuncs.pyx rename to sklearn/utils/arrayfuncs.pyx diff --git a/scikits/learn/utils/bench.py b/sklearn/utils/bench.py similarity index 100% rename from scikits/learn/utils/bench.py rename to sklearn/utils/bench.py diff --git a/scikits/learn/utils/extmath.py b/sklearn/utils/extmath.py similarity index 99% rename from scikits/learn/utils/extmath.py rename to sklearn/utils/extmath.py index b4a085c2f1185..1cb006e38c62f 100644 --- a/scikits/learn/utils/extmath.py +++ b/sklearn/utils/extmath.py @@ -220,7 +220,7 @@ def logsum(arr, axis=0): ======== >>> import numpy as np - >>> from scikits.learn.utils.extmath import logsum + >>> from sklearn.utils.extmath import logsum >>> a = np.arange(10) >>> np.log(np.sum(np.exp(a))) 9.4586297444267107 diff --git a/scikits/learn/utils/fixes.py b/sklearn/utils/fixes.py similarity index 100% rename from scikits/learn/utils/fixes.py rename to sklearn/utils/fixes.py diff --git a/scikits/learn/utils/graph.py b/sklearn/utils/graph.py similarity index 98% rename from scikits/learn/utils/graph.py rename to sklearn/utils/graph.py index 11266ed74f88c..59fabf4105f28 100644 --- a/scikits/learn/utils/graph.py +++ b/sklearn/utils/graph.py @@ -34,7 +34,7 @@ def single_source_shortest_path_length(graph, source, cutoff=None): Examples -------- - >>> from scikits.learn.utils.graph import single_source_shortest_path_length + >>> from sklearn.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/scikits/learn/utils/graph_shortest_path.c b/sklearn/utils/graph_shortest_path.c similarity index 100% rename from scikits/learn/utils/graph_shortest_path.c rename to sklearn/utils/graph_shortest_path.c diff --git a/scikits/learn/utils/graph_shortest_path.pyx b/sklearn/utils/graph_shortest_path.pyx similarity index 100% rename from scikits/learn/utils/graph_shortest_path.pyx rename to sklearn/utils/graph_shortest_path.pyx diff --git a/scikits/learn/utils/setup.py b/sklearn/utils/setup.py similarity index 100% rename from scikits/learn/utils/setup.py rename to sklearn/utils/setup.py diff --git a/scikits/learn/utils/sparsetools/README b/sklearn/utils/sparsetools/README similarity index 100% rename from scikits/learn/utils/sparsetools/README rename to sklearn/utils/sparsetools/README diff --git a/scikits/learn/utils/sparsetools/__init__.py b/sklearn/utils/sparsetools/__init__.py similarity index 100% rename from scikits/learn/utils/sparsetools/__init__.py rename to sklearn/utils/sparsetools/__init__.py diff --git a/scikits/learn/utils/sparsetools/complex_ops.h b/sklearn/utils/sparsetools/complex_ops.h similarity index 100% rename from scikits/learn/utils/sparsetools/complex_ops.h rename to sklearn/utils/sparsetools/complex_ops.h diff --git a/scikits/learn/utils/sparsetools/csgraph.h b/sklearn/utils/sparsetools/csgraph.h similarity index 100% rename from scikits/learn/utils/sparsetools/csgraph.h rename to sklearn/utils/sparsetools/csgraph.h diff --git a/scikits/learn/utils/sparsetools/csgraph.i b/sklearn/utils/sparsetools/csgraph.i similarity index 100% rename from scikits/learn/utils/sparsetools/csgraph.i rename to sklearn/utils/sparsetools/csgraph.i diff --git a/scikits/learn/utils/sparsetools/csgraph.py b/sklearn/utils/sparsetools/csgraph.py similarity index 100% rename from scikits/learn/utils/sparsetools/csgraph.py rename to sklearn/utils/sparsetools/csgraph.py diff --git a/scikits/learn/utils/sparsetools/csgraph_wrap.cxx b/sklearn/utils/sparsetools/csgraph_wrap.cxx similarity index 100% rename from scikits/learn/utils/sparsetools/csgraph_wrap.cxx rename to sklearn/utils/sparsetools/csgraph_wrap.cxx diff --git a/scikits/learn/utils/sparsetools/npy_3kcompat.h b/sklearn/utils/sparsetools/npy_3kcompat.h similarity index 100% rename from scikits/learn/utils/sparsetools/npy_3kcompat.h rename to sklearn/utils/sparsetools/npy_3kcompat.h diff --git a/scikits/learn/utils/sparsetools/py3k.h b/sklearn/utils/sparsetools/py3k.h similarity index 100% rename from scikits/learn/utils/sparsetools/py3k.h rename to sklearn/utils/sparsetools/py3k.h diff --git a/scikits/learn/utils/sparsetools/setup.py b/sklearn/utils/sparsetools/setup.py similarity index 100% rename from scikits/learn/utils/sparsetools/setup.py rename to sklearn/utils/sparsetools/setup.py diff --git a/scikits/learn/utils/src/cholesky_delete.c b/sklearn/utils/src/cholesky_delete.c similarity index 100% rename from scikits/learn/utils/src/cholesky_delete.c rename to sklearn/utils/src/cholesky_delete.c diff --git a/scikits/learn/utils/testing.py b/sklearn/utils/testing.py similarity index 100% rename from scikits/learn/utils/testing.py rename to sklearn/utils/testing.py diff --git a/scikits/learn/utils/tests/__init__.py b/sklearn/utils/tests/__init__.py similarity index 100% rename from scikits/learn/utils/tests/__init__.py rename to sklearn/utils/tests/__init__.py diff --git a/scikits/learn/utils/tests/test___init__.py b/sklearn/utils/tests/test___init__.py similarity index 100% rename from scikits/learn/utils/tests/test___init__.py rename to sklearn/utils/tests/test___init__.py diff --git a/scikits/learn/utils/tests/test_fixes.py b/sklearn/utils/tests/test_fixes.py similarity index 100% rename from scikits/learn/utils/tests/test_fixes.py rename to sklearn/utils/tests/test_fixes.py diff --git a/scikits/learn/utils/tests/test_graph.py b/sklearn/utils/tests/test_graph.py similarity index 100% rename from scikits/learn/utils/tests/test_graph.py rename to sklearn/utils/tests/test_graph.py diff --git a/scikits/learn/utils/tests/test_shortest_path.py b/sklearn/utils/tests/test_shortest_path.py similarity index 95% rename from scikits/learn/utils/tests/test_shortest_path.py rename to sklearn/utils/tests/test_shortest_path.py index 23676887f6b8e..ec1dfd0df7be3 100644 --- a/scikits/learn/utils/tests/test_shortest_path.py +++ b/sklearn/utils/tests/test_shortest_path.py @@ -1,6 +1,6 @@ import numpy as np from numpy.testing import assert_array_almost_equal -from scikits.learn.utils.graph_shortest_path import graph_shortest_path +from sklearn.utils.graph_shortest_path import graph_shortest_path def FloydWarshallSlow(graph, directed=False): diff --git a/scikits/learn/utils/tests/test_svd.py b/sklearn/utils/tests/test_svd.py similarity index 97% rename from scikits/learn/utils/tests/test_svd.py rename to sklearn/utils/tests/test_svd.py index e04a0cb0007b2..2c10e5c43de51 100644 --- a/scikits/learn/utils/tests/test_svd.py +++ b/sklearn/utils/tests/test_svd.py @@ -8,8 +8,8 @@ from numpy.testing import assert_equal from numpy.testing import assert_almost_equal -from scikits.learn.utils.extmath import fast_svd -from scikits.learn.datasets.samples_generator import make_low_rank_matrix +from sklearn.utils.extmath import fast_svd +from sklearn.datasets.samples_generator import make_low_rank_matrix def test_fast_svd_low_rank(): diff --git a/scikits/learn/utils/tests/test_utils.py b/sklearn/utils/tests/test_utils.py similarity index 91% rename from scikits/learn/utils/tests/test_utils.py rename to sklearn/utils/tests/test_utils.py index f9605c3404946..d52265a5821d9 100644 --- a/scikits/learn/utils/tests/test_utils.py +++ b/sklearn/utils/tests/test_utils.py @@ -1,8 +1,8 @@ import numpy as np -from scikits.learn.utils import check_arrays -from scikits.learn.utils import check_random_state -from scikits.learn.utils import resample +from sklearn.utils import check_arrays +from sklearn.utils import check_random_state +from sklearn.utils import resample from nose.tools import assert_raises